/* kin — kinaiapp.xyz */

:root {
  --ink: #f4f2ee;
  --ink-2: rgba(244, 242, 238, 0.72);
  --ink-3: rgba(244, 242, 238, 0.5);
  --line: rgba(244, 242, 238, 0.16);
  --needle: #e4f25a;
  --night: #121116;
  --graphite: #2b2a2f;

  /* Aura, updated live by machine.js */
  --base: #5f5c63;
  --halo: #3a383e;
  --glow: #8a8690;
  --core: #0e0d10;

  --font: "Familjen Grotesk", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3125rem;
  --step-2: 1.75rem;
  --step-3: clamp(2.25rem, 1.6rem + 2.6vw, 3.5rem);
  --step-4: clamp(2.75rem, 1.8rem + 4.2vw, 5.25rem);
  --gutter: clamp(1rem, 0.6rem + 2vw, 2.5rem);
  --measure: 38rem;
}

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

html {
  background: var(--night);
  color: var(--ink);
  font-family: var(--font);
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  background: var(--night);
  font-size: var(--step-0);
  line-height: 1.55;
}

a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--needle); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { font-weight: 500; letter-spacing: -0.02em; line-height: 1.08; margin: 0; }
p { margin: 0; }

.skip {
  position: absolute; left: var(--gutter); top: -4rem; z-index: 50;
  background: var(--ink); color: var(--night); padding: 0.6rem 1rem; border-radius: 999px; text-decoration: none;
}
.skip:focus { top: 1rem; }

/* Header ------------------------------------------------------------- */

.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: flex; align-items: center; gap: 1.5rem;
  padding: max(env(safe-area-inset-top), 1rem) var(--gutter) 1rem;
  pointer-events: none;
}
.site-header > * { pointer-events: auto; }
.wordmark {
  font-weight: 600; font-size: 1.5rem; letter-spacing: -0.04em; text-decoration: none; margin-right: auto;
}
.site-header nav { display: flex; gap: 1.25rem; font-size: var(--step--1); }
.site-header nav a { text-decoration: none; color: var(--ink-2); }
.site-header nav a:hover { color: var(--ink); }

.cta {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3rem; padding: 0 1.4rem;
  background: var(--ink); color: #16151a; border-radius: 999px;
  font-weight: 500; text-decoration: none;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.4) inset, 0 10px 30px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease;
}
.cta:hover { transform: translateY(-1px); text-decoration: none; }
.cta--small { min-height: 2.4rem; padding: 0 1.05rem; font-size: var(--step--1); }

@media (max-width: 640px) {
  .site-header nav { display: none; }
}

/* The machine -------------------------------------------------------- */

.machine { position: relative; height: 1100vh; }
.stage {
  position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden;
  display: grid; place-items: center;
}

.aura { position: absolute; inset: 0; background: var(--base); }
.aura > div { position: absolute; inset: 0; }
.aura__halo { background: radial-gradient(circle at 50% 56%, var(--halo) 0%, transparent 62%); }
.aura__glow {
  inset: auto; width: 70vmax; height: 70vmax; right: -14vmax; top: -18vmax;
  border-radius: 50%; background: var(--glow); filter: blur(12vmax); opacity: 0.75;
}
.aura__core { background: radial-gradient(circle at 50% 56%, var(--core) 0%, color-mix(in srgb, var(--core) 80%, transparent) 18%, transparent 44%); }
.aura__grain {
  opacity: 0.09; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.instrument {
  position: relative; z-index: 2;
  display: grid; justify-items: center; gap: clamp(0.6rem, 1.6vh, 1.2rem);
  --size: min(72vw, 54vh, 560px);
}
.mode {
  font-size: var(--step--1); font-weight: 500; color: var(--ink-2); letter-spacing: 0.02em;
}
.year { width: min(80vw, 420px); height: auto; aspect-ratio: 640 / 120; }

.dial { position: relative; width: var(--size); aspect-ratio: 1; }
.dial__glass {
  position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03) 60%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.dial__gear, .dial__sheen { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.dial__gear { will-change: transform; }
.dial__sheen { mix-blend-mode: plus-lighter; pointer-events: none; }
.dial__needle {
  position: absolute; left: 50%; top: 0.4%; width: 3px; height: 7%; translate: -50% 0;
  background: var(--needle); border-radius: 3px; box-shadow: 0 0 12px rgba(228, 242, 90, 0.7);
}
.dial__needle::before {
  content: ""; position: absolute; left: 50%; top: -12px; translate: -50% 0;
  border: 6px solid transparent; border-top: 7px solid var(--needle);
}

.lens {
  position: absolute; inset: 23%; border-radius: 50%; overflow: hidden;
  background: #fff; padding: 1.6%;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}
.lens__img {
  position: absolute; inset: 1.6%; width: 96.8%; height: 96.8%; border-radius: 50%; object-fit: cover;
  opacity: 0; transition: none;
}
.lens__img.is-shown { opacity: 1; }
.lens__ring { position: absolute; inset: 0; width: 100%; height: 100%; rotate: -90deg; pointer-events: none; }
.lens__track { fill: none; stroke: rgba(255, 255, 255, 0.0); stroke-width: 2.2; }
.lens__progress {
  fill: none; stroke: var(--needle); stroke-width: 2.2; stroke-linecap: round;
  stroke-dasharray: 1; stroke-dashoffset: 1; filter: drop-shadow(0 0 3px rgba(228, 242, 90, 0.8));
}

.label {
  position: absolute; z-index: 3; left: var(--gutter); bottom: max(env(safe-area-inset-bottom), 2rem);
  max-width: 22rem;
}
.label__era { font-size: var(--step-2); font-weight: 500; letter-spacing: -0.02em; line-height: 1.1; }
.label__line { margin-top: 0.35rem; color: var(--ink-2); }
.label.is-changing .label__era,
.label.is-changing .label__line { opacity: 0; translate: 0 6px; }
.label__era, .label__line { transition: opacity 0.35s ease, translate 0.35s ease; }

.hint {
  position: absolute; z-index: 3; bottom: max(env(safe-area-inset-bottom), 2rem); right: var(--gutter);
  font-size: var(--step--1); color: var(--ink-2); transition: opacity 0.4s ease;
}
.fiction {
  position: absolute; z-index: 3; right: var(--gutter); top: 50%; translate: 0 -50%;
  writing-mode: vertical-rl; font-size: 0.75rem; color: var(--ink-3);
}

@media (max-width: 720px) {
  .instrument { --size: min(86vw, 50vh); margin-top: -6vh; }
  .label { right: var(--gutter); max-width: none; bottom: max(env(safe-area-inset-bottom), 1.25rem); }
  .label__era { font-size: var(--step-1); }
  .hint { display: none; }
  .fiction { writing-mode: horizontal-tb; top: auto; translate: none; bottom: auto; top: 4.4rem; right: auto; left: var(--gutter); }
}

/* Content ------------------------------------------------------------ */

.intro, .how, .plans, .promise, .get {
  padding: clamp(4rem, 10vw, 8rem) var(--gutter);
  max-width: 72rem; margin: 0 auto;
}
.intro h1 { font-size: var(--step-4); max-width: 14ch; }
.intro p { margin-top: 1.5rem; max-width: var(--measure); font-size: var(--step-1); line-height: 1.5; color: var(--ink-2); }

.how h2, .plans h2, .promise h2, .get h2 { font-size: var(--step-3); max-width: 18ch; }

.steps { list-style: none; padding: 0; margin: 3rem 0 0; display: grid; gap: 2.5rem; counter-reset: step; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 4rem 1fr; gap: 0 1rem; max-width: 46rem; }
.steps li::before {
  content: counter(step); grid-row: span 2;
  font-size: var(--step-2); font-weight: 500; color: var(--needle); line-height: 1;
}
.steps h3 { font-size: var(--step-1); }
.steps p { margin-top: 0.5rem; color: var(--ink-2); }

.plans__lead { margin-top: 1rem; color: var(--ink-2); max-width: var(--measure); font-size: var(--step-1); }
.plans__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1px; margin-top: 3rem; background: var(--line); border-radius: 28px; overflow: hidden; }
.plan { background: var(--night); padding: 2rem; }
.plan--year { background: linear-gradient(160deg, #3d2b52 0%, #1d1631 60%, var(--night) 100%); }
.plan__price { font-size: var(--step-3); font-weight: 500; letter-spacing: -0.03em; line-height: 1; margin-bottom: 0.75rem; }
.plan__price span { font-size: var(--step-0); color: var(--ink-2); letter-spacing: 0; margin-left: 0.2rem; }
.plan p:not(.plan__price) { color: var(--ink-2); }
.plans__note { margin-top: 1.5rem; font-size: var(--step--1); color: var(--ink-3); max-width: var(--measure); }

.promise ul { margin: 2rem 0 1.5rem; padding-left: 1.2rem; max-width: var(--measure); display: grid; gap: 0.75rem; color: var(--ink-2); }

.get { text-align: left; }
.get p { margin: 1rem 0 2rem; color: var(--ink-2); max-width: var(--measure); }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 2.5rem var(--gutter) max(env(safe-area-inset-bottom), 2.5rem);
  display: grid; gap: 1rem; max-width: 72rem; margin: 0 auto; color: var(--ink-2); font-size: var(--step--1);
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.site-footer .small { color: var(--ink-3); }

/* Legal and support pages -------------------------------------------- */

.page { background: var(--night); }
.page .site-header { position: static; pointer-events: auto; background: linear-gradient(180deg, var(--graphite), var(--night)); }
.doc { max-width: 42rem; margin: 0 auto; padding: 2.5rem var(--gutter) 5rem; }
.doc h1 { font-size: var(--step-3); }
.doc .updated { margin-top: 0.75rem; color: var(--ink-3); font-size: var(--step--1); }
.doc h2 { font-size: var(--step-1); margin-top: 2.75rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.doc h3 { font-size: var(--step-0); margin-top: 1.75rem; font-weight: 600; }
.doc p, .doc li { color: var(--ink-2); }
.doc p { margin-top: 0.9rem; }
.doc ul, .doc ol { padding-left: 1.2rem; margin: 0.9rem 0 0; display: grid; gap: 0.45rem; }
.doc strong { color: var(--ink); font-weight: 600; }
.doc .lead { font-size: var(--step-1); color: var(--ink); margin-top: 1.5rem; line-height: 1.45; }

@media (prefers-reduced-motion: reduce) {
  .cta, .label__era, .label__line, .hint { transition: none; }
}
