/* Coniunctio — static marketing site
 * Editorial paper aesthetic lifted from src/client/styles/global.css.
 * Brand pair only: sepia (default) + midnight (prefers-color-scheme: dark).
 * Self-hosted fonts, zero external requests. Works fully without JS.
 * ========================================================================= */

/* ---- Self-hosted fonts (family names match the app) ---------------------- */
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-latin-opsz-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("/assets/fonts/instrument-serif-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("/assets/fonts/instrument-serif-latin-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

/* ---- Tokens -------------------------------------------------------------- */
:root {
  --font-display: "Instrument Serif", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  /* Titles (H1 + H2) use Instrument Serif; subtitles (H3/H4/small heads) use Inter,
   * kept light so they don't read heavy. */
  --font-heading: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --weight-heading: 570;
  --tracking-heading: -0.012em;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;
  --space-10: 128px;

  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 140ms;
  --dur-med: 240ms;

  --measure: 42rem;      /* readable prose column */
  --wrap: 1180px;        /* page max width */

  /* MIDNIGHT is the default paper. The inline head script sets html[data-theme]
   * before first paint, so for JS visitors this bare :root only ever applies to
   * midnight; it also gives no-JS visitors midnight by default. Sepia is opt-in
   * via html[data-theme="sepia"] (stored choice) or the light-OS fallback. */
  --color-canvas: oklch(20.5% 0.18 270);
  --color-surface: oklch(24% 0.16 270);
  --color-surface-2: rgba(255, 255, 255, 0.06);
  --color-rail: #151c69;
  --color-text: #fef1d0;
  --color-text-strong: #ffffff;
  --color-text-muted: rgba(254, 241, 208, 0.72);
  --color-text-subtle: rgba(254, 241, 208, 0.5);
  --color-border-strong: #fef1d0;
  --color-border-muted: rgba(255, 255, 255, 0.16);
  --color-border-hair: rgba(255, 255, 255, 0.12);
  --color-accent: #fef1d0;
  --color-accent-soft: rgba(255, 255, 255, 0.07);
  --color-highlight: #7aa2ff;
  --color-button-bg: #fef1d0;
  --color-button-text: oklch(20.5% 0.18 270);
  --color-positive: #5fce93;
  --grain: 0.1;
  --grain-img: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --hero-bg: none;
  --shadow-card: inset 0 1px 0 0 rgba(255, 246, 224, 0.08), 0 30px 80px -40px rgba(0, 0, 0, 0.6);
}

/* SEPIA — the light brand paper (matches app [data-theme="sepia"]). Applied
 * when the visitor has explicitly stored the sepia/light choice. */
html[data-theme="sepia"] {
  --color-canvas: #fef1d0;
  --color-surface: #fbe8c2;
  --color-surface-2: rgba(26, 35, 128, 0.05);
  --color-rail: #f8e9c6;
  --color-text: #1a2380;
  --color-text-strong: #15206e;
  --color-text-muted: rgba(36, 81, 181, 0.84);
  --color-text-subtle: rgba(36, 81, 181, 0.58);
  --color-border-strong: #1a2380;
  --color-border-muted: rgba(26, 35, 128, 0.16);
  --color-border-hair: rgba(26, 35, 128, 0.2);
  --color-accent: #1a2380;
  --color-accent-soft: rgba(26, 35, 128, 0.06);
  --color-highlight: #2451b5;
  --color-button-bg: #1a2380;
  --color-button-text: #fef1d0;
  --color-positive: #3a9d6e;
  --grain: 0.12;
  --grain-img: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.7 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --hero-bg: url("/assets/hero-bg-light.webp");
  --shadow-card: 0 1px 0 0 rgba(0, 0, 0, 0.04), 0 12px 36px -16px rgba(0, 0, 0, 0.12);
}

/* No-JS fallback only: a visitor with a light OS preference and no stored
 * choice (so no [data-theme] attribute) gets sepia. JS visitors always carry a
 * [data-theme] attribute, so this never causes a flash for them. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --color-canvas: #fef1d0;
    --color-surface: #fbe8c2;
    --color-surface-2: rgba(26, 35, 128, 0.05);
    --color-rail: #f8e9c6;
    --color-text: #1a2380;
    --color-text-strong: #15206e;
    --color-text-muted: rgba(36, 81, 181, 0.84);
    --color-text-subtle: rgba(36, 81, 181, 0.58);
    --color-border-strong: #1a2380;
    --color-border-muted: rgba(26, 35, 128, 0.16);
    --color-border-hair: rgba(26, 35, 128, 0.2);
    --color-accent: #1a2380;
    --color-accent-soft: rgba(26, 35, 128, 0.06);
    --color-highlight: #2451b5;
    --color-button-bg: #1a2380;
    --color-button-text: #fef1d0;
    --color-positive: #3a9d6e;
    --grain: 0.12;
    --grain-img: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.7 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    --hero-bg: url("/assets/hero-bg-light.webp");
    --shadow-card: 0 1px 0 0 rgba(0, 0, 0, 0.04), 0 12px 36px -16px rgba(0, 0, 0, 0.12);
  }
}

/* Explicit midnight — set by the theme toggle / inline head script. Wins over
 * the media-query fallback because it carries the [data-theme] attribute. */
html[data-theme="midnight"] {
  --color-canvas: oklch(20.5% 0.18 270);
  --color-surface: oklch(24% 0.16 270);
  --color-surface-2: rgba(255, 255, 255, 0.06);
  --color-rail: #151c69;
  --color-text: #fef1d0;
  --color-text-strong: #ffffff;
  --color-text-muted: rgba(254, 241, 208, 0.72);
  --color-text-subtle: rgba(254, 241, 208, 0.5);
  --color-border-strong: #fef1d0;
  --color-border-muted: rgba(255, 255, 255, 0.16);
  --color-border-hair: rgba(255, 255, 255, 0.12);
  --color-accent: #fef1d0;
  --color-accent-soft: rgba(255, 255, 255, 0.07);
  --color-highlight: #7aa2ff;
  --color-button-bg: #fef1d0;
  --color-button-text: oklch(20.5% 0.18 270);
  --color-positive: #5fce93;
  --grain: 0.1;
  --grain-img: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --hero-bg: none;
  --shadow-card: inset 0 1px 0 0 rgba(255, 246, 224, 0.08), 0 30px 80px -40px rgba(0, 0, 0, 0.6);
}

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

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

html,
body {
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100svh;
  background: var(--color-canvas);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Paper grain overlay */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 99;
  pointer-events: none;
  opacity: var(--grain);
  background-image: var(--grain-img);
  background-size: 220px 220px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

img,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  background: var(--color-accent);
  color: var(--color-canvas);
}

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

h1,
h2,
h3,
h4 {
  margin: 0;
  color: var(--color-text-strong);
  overflow-wrap: break-word;
}

/* Titles — H1 and H2 both carry the Instrument Serif display voice. */
h1,
h2 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.022em;
}

/* Subtitles — H3/H4 and small heads are Inter, kept light so they don't read heavy. */
h3,
h4 {
  font-family: var(--font-heading);
  font-weight: var(--weight-heading);
  line-height: 1.12;
  letter-spacing: var(--tracking-heading);
  -webkit-font-smoothing: antialiased;
}

p {
  margin: 0;
}

.eyebrow {
  display: inline-block;
  color: var(--color-text-subtle);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  padding: 10px 16px;
  background: var(--color-button-bg);
  color: var(--color-button-text);
  border-radius: 0 0 8px 0;
}
.skip-link:focus {
  left: 0;
}

/* ---- Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 14px 28px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.005em;
  white-space: nowrap;
  text-align: center;
  transition:
    background var(--dur-med) var(--ease-out),
    color var(--dur-med) var(--ease-out),
    border-color var(--dur-med) var(--ease-out),
    transform var(--dur-fast) var(--ease-out);
}

/* Outline treatment (mirrors the app's .ui-btn): the ink-colored button reads
 * clearly in both themes — beige outline on midnight, navy outline on sepia —
 * and inverts to a solid fill on hover/focus. Color-only transition, no
 * transform, so it stays calm under prefers-reduced-motion. */
/* Compound `.btn.btn-primary` keeps these color rules ahead of `.prose a`
 * (the in-guide CTA lives inside .prose), so the ink text never collapses into
 * the fill and stays legible at rest and on hover. */
.btn.btn-primary {
  background: transparent;
  color: var(--color-button-bg);
  border-color: var(--color-button-bg);
}
.btn.btn-primary:hover,
.btn.btn-primary:focus-visible {
  background: var(--color-button-bg);
  color: var(--color-button-text);
  border-color: var(--color-button-bg);
}

.btn-secondary {
  background: transparent;
  color: var(--color-text-strong);
  border-color: var(--color-border-hair);
}
.btn-secondary:hover {
  background: var(--color-accent-soft);
  border-color: var(--color-border-strong);
}

.btn-large {
  min-height: 56px;
  padding: 16px 34px;
  font-size: 16px;
}

/* Inline underline-reveal text link (design-system "underline-reveal") */
.btn-inline {
  position: relative;
  display: inline-block;
  color: var(--color-text-strong);
  font-weight: 500;
  padding-bottom: 2px;
}
.btn-inline::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 280ms var(--ease-out);
}
.btn-inline:hover::after,
.btn-inline:focus-visible::after {
  transform: scaleX(1);
}

.free-note {
  color: var(--color-text-muted);
  font-size: 14px;
}

/* ---- Site header / nav --------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--color-canvas) 88%, transparent);
  border-bottom: 1px solid var(--color-border-muted);
  backdrop-filter: blur(10px);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 14px clamp(20px, 4vw, 56px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--color-text-strong);
}
/* Ouroboros mark: inline <svg><use href="/assets/mark.svg#mark"> filled with
 * currentColor, so it takes the page ink (royal blue on sepia, cream on midnight). */
.brand .brand-mark {
  width: auto;
  height: 28px;
  aspect-ratio: 1726 / 1708;
  flex-shrink: 0;
  fill: currentColor;
  color: var(--color-text);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.4vw, 30px);
}

/* Theme toggle sits at the right of the bar, just before the CTA cluster. */
.theme-toggle {
  margin-left: auto;
  display: grid;
  place-items: center;
  position: relative;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--color-border-muted);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--color-text-strong);
  cursor: pointer;
  transition:
    border-color var(--dur-fast) var(--ease-out),
    background var(--dur-fast) var(--ease-out);
}
.theme-toggle:hover {
  border-color: var(--color-border-strong);
  background: var(--color-accent-soft);
}
.theme-toggle-icon {
  position: relative;
  display: block;
  width: 20px;
  height: 20px;
}
.theme-icon {
  position: absolute;
  inset: 0;
  width: 20px;
  height: 20px;
  transition:
    opacity var(--dur-med) var(--ease-out),
    transform var(--dur-med) var(--ease-out);
}
/* Sepia (light): show the moon → tap goes to midnight. */
.theme-icon-sun {
  opacity: 0;
  transform: rotate(-90deg) scale(0.6);
}
.theme-icon-moon {
  opacity: 1;
  transform: none;
}
/* Midnight: show the sun → tap goes back to sepia. */
html[data-theme="midnight"] .theme-icon-sun {
  opacity: 1;
  transform: none;
}
html[data-theme="midnight"] .theme-icon-moon {
  opacity: 0;
  transform: rotate(90deg) scale(0.6);
}
.nav-links a {
  color: var(--color-text-muted);
  font-size: 14px;
  font-weight: 500;
  transition: color var(--dur-fast) var(--ease-out);
}
.nav-links a:hover {
  color: var(--color-text-strong);
}
.nav-cta {
  min-height: 40px;
  padding: 9px 20px;
  font-size: 14px;
}

.nav-toggle {
  display: none;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--color-border-muted);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--color-text-strong);
  cursor: pointer;
}
.nav-toggle svg {
  width: 20px;
  height: 20px;
}

@media (max-width: 860px) {
  .nav-toggle {
    display: grid;
  }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    margin: 0;
    padding: 12px clamp(20px, 4vw, 56px) 20px;
    background: color-mix(in srgb, var(--color-canvas) 96%, transparent);
    border-bottom: 1px solid var(--color-border-muted);
    box-shadow: var(--shadow-card);
  }
  .nav[data-open="false"] .nav-links {
    display: none;
  }
  .nav-links a {
    padding: 12px 4px;
    font-size: 16px;
    border-bottom: 1px solid var(--color-border-hair);
  }
  .nav-links a:last-child {
    border-bottom: 0;
  }
  .nav-cta {
    margin-top: 8px;
    justify-content: center;
  }
}

/* ---- Layout scaffolding -------------------------------------------------- */
.section {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: clamp(64px, 10vw, 120px) clamp(20px, 4vw, 56px);
}
.section-tight {
  padding-block: clamp(48px, 7vw, 88px);
}

.section-head {
  max-width: 760px;
  margin-bottom: clamp(40px, 6vw, 64px);
}
.section-head.centered {
  margin-inline: auto;
  text-align: center;
}
.section-head .eyebrow {
  margin-bottom: 16px;
}
.section-head h1,
.section-head h2 {
  font-size: clamp(34px, 5vw, 60px);
  line-height: 1;
  letter-spacing: -0.025em;
}
.section-head p {
  margin-top: 18px;
  color: var(--color-text-muted);
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.5;
  max-width: 560px;
}
.section-head.centered p {
  margin-inline: auto;
}

.rule {
  border: 0;
  border-top: 1px solid var(--color-border-muted);
  margin: 0;
}

/* ---- Hero ---------------------------------------------------------------- */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(72px, 12vw, 132px) clamp(20px, 4vw, 56px) clamp(64px, 9vw, 104px);
  text-align: center;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to bottom, transparent 0%, transparent 72%, var(--color-canvas) 100%),
    var(--hero-bg) center top / cover no-repeat;
}
.hero-inner {
  max-width: 900px;
  margin: 0 auto;
}
.hero-crest {
  width: 60px;
  height: 60px;
  margin: 0 auto 26px;
  opacity: 0.9;
}
.hero h1 {
  font-size: clamp(40px, 7vw, 88px);
  line-height: 0.98;
  letter-spacing: -0.03em;
  max-width: 16ch;
  margin-inline: auto;
}
.hero .eyebrow {
  margin-bottom: 20px;
}
.hero-lead {
  max-width: 620px;
  margin: 26px auto 0;
  color: var(--color-text-muted);
  font-size: clamp(16px, 2.2vw, 20px);
  line-height: 1.55;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 38px;
}
.hero-actions .free-note {
  flex-basis: 100%;
  margin-top: 2px;
}

/* ---- Start / install-equivalent band ------------------------------------ */
.band {
  max-width: var(--wrap);
  margin: 0 auto;
  padding-inline: clamp(20px, 4vw, 56px);
}
.band-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: clamp(28px, 4vw, 44px) clamp(24px, 4vw, 48px);
  border: 1px solid var(--color-border-muted);
  border-radius: var(--radius-lg);
  background: var(--color-surface-2);
}
.band-inner h2 {
  font-size: clamp(26px, 3.4vw, 40px);
  line-height: 1.02;
  max-width: 20ch;
}
.band-inner p {
  margin-top: 10px;
  color: var(--color-text-muted);
  max-width: 46ch;
}

/* ---- How it works steps -------------------------------------------------- */
.steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(28px, 5vw, 56px);
}
.step {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
.step-num {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border: 1px solid var(--color-border-hair);
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--color-text-strong);
}
.step h3 {
  font-size: 21px;
  letter-spacing: -0.015em;
}
.step p {
  margin-top: 8px;
  color: var(--color-text-muted);
  font-size: 15px;
  line-height: 1.6;
}
.steps-note {
  margin-top: clamp(32px, 5vw, 48px);
  padding-top: 28px;
  border-top: 1px solid var(--color-border-muted);
  color: var(--color-text-muted);
  font-size: 16px;
  max-width: 60ch;
}

/* ---- Guide card grid ----------------------------------------------------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.card-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.guide-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 26px 24px;
  border: 1px solid var(--color-border-muted);
  border-radius: var(--radius-md);
  background: var(--color-surface-2);
  transition:
    border-color var(--dur-med) var(--ease-out),
    background var(--dur-med) var(--ease-out);
}
.guide-card:hover {
  border-color: var(--color-border-strong);
}
.guide-card .kicker {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-subtle);
}
.guide-card h3 {
  font-family: var(--font-heading);
  font-size: 21px;
  line-height: 1.12;
  letter-spacing: -0.01em;
}
.guide-card p {
  color: var(--color-text-muted);
  font-size: 14px;
  line-height: 1.55;
}
.guide-card .go {
  margin-top: auto;
  padding-top: 8px;
  color: var(--color-text-strong);
  font-size: 14px;
  font-weight: 500;
}
.guides-group + .guides-group {
  margin-top: clamp(40px, 6vw, 64px);
}
.guides-group h3.group-title {
  font-size: clamp(22px, 3vw, 30px);
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

/* ---- Pricing ------------------------------------------------------------- */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  max-width: 860px;
  margin: 0 auto;
}
.pricing-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 34px 30px;
  border: 1px solid var(--color-border-muted);
  border-radius: var(--radius-lg);
  background: var(--color-surface-2);
}
.pricing-card.featured {
  border-color: var(--color-border-strong);
}
.pricing-card .plan {
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-subtle);
}
.pricing-card .price {
  font-family: var(--font-display);
  font-size: clamp(40px, 6vw, 56px);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--color-text-strong);
}
.pricing-card .price span {
  font-size: 18px;
  color: var(--color-text-muted);
}
.pricing-card .sub {
  color: var(--color-text-muted);
  font-size: 15px;
}
.pricing-card .trial {
  color: var(--color-highlight);
  font-weight: 500;
  font-size: 15px;
}
.pricing-card .save {
  align-self: flex-start;
  margin-top: 4px;
  padding: 4px 12px;
  border: 1px solid var(--color-border-muted);
  border-radius: var(--radius-pill);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.pricing-card .btn {
  margin-top: 18px;
}
.pricing-meta {
  margin-top: 28px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 15px;
  line-height: 1.6;
}
.pricing-meta .anchor {
  display: block;
  margin-top: 6px;
  color: var(--color-text-subtle);
  font-size: 14px;
}

/* ---- FAQ accordion ------------------------------------------------------- */
.faq-list {
  max-width: var(--measure);
  margin: 0 auto;
}
.faq-item {
  border-bottom: 1px solid var(--color-border-muted);
}
.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 4px;
  cursor: pointer;
  list-style: none;
  color: var(--color-text-strong);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.45rem;
  line-height: 1.35;
  letter-spacing: 0;
}
.faq-item summary::-webkit-details-marker {
  display: none;
}
.faq-item summary .chev {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  transition: transform var(--dur-med) var(--ease-out);
}
.faq-item[open] summary .chev {
  transform: rotate(45deg);
}
.faq-item .faq-body {
  padding: 0 4px 24px;
  color: var(--color-text-muted);
  font-size: 16px;
  line-height: 1.65;
  max-width: 62ch;
}
.faq-item .faq-body a {
  color: var(--color-text-strong);
  border-bottom: 1px solid var(--color-border-hair);
}
.faq-item .faq-body a:hover {
  border-color: var(--color-border-strong);
}

/* ---- Final CTA ----------------------------------------------------------- */
.final-cta {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: clamp(72px, 11vw, 128px) clamp(20px, 4vw, 56px);
  text-align: center;
}
.final-cta h2 {
  font-size: clamp(34px, 6vw, 68px);
  line-height: 0.98;
  letter-spacing: -0.03em;
  max-width: 18ch;
  margin-inline: auto;
}
.final-cta p {
  margin: 20px auto 0;
  max-width: 52ch;
  color: var(--color-text-muted);
  font-size: 17px;
  line-height: 1.55;
}
.final-cta .hero-actions {
  margin-top: 34px;
}

/* ---- Footer -------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--color-border-muted);
  background: var(--color-surface-2);
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: clamp(28px, 5vw, 56px);
  max-width: var(--wrap);
  margin: 0 auto;
  padding: clamp(48px, 7vw, 80px) clamp(20px, 4vw, 56px) clamp(32px, 4vw, 48px);
}
.footer-brand .brand {
  margin-bottom: 14px;
}
.footer-brand p {
  color: var(--color-text-muted);
  font-size: 14px;
  line-height: 1.6;
  max-width: 34ch;
}
.footer-col h4 {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-subtle);
  margin-bottom: 14px;
}
.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.footer-col a {
  color: var(--color-text-muted);
  font-size: 14px;
  transition: color var(--dur-fast) var(--ease-out);
}
.footer-col a:hover {
  color: var(--color-text-strong);
}
.footer-legal {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 56px) clamp(40px, 5vw, 56px);
  color: var(--color-text-subtle);
  font-size: 13px;
  line-height: 1.6;
}
.footer-legal .disclaimer {
  padding-top: 22px;
  border-top: 1px solid var(--color-border-muted);
}

/* ========================================================================= *
 * GUIDE PAGES (article depth)
 * ========================================================================= */
.guide-main {
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(20px, 4vw, 40px) clamp(20px, 5vw, 24px) clamp(64px, 9vw, 104px);
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: clamp(16px, 3vw, 28px) 0 clamp(28px, 4vw, 40px);
  font-size: 13px;
  color: var(--color-text-subtle);
}
.breadcrumbs a {
  color: var(--color-text-muted);
}
.breadcrumbs a:hover {
  color: var(--color-text-strong);
}
.breadcrumbs .sep {
  opacity: 0.5;
}
.breadcrumbs [aria-current="page"] {
  color: var(--color-text);
}

.guide-header .kicker {
  display: inline-block;
  margin-bottom: 16px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-subtle);
}
.guide-header h1 {
  font-size: clamp(32px, 5.4vw, 56px);
  line-height: 1.02;
  letter-spacing: -0.028em;
}
.guide-updated {
  margin-top: 18px;
  font-size: 13px;
  color: var(--color-text-subtle);
}

.answer-block {
  margin: clamp(24px, 4vw, 34px) 0;
  padding: clamp(22px, 3vw, 28px) clamp(22px, 3vw, 30px);
  border-left: 2px solid var(--color-accent);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background: var(--color-surface-2);
}
.answer-block p {
  font-size: clamp(17px, 2.2vw, 20px);
  line-height: 1.55;
  color: var(--color-text-strong);
}
.answer-block p + p {
  margin-top: 14px;
  font-size: 16px;
  color: var(--color-text-muted);
}

.prose {
  font-size: 17px;
  line-height: 1.72;
  color: var(--color-text);
}
.prose > * + * {
  margin-top: 22px;
}
.prose h2 {
  margin-top: clamp(40px, 6vw, 60px);
  font-size: clamp(26px, 3.6vw, 38px);
  line-height: 1.08;
  letter-spacing: -0.022em;
}
.prose h3 {
  margin-top: clamp(28px, 4vw, 38px);
  font-family: var(--font-heading);
  font-size: clamp(20px, 2.6vw, 25px);
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--color-text-strong);
}
.prose p {
  color: var(--color-text);
}
.prose a {
  color: var(--color-text-strong);
  border-bottom: 1px solid var(--color-border-hair);
  transition: border-color var(--dur-fast) var(--ease-out);
}
.prose a:hover {
  border-color: var(--color-border-strong);
}
.prose strong {
  color: var(--color-text-strong);
  font-weight: 600;
}
.prose em {
  font-style: italic;
}
.prose ul,
.prose ol {
  padding-left: 1.3em;
  color: var(--color-text);
}
.prose li + li {
  margin-top: 8px;
}
.prose blockquote {
  margin: clamp(28px, 4vw, 36px) 0;
  padding-left: 22px;
  border-left: 2px solid var(--color-border-strong);
  font-family: var(--font-display);
  font-size: clamp(21px, 3vw, 28px);
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: var(--color-text-strong);
}
.prose blockquote cite {
  display: block;
  margin-top: 12px;
  font-family: var(--font-body);
  font-size: 14px;
  font-style: normal;
  letter-spacing: 0.02em;
  color: var(--color-text-subtle);
}

/* Callout */
.callout {
  margin: clamp(28px, 4vw, 36px) 0;
  padding: 22px 24px;
  border: 1px solid var(--color-border-muted);
  border-radius: var(--radius-md);
  background: var(--color-surface-2);
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-text-muted);
}
.callout strong {
  color: var(--color-text-strong);
}

/* Readings table (personal vs archetypal) */
.table-wrap {
  overflow-x: auto;
  margin: clamp(28px, 4vw, 36px) 0;
  border: 1px solid var(--color-border-muted);
  border-radius: var(--radius-md);
}
.reading-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  min-width: 460px;
}
.reading-table th,
.reading-table td {
  padding: 14px 18px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--color-border-muted);
  line-height: 1.5;
}
.reading-table thead th {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-subtle);
}
.reading-table tbody tr:last-child td {
  border-bottom: 0;
}
.reading-table td:first-child {
  color: var(--color-text-strong);
  font-weight: 500;
}

/* In-guide CTA block */
.cta-block {
  margin: clamp(40px, 6vw, 56px) 0;
  padding: clamp(30px, 4vw, 40px);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-lg);
  text-align: center;
}
.cta-block h2 {
  margin-top: 0;
  font-size: clamp(26px, 3.6vw, 40px);
  line-height: 1.02;
  letter-spacing: -0.02em;
}
.cta-block p {
  margin: 14px auto 0;
  max-width: 46ch;
  color: var(--color-text-muted);
  font-size: 16px;
}
.cta-block .btn {
  margin-top: 22px;
}
.cta-block .free-note {
  margin-top: 14px;
}

/* Mini-FAQ inside guide */
.mini-faq {
  margin-top: clamp(48px, 7vw, 72px);
}
.mini-faq h2 {
  margin-bottom: 12px;
  font-size: clamp(24px, 3.4vw, 34px);
  letter-spacing: -0.02em;
}

/* Related guides */
.related {
  margin-top: clamp(48px, 7vw, 72px);
}
.related h2 {
  margin-bottom: 22px;
  font-size: clamp(24px, 3.4vw, 34px);
  letter-spacing: -0.02em;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

/* ---- Responsive ---------------------------------------------------------- */
@media (max-width: 860px) {
  .steps,
  .card-grid,
  .card-grid.two,
  .pricing-grid,
  .related-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }
  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  .footer-inner {
    grid-template-columns: 1fr;
  }
  .band-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ========================================================================= *
 * BRAND GLYPHS  ·  single-color marks recolored with the current ink
 * The SVGs use currentColor (some stroke, some fill). Using them as a CSS
 * mask over `background-color` recolors them reliably in BOTH themes,
 * regardless of each file's internal fill/stroke setup.
 * ========================================================================= */
.glyph {
  display: inline-block;
  flex-shrink: 0;
  width: 1em;
  height: 1em;
  background-color: currentColor;
  -webkit-mask: var(--glyph-src) no-repeat center / contain;
  mask: var(--glyph-src) no-repeat center / contain;
}
.glyph--analysis { --glyph-src: url("/assets/glyphs/analysis.svg"); }
.glyph--analyst  { --glyph-src: url("/assets/glyphs/analyst.svg"); }
.glyph--atom     { --glyph-src: url("/assets/glyphs/atom.svg"); }
.glyph--dream    { --glyph-src: url("/assets/glyphs/dream.svg"); }
.glyph--dreamer  { --glyph-src: url("/assets/glyphs/dreamer.svg"); }
.glyph--rituals  { --glyph-src: url("/assets/glyphs/rituals-2.svg"); }
.glyph--writing  { --glyph-src: url("/assets/glyphs/writing.svg"); }
/* Per-guide topical glyphs (Lucide ISC + Tabler MIT, normalized to house style). */
.glyph--spiral   { --glyph-src: url("/assets/glyphs/glyph-spiral.svg"); }
.glyph--search   { --glyph-src: url("/assets/glyphs/glyph-search.svg"); }
.glyph--robot    { --glyph-src: url("/assets/glyphs/glyph-robot.svg"); }
.glyph--notebook { --glyph-src: url("/assets/glyphs/glyph-notebook.svg"); }
.glyph--tooth    { --glyph-src: url("/assets/glyphs/glyph-tooth.svg"); }
.glyph--snake    { --glyph-src: url("/assets/glyphs/glyph-snake.svg"); }
.glyph--run      { --glyph-src: url("/assets/glyphs/glyph-run.svg"); }
.glyph--mountain { --glyph-src: url("/assets/glyphs/glyph-mountain.svg"); }
.glyph--skull    { --glyph-src: url("/assets/glyphs/glyph-skull.svg"); }
.glyph--ex       { --glyph-src: url("/assets/glyphs/glyph-heart-crack.svg"); }
.glyph--plane    { --glyph-src: url("/assets/glyphs/glyph-plane.svg"); }
.glyph--droplets { --glyph-src: url("/assets/glyphs/glyph-droplets.svg"); }

/* Lead glyph inline at the start of a page/section H1 (hub). Sized to the cap
 * height and baseline-aligned so it reads as the first mark on the title line. */
.glyph--lead {
  width: 0.9em;
  height: 0.9em;
  margin: 0 0.28em 0 0;
  vertical-align: baseline;
  color: var(--color-accent);
  opacity: 0.9;
}

/* Small glyph as a quality marker on cards. */
.guide-card .glyph {
  width: 20px;
  height: 20px;
  margin-bottom: 4px;
  color: var(--color-text-subtle);
  transition: color var(--dur-med) var(--ease-out);
}
.guide-card:hover .glyph {
  color: var(--color-accent);
}

/* Glyph inline at the start of a major section head, at cap height. */
.prose h2 .glyph,
.prose h3 .glyph {
  width: 0.9em;
  height: 0.9em;
  margin-right: 0.28em;
  color: var(--color-highlight);
  vertical-align: baseline;
}

/* ========================================================================= *
 * GUIDE HEADER  ·  inline glyph marker at the start of the H1, hero-figure slot
 * The glyph reads the per-page --guide-glyph set inline on .guide-header and
 * sits inside the H1 before the text, sized to the cap height and baseline-
 * aligned. It is decorative (aria-hidden) and adds no text to the heading.
 * ========================================================================= */
.guide-glyph {
  display: inline-block;
  flex-shrink: 0;
  width: 0.9em;
  height: 0.9em;
  margin: 0 0.28em 0 0;
  vertical-align: baseline;
  background-color: var(--color-accent);
  -webkit-mask: var(--guide-glyph) no-repeat center / contain;
  mask: var(--guide-glyph) no-repeat center / contain;
  opacity: 0.9;
}
/* Hero illustration (hand-painted ink + watercolour; one file for both themes —
 * see marketing/seo-image-generation.md). Full guide-column width, cropped to 3:2,
 * rounded like the site's panels. No border/shadow: the painted paper is its own
 * edge. The surface fill only shows while the image loads. */
.guide-hero {
  margin: clamp(24px, 4vw, 34px) 0 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-surface-2);
}
.guide-hero img,
.guide-hero video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

/* ========================================================================= *
 * RICHER SURFACES  ·  flat panels, pull-quotes
 * Panels are flat theme surfaces (solid color + hairline border) — no texture
 * imagery behind them.
 * ========================================================================= */
/* In-guide CTA keeps a flat surface fill. */
.cta-block {
  background: var(--color-surface-2);
}

/* Pull-quote treatment for the Jung quotes. */
.prose blockquote {
  position: relative;
  isolation: isolate;
  margin-inline: 0;
  padding: clamp(24px, 4vw, 30px) clamp(24px, 4vw, 32px) clamp(22px, 3.4vw, 28px)
    clamp(34px, 5vw, 46px);
  border-left: 3px solid var(--color-accent);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background: var(--color-surface-2);
}
.prose blockquote::before {
  content: "\201C";
  position: absolute;
  z-index: -1;
  top: 0.02em;
  left: 0.16em;
  font-family: var(--font-display);
  font-size: 3.4em;
  line-height: 1;
  color: var(--color-accent);
  opacity: 0.16;
  pointer-events: none;
}

/* ========================================================================= *
 * DREAM ANALYZER  ·  /dream-analyzer form (works without JS: GET → /start)
 * ========================================================================= */
.analyzer {
  scroll-margin-top: 96px; /* clear the sticky header when linked as #analyzer */
  margin: clamp(28px, 4vw, 40px) 0 clamp(40px, 6vw, 56px);
  padding: clamp(24px, 4vw, 36px);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-lg);
  background: var(--color-surface-2);
}
.analyzer h2 {
  font-size: clamp(26px, 3.6vw, 36px);
}
.analyzer-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}
.analyzer-label {
  color: var(--color-text-muted);
  font-size: 16px;
}
.analyzer-form textarea {
  display: block;
  width: 100%;
  min-height: 180px;
  padding: 16px 18px;
  border: 1px solid var(--color-border-muted);
  border-radius: var(--radius-md);
  background: var(--color-canvas);
  color: var(--color-text-strong);
  font-family: var(--font-body);
  font-size: 17px; /* ≥16px keeps iOS from zooming on focus */
  line-height: 1.6;
  resize: vertical;
  transition: border-color var(--dur-med) var(--ease-out);
}
.analyzer-form textarea::placeholder {
  color: var(--color-text-subtle);
}
.analyzer-form textarea:focus {
  outline: none;
  border-color: var(--color-border-strong);
}
.analyzer-form textarea:focus-visible {
  outline: 2px solid var(--color-highlight);
  outline-offset: 3px;
}
.analyzer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
}
@media (max-width: 520px) {
  .analyzer-actions .btn {
    width: 100%;
  }
}

/* Secondary link under the in-guide CTA → the dream analyzer. */
.cta-block .analyzer-link {
  margin-top: 10px;
  font-size: 14px;
}
.cta-block .analyzer-link a {
  color: var(--color-text-strong);
  border-bottom: 1px solid var(--color-border-hair);
  transition: border-color var(--dur-fast) var(--ease-out);
}
.cta-block .analyzer-link a:hover {
  border-color: var(--color-border-strong);
}
