/* Hooshi landing: a dark scroll story over one sticky three.js stage (story.js), then calm Apple-style bands
   (after ordakapp.ir). Hooshi's own identity: black pebble, one mint spark, Estedad. Fonts are self-hosted. */
@font-face {
  font-family: "Estedad";
  src: url("/fonts/estedad-arabic-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F;
}
@font-face {
  font-family: "Estedad";
  src: url("/fonts/estedad-latin-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2190-21FF, U+2212, U+2318, U+21E7;
}

:root {
  --night: #0a0a0c;
  --night-2: #111113;
  --surface: #16161a;
  --on-night: #f5f5f7;
  --on-night-2: #a1a1aa;
  --on-night-3: #6e6e76;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --white: #ffffff;
  --tint: #f5f5f7;
  --line-dark: rgba(255, 255, 255, 0.1);
  --line-light: rgba(0, 0, 0, 0.08);
  --spark: #6ef2c2;
  --spark-on-light: #0b8a66;
  --idea: #ffd27a;
  --dev: #8ab4ff;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --radius: 28px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; background: var(--night); }
body {
  margin: 0; background: var(--night); color: var(--on-night);
  font: 16px/1.85 Estedad, -apple-system, "SF Arabic", "Segoe UI", Tahoma, sans-serif;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: inherit; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.wrap { width: min(1120px, calc(100% - 32px)); margin-inline: auto; }
:focus-visible { outline: 3px solid var(--spark); outline-offset: 3px; border-radius: 10px; }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 50; background: var(--white); color: var(--ink); padding: 8px 14px; border-radius: 999px; font-weight: 700; }
.skip:focus { top: 10px; }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 30; background: rgba(10, 10, 12, 0.62);
  backdrop-filter: saturate(160%) blur(18px); -webkit-backdrop-filter: saturate(160%) blur(18px);
  border-bottom: 1px solid var(--line-dark);
}
.nav-in { display: flex; align-items: center; gap: 20px; height: 56px; }
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 800; font-size: 17px; }
.brand-mark { width: 28px; height: 28px; }
.links { display: flex; gap: 24px; margin-inline-start: auto; font-size: 14px; color: var(--on-night-2); }
.links a { text-decoration: none; transition: color 160ms; }
.links a:hover { color: var(--on-night); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 26px;
  border-radius: 999px; font: inherit; font-size: 16px; font-weight: 800; text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: transform 160ms var(--ease), background 160ms, border-color 160ms;
}
.btn:active { transform: scale(0.98); }
.btn-light { background: var(--on-night); color: #0b0b0d; }
.btn-light:hover { background: var(--white); }
.btn-ghost { background: transparent; color: var(--on-night); border-color: rgba(255, 255, 255, 0.22); }
.btn-ghost:hover { border-color: rgba(255, 255, 255, 0.5); }
.btn-sm { min-height: 36px; padding: 0 16px; font-size: 14px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }

/* ---------- story ---------- */
.story { position: relative; }
.stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; background: var(--night); }
.scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 900ms var(--ease); }
.story.ready .scene { opacity: 1; }
/* Only without WebGL or with reduced motion; while the 3D story loads the stage simply stays dark. */
.fallback { position: absolute; inset: 0; display: none; place-items: center; }
.story.static .fallback { display: grid; }
.fallback-mascot { width: min(34vw, 180px); aspect-ratio: 1; margin-bottom: 18vh; }
.shade {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% 40%, transparent 55%, rgba(10, 10, 12, 0.85) 100%),
    linear-gradient(to top, rgba(10, 10, 12, 0.92) 0%, rgba(10, 10, 12, 0) 38%);
}
.demo-tag {
  position: absolute; top: 70px; inset-inline-end: 18px; margin: 0; font-size: 12px; font-weight: 700; color: var(--on-night-3);
  border: 1px solid var(--line-dark); border-radius: 999px; padding: 0 10px; line-height: 24px;
}

.chapters { position: relative; margin-top: -100vh; margin-top: -100svh; z-index: 2; }
.chapter { min-height: 100vh; min-height: 100svh; display: flex; align-items: flex-end; padding: 0 0 max(56px, 9svh); }
.chapter .copy { max-width: 1120px; }
.chapter .copy > * { max-width: 34rem; }
.chapter .copy {
  opacity: .28; transform: translateY(18px); transition: opacity 520ms var(--ease), transform 520ms var(--ease);
}
.chapter.on .copy { opacity: 1; transform: none; }
.hero { align-items: center; padding-top: 72px; }
.hero .copy > * { max-width: 40rem; }

.kicker { margin: 0 0 14px; font-size: 15px; font-weight: 700; color: var(--on-night-2); display: flex; align-items: center; gap: 8px; }
.kicker::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--spark); box-shadow: 0 0 14px var(--spark); }
.display {
  margin: 0; font-weight: 900; font-size: clamp(2.3rem, 6.6vw, 5.2rem); line-height: 1.12; letter-spacing: -0.012em; text-wrap: balance;
}
.display span { display: block; }
.display .soft { color: var(--on-night-3); font-size: .62em; line-height: 1.3; margin-top: 10px; font-weight: 800; }
.lead { margin: 18px 0 0; font-size: clamp(16px, 1.6vw, 19px); color: var(--on-night-2); max-width: 34rem; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.fine { margin: 16px 0 0; font-size: 14px; color: var(--on-night-3); }
.fine a { color: var(--on-night-2); }
/* Which device's story: the visitor's is picked for them, the others are one tap away. */
.devices { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 18px; }
.devices-label { font-size: 13px; color: var(--on-night-3); margin-inline-end: 4px; }
.devices button {
  font: inherit; font-size: 13px; font-weight: 700; min-height: 34px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  color: var(--on-night-2); background: transparent; border: 1px solid var(--line-dark); transition: background 160ms, color 160ms, border-color 160ms;
}
.devices button:hover { color: var(--on-night); border-color: rgba(255, 255, 255, 0.3); }
.devices button[aria-pressed="true"] { color: #0b0b0d; background: var(--on-night); border-color: var(--on-night); }
.step { margin: 0 0 10px; font-size: 13px; font-weight: 800; color: var(--spark); letter-spacing: 0; }
.title { margin: 0; font-weight: 900; font-size: clamp(1.9rem, 4.6vw, 3.6rem); line-height: 1.2; text-wrap: balance; }
.kbd { font-family: inherit; font-weight: 800; color: var(--on-night); background: rgba(255, 255, 255, 0.08); border: 1px solid var(--line-dark); border-radius: 8px; padding: 0 8px; }

.example { margin-top: 22px; padding: 14px 16px; border-radius: 18px; background: rgba(22, 22, 26, 0.78); border: 1px solid var(--line-dark); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.example p { margin: 0; }
.said { color: var(--on-night-2); font-size: 15px; }
.became { margin-top: 8px !important; font-weight: 700; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tag { font-size: 12px; font-weight: 800; border-radius: 999px; padding: 0 9px; line-height: 22px; }
.tag-promise { color: var(--spark); background: rgba(110, 242, 194, 0.14); }
.when { color: var(--on-night-3); font-weight: 600; font-size: 14px; }

.scroll-hint {
  position: absolute; bottom: 22px; left: 50%; width: 22px; height: 36px; margin-left: -11px; border-radius: 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
}
.scroll-hint::after {
  content: ""; position: absolute; top: 7px; left: 50%; width: 3px; height: 7px; margin-left: -1.5px; border-radius: 2px;
  background: var(--on-night-2); animation: hint 1.8s var(--ease) 4;
}
@keyframes hint { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(10px); opacity: 0; } 100% { opacity: 0; } }

/* Where am I: one dot per chapter, the current one stretched. */
.dots {
  position: fixed; z-index: 20; left: 18px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 10px; transition: opacity 300ms;
}
.dots a { display: block; width: 6px; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.28); transition: height 260ms var(--ease), background 260ms; }
.dots a.on { height: 22px; background: var(--spark); }
.dots.away { opacity: 0; pointer-events: none; }

/* ---------- bands ---------- */
.band { padding: clamp(80px, 12vw, 140px) 0; position: relative; z-index: 3; }
.band-white { background: var(--white); color: var(--ink); }
.band-tint { background: var(--tint); color: var(--ink); }
.band-dark { background: var(--night-2); color: var(--on-night); }
.eyebrow { margin: 0 0 10px; font-size: 14px; font-weight: 800; color: var(--spark-on-light); }
.band-dark .eyebrow { color: var(--spark); }
.h2 { margin: 0 0 28px; font-weight: 900; font-size: clamp(2rem, 4.8vw, 3.6rem); line-height: 1.2; text-wrap: balance; }
.lead.dark { color: var(--muted); }
.band-white .lead, .band-tint .lead { color: var(--muted); }
.split { display: grid; gap: 40px; }
.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.facts li { display: grid; gap: 4px; padding: 18px 0; border-top: 1px solid var(--line-light); }
.facts b { font-weight: 800; font-size: 18px; }
.facts span { color: var(--muted); }

/* "If you want, I'll do these": one card per action that works today. */
.do-grid { list-style: none; margin: 32px 0 0; padding: 0; display: grid; gap: 14px; grid-template-columns: 1fr; }
.do-grid li { display: grid; gap: 6px; padding: 20px 22px; border-radius: 22px; background: var(--tint); }
.do-grid b { font-size: 18px; font-weight: 900; }
.do-grid span { color: var(--muted); }
.band-white .note { color: var(--muted); }
/* "The same Hooshi everywhere": a card per device, its status straight from the download feed. */
.device-grid { list-style: none; margin: 32px 0 0; padding: 0; display: grid; gap: 14px; grid-template-columns: 1fr; }
.device-grid li { display: grid; gap: 6px; padding: 22px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line-dark); }
.device-grid b { font-size: 20px; font-weight: 900; }
.device-grid span { color: var(--on-night-2); }
.device-grid em { font-style: normal; font-size: 13px; font-weight: 800; color: var(--on-night-3); margin-top: 6px; }
.device-grid em a { color: var(--spark); text-decoration: none; }
.band-dark .note { color: var(--on-night-3); }
.band-dark .lead { color: var(--on-night-2); }
.table-wrap { background: var(--white); border-radius: 22px; overflow: hidden; border: 1px solid var(--line-light); }
.where { width: 100%; border-collapse: collapse; font-size: 15px; }
.where th, .where td { text-align: start; vertical-align: top; padding: 18px 20px; border-top: 1px solid var(--line-light); }
.where tr:first-child th, .where tr:first-child td { border-top: 0; }
.where th { width: 30%; font-weight: 800; }
.where td { color: var(--muted); }
.note { margin: 18px 0 0; color: var(--muted); font-size: 14.5px; max-width: 70ch; }

.invite { display: grid; justify-items: center; text-align: center; }
.invite .lead { margin: 0 auto; color: var(--on-night-2); }
.invite .h2 { margin-bottom: 10px; }
.invite-mascot { width: 96px; height: 96px; margin-bottom: 18px; }
.invite-form { display: grid; gap: 14px; width: min(420px, 100%); margin-top: 30px; text-align: start; }
.field { display: grid; gap: 6px; }
.field > span { font-size: 14px; font-weight: 700; color: var(--on-night-2); }
.input {
  width: 100%; min-height: 54px; padding: 0 16px; border-radius: 16px; border: 1px solid rgba(255, 255, 255, 0.16);
  background: var(--surface); font: inherit; font-size: 18px; color: var(--on-night); text-align: left;
}
.input::placeholder { color: var(--on-night-3); }
.input:focus { outline: 3px solid var(--spark); outline-offset: 1px; border-color: transparent; }
.form-msg { margin: 0; min-height: 1.8em; font-size: 15px; text-align: center; }
.form-msg.ok { color: var(--spark); font-weight: 800; }
.form-msg.err { color: #ff8a8a; }

.faq details { border-top: 1px solid var(--line-light); padding: 20px 0; max-width: 780px; }
.faq summary { cursor: pointer; font-size: 19px; font-weight: 800; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); font-weight: 400; }
.faq details[open] summary::after { content: "−"; }
.faq p { margin: 10px 0 0; color: var(--muted); }

.foot { background: var(--white); color: var(--muted); font-size: 14px; position: relative; z-index: 3; }
.foot-in { display: flex; justify-content: space-between; padding: 28px 0 40px; border-top: 1px solid var(--line-light); }

@media (min-width: 900px) {
  /* The copy sits on the right (RTL); a soft dark falloff keeps the cards from fighting it. */
  .shade {
    background:
      linear-gradient(to left, rgba(10, 10, 12, 0.9) 0%, rgba(10, 10, 12, 0.55) 30%, rgba(10, 10, 12, 0) 52%),
      radial-gradient(120% 80% at 50% 40%, transparent 55%, rgba(10, 10, 12, 0.85) 100%);
  }
  .chapter { align-items: center; padding: 0; }
  /* Pinned to the right edge with a fixed width: story.js keeps the 3D scene in the left ~56%. */
  .chapter .copy { display: flex; flex-direction: column; align-items: flex-start; width: auto; margin: 0; padding-inline-start: 6vw; }
  .chapter .copy > *, .hero .copy > * { max-width: min(36rem, 38vw); }
  .split { grid-template-columns: 1.1fr 1fr; align-items: start; }
  .do-grid { grid-template-columns: repeat(3, 1fr); }
  .device-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 641px) and (max-width: 899px) {
  .do-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .links { display: none; }
  .nav-in .btn-sm { margin-inline-start: auto; }
  .dots { left: 8px; gap: 8px; }
  .chapter .copy { padding-inline-start: 6px; }
  .where, .where tbody, .where tr, .where th, .where td { display: block; width: auto; }
  .where th { padding-bottom: 0; }
  .where td { border-top: 0; padding-top: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .chapter .copy { transition: none; opacity: 1; transform: none; }
  .scroll-hint::after { animation: none; }
}
