/* ============================================================
   asmy.cc — prototype v2
   Aesthetic: sports-broadcast control room.
   Dark ink · hex-grid texture · electric pitch green + signal amber.
   Static. No build. Logical properties throughout so RTL/LTR flip clean.
   ============================================================ */

/* ---------- 1. tokens ---------- */
:root {
  --ink:        #070d16;
  --ink-2:      #0c1a14;
  --panel:      #0e1a2e;
  --panel-2:    #12291f;
  --line:       rgba(77, 163, 255, .16);
  --line-soft:  rgba(255, 255, 255, .07);

  --fg:         #eaf1f9;
  --fg-dim:     #8fa0b8;
  --fg-faint:   #5d6c85;

  --acc:        #4da3ff;
  --acc-deep:   #2f6fd0;
  --amber:      #ffc247;

  --f-body:  'Alexandria', system-ui, sans-serif;
  --f-ar:    'Reem Kufi', 'Alexandria', sans-serif;
  --f-en:    'Archivo', 'Alexandria', sans-serif;

  --pad:     clamp(1.15rem, 4.5vw, 4rem);
  --maxw:    1180px;
  --r:       14px;
  --ease:    cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--fg);
  font-family: var(--f-body);
  font-weight: 300;
  font-size: clamp(.95rem, .35vw + .88rem, 1.05rem);
  line-height: 1.8;
  overflow-x: clip;
}

/* the hex field — his own visual motif, rebuilt in CSS instead of
   stretching the 800px stock cover */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(77, 163, 255, .13), transparent 60%),
    radial-gradient(90% 60% at 100% 100%, rgba(255, 194, 71, .06), transparent 55%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='97' viewBox='0 0 56 97'%3E%3Cpath d='M28 0 56 16v32L28 64 0 48V16z' fill='none' stroke='%234da3ff' stroke-opacity='.075' stroke-width='1'/%3E%3Cpath d='M28 64 56 80v32L28 128 0 112V80z' fill='none' stroke='%234da3ff' stroke-opacity='.075' stroke-width='1'/%3E%3C/svg%3E");
  background-size: auto, auto, 56px 97px;
}

/* film grain */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: .3;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.42'/%3E%3C/svg%3E");
}

/* ---------- 2. bilingual switch (pure CSS, JS only flips the root) ---------- */
html[lang="ar"] [data-l="en"],
html[lang="en"] [data-l="ar"] { display: none !important; }

html[lang="ar"] { font-family: var(--f-body); }

/* ---------- 3. type ---------- */
h1, h2, h3, h4 {
  margin: 0;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.01em;
}
html[lang="ar"] h1, html[lang="ar"] h2,
html[lang="ar"] h3, html[lang="ar"] h4 { font-family: var(--f-ar); line-height: 1.35; }
html[lang="en"] h1, html[lang="en"] h2,
html[lang="en"] h3, html[lang="en"] h4 {
  font-family: var(--f-en);
  font-stretch: 112%;
  text-transform: uppercase;
  letter-spacing: -.02em;
}

p { margin: 0 0 1em; }
a { color: inherit; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .6ch;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--acc);
  margin-bottom: 1.1rem;
}
.eyebrow::before {
  content: '';
  width: 26px;
  height: 2px;
  background: var(--acc);
}
html[lang="ar"] .eyebrow { letter-spacing: .06em; font-family: var(--f-ar); }

.lead { color: var(--fg-dim); font-size: 1.06em; max-width: 62ch; }
.dim  { color: var(--fg-dim); }
.faint{ color: var(--fg-faint); }
.num  { font-family: var(--f-en); font-variant-numeric: tabular-nums; }

/* ---------- 4. shell ---------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad);
}

section { padding-block: clamp(3.5rem, 9vw, 7rem); position: relative; }

.sec-head { margin-bottom: clamp(2rem, 4vw, 3.2rem); }
.sec-head h2 { font-size: clamp(1.6rem, 4vw, 2.6rem); }

/* ---------- 5. nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--ink) 82%, transparent);
  border-bottom: 1px solid var(--line);
}
.nav-in {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 62px;
}
.brand {
  display: flex;
  align-items: center;
  gap: .65rem;
  text-decoration: none;
  font-family: var(--f-en);
  font-weight: 800;
  font-stretch: 118%;
  letter-spacing: .01em;
  font-size: 1.02rem;
}
.brand .dot {
  width: 9px; height: 9px;
  border-radius: 2px;
  background: var(--acc);
  box-shadow: 0 0 12px var(--acc);
  animation: live 2.4s var(--ease) infinite;
}
@keyframes live { 0%,100% { opacity:1 } 50% { opacity:.25 } }

.nav-links {
  display: flex;
  gap: clamp(.5rem, 2vw, 1.6rem);
  margin-inline-start: auto;
  align-items: center;
}
.nav-links a {
  text-decoration: none;
  font-size: .82rem;
  font-weight: 400;
  color: var(--fg-dim);
  padding: .35rem 0;
  position: relative;
  transition: color .25s var(--ease);
  white-space: nowrap;
}
.nav-links a::after {
  content: '';
  position: absolute;
  inset-inline: 0;
  bottom: -2px;
  height: 2px;
  background: var(--acc);
  transform: scaleX(0);
  transform-origin: inline-start;
  transition: transform .3s var(--ease);
}
.nav-links a:hover { color: var(--fg); }
.nav-links a:hover::after,
.nav-links a[aria-current="page"]::after { transform: scaleX(1); }
.nav-links a[aria-current="page"] { color: var(--fg); }

.lang-btn {
  font-family: var(--f-en);
  font-weight: 700;
  font-size: .74rem;
  letter-spacing: .08em;
  color: var(--ink);
  background: var(--acc);
  border: 0;
  border-radius: 100px;
  padding: .42rem .95rem;
  cursor: pointer;
  transition: transform .2s var(--ease), box-shadow .25s var(--ease);
}
.lang-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(77,163,255,.35); }

/* ---------- 6. hero ---------- */
.hero { padding-block: clamp(3rem, 8vw, 6rem) clamp(2.5rem, 6vw, 4.5rem); }

.hero-grid {
  display: grid;
  gap: clamp(1.6rem, 4vw, 3rem);
  grid-template-columns: 1fr;
  align-items: end;
}
@media (min-width: 900px) {
  .hero-grid { grid-template-columns: 1fr auto; }
}

.avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--acc);
  padding: 3px;
  background: var(--ink-2);
  box-shadow: 0 0 0 6px rgba(77,163,255,.08);
}

.hero h1 {
  font-size: clamp(2.4rem, 9vw, 5.4rem);
  margin-block: .3rem .9rem;
}
html[lang="en"] .hero h1 { font-stretch: 125%; font-weight: 800; }

.hero-title {
  font-size: clamp(.92rem, 1.6vw, 1.1rem);
  color: var(--fg-dim);
  max-width: 46ch;
  border-inline-start: 2px solid var(--acc);
  padding-inline-start: 1rem;
  line-height: 1.75;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin-top: 1.6rem;
}

.tag {
  font-size: .74rem;
  letter-spacing: .04em;
  padding: .32rem .8rem;
  border: 1px solid var(--line);
  border-radius: 100px;
  color: var(--fg-dim);
  background: rgba(255,255,255,.02);
  white-space: nowrap;
}
.tag.on { color: var(--acc); border-color: rgba(77,163,255,.4); }

.id-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.4rem;
}

/* broadcast slate — the 2002 → NOW rail beside the name */
.slate {
  display: grid;
  gap: .9rem;
  padding-inline-start: 1.1rem;
  border-inline-start: 1px solid var(--line);
}
.slate-line { display: block; }
.slate-line i {
  display: block;
  font-family: var(--f-en);
  font-style: normal;
  font-weight: 800;
  font-stretch: 118%;
  font-size: 1.35rem;
  letter-spacing: .02em;
  color: var(--fg-faint);
  font-variant-numeric: tabular-nums;
}
.slate-line em {
  display: block;
  font-style: normal;
  font-size: .72rem;
  letter-spacing: .1em;
  color: var(--fg-faint);
  margin-top: .15rem;
}
.slate-line.on i  { color: var(--acc); text-shadow: 0 0 18px rgba(77,163,255,.5); }
.slate-line.on em { color: var(--fg-dim); }
@media (max-width: 899px) {
  .slate {
    display: flex;
    gap: 2rem;
    border-inline-start: 0;
    border-top: 1px solid var(--line);
    padding-inline-start: 0;
    padding-top: 1.2rem;
  }
}

/* ---------- 7. ticker ---------- */
.ticker {
  /* the rail always runs LTR so the marquee maths hold in both directions */
  direction: ltr;
  border-block: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(77,163,255,.07), transparent 45%, rgba(255,194,71,.05));
  overflow: hidden;
  padding-block: .8rem;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.ticker-track {
  display: flex;
  width: max-content;
  gap: 2.6rem;
  animation: slide 42s linear infinite;
}
.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes slide { to { transform: translateX(-50%); } }

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  font-size: .78rem;
  letter-spacing: .05em;
  color: var(--fg-dim);
  white-space: nowrap;
}
.ticker-item::before {
  content: '';
  width: 5px; height: 5px;
  transform: rotate(45deg);
  background: var(--amber);
}

/* ---------- 8. stats ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.stat {
  background: var(--panel);
  padding: clamp(1.2rem, 2.6vw, 1.9rem) clamp(1rem, 2vw, 1.5rem);
  position: relative;
  transition: background .3s var(--ease);
}
.stat:hover { background: var(--panel-2); }
.stat b {
  display: block;
  font-family: var(--f-en);
  font-stretch: 118%;
  font-size: clamp(1.9rem, 4.6vw, 2.9rem);
  font-weight: 800;
  line-height: 1;
  color: var(--acc);
  letter-spacing: -.03em;
}
.stat.amber b { color: var(--amber); }
.stat.long b { font-size: clamp(1.2rem, 2.4vw, 1.65rem); line-height: 1.3; }
.stat span {
  display: block;
  margin-top: .55rem;
  font-size: .78rem;
  color: var(--fg-dim);
  line-height: 1.6;
}

/* ---------- 9. cards / grids ---------- */
.grid { display: grid; gap: clamp(.9rem, 2vw, 1.3rem); }
.g2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }

.card {
  background: linear-gradient(160deg, var(--panel), var(--ink-2));
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: clamp(1.2rem, 2.6vw, 1.85rem);
  position: relative;
  overflow: hidden;
  transition: transform .35s var(--ease), border-color .35s var(--ease);
}
.card::after {
  content: '';
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 0;
  width: 0;
  height: 2px;
  background: var(--acc);
  transition: width .45s var(--ease);
}
.card:hover { transform: translateY(-4px); border-color: rgba(77,163,255,.34); }
.card:hover::after { width: 100%; }

.card h3 { font-size: 1.06rem; margin-bottom: .5rem; }
.card p { font-size: .88rem; color: var(--fg-dim); margin: 0; }

.card .idx {
  font-family: var(--f-en);
  font-weight: 800;
  font-size: .82rem;
  color: var(--fg-faint);
  letter-spacing: .1em;
  display: block;
  margin-bottom: .9rem;
}

/* project list */
.plist { list-style: none; margin: 0; padding: 0; }
.plist li {
  display: flex;
  align-items: baseline;
  gap: .9rem;
  padding-block: .95rem;
  border-bottom: 1px solid var(--line-soft);
  font-size: .93rem;
}
.plist li::before {
  content: '';
  flex: 0 0 auto;
  width: 7px; height: 7px;
  transform: rotate(45deg) translateY(-1px);
  background: var(--acc);
}
.plist li:last-child { border-bottom: 0; }
.plist .rel { color: var(--fg-faint); font-size: .76rem; }

/* ---------- 10. timeline ---------- */
.tl { position: relative; padding-inline-start: 1.65rem; }
.tl::before {
  content: '';
  position: absolute;
  inset-block: .5rem;
  inset-inline-start: 4px;
  width: 2px;
  background: linear-gradient(var(--acc), rgba(77,163,255,.15) 55%, transparent);
}
.tl-item {
  position: relative;
  padding-block: 1.05rem;
  border-bottom: 1px solid var(--line-soft);
}
.tl-item:last-child { border-bottom: 0; }
.tl-item::before {
  content: '';
  position: absolute;
  inset-inline-start: calc(-1.65rem + 1px);
  top: 1.6rem;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--ink);
  border: 2px solid var(--acc-deep);
  transition: background .3s var(--ease), box-shadow .3s var(--ease);
}
.tl-item.now::before { background: var(--acc); box-shadow: 0 0 10px var(--acc); }
.tl-item:hover::before { background: var(--acc); }

.tl-when {
  font-family: var(--f-en);
  font-size: .72rem;
  letter-spacing: .1em;
  color: var(--fg-faint);
  font-variant-numeric: tabular-nums;
  display: block;
  margin-bottom: .3rem;
}
.tl-role { font-size: 1.02rem; font-weight: 600; display: block; }
.tl-org { font-size: .84rem; color: var(--fg-dim); }
.tl-item.now .tl-when { color: var(--acc); }

/* ---------- 11. chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; margin: 0; list-style: none; }
.chips li {
  font-size: .8rem;
  padding: .42rem .9rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.02);
  color: var(--fg-dim);
  transition: color .25s var(--ease), border-color .25s var(--ease), transform .25s var(--ease);
}
.chips li:hover { color: var(--acc); border-color: rgba(77,163,255,.45); transform: translateY(-2px); }

/* ---------- 12. media ---------- */
.shot {
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--ink-2);
}
.shot img {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: cover;
  filter: saturate(.75) contrast(1.05);
  transition: filter .5s var(--ease), transform .6s var(--ease);
}
.shot:hover img { filter: saturate(1) contrast(1.05); transform: scale(1.03); }
.shot figcaption {
  padding: .8rem 1rem;
  font-size: .78rem;
  color: var(--fg-dim);
  border-top: 1px solid var(--line-soft);
}

.hole {
  color: var(--amber);
  background: rgba(255,194,71,.09);
  border: 1px dashed rgba(255,194,71,.42);
  border-radius: 6px;
  padding: .1rem .5rem;
  font-size: .82em;
  white-space: nowrap;
}

/* ---------- 13. note / callout ---------- */
.note {
  border-inline-start: 2px solid var(--amber);
  background: rgba(255,194,71,.055);
  padding: .95rem 1.15rem;
  border-radius: 0 var(--r) var(--r) 0;
  font-size: .85rem;
  color: var(--fg-dim);
}
html[dir="rtl"] .note { border-radius: var(--r) 0 0 var(--r); }

/* ---------- 14. buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  font-size: .86rem;
  font-weight: 500;
  padding: .78rem 1.5rem;
  border-radius: 100px;
  border: 1px solid var(--acc);
  color: var(--acc);
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  transition: background .3s var(--ease), color .3s var(--ease), transform .2s var(--ease);
}
.btn:hover { background: var(--acc); color: var(--ink); transform: translateY(-2px); }
.btn.solid { background: var(--acc); color: var(--ink); }
.btn.solid:hover { box-shadow: 0 8px 26px rgba(77,163,255,.32); }
.btn.ghost { border-color: var(--line); color: var(--fg-dim); }
.btn.ghost:hover { background: rgba(255,255,255,.05); color: var(--fg); border-color: var(--fg-faint); }
.btn-row { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.6rem; }

/* ---------- 15. form ---------- */
.form { display: grid; gap: 1rem; }
.field { display: grid; gap: .45rem; }
.field label { font-size: .78rem; color: var(--fg-dim); letter-spacing: .03em; }
.field input, .field textarea, .field select {
  font-family: inherit;
  font-size: .92rem;
  color: var(--fg);
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .8rem 1rem;
  transition: border-color .25s var(--ease), background .25s var(--ease);
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--acc);
  background: var(--panel);
}
.field textarea { resize: vertical; min-height: 130px; }
.field ::placeholder { color: var(--fg-faint); }

.form-msg {
  display: none;
  align-items: center;
  gap: .6rem;
  font-size: .85rem;
  color: var(--acc);
  border: 1px solid rgba(77,163,255,.35);
  background: rgba(77,163,255,.07);
  border-radius: 10px;
  padding: .8rem 1rem;
}
.form-msg.show { display: flex; }

/* ---------- 16. footer ---------- */
.foot {
  border-top: 1px solid var(--line);
  padding-block: 2.4rem;
  margin-top: clamp(2rem, 6vw, 4rem);
}
.foot-in {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: center;
  justify-content: space-between;
  font-size: .78rem;
  color: var(--fg-faint);
}
.foot a { color: var(--fg-dim); text-decoration: none; }
.foot a:hover { color: var(--acc); }

/* ---------- 17. reveal ---------- */
.rv {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.rv.in { opacity: 1; transform: none; }

.stagger > * { animation: rise .8s var(--ease) both; }
.stagger > *:nth-child(1) { animation-delay: .05s }
.stagger > *:nth-child(2) { animation-delay: .13s }
.stagger > *:nth-child(3) { animation-delay: .21s }
.stagger > *:nth-child(4) { animation-delay: .29s }
.stagger > *:nth-child(5) { animation-delay: .37s }
@keyframes rise { from { opacity: 0; transform: translateY(22px) } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001s !important;
  }
  .rv { opacity: 1; transform: none; }
}

/* ---------- 18. small screens ---------- */
@media (max-width: 620px) {
  .nav-links { gap: .75rem; }
  .nav-links a { font-size: .76rem; }
  .brand { font-size: .92rem; }
  .shot img { height: 180px; }
}

::selection { background: var(--acc); color: var(--ink); }

:focus-visible { outline: 2px solid var(--acc); outline-offset: 3px; border-radius: 4px; }
