/* The King's Code: product information page.
   Same brand family as the sales page (near-black and gold, crown mark),
   in a quieter register. Display: Marcellus. Text: Public Sans. */

:root {
  color-scheme: dark;

  /* Neutrals, tinted a hair toward the gold hue (85) */
  --bg: oklch(0.155 0.006 85);          /* #0d0c09 */
  --surface: oklch(0.195 0.008 85);     /* #171511 */
  --surface-2: oklch(0.235 0.01 85);    /* #201e19 */
  --line: oklch(0.34 0.012 85);         /* #3b3831, hairlines only */
  --ink: oklch(0.945 0.008 85);         /* #efece7, 16.6:1 on bg */
  --ink-muted: oklch(0.775 0.012 85);   /* #b9b5ad, 9.6:1 on bg */

  /* Brand gold, close to the sales page's #D4AF37 */
  --gold: oklch(0.775 0.128 88);        /* #d8b14a, 9.5:1 on bg */
  --gold-bright: oklch(0.84 0.115 90);  /* #e8c76e, hover */
  --gold-wash: oklch(0.775 0.128 88 / 0.1);
  --on-gold: oklch(0.17 0.01 85);       /* text on gold, 9.3:1 */

  /* Device mockup */
  --device-shell: oklch(0.25 0.01 85);
  --device-edge: oklch(0.4 0.015 85);
  --device-screen: oklch(0.13 0.006 85);
  --device-rule: oklch(0.26 0.01 85);
  --device-camera: oklch(0.05 0 0);
  --device-drop: oklch(0 0 0 / 0.45);
  --breath-core: oklch(0.775 0.128 88 / 0.18);
  --breath-edge: oklch(0.775 0.128 88 / 0.04);

  --font-display: "Marcellus", "Trajan Pro", Georgia, serif;
  --font-text: "Public Sans", "Segoe UI", system-ui, -apple-system, sans-serif;

  /* Type scale (about 1.25 between steps) */
  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: clamp(1.625rem, 1.3rem + 1.5vw, 2.25rem);
  --step-3: clamp(2.125rem, 1.45rem + 3.2vw, 3.5rem);

  /* Space */
  --space-2xs: 0.25rem;
  --space-xs: 0.5rem;
  --space-s: 0.75rem;
  --space-m: 1rem;
  --space-l: 1.5rem;
  --space-xl: 2.5rem;
  --space-2xl: 4rem;
  --section: clamp(3.5rem, 2.5rem + 5vw, 6.5rem);
  --gutter: 1rem;

  --radius-s: 0.5rem;
  --radius-m: 0.75rem;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1); /* ease-out-quint */

  --z-skip: 10;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: var(--step-0);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word;
}

h1, h2, h3 { text-wrap: balance; }
p, li, dd { text-wrap: pretty; }

h1, h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0;
  color: var(--ink);
}

h3 {
  margin: 0;
  font-size: var(--step-1);
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
}

p { margin: 0; }

a {
  color: var(--gold);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color 160ms var(--ease-out);
}
a:hover { color: var(--gold-bright); }

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

.shell {
  width: 100%;
  max-width: 72rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

@media (min-width: 48rem) {
  :root { --gutter: 1.75rem; }
}

/* ---- Skip link ----------------------------------------------------------- */
.skip-link {
  position: absolute;
  top: var(--space-s);
  left: var(--space-s);
  z-index: var(--z-skip);
  padding: var(--space-s) var(--space-m);
  border-radius: var(--radius-s);
  background: var(--gold);
  color: var(--on-gold);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}
.skip-link:focus-visible { transform: none; color: var(--on-gold); }

/* ---- Crown mark ---------------------------------------------------------- */
.crown { display: block; flex: none; fill: currentColor; color: var(--gold); }

/* ---- Masthead ------------------------------------------------------------ */
.masthead { border-bottom: 1px solid var(--line); }

.masthead__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  column-gap: var(--space-l);
  padding-block: var(--space-xs);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  min-height: 44px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: 0.02em;
  text-decoration: none;
}
.wordmark:hover { color: var(--ink); }
.wordmark .crown { width: 1.375rem; height: 1.375rem; }

.site-nav { flex: 1 1 auto; }

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  margin: 0 calc(var(--space-xs) * -1);
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: var(--space-xs);
  color: var(--ink-muted);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--gold);
}

@media (min-width: 48rem) {
  .masthead__inner { flex-wrap: nowrap; min-height: 4.5rem; }
  .site-nav { flex: 0 1 auto; }
  .site-nav ul { justify-content: flex-end; column-gap: var(--space-s); margin: 0; }
}

/* ---- Hero ---------------------------------------------------------------- */
.hero { padding-block: var(--space-xl) var(--section); }

.hero__grid {
  display: grid;
  gap: var(--space-2xl);
  align-items: center;
}

.hero__kicker {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin-bottom: var(--space-m);
  color: var(--gold);
  font-size: 0.9375rem;
  font-weight: 500;
}
.hero__kicker .crown { width: 1rem; height: 1rem; }

.hero h1 {
  max-width: 17ch;
  font-size: var(--step-3);
  line-height: 1.12;
}

.lede {
  max-width: 36rem;
  margin-top: var(--space-l);
  color: var(--ink-muted);
  font-size: 1.125rem;
  line-height: 1.75;
}

.specs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-l) var(--space-l);
  max-width: 36rem;
  margin: var(--space-xl) 0 0;
}
.specs div { padding-top: var(--space-s); border-top: 1px solid var(--line); }
.specs dt { color: var(--ink-muted); font-size: var(--step--1); line-height: 1.5; }
.specs dd { margin: var(--space-2xs) 0 0; font-weight: 600; line-height: 1.4; }

@media (min-width: 40rem) {
  .specs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 60rem) {
  .hero { padding-top: var(--space-2xl); }
  .hero__grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: var(--space-xl); }
}

/* ---- Device mockup (illustration of the app) ----------------------------- */
.showcase {
  position: relative;
  display: grid;
  justify-items: center;
  gap: var(--space-m);
  margin: 0;
}

.showcase::before {
  content: "";
  position: absolute;
  inset: 4% 0 14%;
  background: radial-gradient(closest-side, var(--gold-wash), transparent);
  pointer-events: none;
}

.device {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(100%, 18.5rem);
  aspect-ratio: 9 / 19;
  padding: 0.625rem;
  border-radius: 2.75rem;
  background: var(--device-shell);
  box-shadow:
    inset 0 0 0 1px var(--device-edge),
    0 6px 8px var(--device-drop);
}

.screen {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 0.75rem 1.125rem 1.125rem;
  border-radius: 2.2rem;
  background: var(--device-screen);
  color: var(--ink);
  font-size: 0.8125rem;
  line-height: 1.4;
}

.screen::before { /* camera cut-out */
  content: "";
  position: absolute;
  top: 0.625rem;
  left: 50%;
  width: 5.25rem;
  height: 1.375rem;
  border-radius: 999px;
  background: var(--device-camera);
  transform: translateX(-50%);
}

.app-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 1.375rem;
  padding-inline: 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
}
.app-status svg { display: block; fill: currentColor; }

.app-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.25rem;
  color: var(--ink-muted);
  font-size: 0.75rem;
}
.app-bar__name { display: flex; align-items: center; gap: 0.375rem; color: var(--ink); font-weight: 600; }
.app-bar .crown { width: 0.875rem; height: 0.875rem; }

.app-progress {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.25rem;
  margin-top: 0.625rem;
}
.app-progress span { height: 3px; border-radius: 2px; background: var(--line); }
.app-progress span:first-child { background: var(--gold); }

.app-title {
  margin-top: 1.125rem;
  font-family: var(--font-display);
  font-size: 1.625rem;
  line-height: 1.1;
}
.app-sub { margin-top: 0.25rem; color: var(--ink-muted); }

.breath {
  position: relative;
  display: grid;
  place-items: center;
  width: 8.5rem;
  aspect-ratio: 1;
  margin: 1.125rem auto 1rem;
}
.breath__ring {
  position: absolute;
  inset: 0;
  border: 1px solid var(--gold);
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--breath-core), var(--breath-edge));
}
.breath__label { position: relative; max-inline-size: 72%; text-align: center; font-weight: 500; text-wrap: balance; }
.breath__label small { display: block; color: var(--ink-muted); font-size: 0.75rem; font-weight: 400; }

.app-steps {
  margin: 0;
  padding: 0;
  list-style: none;
}
.app-steps li {
  display: grid;
  grid-template-columns: 0.625rem 1fr auto;
  align-items: center;
  gap: 0.625rem;
  padding-block: 0.5rem;
  border-top: 1px solid var(--device-rule);
  color: var(--ink-muted);
}
.app-steps li::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border: 1px solid var(--ink-muted);
  border-radius: 50%;
}
.app-steps b { color: var(--ink); font-weight: 600; }
.app-steps .is-current::before { border-color: var(--gold); background: var(--gold); }
.app-steps .is-current b { color: var(--gold); }
.app-steps span { font-size: 0.75rem; }

.app-cta {
  display: grid;
  place-items: center;
  min-height: 2.75rem;
  margin-top: auto;
  border-radius: 999px;
  background: var(--gold);
  color: var(--on-gold);
  font-weight: 600;
}

.showcase figcaption {
  position: relative;
  max-width: 18.5rem;
  color: var(--ink-muted);
  font-size: var(--step--1);
  line-height: 1.5;
  text-align: center;
}

@media (prefers-reduced-motion: no-preference) {
  .device { animation: rise 900ms var(--ease-out) both; }
  /* One slow inhale, under five seconds, then it rests (WCAG 2.2.2). */
  .breath__ring { animation: inhale 4.2s cubic-bezier(0.45, 0, 0.55, 1) 600ms both; }
}

@keyframes rise {
  from { transform: translateY(1.25rem); }
  to { transform: none; }
}

@keyframes inhale {
  from { transform: scale(0.78); }
  to { transform: scale(1); }
}

/* ---- Sections ------------------------------------------------------------ */
.section { padding-block: var(--section); border-top: 1px solid var(--line); }
.section--surface { background: var(--surface); }

.section__head h2 { font-size: var(--step-2); line-height: 1.2; }

.split { display: grid; gap: var(--space-l); }

@media (min-width: 56rem) {
  .split { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: var(--space-xl); }
}

.prose { max-width: 40rem; }
.prose > * + * { margin-top: var(--space-m); }
.prose > h3 { margin-top: var(--space-xl); }

.prose__lead {
  font-size: var(--step-1);
  line-height: 1.6;
  color: var(--ink);
}

.prose p:not(.prose__lead) { color: var(--ink-muted); }

/* What is included */
.included { margin: 0; padding: 0; list-style: none; }
.included li {
  display: grid;
  grid-template-columns: 1.5rem 1fr;
  padding-block: var(--space-s);
  border-bottom: 1px solid var(--line);
}
.included li:first-child { border-top: 1px solid var(--line); }
.included li::before {
  content: "";
  width: 0.4375rem;
  height: 0.4375rem;
  margin-top: 0.7em;
  background: var(--gold);
  transform: rotate(45deg);
}

/* The routine: the one real sequence on the page, so it is numbered */
.routine__intro { max-width: 40rem; margin-top: var(--space-m); color: var(--ink-muted); }

.steps {
  display: grid;
  gap: 0;
  margin: var(--space-xl) 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  display: grid;
  grid-template-columns: 2.75rem 1fr;
  column-gap: var(--space-m);
  padding-block: var(--space-l);
  border-top: 1px solid var(--line);
  counter-increment: step;
}
.steps li::before {
  content: counter(step);
  grid-row: span 2;
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 2.25rem;
  line-height: 1;
}
.steps p { margin-top: var(--space-2xs); color: var(--ink-muted); }

@media (min-width: 48rem) {
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--space-xl); }
}

@media (min-width: 68rem) {
  .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: var(--space-l); }
  .steps li { grid-template-columns: 1fr; row-gap: var(--space-s); }
  .steps li::before { grid-row: auto; }
}

/* What it is not */
.notice__body { max-width: 44rem; }
.notice__body p { color: var(--ink-muted); }
.notice__body p + p { margin-top: var(--space-m); }
.notice__body p:first-of-type { color: var(--ink); }

/* FAQ */
.faq { display: grid; gap: 0; }
.faq__item { padding-block: var(--space-l); border-top: 1px solid var(--line); }
.faq__item p { margin-top: var(--space-xs); color: var(--ink-muted); }

@media (min-width: 48rem) {
  .faq { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--space-xl); }
}

/* Support */
.support__mail {
  display: inline-flex;
  align-items: center;
  gap: var(--space-s);
  max-width: 100%;
  min-height: 3.25rem;
  margin-top: var(--space-l);
  padding: var(--space-s) var(--space-l);
  border: 1px solid var(--gold);
  border-radius: var(--radius-m);
  color: var(--gold);
  font-weight: 600;
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out);
}
.support__mail svg { flex: none; width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.5; }
.support__mail:hover { background: var(--gold); color: var(--on-gold); }

.policy-links {
  display: flex;
  flex-wrap: wrap;
  column-gap: var(--space-l);
  margin: var(--space-l) 0 0;
  padding: 0;
  list-style: none;
}
.policy-links a { display: inline-flex; align-items: center; min-height: 44px; }

/* ---- Footer -------------------------------------------------------------- */
.colophon {
  padding-block: var(--space-xl) var(--space-2xl);
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: var(--step--1);
  line-height: 1.65;
}

.colophon__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-s) var(--space-l);
}

.colophon .wordmark { font-size: 1.125rem; }

.colophon__nav ul {
  display: flex;
  flex-wrap: wrap;
  column-gap: var(--space-l);
  margin: 0;
  padding: 0;
  list-style: none;
}
.colophon__nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); }
.colophon__nav a:hover { color: var(--gold-bright); }

.colophon__note { max-width: 46rem; margin-top: var(--space-l); }
.colophon__copy { margin-top: var(--space-m); }

/* ---- Legal pages --------------------------------------------------------- */
.legal { padding-block: var(--space-2xl) var(--section); }
.legal .shell { max-width: 48rem; }
.legal h1 { font-size: var(--step-3); line-height: 1.12; }
.legal .updated { margin-top: var(--space-s); color: var(--ink-muted); font-size: var(--step--1); }
.legal section { margin-top: var(--space-xl); padding-top: var(--space-l); border-top: 1px solid var(--line); }
.legal h2 { font-size: var(--step-1); font-family: var(--font-text); font-weight: 600; line-height: 1.35; }
.legal section p { margin-top: var(--space-s); max-width: 42rem; color: var(--ink-muted); }

/* Programmatic focus targets (skip link destination) need no ring */
[tabindex="-1"]:focus { outline: none; }
