/* Kairos Studio, the landing page: one light ground from the hero to the FAQ, one typeface, and one
   theme switch that governs every section. Graphite is monochrome and the default; Sage is a cool
   mineral green. Never orange, blue or purple. Each section's own rules live in sections/<name>/,
   inside @scope (#<name>), and alias the tokens below. */

@font-face {
  font-family: Geist;
  src: url("assets/fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

/* ---------- Themes ---------- */

:root {
  --sans: Geist, ui-sans-serif, system-ui, -apple-system, sans-serif;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --gutter: clamp(20px, 2.65vw, 48px);
  --bar-h: 72px;
  color-scheme: light;
}

/* "-soft" text reaches 4.5 to 1 on --ground and on --surface; "--on-accent" reaches it on --accent. */
:root,
[data-theme="graphite"] {
  --ground: #f4f4f2;
  --ground-deep: #e9e9e6;
  --surface: #ffffff;
  --ink: #141518;
  --ink-2: #3b3d42;
  --ink-soft: #5b5e64;
  --line: rgb(20 21 24 / 0.14);
  --hair: rgb(20 21 24 / 0.08);
  --hover: rgb(20 21 24 / 0.04);
  --accent: #141518;
  --accent-deep: #34363b;
  --accent-ink: #141518;
  --accent-soft: #e6e6e3;
  --accent-light: #c9cbcd;
  --on-accent: #ffffff;
  --glow-color: #8e9296;
  --orb-accent-1: #9b9b9b;
  --orb-accent-2: #e5e5e5;
  --orb-accent-3: #ffffff;
  --orb-base: #141518;
  --orb-interior: #050506;
}

[data-theme="sage"] {
  --ground: #f1f4f1;
  --ground-deep: #e3e9e4;
  --surface: #ffffff;
  --ink: #111a16;
  --ink-2: #33413a;
  --ink-soft: #4d5b55;
  --line: rgb(17 26 22 / 0.14);
  --hair: rgb(17 26 22 / 0.08);
  --hover: rgb(17 26 22 / 0.04);
  --accent: #2f5d4f;
  --accent-deep: #224539;
  --accent-ink: #2a5547;
  --accent-soft: #e1ebe5;
  --accent-light: #a9d6c0;
  --on-accent: #ffffff;
  --glow-color: #5f9e86;
  --orb-accent-1: #4f8f78;
  --orb-accent-2: #a9d6c0;
  --orb-accent-3: #effaf4;
  --orb-base: #0f2b24;
  --orb-interior: #03100d;
}

/* ---------- Base ---------- */

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

html {
  background: var(--ground);
  color: var(--ink);
  font: 400 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  font-optical-sizing: auto;
  scroll-behavior: smooth;
  scroll-padding-top: var(--bar-h);
  scrollbar-color: color-mix(in oklab, var(--ink) 24%, transparent) transparent;
}

body {
  margin: 0;
  overflow-x: clip;
}

::selection {
  background: color-mix(in oklab, var(--accent) 22%, white);
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

a {
  color: inherit;
  text-underline-offset: 0.2em;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: fixed;
  left: 16px;
  top: -56px;
  z-index: 30;
  padding: 10px 16px;
  border-radius: 3px;
  background: var(--ink);
  color: var(--ground);
  font-size: 14px;
  text-decoration: none;
  transition: top 160ms var(--ease-out);
}

.skip:focus-visible {
  top: 16px;
}

/* ---------- Header: the brand, one glass pill of sections, the theme and the one action ---------- */

.bar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  height: var(--bar-h);
  padding: 0 var(--gutter);
  transition: background-color 300ms ease, box-shadow 300ms ease, backdrop-filter 300ms ease;
}

/* Once the page scrolls, the bar becomes a material the sections pass under, with a soft edge instead of a rule. */
.bar[data-scrolled] {
  background: color-mix(in oklab, var(--ground) 78%, transparent);
  box-shadow: 0 1px 0 var(--hair), 0 8px 24px -18px rgb(0 0 0 / 0.18);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
}

.brand {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.wordmark {
  display: grid;
  line-height: 1;
}

.wordmark b {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.wordmark small {
  margin-top: 3px;
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.62em;
  color: var(--ink-2);
}

.pill {
  display: flex;
  align-items: center;
  height: 41px;
  padding: 0 6px;
  border-radius: 3px;
  background: rgb(255 255 255 / 0.6);
  box-shadow: inset 0 0 0 1px var(--line);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
}

.pill a {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 100%;
  padding: 0 clamp(12px, 1.4vw, 22px);
  font-size: 11px;
  font-weight: 550;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-soft);
  white-space: nowrap;
  transition: color 160ms ease;
}

.pill a[aria-current="true"] {
  color: var(--ink);
}

.pill a + a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  height: 12px;
  border-left: 1px solid var(--line);
  translate: 0 -50%;
}

.bar-end {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 14px;
}

.themes {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px var(--line);
  background: rgb(255 255 255 / 0.4);
}

.themes[hidden] {
  display: none;
}

.themes button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 2px;
  background: none;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 550;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, transform 120ms var(--ease-out);
}

.themes button[aria-checked="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.08), inset 0 0 0 1px var(--line);
}

.themes button:active {
  transform: scale(0.97);
}

.swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.12);
}

[data-theme-choice="graphite"] .swatch { background: #141518; }
[data-theme-choice="sage"] .swatch { background: #2f5d4f; }

/* ---------- Buttons, shared by the header, the hero and the closing ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 550;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 120ms var(--ease-out);
}

.btn:active {
  transform: scale(0.97);
}

.btn svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: square;
  flex: none;
}

.btn-line {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--ink);
}

.btn-fill {
  background: var(--accent);
  color: var(--on-accent);
}

@media (hover: hover) and (pointer: fine) {
  .pill a:hover,
  .themes button:hover { color: var(--ink); }
  .btn-line:hover { background: var(--ink); color: var(--ground); }
  .btn-fill:hover { background: var(--accent-deep); }
}

/* ---------- Sections ---------- */

main > section {
  position: relative;
}

/* Offscreen sections hold their CSS motion: entrances wait until they are first seen, loops rest. */
.js main > section:not(.is-in) *,
.js main > section:not(.is-in) *::before,
.js main > section:not(.is-in) *::after {
  animation-play-state: paused !important;
}

/* ---------- Closing: the prototype and the one action ---------- */

.closing {
  padding: clamp(88px, 13vh, 160px) var(--gutter) 40px;
  border-top: 1px solid var(--hair);
}

.closing-inner {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 6vw, 96px);
  max-width: 1240px;
  margin: 0 auto;
}

.closing h2 {
  margin: 0;
  max-width: 14ch;
  font-size: clamp(2rem, 1.2rem + 2.6vw, 3.5rem);
  font-weight: 450;
  line-height: 1.04;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.closing-lead {
  margin: 20px 0 32px;
  max-width: 40ch;
  color: var(--ink-2);
  font-size: 17px;
  line-height: 1.55;
  text-wrap: pretty;
}

.screens {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.screens a {
  display: grid;
  grid-template-columns: minmax(7rem, 2fr) 5fr auto;
  align-items: baseline;
  gap: 4px 24px;
  padding: 22px 4px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition: background-color 160ms ease;
}

.screens b {
  font-size: 20px;
  font-weight: 550;
  letter-spacing: -0.015em;
}

.screens span {
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.45;
}

.screens svg {
  align-self: center;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 200ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .screens a:hover { background: var(--hover); }
  .screens a:hover svg { transform: translateX(3px); }
}

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 32px;
  max-width: 1240px;
  margin: clamp(72px, 10vh, 120px) auto 0;
  padding-top: 20px;
  border-top: 1px solid var(--hair);
  color: var(--ink-soft);
  font-size: 13px;
}

.foot p {
  margin: 0;
}

/* ---------- Smaller screens ---------- */

@media (max-width: 1080px) {
  .bar { grid-template-columns: 1fr auto; }
  .pill { display: none; }
}

@media (max-width: 860px) {
  .closing-inner { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  :root { --bar-h: 64px; }
  /* On a phone the bar sits on the hero and scrolls away with it, so it never covers the content. */
  .bar,
  .bar[data-scrolled] {
    position: absolute;
    background: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .bar-end .btn { display: none; }
  .themes button { padding: 0 8px; }
  .screens a { grid-template-columns: 1fr auto; }
  .screens span { grid-column: 1; }
  .screens svg { grid-row: 1 / span 2; grid-column: 2; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

@media (prefers-reduced-transparency: reduce) {
  .pill,
  .bar[data-scrolled] { background: var(--ground); backdrop-filter: none; -webkit-backdrop-filter: none; }
}

/* The icon sprite the walkthrough's window draws from: defined once, drawn nowhere itself. */
.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
