:root,
[data-theme="light"] {
  color-scheme: light;
  --bg: #f8f5f0;
  --bg-soft: #f2ede4;
  --surface: rgba(255, 255, 255, 0.52);
  --text: #1f1a17;
  --muted: #6f675f;
  --line: rgba(50, 38, 28, 0.12);
  --accent: #b89a6a;
  --accent-dark: #9d8054;
  --shadow: 0 20px 50px rgba(36, 28, 21, 0.08);
  --header-bg: rgba(248, 245, 240, 0.64);
  --header-border: rgba(50, 38, 28, 0.06);
  --ghost-bg: rgba(255, 255, 255, 0.36);
  --trace-bg: rgba(255, 255, 255, 0.46);
  --body-gradient-top: rgba(255, 255, 255, 0.72);
  --grain: rgba(40, 30, 20, 0.025);
  --menu-surface: rgba(252, 247, 240, 0.97);
  --menu-border: rgba(50, 38, 28, 0.1);
  --menu-shadow: 0 18px 44px rgba(36, 28, 21, 0.11);
  --menu-backdrop: rgba(31, 26, 23, 0.16);
  --radius: 28px;
  --container: 1120px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1a1714;
  --bg-soft: #221d18;
  --surface: rgba(40, 34, 28, 0.85);
  --text: #f4eee6;
  --muted: #b7ab9b;
  --line: rgba(244, 238, 230, 0.12);
  --accent: #c4a876;
  --accent-dark: #b89a6a;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.22);
  --header-bg: rgba(34, 29, 24, 0.84);
  --header-border: rgba(199, 163, 108, 0.09);
  --ghost-bg: rgba(244, 238, 230, 0.05);
  --trace-bg: rgba(44, 38, 32, 0.9);
  --body-gradient-top: rgba(199, 163, 108, 0.08);
  --grain: rgba(199, 163, 108, 0.022);
  --menu-surface: rgba(34, 29, 24, 0.98);
  --menu-border: rgba(244, 238, 230, 0.1);
  --menu-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
  --menu-backdrop: rgba(14, 12, 10, 0.48);
  --surface-border: rgba(199, 163, 108, 0.11);
  --trace-border: rgba(199, 163, 108, 0.14);
  --idea-bg: rgba(38, 33, 27, 0.62);
  --footer-muted: #c4b8a8;
}

[data-theme="dark"] body {
  background:
    radial-gradient(circle at top, rgba(199, 163, 108, 0.08), transparent 45%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 100%);
}

[data-theme="dark"] .site-header {
  box-shadow:
    0 1px 0 color-mix(in srgb, var(--header-border) 85%, transparent),
    0 4px 18px rgba(0, 0, 0, 0.14);
}

[data-theme="dark"] .section-card {
  border-color: var(--surface-border);
}

[data-theme="dark"] .trace-card {
  border-color: var(--trace-border);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .idea-card {
  background: var(--idea-bg);
  border-color: rgba(199, 163, 108, 0.13);
}

[data-theme="dark"] .button--primary {
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.26);
}

[data-theme="dark"] .button--ghost:hover {
  border-color: rgba(199, 163, 108, 0.2);
}

[data-theme="dark"] .hero-support {
  opacity: 0.9;
}

[data-theme="dark"] .site-footer {
  border-top-color: rgba(199, 163, 108, 0.1);
}

[data-theme="dark"] .site-footer__inner,
[data-theme="dark"] .footer-nav a {
  color: var(--footer-muted);
}

[data-theme="dark"] .footer-nav a:hover {
  color: var(--text);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(circle at top, var(--body-gradient-top), transparent 42%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 100%);
  color: var(--text);
  font-family: "Inter", system-ui, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background 200ms ease, color 200ms ease;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(var(--grain) 0.7px, transparent 0.7px);
  background-size: 14px 14px;
  opacity: 0.55;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.45), rgba(0,0,0,0.12));
  transition: opacity 200ms ease;
}

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

a:focus-visible,
.button:focus-visible,
.theme-toggle:focus-visible,
.menu-toggle:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--text);
  color: var(--bg);
  font-size: 0.9rem;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

.container {
  width: min(calc(100% - 2rem), var(--container));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  --header-height: 72px;
  backdrop-filter: blur(14px);
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--line) 55%, transparent),
    0 6px 20px rgba(36, 28, 21, 0.035);
  transition: background 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

.site-header__inner {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  min-height: 72px;
}

.brand {
  justify-self: start;
  grid-column: 1;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(1.7rem, 2.2vw, 2rem);
  letter-spacing: 0.015em;
  line-height: 1;
  display: inline-flex;
  align-items: baseline;
  gap: 0.04em;
}

.brand .life {
  font-family: "Caveat", cursive;
  font-size: 1.08em;
  color: color-mix(in srgb, var(--text) 84%, var(--muted) 16%);
  transform: translateY(0.05em);
}

.site-nav {
  justify-self: center;
  grid-column: 2;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: clamp(1.6rem, 2.4vw, 2rem);
}

.site-nav a {
  color: var(--muted);
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: color 200ms ease;
}

.site-nav a:hover { color: var(--text); }

.site-nav__leave {
  color: color-mix(in srgb, var(--text) 82%, var(--muted) 18%);
}

.site-nav__leave:hover {
  color: var(--text);
}

.header-controls {
  justify-self: end;
  grid-column: 3;
  display: flex;
  align-items: center;
  gap: 0.15rem;
  flex-shrink: 0;
}

.theme-toggle,
.menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.375rem;
  height: 2.375rem;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  border-radius: 999px;
  transition: color 200ms ease, background-color 200ms ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible,
.menu-toggle:hover,
.menu-toggle:focus-visible {
  color: var(--text);
  background: color-mix(in srgb, var(--muted) 11%, transparent);
}

.theme-toggle svg,
.menu-toggle svg {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-toggle__sun {
  display: none;
}

[data-theme="dark"] .theme-toggle__moon {
  display: none;
}

[data-theme="dark"] .theme-toggle__sun {
  display: block;
}

.menu-toggle {
  display: none;
}

.menu-toggle__close {
  display: none;
}

.site-header.is-menu-open .menu-toggle__open {
  display: none;
}

.site-header.is-menu-open .menu-toggle__close {
  display: block;
}

.mobile-menu-backdrop {
  display: none;
}

.hero {
  padding: clamp(4.5rem, 9vw, 7.5rem) 0 clamp(3rem, 6vw, 4.5rem);
  text-align: center;
}

.hero__inner {
  display: grid;
  gap: 1.5rem;
  justify-items: center;
}

.line-mark {
  width: min(100%, 360px);
  height: auto;
  opacity: 0.84;
}

.hero-title {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(3rem, 9vw, 5.7rem);
  line-height: 0.95;
  font-weight: 500;
  letter-spacing: 0.015em;
  text-wrap: balance;
}

.hero-title .life {
  display: inline-block;
  margin-left: 0.02em;
  font-family: "Caveat", cursive;
  font-size: 0.96em;
  color: color-mix(in srgb, var(--text) 84%, var(--muted) 16%);
  transform: translateY(0.04em);
}

.hero-subtitle {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 2.1vw, 1.2rem);
  line-height: 1.75;
  text-wrap: balance;
}

.hero-support {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(0.88rem, 1.7vw, 0.98rem);
  line-height: 1.75;
  text-wrap: balance;
  opacity: 0.82;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  margin-top: 0.8rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0.9rem 1.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 500;
  font-size: 0.98rem;
  transition: transform 220ms ease, box-shadow 220ms ease, background-color 220ms ease, color 220ms ease, border-color 220ms ease;
  cursor: pointer;
}

.button:hover {
  transform: translateY(-1px);
}

.button--primary {
  background: color-mix(in srgb, var(--accent) 88%, #f8ecdb 12%);
  color: #fff8ef;
  box-shadow: 0 12px 28px rgba(184, 154, 106, 0.22);
}

.button--primary:hover {
  background: color-mix(in srgb, var(--accent-dark) 88%, #f8ecdb 12%);
}

.button--ghost {
  border-color: var(--line);
  color: var(--muted);
  background: var(--ghost-bg);
}

.button--ghost:hover {
  color: var(--text);
  border-color: rgba(50, 38, 28, 0.18);
}

.section {
  padding: clamp(2.5rem, 5vw, 4.5rem) 0;
}

.section-card {
  background: var(--surface);
  border: 1px solid rgba(50, 38, 28, 0.08);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  padding: clamp(1.5rem, 3vw, 2.5rem);
}

.section-label {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.section-title {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(2rem, 5vw, 3.15rem);
  line-height: 1.05;
  font-weight: 500;
  text-wrap: balance;
}

.section-copy {
  max-width: 760px;
  margin: 1rem auto 0;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.82;
  text-wrap: pretty;
}

.examples {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.trace-card {
  background: var(--trace-bg);
  border: 1px solid rgba(50, 38, 28, 0.08);
  border-radius: 22px;
  padding: 1.35rem 1.2rem;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: 0 10px 24px rgba(20, 15, 10, 0.05);
}

.trace-card blockquote {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  line-height: 1.5;
  color: color-mix(in srgb, var(--text) 94%, var(--muted) 6%);
}

.idea-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.75rem;
}

.idea-card {
  padding: 1.35rem 1.2rem;
  border-radius: 4px;
  background: transparent;
  border: 1px solid rgba(50, 38, 28, 0.1);
}

.idea-card h3 {
  margin: 0 0 0.45rem;
  font-family: "Cormorant Garamond", serif;
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--text);
}

.idea-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.7;
}

.cta-block {
  text-align: center;
  padding-top: clamp(2rem, 5vw, 3rem);
  padding-bottom: clamp(3.5rem, 7vw, 5rem);
}

.cta-block .section-copy {
  margin-top: 0.8rem;
  max-width: 640px;
}

.site-footer {
  border-top: 1px solid rgba(50, 38, 28, 0.08);
  padding: 1.3rem 0 2rem;
}

.site-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.footer-brand-block {
  display: grid;
  gap: 0.15rem;
}

.footer-brand {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.25rem;
  color: var(--text);
}

.footer-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  font-size: 0.9rem;
}

.footer-nav a {
  color: var(--muted);
  transition: color 220ms ease;
}

.footer-nav a:hover { color: var(--text); }

.footer-nav__sep {
  color: color-mix(in srgb, var(--muted) 55%, transparent);
  user-select: none;
}

@media (max-width: 920px) {
  .examples,
  .idea-grid,
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .trace-card {
    min-height: auto;
  }
}

@media (max-width: 768px) {
  .site-header {
    --header-height: 68px;
  }

  .site-header__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: var(--header-height);
  }

  .brand {
    grid-column: auto;
    font-size: clamp(1.55rem, 5vw, 1.75rem);
  }

  .site-nav {
    position: fixed;
    top: calc(var(--header-height) + env(safe-area-inset-top, 0px) + 0.625rem);
    left: 1rem;
    right: 1rem;
    z-index: 30;
    grid-column: auto;
    justify-self: stretch;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.35rem 0;
    border-radius: 22px;
    background: var(--menu-surface);
    border: 1px solid var(--menu-border);
    box-shadow: var(--menu-shadow);
    backdrop-filter: blur(18px);
    display: flex;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-6px) scale(0.98);
    transform-origin: top center;
    transition:
      opacity 200ms ease,
      transform 200ms ease,
      visibility 200ms ease;
  }

  .site-header.is-menu-open .site-nav {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
  }

  .site-nav a {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 0.65rem 1.15rem;
    font-size: 0.98rem;
    border-bottom: 1px solid var(--line);
  }

  .site-nav a:last-child {
    border-bottom: none;
  }

  .header-controls {
    grid-column: auto;
    justify-self: auto;
    margin-left: auto;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .mobile-menu-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    top: calc(var(--header-height) + env(safe-area-inset-top, 0px));
    z-index: 25;
    margin: 0;
    padding: 0;
    border: none;
    background: var(--menu-backdrop);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 200ms ease, visibility 200ms ease;
  }

  body.is-menu-open .mobile-menu-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  body.is-menu-open {
    overflow: hidden;
  }
}

@media (min-width: 769px) {
  .mobile-menu-backdrop {
    display: none !important;
  }
}

@media (max-width: 640px) {
  .site-header {
    --header-height: 64px;
  }

  .site-header__inner {
    min-height: var(--header-height);
  }

  .hero {
    padding-top: 4rem;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
  }

  .hero-actions .button {
    width: min(100%, 280px);
  }

  .section-card {
    border-radius: 24px;
  }

  .site-footer__inner {
    flex-direction: column;
    text-align: center;
  }
}

/* Social proof */
.social-proof {
  padding-top: 0;
  text-align: center;
}

.social-proof .section-title {
  font-size: clamp(1.75rem, 4.5vw, 2.65rem);
  max-width: 22ch;
  margin-inline: auto;
}

.social-proof__fallback {
  margin: 1.75rem auto 0;
  max-width: 36ch;
  color: var(--muted);
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(1.25rem, 3vw, 1.65rem);
  line-height: 1.55;
  text-wrap: balance;
}

.stat-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 2.75rem);
  margin-top: clamp(2rem, 4vw, 2.75rem);
  max-width: 16rem;
  margin-inline: auto;
}

.stat {
  display: grid;
  gap: 0.45rem;
  justify-items: center;
}

.stat__value {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(2.5rem, 6vw, 3.75rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.01em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.stat__label {
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* Featured traces */
.featured-traces {
  text-align: center;
}

.featured-traces .section-subtitle {
  margin: 0.85rem auto 0;
  max-width: 28ch;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.7;
  text-wrap: balance;
}

.featured-traces .examples {
  margin-top: clamp(1.75rem, 4vw, 2.25rem);
}

.featured-traces .trace-card {
  min-height: 200px;
  padding: clamp(1.5rem, 3vw, 2rem) clamp(1.25rem, 2.5vw, 1.75rem);
  transition: transform 260ms ease, box-shadow 260ms ease, border-color 260ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .featured-traces .trace-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 32px rgba(20, 15, 10, 0.07);
    border-color: rgba(50, 38, 28, 0.12);
  }
}

.featured-traces .trace-card:focus-within {
  outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: 3px;
}

.featured-traces .trace-card blockquote {
  font-size: clamp(1.4rem, 2.6vw, 1.85rem);
  line-height: 1.48;
}

.featured-traces__cta {
  margin-top: clamp(2rem, 4vw, 2.75rem);
}

@media (prefers-reduced-motion: reduce) {
  body,
  .site-header,
  .theme-toggle,
  .featured-traces .trace-card,
  .site-nav,
  .mobile-menu-backdrop {
    transition: none;
  }
}
