/*
  Sarmad website stylesheet.
  Tokens come from the Sarmad design system (tokens.json v2): Dawn is the
  light theme, Night the dark default, Bedside the darkest.
  Fonts are self-hosted so the site makes no third-party requests.
*/

/* ---------- Fonts ---------- */
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Noto Naskh Arabic";
  src: url("../fonts/noto-naskh-arabic-arabic-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFC;
}
@font-face {
  font-family: "Readex Pro";
  src: url("../fonts/readex-pro-latin-300-normal.woff2") format("woff2");
  font-weight: 300; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Readex Pro";
  src: url("../fonts/readex-pro-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Readex Pro";
  src: url("../fonts/readex-pro-latin-500-normal.woff2") format("woff2");
  font-weight: 500; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Readex Pro";
  src: url("../fonts/readex-pro-arabic-300-normal.woff2") format("woff2");
  font-weight: 300; font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFC;
}
@font-face {
  font-family: "Readex Pro";
  src: url("../fonts/readex-pro-arabic-400-normal.woff2") format("woff2");
  font-weight: 400; font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFC;
}
@font-face {
  font-family: "Readex Pro";
  src: url("../fonts/readex-pro-arabic-500-normal.woff2") format("woff2");
  font-weight: 500; font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFC;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-display: swap;
}

/* ---------- Tokens: Dawn (light) is the base ---------- */
:root {
  color-scheme: light;
  --surface-100: #f5efe3;
  --surface-200: #fbf7ee;
  --surface-300: #ebe3d2;
  --border: #d6cbb5;
  --border-strong: #7a6f5b;
  --ink: #1a2431;
  --ink-muted: #4a5665;
  --ink-faint: #5b6674;
  --lamp: #e0a23f;
  --on-lamp: #1a1204;
  --lamp-soft: #f3dfb8;
  --lamp-ink: #7a4a05;
  --tide: #2f6f85;
  --on-tide: #ffffff;
  --tide-soft: #d3e4e9;
  --tide-ink: #255a6c;
  --ember-ink: #9a3b24;
  --focus-ring: #1a2431;
  --scrim: rgba(26, 36, 49, 0.48);
  --shadow-sheet: 0 -8px 32px rgba(26, 36, 49, 0.14);
  /* Visualizer pills: decorative, tuned per theme */
  --viz-warm: #c98a2b;
  --viz-cool: #2f6f85;
  --viz-soft: #9aa3ad;
  --logo-dawn: block;
  --logo-night: none;
  --mark-fill: #1a2431; /* brand: never the amber mark on a light ground */

  --font-sans: "Readex Pro", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --font-display: "Fraunces", "Noto Naskh Arabic", Georgia, serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;

  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 24px; --space-6: 32px; --space-7: 48px; --space-8: 64px;
  --radius-sm: 8px; --radius-md: 16px; --radius-lg: 28px; --radius-pill: 999px;
  --touch-min: 48px; --control-md: 56px; --play-button: 88px;
  --duration-feedback: 100ms; --duration-calm: 600ms;
  --easing-standard: cubic-bezier(0.2, 0, 0, 1);
  --easing-decelerate: cubic-bezier(0.05, 0.7, 0.1, 1);
  --page-max: 1200px;
  --gutter: 16px;
}

/* Night, from the system setting unless the visitor picked another theme */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --surface-100: #0d1520;
    --surface-200: #152130;
    --surface-300: #1e2d40;
    --border: #2f4258;
    --border-strong: #6f8499;
    --ink: #ece6d9;
    --ink-muted: #a9b4c0;
    --ink-faint: #8696a8;
    --lamp: #e6b673;
    --on-lamp: #17110a;
    --lamp-soft: #2e2617;
    --lamp-ink: #e6b673;
    --tide: #7fb4c4;
    --on-tide: #0a1a20;
    --tide-soft: #16303a;
    --tide-ink: #7fb4c4;
    --ember-ink: #e8a392;
    --focus-ring: #f2d49a;
    --scrim: rgba(5, 9, 14, 0.72);
    --shadow-sheet: 0 -8px 32px rgba(0, 0, 0, 0.45);
    --viz-warm: #e6b673;
    --viz-cool: #7fb4c4;
    --viz-soft: #4a5d72;
    --logo-dawn: none;
    --logo-night: block;
    --mark-fill: #e6b673;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --surface-100: #0d1520;
  --surface-200: #152130;
  --surface-300: #1e2d40;
  --border: #2f4258;
  --border-strong: #6f8499;
  --ink: #ece6d9;
  --ink-muted: #a9b4c0;
  --ink-faint: #8696a8;
  --lamp: #e6b673;
  --on-lamp: #17110a;
  --lamp-soft: #2e2617;
  --lamp-ink: #e6b673;
  --tide: #7fb4c4;
  --on-tide: #0a1a20;
  --tide-soft: #16303a;
  --tide-ink: #7fb4c4;
  --ember-ink: #e8a392;
  --focus-ring: #f2d49a;
  --scrim: rgba(5, 9, 14, 0.72);
  --shadow-sheet: 0 -8px 32px rgba(0, 0, 0, 0.45);
  --viz-warm: #e6b673;
  --viz-cool: #7fb4c4;
  --viz-soft: #4a5d72;
  --logo-dawn: none;
  --logo-night: block;
  --mark-fill: #e6b673;
}
:root[data-theme="bedside"] {
  color-scheme: dark;
  --surface-100: #07090c;
  --surface-200: #0c1016;
  --surface-300: #131a23;
  --border: #1f2833;
  --border-strong: #5f6a77;
  --ink: #a0947e;
  --ink-muted: #8d8576;
  --ink-faint: #8a8272;
  --lamp: #ad814a;
  --on-lamp: #0a0704;
  --lamp-soft: #1e170d;
  --lamp-ink: #ac854d;
  --tide: #5d8794;
  --on-tide: #03080a;
  --tide-soft: #0d1a1f;
  --tide-ink: #658c98;
  --ember-ink: #b57767;
  --focus-ring: #b79e72;
  --scrim: rgba(0, 0, 0, 0.6);
  --shadow-sheet: 0 -8px 32px rgba(0, 0, 0, 0.6);
  --viz-warm: #ad814a;
  --viz-cool: #5d8794;
  --viz-soft: #2c3540;
  --logo-dawn: none;
  --logo-night: block;
  --mark-fill: #ad814a;
}

@media (min-width: 600px) { :root { --gutter: 24px; } }
@media (min-width: 840px) { :root { --gutter: 32px; } }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--surface-100);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--duration-calm) ease-in-out, color var(--duration-calm) ease-in-out;
  overflow-x: hidden;
}
img, svg, canvas { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--lamp-ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; border-radius: 4px; }
button { font: inherit; color: inherit; }
h1, h2, h3, p, ul, ol, figure, dl, dd { margin: 0; }
ul, ol { padding: 0; }
.icon { width: 24px; height: 24px; flex-shrink: 0; }
.icon-sm { width: 20px; height: 20px; flex-shrink: 0; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip-link {
  position: absolute; inset-inline-start: var(--gutter); top: -100px; z-index: 30;
  background: var(--surface-200); color: var(--ink); padding: 12px 16px;
  border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
}
.skip-link:focus { top: 12px; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.mono { font-family: var(--font-mono); font-size: 14px; line-height: 20px; }

.wrap { width: 100%; max-width: var(--page-max); margin-inline: auto; padding-inline: var(--gutter); }

/* Display type: Fraunces in Latin, Noto Naskh in Arabic. No letter-spacing on Arabic. */
.display { font-family: var(--font-display); font-weight: 400; color: var(--ink); }
.h-hero { font-size: clamp(44px, 7vw, 84px); line-height: 1.04; letter-spacing: -0.015em; }
.h-section { font-size: clamp(32px, 4.2vw, 48px); line-height: 1.15; letter-spacing: -0.01em; }
.h-sub { font-size: 28px; line-height: 38px; }
:lang(ar) .h-hero, :lang(ar) .h-section { letter-spacing: 0; line-height: 1.5; }
.lede { font-size: 18px; line-height: 1.75; color: var(--ink-muted); max-width: 46ch; }
.body-muted { color: var(--ink-muted); max-width: 60ch; }
.caption { font-size: 12px; line-height: 20px; color: var(--ink-faint); }

/* Logo lockups swap with the theme */
.logo-dawn { display: var(--logo-dawn); }
.logo-night { display: var(--logo-night); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--control-md); padding: 0 var(--space-5);
  border-radius: var(--radius-pill);
  font-size: 15px; line-height: 20px; font-weight: 500; white-space: nowrap;
  text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: transform var(--duration-feedback) ease-out, background-color var(--duration-feedback) ease-out, border-color var(--duration-calm) ease-in-out;
  position: relative; isolation: isolate;
}
.btn::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1;
  background: currentColor; opacity: 0; transition: opacity var(--duration-feedback) ease-out;
}
.btn:hover { text-decoration: none; }
.btn:hover::after { opacity: 0.08; }
.btn:active { transform: scale(0.98); }
.btn:active::after { opacity: 0.12; }
.btn-primary { background: var(--lamp); color: var(--on-lamp); border-color: var(--border-strong); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-primary { border-color: var(--lamp); } }
:root[data-theme="dark"] .btn-primary, :root[data-theme="bedside"] .btn-primary { border-color: var(--lamp); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--border-strong); }
.btn-sm { min-height: var(--touch-min); padding: 0 18px; font-size: 14px; }
.icon-btn {
  width: var(--touch-min); height: var(--touch-min); border-radius: var(--radius-pill);
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid transparent; color: var(--ink); cursor: pointer;
  transition: background-color var(--duration-feedback) ease-out, transform var(--duration-feedback) ease-out;
}
.icon-btn:hover { background: var(--surface-300); }
.icon-btn:active { transform: scale(0.96); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--surface-100) 88%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--duration-calm) ease-in-out, background-color var(--duration-calm) ease-in-out;
}
.site-header.is-scrolled { border-bottom-color: var(--border); }
@supports not (background: color-mix(in srgb, red 50%, transparent)) {
  .site-header { background: var(--surface-100); }
}
.nav { height: 72px; display: flex; align-items: center; gap: var(--space-4); }
.nav-brand { display: flex; align-items: center; height: var(--touch-min); flex-shrink: 0; }
.nav-brand img { height: 34px; width: auto; }
.nav-links { display: flex; align-items: center; gap: var(--space-1); margin-inline-start: auto; list-style: none; }
.nav-links a {
  display: inline-flex; align-items: center; min-height: var(--touch-min); padding: 0 14px;
  border-radius: var(--radius-pill); color: var(--ink); text-decoration: none; font-size: 15px;
  transition: background-color var(--duration-feedback) ease-out;
}
.nav-links a:hover { background: var(--surface-300); }
.nav-links a[aria-current="page"] { color: var(--lamp-ink); }
.nav-tools { display: flex; align-items: center; gap: var(--space-2); }
.nav-menu-btn { display: none; }
.mobile-menu { display: none; }

@media (max-width: 899px) {
  .nav-links, .nav-tools .nav-cta { display: none; }
  .nav-tools { margin-inline-start: auto; }
  .nav-menu-btn { display: inline-flex; }
  .mobile-menu {
    border-top: 1px solid var(--border);
    padding: var(--space-2) var(--gutter) var(--space-5);
    background: var(--surface-100);
  }
  .mobile-menu.is-open { display: block; }
  .mobile-menu ul { list-style: none; display: grid; gap: 0; }
  .mobile-menu a:not(.btn) {
    display: flex; align-items: center; min-height: 52px; color: var(--ink);
    text-decoration: none; font-size: 18px; border-bottom: 1px solid var(--border);
  }
  .mobile-menu .btn { margin-top: var(--space-5); width: 100%; }
}

/* ---------- Hero ---------- */
.hero { padding-top: var(--space-6); padding-bottom: var(--space-8); }
.hero-grid { display: grid; gap: var(--space-7); align-items: center; }
.hero-copy { display: flex; flex-direction: column; gap: var(--space-5); }
.hero-ctas { display: flex; flex-wrap: wrap; gap: var(--space-3); padding-top: var(--space-2); }
.hero-visual {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  background: #7fb4c4; /* the screenshot's own tide ground, fixed in every theme */
  aspect-ratio: 5 / 5.4; display: flex; align-items: flex-start; justify-content: center;
  padding-top: 40px;
}
.hero-visual img { width: 78%; max-width: 420px; }
.hero-visual .moon {
  position: absolute; top: 36px; inset-inline-end: 36px; width: 56px; height: 56px;
  border-radius: 50%; background: #ece6d9;
}
@media (min-width: 900px) {
  .hero { padding-top: var(--space-7); }
  .hero-grid { grid-template-columns: 1.05fr 0.95fr; gap: var(--space-8); }
  .hero-visual { aspect-ratio: auto; height: min(640px, calc(100dvh - 160px)); min-height: 480px; }
  .hero-visual img { width: auto; height: auto; max-height: none; max-width: 76%; }
}

/* ---------- Sections ---------- */
.section { padding-block: var(--space-8); }
@media (min-width: 900px) { .section { padding-block: 112px; } }
.stack { display: flex; flex-direction: column; gap: var(--space-4); }
.section-head { display: flex; flex-direction: column; gap: var(--space-3); max-width: 720px; margin-bottom: var(--space-7); }

/* ---------- Listen (live demo) ---------- */
.listen {
  background: var(--surface-200); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
}
.listen-canvas-wrap { position: relative; height: 260px; border-bottom: 1px solid var(--border); background: var(--surface-200); }
.listen-canvas-wrap canvas { width: 100%; height: 100%; }
.listen-moon {
  position: absolute; top: 28px; inset-inline-end: 32px; width: 40px; height: 40px; border-radius: 50%;
  background: var(--ink); opacity: 0.9;
}
.listen-body {
  display: grid; gap: var(--space-6); padding: var(--space-6) var(--space-5) var(--space-6);
}
.listen-text { display: flex; flex-direction: column; gap: var(--space-3); }
.listen-controls { display: flex; align-items: center; gap: var(--space-5); flex-wrap: wrap; }
.play-btn {
  width: var(--play-button); height: var(--play-button); border-radius: 50%;
  background: var(--lamp); color: var(--on-lamp); border: 1px solid var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0;
  transition: transform var(--duration-feedback) ease-out;
  position: relative; isolation: isolate;
}
:root[data-theme="dark"] .play-btn, :root[data-theme="bedside"] .play-btn { border-color: var(--lamp); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .play-btn { border-color: var(--lamp); } }
.play-btn::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: currentColor; opacity: 0; z-index: -1; transition: opacity var(--duration-feedback); }
.play-btn:hover::after { opacity: 0.08; }
.play-btn:active { transform: scale(0.97); }
.play-btn svg { width: 34px; height: 34px; }
.play-btn .i-stop { display: none; }
.play-btn[aria-pressed="true"] .i-play { display: none; }
.play-btn[aria-pressed="true"] .i-stop { display: block; }
.listen-meta { display: flex; flex-direction: column; gap: 2px; min-width: 150px; }
.listen-time { font-size: 28px; line-height: 36px; font-weight: 300; font-variant-numeric: tabular-nums; }
.listen-status { font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.seed-row { display: flex; align-items: center; gap: var(--space-2); }
.seed-label { font-size: 12px; line-height: 20px; color: var(--ink-faint); }
.seed-code { font-family: var(--font-mono); font-size: 14px; color: var(--ink-muted); direction: ltr; unicode-bidi: isolate; }
.listen-note { font-size: 14px; line-height: 24px; color: var(--ink-faint); }
.listen-error { font-size: 14px; color: var(--ember-ink); }
@media (min-width: 900px) {
  .listen-canvas-wrap { height: 320px; }
  .listen-body { grid-template-columns: 1fr auto; align-items: end; padding: var(--space-7); }
}

/* ---------- Generators bento: 5 items, 5 cells ---------- */
.bento { display: grid; gap: var(--space-4); grid-template-columns: 1fr 1fr; }
.gen { display: flex; flex-direction: column; gap: var(--space-3); }
.gen-art { border-radius: var(--radius-md); overflow: hidden; aspect-ratio: 1 / 1; background: var(--surface-300); }
.gen-art img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--easing-standard); }
.gen:hover .gen-art img { transform: scale(1.03); }
.gen-name { font-size: 18px; line-height: 26px; font-weight: 500; }
.gen-desc { font-size: 14px; line-height: 24px; color: var(--ink-muted); }
.gen-big { grid-column: 1 / -1; }
.gen-big .gen-art { aspect-ratio: 16 / 10; border-radius: var(--radius-lg); }
@media (min-width: 900px) {
  .bento { grid-template-columns: repeat(4, 1fr); grid-template-rows: auto auto; gap: var(--space-5); }
  .gen-big { grid-column: 1 / 3; grid-row: 1 / 3; }
  .gen-big .gen-art { aspect-ratio: auto; flex: 1; min-height: 0; }
  .gen-big .gen-name { font-size: 22px; line-height: 30px; }
}

/* ---------- Mood split ---------- */
.split { display: grid; gap: var(--space-7); align-items: center; }
.split-visual {
  border-radius: var(--radius-lg); overflow: hidden; background: #1e2d40; /* screenshot ground */
  display: flex; justify-content: center; align-items: flex-start; padding-top: 48px; aspect-ratio: 1 / 1.05;
}
.split-visual img { width: 72%; max-width: 400px; }
.split-copy { display: flex; flex-direction: column; gap: var(--space-5); }
.pill-list { display: flex; flex-wrap: wrap; gap: var(--space-2); list-style: none; }
.pill-list li {
  min-height: 40px; padding: 0 16px; display: inline-flex; align-items: center;
  border: 1px solid var(--border-strong); border-radius: var(--radius-pill); font-size: 14px; color: var(--ink);
}
.fact-line { display: flex; gap: var(--space-3); align-items: flex-start; color: var(--ink-muted); }
.fact-line svg { color: var(--tide-ink); margin-top: 2px; }
@media (min-width: 900px) {
  .split { grid-template-columns: 1fr 1fr; gap: 96px; }
}

/* ---------- Privacy statement ---------- */
.privacy-block { display: flex; flex-direction: column; gap: var(--space-7); }
.privacy-head { display: flex; flex-direction: column; gap: var(--space-4); max-width: 820px; }
.privacy-head .h-section { font-size: clamp(36px, 5.4vw, 64px); }
.facts { display: grid; gap: 0; grid-template-columns: 1fr; list-style: none; }
.facts li { display: grid; grid-template-columns: auto 1fr; gap: var(--space-4); padding-block: var(--space-5); border-top: 1px solid var(--border); }
.facts svg { color: var(--lamp-ink); width: 28px; height: 28px; }
.facts strong { display: block; font-weight: 500; font-size: 18px; line-height: 28px; }
.facts span { color: var(--ink-muted); font-size: 15px; line-height: 26px; }
@media (min-width: 720px) {
  .facts { grid-template-columns: 1fr 1fr; column-gap: var(--space-7); }
}

/* ---------- Themes picker ---------- */
.themes { display: grid; gap: var(--space-4); grid-template-columns: 1fr; margin-top: var(--space-6); }
.theme-swatch {
  text-align: start; cursor: pointer; border-radius: var(--radius-md); padding: 0; overflow: hidden;
  border: 1px solid var(--border-strong); background: var(--surface-200);
  display: flex; flex-direction: column;
  transition: transform var(--duration-feedback) ease-out, border-color var(--duration-calm) ease-in-out;
}
.theme-swatch:active { transform: scale(0.99); }
.theme-swatch[aria-pressed="true"] { border: 2px solid var(--lamp-ink); }
.swatch-art { height: 132px; position: relative; padding: 20px; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; }
.swatch-art .disc { position: absolute; top: 20px; inset-inline-end: 20px; width: 32px; height: 32px; border-radius: 50%; }
.swatch-art .row { display: flex; gap: 6px; }
.swatch-art .row span { height: 10px; border-radius: 999px; }
.swatch-label { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: 14px 18px; min-height: 64px; }
.swatch-label strong { font-weight: 500; display: block; line-height: 24px; }
.swatch-label small { display: block; color: var(--ink-muted); font-size: 13px; line-height: 20px; }
.swatch-check {
  width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; color: transparent;
}
.theme-swatch[aria-pressed="true"] .swatch-check { background: var(--lamp); border-color: var(--lamp-ink); color: var(--on-lamp); }
@media (min-width: 720px) { .themes { grid-template-columns: repeat(3, 1fr); } }
.access-row { display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-6); margin-top: var(--space-6); color: var(--ink-muted); font-size: 15px; list-style: none; }
.access-row li { display: flex; align-items: center; gap: var(--space-2); }
.access-row svg { color: var(--tide-ink); }

/* ---------- FAQ ---------- */
.faq-grid { display: grid; gap: var(--space-6); }
.faq-intro { display: flex; flex-direction: column; gap: var(--space-4); }
.faq-list { border-top: 1px solid var(--border); }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-4); min-height: 64px; padding-block: var(--space-3); font-size: 18px; line-height: 28px; font-weight: 500;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary svg { transition: transform var(--duration-calm) var(--easing-standard); color: var(--ink-muted); }
.faq-item[open] summary svg { transform: rotate(180deg); }
.faq-item .answer { padding-bottom: var(--space-5); color: var(--ink-muted); max-width: 64ch; }
.faq-item .answer p + p { margin-top: var(--space-3); }
@media (min-width: 900px) {
  .faq-grid { grid-template-columns: 5fr 7fr; gap: 96px; align-items: start; }
  .faq-intro { position: sticky; top: 112px; }
}

/* ---------- Closing ---------- */
.closing { text-align: center; display: flex; flex-direction: column; align-items: center; gap: var(--space-5); padding-block: 96px 128px; }
.closing-mark { width: 120px; height: 120px; }
.closing-mark rect { fill: var(--mark-fill); }
.closing .h-section { font-size: clamp(36px, 5.4vw, 64px); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding-block: var(--space-7) var(--space-6); font-size: 15px; }
.footer-grid { display: grid; gap: var(--space-6); grid-template-columns: 1fr 1fr; }
.footer-brand { grid-column: 1 / -1; display: flex; flex-direction: column; gap: var(--space-3); }
.footer-brand img { height: 34px; width: auto; }
.footer-brand p { color: var(--ink-muted); max-width: 36ch; }
.footer-col h2 { font-size: 14px; line-height: 20px; font-weight: 500; color: var(--ink-faint); margin-bottom: var(--space-2); }
.footer-col ul { list-style: none; display: grid; gap: 0; }
.footer-col a { color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; min-height: 40px; }
.footer-col a:hover { text-decoration: underline; }
.footer-base {
  margin-top: var(--space-7); padding-top: var(--space-5); border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6); justify-content: space-between;
  color: var(--ink-faint); font-size: 13px; line-height: 22px;
}
@media (min-width: 900px) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
  .footer-brand { grid-column: auto; }
}

/* ---------- Document pages (privacy, terms, support) ---------- */
.doc { padding-block: var(--space-7) var(--space-8); }
.doc-grid { display: grid; gap: var(--space-7); }
.doc-head { display: flex; flex-direction: column; gap: var(--space-3); padding-bottom: var(--space-6); border-bottom: 1px solid var(--border); margin-bottom: var(--space-6); }
.doc-head .h-section { font-size: clamp(36px, 5vw, 56px); }
.doc-meta { color: var(--ink-faint); font-size: 14px; }
.doc-summary {
  background: var(--tide-soft); color: var(--ink); border-radius: var(--radius-md);
  padding: var(--space-5); margin-bottom: var(--space-6);
}
.doc-summary h2 { font-size: 16px; font-weight: 500; margin-bottom: var(--space-2); color: var(--tide-ink); }
.doc-summary ul { padding-inline-start: 20px; display: grid; gap: 4px; }
.prose { max-width: 68ch; }
.prose h2 { font-family: var(--font-display); font-weight: 400; font-size: 28px; line-height: 38px; margin-top: var(--space-7); margin-bottom: var(--space-3); scroll-margin-top: 96px; }
.prose h3 { font-size: 18px; line-height: 28px; font-weight: 500; margin-top: var(--space-5); margin-bottom: var(--space-2); }
.prose p, .prose ul, .prose ol { margin-bottom: var(--space-4); color: var(--ink); }
.prose ul, .prose ol { padding-inline-start: 22px; }
.prose li + li { margin-top: 6px; }
.prose li::marker { color: var(--ink-faint); }
.prose strong { font-weight: 500; }
.prose > :first-child { margin-top: 0; }
.toc { display: none; }
.todo {
  background: var(--lamp-soft); color: var(--ink); border: 1px dashed var(--lamp-ink);
  border-radius: 6px; padding: 0 6px; font-family: var(--font-mono); font-size: 0.86em;
}
@media (min-width: 1000px) {
  .doc-grid { grid-template-columns: 240px minmax(0, 1fr); gap: 96px; }
  .toc { display: block; position: sticky; top: 104px; align-self: start; }
  .toc h2 { font-size: 14px; font-weight: 500; color: var(--ink-faint); margin-bottom: var(--space-2); }
  .toc ol { list-style: none; border-inline-start: 1px solid var(--border); }
  .toc a {
    display: block; padding: 6px 0 6px 16px; padding-inline: 16px 0; color: var(--ink-muted);
    text-decoration: none; font-size: 14px; line-height: 22px;
  }
  .toc a:hover { color: var(--ink); }
}

/* Contact block on support */
.contact-card {
  border: 1px solid var(--border); background: var(--surface-200); border-radius: var(--radius-lg);
  padding: var(--space-6); display: grid; gap: var(--space-4); margin-top: var(--space-7);
}
.contact-card .btn { justify-self: start; }

/* ---------- 404 ---------- */
.notfound { min-height: calc(100dvh - 72px - 220px); display: flex; align-items: center; padding-block: var(--space-8); }
.notfound-inner { display: flex; flex-direction: column; gap: var(--space-5); align-items: flex-start; }
.notfound-mark { width: 96px; height: 96px; opacity: 0.9; }
.notfound-mark rect { fill: var(--tide); }

/* ---------- Reveal on scroll (only when motion is allowed) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(20px); transition: opacity 900ms var(--easing-standard), transform 900ms var(--easing-standard); }
  .js .reveal.in { opacity: 1; transform: none; }
  .js .reveal-d1 { transition-delay: 120ms; }
  .js .reveal-d2 { transition-delay: 240ms; }
  .js .hero .reveal { transition-duration: 1100ms; }

  .mark-anim .col { opacity: 0; }
  .mark-anim.in .col { animation: col-in 1.2s ease-in-out forwards; }
  .mark-anim.in .col-1 { animation-delay: 0.6s; }
  .mark-anim.in .col-2 { animation-delay: 1.2s; }
  .mark-anim.in .col-3 { animation-delay: 1.8s; }
  .mark-anim.in .col-4 { animation-delay: 2.4s; }
}
@keyframes col-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  .btn, .play-btn, .theme-swatch, .icon-btn { border: 1px solid ButtonText; }
}
@media print {
  .site-header, .site-footer, .toc, .skip-link { display: none !important; }
  body { background: #fff; color: #111; }
}

/* ---------- Helpers that keep markup free of inline styles (strict CSP) ---------- */
.top-sentinel { position: absolute; top: 0; inset-inline-start: 0; width: 1px; height: 1px; }
.footer-col a { overflow-wrap: anywhere; }
.section-head.tight { margin-bottom: 0; }
.privacy-link { font-size: 16px; }
/* Theme swatches show each theme's real palette, whatever the page theme is */
.sw-night { background: #0d1520; }
.sw-night .disc { background: #ece6d9; }
.sw-night .p1 { background: #7fb4c4; } .sw-night .p2 { background: #e6b673; } .sw-night .p3 { background: #4a5d72; }
.sw-bedside { background: #07090c; }
.sw-bedside .disc { background: #a0947e; }
.sw-bedside .p1 { background: #5d8794; } .sw-bedside .p2 { background: #ad814a; } .sw-bedside .p3 { background: #2c3540; }
.sw-dawn { background: #f5efe3; border-bottom: 1px solid #d6cbb5; }
.sw-dawn .disc { background: #1a2431; }
.sw-dawn .p1 { background: #2f6f85; } .sw-dawn .p2 { background: #e0a23f; } .sw-dawn .p3 { background: #b9ad96; }
.w8 { width: 8px; } .w12 { width: 12px; } .w20 { width: 20px; } .w32 { width: 32px; } .w48 { width: 48px; } .w72 { width: 72px; }
[data-theme-toggle] .i-sun { display: none; }

/* Line under the sound cards (Strings and Ney). */
.bento + p { margin-top: 1.5rem; }
