/* =========================================================
   Infercia — minimal, near-black, ice-on-black (dot edition)
   Signature: a dot-matrix planet — the hero opens zoomed
   deep into the dotted dome, and scroll pulls the camera
   back to the full globe. Accent used with restraint.
   ========================================================= */

:root {
  --accent:      #2878f8;
  --accent-soft: #6ea0f6;

  --bg:      #050608;
  --bg-2:    #0a0c11;
  --line:    rgba(255,255,255,.09);
  --line-2:  rgba(255,255,255,.05);

  --ink:     #eef1f5;   /* high */
  --ink-mid: #9aa3b0;   /* body */
  --ink-low: #5b6472;   /* labels / captions */

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans:  "Inter", system-ui, -apple-system, sans-serif;
  --mono:  "IBM Plex Mono", ui-monospace, monospace;
  --ar:    "Noto Naskh Arabic", "Fraunces", serif;

  --maxw:   1180px;
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --ease:   cubic-bezier(.22,.61,.36,1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-mid);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

p { margin: 0; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 1.5px solid var(--accent-soft); outline-offset: 4px; border-radius: 2px; }

h1, h2 {
  font-family: var(--serif);
  font-weight: 300;
  color: var(--ink);
  line-height: 1.04;
  letter-spacing: -0.01em;
  margin: 0;
}
em { font-style: italic; }

/* ---------- shared bits ---------- */
.tag {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink-low);
  display: inline-flex;
  align-items: center;
  gap: .55rem;
}
.tag i { font-style: normal; color: var(--accent-soft); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .8rem 1.5rem;
  font-family: var(--sans); font-weight: 500; font-size: .9rem;
  letter-spacing: .01em;
  border-radius: 2px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .25s var(--ease), border-color .25s var(--ease), color .25s var(--ease), transform .2s var(--ease);
  white-space: nowrap;
}
.btn--solid { background: var(--ink); color: #06070a; }
.btn--solid:hover { background: #fff; transform: translateY(-1px); }
.btn--line { border-color: var(--line); color: var(--ink); background: transparent; }
.btn--line:hover { border-color: rgba(255,255,255,.32); background: rgba(255,255,255,.03); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

/* =========================================================
   THE STAGE — fixed planet layer behind everything
   ========================================================= */
.stage { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; background: var(--bg); }

/* faint hex/character matrix, extremely subtle */
.stage__matrix { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .5; }

/* dot-matrix planet canvas; JS drives the camera + all fading internally */
.stage__globe {
  position: absolute; left: 0; top: 0;
  width: 100%; height: 100%;
}

/* soft edge darkening so text always sits on near-black.
   Stronger top + bottom bands keep hero sub-copy and captions legible
   even when the bright planet limb passes behind them. */
.stage__vignette {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(5,6,8,.85) 0%, rgba(5,6,8,.15) 22%, rgba(5,6,8,0) 40%, rgba(5,6,8,0) 55%, rgba(5,6,8,.6) 80%, rgba(5,6,8,.92) 100%),
    radial-gradient(120% 80% at 50% 42%, transparent 52%, rgba(5,6,8,.62) 100%);
}

/* everything above the stage */
.nav, main, .footer { position: relative; z-index: 2; }

/* =========================================================
   NAV
   ========================================================= */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; gap: 2rem;
  padding: 1.15rem var(--gutter);
  transition: background .4s var(--ease), border-color .4s, backdrop-filter .4s;
  border-bottom: 1px solid transparent;
}
.nav.is-stuck {
  background: rgba(5,6,8,.6);
  backdrop-filter: blur(16px) saturate(1.1);
  border-bottom-color: var(--line-2);
}
.nav__brand { display: inline-flex; align-items: center; }
.nav__logo { display: block; height: 34px; width: auto; }
.nav__links { display: flex; gap: 1.9rem; margin-left: auto; }
.nav__links a { font-size: .86rem; color: var(--ink-mid); transition: color .2s; }
.nav__links a:hover { color: var(--ink); }
.nav__cta {
  font-size: .84rem; font-weight: 500; color: var(--ink);
  padding: .5rem 1rem; border: 1px solid var(--line); border-radius: 2px;
  transition: border-color .2s, background .2s;
}
.nav__cta:hover { border-color: rgba(255,255,255,.32); background: rgba(255,255,255,.03); }

/* =========================================================
   HERO
   ========================================================= */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: 8rem var(--gutter) 6rem;
}
.hero__inner {
  max-width: 760px;
  position: relative;
}
/* soft local scrim so hero copy reads over the bright planet limb */
.hero__inner::before {
  content: ""; position: absolute; z-index: -1;
  left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 130%; height: 190%;
  background: radial-gradient(60% 55% at 50% 50%, rgba(5,6,8,.78), rgba(5,6,8,.35) 55%, transparent 78%);
  pointer-events: none;
}
.hero__title {
  font-size: clamp(3rem, 9vw, 6.6rem);
  letter-spacing: -0.025em;
  margin-bottom: 1.6rem;
}
.hero__sub {
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  color: var(--ink-mid);
  max-width: 40ch; margin: 0 auto 2.4rem;
}
.hero__cta { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; }

.scroll-hint {
  position: absolute; bottom: 2.2rem; left: 50%; transform: translateX(-50%);
  font-family: var(--mono); font-size: .64rem; letter-spacing: .3em; text-transform: uppercase;
  color: var(--ink-low);
  display: flex; align-items: center; gap: .6rem;
}
.scroll-hint span {
  width: 1px; height: 34px; background: linear-gradient(180deg, var(--ink-low), transparent);
  position: relative; overflow: hidden;
}
.scroll-hint span::after {
  content: ""; position: absolute; top: 0; left: 0; width: 1px; height: 12px;
  background: var(--accent-soft); animation: fall 2.2s var(--ease) infinite;
}
@keyframes fall { 0% { transform: translateY(-14px); opacity: 0; } 40% { opacity: 1; } 100% { transform: translateY(34px); opacity: 0; } }

/* =========================================================
   GLOBE ACT — pinned scrollytelling scene
   The section is tall; a sticky track pins the viewport while
   the globe (on the fixed stage) zooms out. Two panels cross-
   fade: the statement, then the dialect readout. Both are held
   in the LOWER band so they never sit on top of the sphere.
   ========================================================= */
.globe-act { position: relative; height: 260vh; }
.globe-act__track {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 0 var(--gutter) clamp(2.5rem, 6vh, 5rem);
}
.act-panel {
  position: absolute; left: 50%; bottom: clamp(2.5rem, 6vh, 5rem);
  transform: translateX(-50%);
  width: min(var(--maxw), 100% - 2 * var(--gutter));
  opacity: 0; transition: opacity .4s var(--ease);
  will-change: opacity;
}
.act-panel.is-on { opacity: 1; }

/* panel 1 — statement, centered in the lower band */
.act-panel--reveal { text-align: center; }
.reveal__inner { max-width: 640px; margin: 0 auto; }
.reveal__line {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(1.25rem, 2.6vw, 1.95rem);
  line-height: 1.42; color: var(--ink-mid);
  letter-spacing: -.01em;
}
.reveal__punch {
  font-family: var(--serif); font-style: italic; font-weight: 300;
  font-size: clamp(1.25rem, 2.6vw, 1.95rem);
  color: var(--ink); margin-top: 1.2rem;
}

/* panel 2 — dialect readout row (reference stat style) */
.dialects__head {
  display: flex; align-items: baseline; gap: 1.4rem; flex-wrap: wrap;
  padding-bottom: 1.4rem; margin-bottom: 1.8rem;
  border-bottom: 1px solid var(--line-2);
}
.dialects__note { font-size: .9rem; color: var(--ink-low); max-width: 46ch; }

.dialects__grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(6, 1fr);
}
.dialects__grid li {
  padding: 0 1.1rem;
  border-left: 1px solid var(--line-2);
  display: flex; flex-direction: column; gap: .35rem;
  transition: opacity .5s var(--ease);
}
.dialects__grid li:first-child { border-left: 0; padding-left: 0; }
.dialects__grid li.is-dim { opacity: .38; }
.dl__native {
  font-family: var(--ar); font-size: 1.5rem; color: var(--ink); line-height: 1.1;
  min-height: 1.9rem;
}
.dl__native[lang="tr"], .dl__native[lang="az"] { font-family: var(--serif); font-weight: 400; }
.dl__name { font-size: .9rem; color: var(--ink-mid); }
.dl__code { font-family: var(--mono); font-size: .68rem; color: var(--ink-low); letter-spacing: .08em; }

/* =========================================================
   PRODUCTS
   ========================================================= */
.product {
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(4rem, 9vw, 8rem) var(--gutter);
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2.5rem, 7vw, 6rem);
  align-items: center;
  border-top: 1px solid var(--line-2);
}
.product__copy .tag { margin-bottom: 1.6rem; }
.product__title {
  font-size: clamp(1.9rem, 3.6vw, 2.9rem);
  max-width: 15ch; margin-bottom: 1.3rem;
}
.product__lede {
  font-size: 1rem; color: var(--ink-mid);
  max-width: 42ch; margin-bottom: 2.2rem;
}

.product__visual { display: flex; justify-content: center; }
.product--rev .product__copy { order: 2; }
.product--rev .product__visual { order: 1; }

/* phone frame */
.phone {
  width: 268px; aspect-ratio: 9 / 19.2;
  background: #05070a; border-radius: 40px; padding: 9px;
  border: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 50px 90px -40px rgba(0,0,0,.9), inset 0 1px 0 rgba(255,255,255,.05);
}
.phone__screen { width: 100%; height: 100%; border-radius: 32px; overflow: hidden; background: #0a0c11; }
.phone__screen img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }

/* window frame */
.window {
  width: 100%; max-width: 560px;
  border: 1px solid rgba(255,255,255,.1); border-radius: 10px; overflow: hidden;
  background: #0a0c11;
  box-shadow: 0 50px 90px -40px rgba(0,0,0,.9), inset 0 1px 0 rgba(255,255,255,.04);
}
.window__bar { display: flex; align-items: center; gap: 7px; padding: .7rem .9rem; border-bottom: 1px solid var(--line-2); }
.window__bar i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.14); display: block; }
.window__body { line-height: 0; }
.window__body img { width: 100%; height: auto; display: block; }

/* =========================================================
   PRODUCT WHEELS — compact pinned bands. The track sticks to
   the middle of the viewport while the surrounding section's
   scroll length scrubs the screenshot wheel (JS: initWheels).
   ========================================================= */
.pw-pin {
  position: relative;
  height: calc(var(--pwh) + (var(--steps) - 1) * var(--stepvh, 32vh));
  border-top: 1px solid var(--line-2);
}
#app   { --pwh: 540px; --steps: 7; }
#ielts { --pwh: 500px; --steps: 10; --stepvh: 26vh; }

.pw-track {
  position: sticky;
  top: calc(50vh - var(--pwh) / 2);
  height: var(--pwh);
  overflow: hidden;
}

.pw__copy { position: absolute; z-index: 5; top: 50%; transform: translateY(-50%); }
.pw__copy--left  { left: var(--gutter);  width: min(30vw, 400px); }
.pw__copy--right { right: var(--gutter); width: min(34vw, 440px); }
.pw__title { font-size: clamp(1.8rem, 3vw, 2.5rem); margin: 1.3rem 0 1.1rem; }
.pw__lede { font-size: .98rem; color: var(--ink-mid); margin-bottom: 1.7rem; }

/* the wheel stage fills the track; JS places children each scroll tick */
.wheel { position: absolute; inset: 0; z-index: 2; }
.wheel__ring {
  position: absolute;
  border: 1px solid var(--line);
  border-radius: 50%;
  pointer-events: none;
}
.wheel__item {
  position: absolute;
  cursor: pointer;
  will-change: transform, opacity;
}
.wheel__item .phone, .wheel__item .window { width: 100%; }
.wheel__item .phone { padding: 6px; border-radius: 30px; }
.wheel__item .phone__screen { border-radius: 25px; }

@media (max-width: 820px) {
  #app   { --pwh: 660px; }
  #ielts { --pwh: 620px; }
  .pw__copy--left, .pw__copy--right {
    position: static; transform: none; width: auto;
    padding: 2.6rem var(--gutter) 0;
  }
}

/* =========================================================
   CLOSING + FOOTER
   ========================================================= */
.closing {
  text-align: center;
  padding: clamp(5rem, 11vw, 9rem) var(--gutter);
  border-top: 1px solid var(--line-2);
}
.closing__title {
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  margin-bottom: 2.4rem;
}
.closing__title em { color: var(--accent-soft); }

.footer {
  max-width: var(--maxw); margin: 0 auto;
  padding: 2rem var(--gutter) 3rem;
  border-top: 1px solid var(--line-2);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  font-size: .8rem; color: var(--ink-low);
}
.footer__brand { display: inline-flex; align-items: center; }
.footer__logo { display: block; height: 26px; width: auto; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 820px) {
  .nav__links { display: none; }
  .nav { gap: 1rem; }
  .product { grid-template-columns: 1fr; gap: 2.5rem; }
  .product--rev .product__copy { order: 1; }
  .product--rev .product__visual { order: 2; }
  .product__title { max-width: none; }
  .dialects__grid { grid-template-columns: repeat(3, 1fr); gap: 1.6rem 0; }
  .dialects__grid li:nth-child(3n+1) { border-left: 0; padding-left: 0; }
}
@media (max-width: 480px) {
  /* keep panels in the lower third so they never sit on the sphere */
  .globe-act__track { justify-content: flex-end; padding-bottom: 2rem; }
  .act-panel { bottom: 2rem; }
  .act-panel--reveal .reveal__line,
  .act-panel--reveal .reveal__punch { font-size: 1.15rem; line-height: 1.38; }

  .dialects__head { padding-bottom: 1rem; margin-bottom: 1.2rem; }
  .dialects__note { font-size: .82rem; }
  .dialects__grid { grid-template-columns: repeat(2, 1fr); gap: 1.1rem 0; }
  .dialects__grid li { padding: 0 .9rem; }
  .dialects__grid li:nth-child(2n+1) { border-left: 0; padding-left: 0; }
  .dl__native { font-size: 1.2rem; min-height: 1.5rem; }
  .dl__name { font-size: .84rem; }
  .btn { flex: 1; }
}

/* =========================================================
   REDUCED MOTION
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .scroll-hint span::after { display: none; }
}
