/* ============================================================
   Stackova — Coming Soon
   Brand System V2.0 «Layers of Light» — tokens in docs/BRAND.md
   ============================================================ */

@font-face {
  font-family: 'Bricolage Grotesque';
  src: url('fonts/bricolage-grotesque-latin.woff2') format('woff2');
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Instrument Sans';
  src: url('fonts/instrument-sans-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('fonts/jetbrains-mono-latin.woff2') format('woff2');
  font-weight: 100 800;
  font-display: swap;
}
@font-face {
  font-family: 'Noto Sans Arabic';
  src: url('fonts/noto-sans-arabic.woff2') format('woff2');
  font-weight: 400 800;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}

:root {
  --void: #05060D;
  --panel: #0D0F1E;
  --panel2: #131630;
  --line: rgba(255,255,255,0.09);
  --text: #F4F5FC;
  --dim: #9BA0BD;
  --blue: #4D6BFF;
  --cyan: #2BD9FF;
  --magenta: #FF3D9A;
  --amber: #FFB020;
  --blue-fill: #4D6BFF;
  --on-blue: #FFFFFF;
  --aurora: linear-gradient(100deg, #2BD9FF, #4D6BFF 45%, #FF3D9A);
  --aurora-text: linear-gradient(100deg, #2BD9FF, #6E86FF 45%, #FF3D9A);
  --atmo1: rgba(77,107,255,0.16);
  --atmo2: rgba(255,61,154,0.10);
  --f-display: 'Bricolage Grotesque', 'Noto Sans Arabic', 'Segoe UI', system-ui, sans-serif;
  --f-body: 'Instrument Sans', 'Noto Sans Arabic', 'Segoe UI', system-ui, sans-serif;
  --f-mono: 'JetBrains Mono', 'Noto Sans Arabic', Consolas, monospace;
}
@media (prefers-color-scheme: light) {
  :root {
    --void: #F4F5FA;
    --panel: #FFFFFF;
    --panel2: #EBEDF7;
    --line: rgba(12,14,30,0.11);
    --text: #0C0E1E;
    --dim: #5C6180;
    --blue: #3050F0;
    --cyan: #0090CF;
    --magenta: #D6217F;
    --amber: #A96C00;
    --blue-fill: #3050F0;
    --on-blue: #FFFFFF;
    --aurora-text: linear-gradient(100deg, #0090CF, #3050F0 45%, #D6217F);
    --atmo1: rgba(48,80,240,0.10);
    --atmo2: rgba(214,33,127,0.07);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--void);
  color: var(--text);
  font-family: var(--f-body);
  font-size: 16.5px;
  line-height: 1.65;
  min-height: 100dvh;
  overflow-x: hidden;
}
::selection { background: var(--blue); color: #fff; }

h1, h2 { font-family: var(--f-display); margin: 0; line-height: 1.08; letter-spacing: -0.015em; text-wrap: balance; }
[dir="rtl"] h1, [dir="rtl"] h2 { letter-spacing: 0; }
p { margin: 0; }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }

#stars { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

/* ---------- top bar ---------- */
.top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px clamp(20px, 4vw, 48px);
  max-width: 1240px; margin: 0 auto;
}
.lockup { display: flex; align-items: center; gap: 12px; }
.lockup b { font-family: var(--f-display); font-weight: 800; font-size: 22px; letter-spacing: -0.02em; }
.lang-btn {
  font-family: var(--f-mono); font-size: 13px; font-weight: 500;
  color: var(--dim); background: var(--panel);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 18px; cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease;
}
.lang-btn:hover { color: var(--text); border-color: var(--dim); }
.lang-btn:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

/* ---------- hero ---------- */
.hero {
  position: relative; z-index: 1;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
  max-width: 1240px;
  margin: 0 auto;
  padding: 110px clamp(20px, 4vw, 48px) 60px;
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(640px 460px at 78% 14%, var(--atmo1), transparent 70%),
    radial-gradient(560px 420px at 6% 88%, var(--atmo2), transparent 70%);
  pointer-events: none;
}
.hero > * { position: relative; }
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 96px; text-align: center; }
  .hero-copy { display: flex; flex-direction: column; align-items: center; }
}

.eyebrow {
  font-family: var(--f-mono); font-size: 12px; font-weight: 500;
  letter-spacing: 0.28em; color: var(--dim);
}
[dir="rtl"] .eyebrow { letter-spacing: 0; }
h1 { font-size: clamp(46px, 7.4vw, 92px); font-weight: 800; margin-top: 18px; }
.aurora-text {
  background: var(--aurora-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.sub { color: var(--dim); font-size: clamp(16.5px, 2vw, 19px); max-width: 50ch; margin-top: 20px; }
.sub strong { color: var(--text); font-weight: 600; }

/* ---------- waitlist form ---------- */
.waitform { display: flex; gap: 10px; margin-top: 34px; width: 100%; max-width: 480px; flex-wrap: wrap; }
.waitform input {
  flex: 1; min-width: 220px;
  font-family: var(--f-body); font-size: 15.5px;
  color: var(--text); background: var(--panel);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 13px 24px;
  transition: border-color 0.18s ease;
}
.waitform input::placeholder { color: var(--dim); }
.waitform input:focus { outline: none; border-color: var(--blue); }
.waitform input:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  border: none; border-radius: 999px;
  background: var(--blue-fill); color: var(--on-blue);
  padding: 13px 30px;
  font-family: var(--f-body); font-size: 15.5px; font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 30px color-mix(in srgb, var(--blue-fill) 40%, transparent);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 14px 36px color-mix(in srgb, var(--blue-fill) 50%, transparent); }
.btn:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.btn[disabled] { opacity: 0.6; cursor: wait; transform: none; }
.form-msg { margin-top: 14px; font-size: 14.5px; min-height: 1.5em; }
.form-msg.ok { color: var(--cyan); }
.form-msg.err { color: var(--magenta); }
.micro { color: var(--dim); font-size: 13.5px; margin-top: 10px; }
.micro b { color: var(--amber); font-weight: 600; }

/* ---------- beta CTA ---------- */
.beta-cta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  max-width: 480px;
}
.beta-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--f-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--cyan);
}
[dir="rtl"] .beta-live { letter-spacing: 0; }
.beta-live i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 12px color-mix(in srgb, var(--cyan) 80%, transparent);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
.btn-beta {
  border: 1px solid color-mix(in srgb, var(--cyan) 55%, transparent);
  color: var(--cyan);
  background: transparent;
  text-decoration: none;
  padding: 10px 24px;
  font-size: 14.5px;
}
@media (prefers-reduced-motion: reduce) {
  .beta-live i { animation: none; }
}

/* ---------- value props ---------- */
.props { display: flex; flex-direction: column; gap: 13px; margin-top: 42px; padding: 0; list-style: none; }
.props li { display: flex; align-items: center; gap: 12px; color: var(--dim); font-size: 15px; }
.props li b { color: var(--text); font-weight: 600; }
.props i {
  flex: none; width: 9px; height: 9px; border-radius: 50%;
}
.dot-amber   { background: var(--amber);   box-shadow: 0 0 14px color-mix(in srgb, var(--amber) 70%, transparent); }
.dot-magenta { background: var(--magenta); box-shadow: 0 0 14px color-mix(in srgb, var(--magenta) 70%, transparent); }
.dot-cyan    { background: var(--cyan);    box-shadow: 0 0 14px color-mix(in srgb, var(--cyan) 70%, transparent); }

/* ---------- 3D stack ---------- */
.scene { perspective: 1200px; display: flex; justify-content: center; padding: 20px 0; }
.drift { animation: drift 9s ease-in-out infinite alternate; }
.stack3d {
  position: relative;
  width: min(320px, 66vw); height: min(320px, 66vw);
  transform-style: preserve-3d;
  transform: rotateX(calc(56deg + var(--rx, 0deg))) rotateZ(calc(43deg + var(--rz, 0deg)));
  transition: transform 0.25s ease-out;
}
.layer3d {
  position: absolute;
  width: 65.6%; height: 65.6%;
  left: 17.2%; top: 17.2%;
  border-radius: 26px;
  border: 1.5px solid rgba(255,255,255,0.32);
  transform: var(--tf);
  animation: assemble 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: calc(var(--i) * 0.13s + 0.2s);
}
.ly-amber   { --i: 0; --tf: translateZ(-76px); background: linear-gradient(135deg, rgba(255,176,32,0.92), rgba(255,122,61,0.92)); box-shadow: 0 0 70px rgba(255,150,40,0.45); }
.ly-magenta { --i: 1; --tf: translateZ(-26px); background: linear-gradient(135deg, rgba(255,61,154,0.90), rgba(190,60,220,0.90)); box-shadow: 0 0 70px rgba(255,61,154,0.40); }
.ly-aurora  { --i: 2; --tf: translateZ(26px) translateX(37%) translateY(6%); background: linear-gradient(135deg, rgba(43,217,255,0.94), rgba(77,107,255,0.94) 55%, rgba(255,61,154,0.94)); box-shadow: 0 0 90px rgba(77,107,255,0.55); }
.ly-cyan    { --i: 3; --tf: translateZ(76px); background: linear-gradient(135deg, rgba(43,217,255,0.55), rgba(77,107,255,0.42)); box-shadow: 0 0 60px rgba(43,217,255,0.35); }
@keyframes assemble {
  from { opacity: 0; transform: var(--tf) translate3d(0, 0, 170px); }
  to   { opacity: 1; transform: var(--tf); }
}
@keyframes drift {
  from { transform: translateY(-9px); }
  to   { transform: translateY(9px); }
}
.scene-hint {
  text-align: center;
  font-family: var(--f-mono); font-size: 11.5px;
  color: var(--dim); letter-spacing: 0.2em;
  margin-top: 4px;
}
[dir="rtl"] .scene-hint { letter-spacing: 0; }
@media (max-width: 900px) { .scene-wrap { order: -1; } }

/* ---------- live projects ---------- */
.projects {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--line);
  padding: clamp(56px, 9vh, 104px) 0;
}
.projects-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 48px);
}
.projects-head { max-width: 60ch; }
.projects h2 {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(28px, 4.4vw, 46px);
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin-top: 16px;
  text-wrap: balance;
}
[dir="rtl"] .projects h2 { letter-spacing: 0; }
.projects-sub {
  color: var(--dim);
  font-size: clamp(15.5px, 2vw, 17px);
  line-height: 1.65;
  margin-top: 16px;
  max-width: 56ch;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
  max-width: 940px;
  margin-top: clamp(28px, 4vw, 44px);
}
@media (max-width: 720px) { .project-grid { grid-template-columns: 1fr; max-width: 460px; } }

/* compact, image-first gallery card */
.proj-card {
  display: block;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  overflow: hidden;
  text-decoration: none;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}
.proj-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  box-shadow: 0 18px 46px -22px var(--glow);
}
.proj-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.proj-thumb {
  display: block;
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--panel2);
}
.proj-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.4s ease;
}
.proj-card:hover .proj-thumb img { transform: scale(1.04); }
.proj-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to top, var(--glow), transparent 55%);
  opacity: 0;
  transition: opacity 0.22s ease;
}
.proj-card:hover .proj-thumb::after { opacity: 1; }

/* small glassy "live" pill on the thumbnail */
.proj-live {
  position: absolute;
  top: 10px; left: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px 3px 8px;
  border-radius: 999px;
  background: rgba(5, 6, 13, 0.55);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-family: var(--f-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: #eef1fb;
}
[dir="rtl"] .proj-live { left: auto; right: 10px; letter-spacing: 0; }
.proj-live i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px color-mix(in srgb, var(--cyan) 85%, transparent);
  animation: pulse 2s ease-in-out infinite;
}

.proj-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
}
.proj-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.proj-meta b {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
  color: var(--text);
}
[dir="rtl"] .proj-meta b { letter-spacing: 0; }
.proj-cat {
  font-size: 12.5px;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.proj-go {
  margin-left: auto;
  flex: none;
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--dim);
  font-size: 15px;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
[dir="rtl"] .proj-go { margin-left: 0; margin-right: auto; transform: scaleX(-1); }
.proj-card:hover .proj-go {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  transform: translate(2px, -2px);
}
[dir="rtl"] .proj-card:hover .proj-go { transform: translate(-2px, -2px) scaleX(-1); }

/* ---------- footer ---------- */
.foot {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  max-width: 1240px; margin: 0 auto;
  padding: 22px clamp(20px, 4vw, 48px) 34px;
  font-family: var(--f-mono); font-size: 12px; color: var(--dim);
  border-top: 1px solid var(--line);
}
.foot a { color: var(--dim); text-decoration: none; }
.foot a:hover, .foot a:focus-visible { color: var(--text); }

@media (prefers-reduced-motion: reduce) {
  .layer3d { animation: none; }
  .drift { animation: none; }
  .btn, .stack3d { transition: none; }
}
