/*
 * WoodSnap website — shared styles.
 *
 * Colour tokens mirror the app theme (frontend/lib/core/design/theme.dart and
 * frontend/lib/utils/constants.dart): cream / espresso surfaces and the
 * Saddle Wood brown primary. The app's foreground and border greys are warmed
 * here so every neutral reads as timber rather than slate.
 *
 * Theme resolution: light tokens on :root; dark tokens when the system prefers
 * dark (unless the visitor forced light), or when the visitor forced dark.
 * The override lives in localStorage['woodsnap-theme'] and is applied to
 * <html data-theme> by the inline script in each page's <head>.
 */

/* ---------- Fonts (Poppins, same family as the app; latin subset) ---------- */

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/poppins-regular.woff2") format("woff2");
}
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/poppins-medium.woff2") format("woff2");
}
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/poppins-semibold.woff2") format("woff2");
}
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/poppins-bold.woff2") format("woff2");
}

/* ---------- Tokens ---------- */

:root {
  color-scheme: light;

  --bg: #f8f3ed;
  --bg-tint: #f2e9de;
  --surface: #ffffff;
  --surface-2: #f6ece3;
  --text: #2a211b;
  --text-body: #3f332a;
  --text-muted: #6b5d52;
  --border: #e6dcd0;
  --border-strong: #d6c6b4;

  --accent: #8b4513;
  --accent-hover: #6a330e;
  --accent-text: #8b4513;
  --accent-soft: rgb(139 69 19 / 0.07);
  --accent-soft-strong: rgb(139 69 19 / 0.13);
  --on-accent: #ffffff;

  --forest: #2e7d52;
  --forest-soft: rgb(46 125 82 / 0.1);

  --ph-bg: #fcebc7;
  --ph-text: #7a4a06;
  --ph-border: #e7c583;

  --header-bg: rgb(248 243 237 / 0.8);
  --grain-color: #8b4513;
  --grain-opacity: 0.1;
  --photo-scrim: rgb(42 33 27 / 0.28);

  --shadow-card: 0 1px 2px rgb(42 33 27 / 0.04), 0 12px 32px -16px rgb(42 33 27 / 0.14);
  --shadow-pop: 0 2px 4px rgb(42 33 27 / 0.05), 0 18px 40px -12px rgb(42 33 27 / 0.2);
  --focus: #8b4513;

  --sun-opacity: 0;
  --sun-transform: rotate(-90deg) scale(0.5);
  --moon-opacity: 1;
  --moon-transform: none;

  --font: "Poppins", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --header-h: 64px;
  --toc-bar-h: 52px;
  --gutter: 16px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-3xl: 28px;
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* Dark tokens — kept identical in both blocks below. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;

    --bg: #1a140f;
    --bg-tint: #1f1812;
    --surface: #221a14;
    --surface-2: #2a2019;
    --text: #f3ece4;
    --text-body: #e0d5c9;
    --text-muted: #b3a597;
    --border: #3a2e24;
    --border-strong: #4d3e31;

    --accent: #a0561f;
    --accent-hover: #8b4513;
    --accent-text: #dd9a5b;
    --accent-soft: rgb(221 154 91 / 0.08);
    --accent-soft-strong: rgb(221 154 91 / 0.15);
    --on-accent: #ffffff;

    --forest: #6fcf8e;
    --forest-soft: rgb(111 207 142 / 0.1);

    --ph-bg: rgb(221 154 91 / 0.14);
    --ph-text: #f0c38e;
    --ph-border: rgb(221 154 91 / 0.38);

    --header-bg: rgb(26 20 15 / 0.76);
    --grain-color: #dd9a5b;
    --grain-opacity: 0.085;
    --photo-scrim: rgb(0 0 0 / 0.4);

    --shadow-card: 0 0 0 transparent;
    --shadow-pop: 0 18px 44px -14px rgb(0 0 0 / 0.6);
    --focus: #dd9a5b;

    --sun-opacity: 1;
    --sun-transform: none;
    --moon-opacity: 0;
    --moon-transform: rotate(90deg) scale(0.5);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #1a140f;
  --bg-tint: #1f1812;
  --surface: #221a14;
  --surface-2: #2a2019;
  --text: #f3ece4;
  --text-body: #e0d5c9;
  --text-muted: #b3a597;
  --border: #3a2e24;
  --border-strong: #4d3e31;

  --accent: #a0561f;
  --accent-hover: #8b4513;
  --accent-text: #dd9a5b;
  --accent-soft: rgb(221 154 91 / 0.08);
  --accent-soft-strong: rgb(221 154 91 / 0.15);
  --on-accent: #ffffff;

  --forest: #6fcf8e;
  --forest-soft: rgb(111 207 142 / 0.1);

  --ph-bg: rgb(221 154 91 / 0.14);
  --ph-text: #f0c38e;
  --ph-border: rgb(221 154 91 / 0.38);

  --header-bg: rgb(26 20 15 / 0.76);
  --grain-color: #dd9a5b;
  --grain-opacity: 0.085;
  --photo-scrim: rgb(0 0 0 / 0.4);

  --shadow-card: 0 0 0 transparent;
  --shadow-pop: 0 18px 44px -14px rgb(0 0 0 / 0.6);
  --focus: #dd9a5b;

  --sun-opacity: 1;
  --sun-transform: none;
  --moon-opacity: 0;
  --moon-transform: rotate(90deg) scale(0.5);
}

@media (min-width: 768px) {
  :root {
    --gutter: 32px;
  }
}

@media (min-width: 1280px) {
  :root {
    --gutter: 40px;
  }
}

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

*,
*::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;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text-body);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

main {
  flex: 1 0 auto;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--accent-text);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 2px;
}

strong {
  font-weight: 600;
  color: var(--text);
}

::selection {
  background: var(--accent-soft-strong);
  color: var(--text);
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow-pop);
  border: 1px solid var(--border);
}

.skip-link:focus {
  top: 12px;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.icon {
  width: 20px;
  height: 20px;
  flex: none;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(1.5) blur(18px);
  backdrop-filter: saturate(1.5) blur(18px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header {
    background: var(--bg);
  }
}

.site-header.is-scrolled {
  border-bottom-color: var(--border);
}

.header-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin-right: auto;
  padding-right: 6px;
  border-radius: 10px;
  color: var(--text);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

.site-nav {
  display: flex;
  align-items: center;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-list a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.nav-list a:hover {
  color: var(--text);
  background: var(--accent-soft);
}

.nav-list a[aria-current="page"] {
  color: var(--text);
  background: var(--accent-soft-strong);
}

.icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: none;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.icon-btn:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
}

.icon-btn:active {
  transform: scale(0.95);
}

.icon-btn:focus-visible {
  border-radius: 999px;
}

.theme-toggle {
  margin-left: 6px;
}

.theme-toggle .icon {
  position: absolute;
  inset: 0;
  margin: auto;
  transition: opacity 0.3s var(--ease-out), transform 0.45s var(--ease-out);
}

.theme-toggle .icon-sun {
  opacity: var(--sun-opacity);
  transform: var(--sun-transform);
}

.theme-toggle .icon-moon {
  opacity: var(--moon-opacity);
  transform: var(--moon-transform);
}

.nav-toggle {
  display: none;
}

.nav-toggle .icon-close {
  display: none;
}

.site-header.nav-open .nav-toggle .icon-close {
  display: block;
}

.site-header.nav-open .nav-toggle .icon-menu {
  display: none;
}

html:not(.js) .theme-toggle {
  display: none;
}

@media (max-width: 519px) {
  .js .nav-toggle {
    display: inline-flex;
  }

  .js .nav-list {
    display: none;
    position: absolute;
    top: calc(var(--header-h) - 2px);
    left: var(--gutter);
    right: var(--gutter);
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-pop);
  }

  .js .site-header.nav-open .nav-list {
    display: flex;
    animation: pop 0.18s var(--ease-out);
  }

  .js .nav-list a {
    display: flex;
    min-height: 48px;
    padding: 0 16px;
    border-radius: var(--radius-md);
    color: var(--text);
    font-size: 16px;
  }
}

/* ---------- Buttons & small components ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  font: 600 15px/1.2 var(--font);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

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

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

.btn-secondary:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
}

mark.ph {
  padding: 0.05em 0.38em;
  border: 1px dashed var(--ph-border);
  border-radius: 6px;
  background: var(--ph-bg);
  color: var(--ph-text);
  font-size: 0.92em;
  font-weight: 500;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* ---------- Legal hero ---------- */

.legal-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, var(--bg-tint), var(--bg));
  border-bottom: 1px solid var(--border);
}

.grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: var(--grain-color);
  opacity: var(--grain-opacity);
  -webkit-mask: url("../img/grain.svg") 72% 50% / cover no-repeat;
  mask: url("../img/grain.svg") 72% 50% / cover no-repeat;
}

.legal-hero .container {
  position: relative;
  padding-block: 48px 40px;
}

@media (max-width: 767px) {
  .legal-hero .grain {
    -webkit-mask-position: 58% 50%;
    mask-position: 58% 50%;
  }
}

@media (min-width: 768px) {
  .legal-hero .container {
    padding-block: 88px 64px;
  }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 22px;
  padding: 5px 14px 5px 5px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.eyebrow img {
  width: 24px;
  height: 24px;
  border-radius: 7px;
}

.eyebrow .sep {
  color: var(--text-muted);
  font-weight: 500;
}

.page-title {
  margin: 0 0 14px;
  color: var(--text);
  font-size: clamp(36px, 6vw, 58px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.028em;
}

.lede {
  max-width: 34em;
  margin: 0;
  color: var(--text-muted);
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.55;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  margin: 28px 0 0;
  font-size: 14px;
}

.meta-row > div {
  display: flex;
  gap: 8px;
}

.meta-row dt {
  color: var(--text-muted);
}

.meta-row dd {
  margin: 0;
  color: var(--text);
  font-weight: 500;
}

.draft-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 44em;
  margin: 24px 0 0;
  padding: 12px 16px;
  border: 1px dashed var(--ph-border);
  border-radius: var(--radius-lg);
  background: var(--ph-bg);
  color: var(--ph-text);
  font-size: 14px;
  line-height: 1.5;
}

.draft-note .icon {
  width: 18px;
  height: 18px;
  margin-top: 1px;
}

/* ---------- Legal layout & table of contents ---------- */

.legal-layout {
  padding-block: 0 88px;
}

@media (min-width: 1024px) {
  .legal-layout {
    display: grid;
    grid-template-columns: 232px minmax(0, 1fr);
    gap: 56px;
    align-items: start;
    padding-block: 56px 120px;
  }
}

.toc {
  position: sticky;
  top: var(--header-h);
  z-index: 20;
  margin: 0 calc(var(--gutter) * -1) 8px;
}

.toc summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--toc-bar-h);
  padding: 0 var(--gutter);
  border-bottom: 1px solid var(--border);
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(1.5) blur(18px);
  backdrop-filter: saturate(1.5) blur(18px);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

.toc summary::-webkit-details-marker {
  display: none;
}

.toc summary .icon {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}

.toc-current {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.toc-current:not(:empty)::before {
  content: "· ";
}

.toc .toc-chevron {
  transition: transform 0.2s ease;
}

.toc details[open] .toc-chevron {
  transform: rotate(180deg);
}

.toc-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: var(--gutter);
  right: var(--gutter);
  max-height: min(70vh, 540px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-pop);
  animation: pop 0.18s var(--ease-out);
}

.toc-title {
  display: none;
}

.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc a {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-height: 46px;
  padding: 11px 12px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 14.5px;
  line-height: 1.4;
  text-decoration: none;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.toc a:hover {
  color: var(--text);
  background: var(--accent-soft);
}

.toc a .n {
  min-width: 1.7em;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.toc a.is-active {
  color: var(--accent-text);
  background: var(--accent-soft);
  font-weight: 500;
}

.toc a.is-active .n {
  color: var(--accent-text);
}

.toc-foot {
  display: none;
}

@media (min-width: 1024px) {
  .toc {
    top: calc(var(--header-h) + 32px);
    max-height: calc(100vh - var(--header-h) - 56px);
    margin: 0;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }

  .js .toc summary {
    display: none;
  }

  .toc-panel {
    position: static;
    max-height: none;
    overflow: visible;
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
    animation: none;
  }

  .toc-title {
    display: block;
    margin: 0 0 10px 12px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .toc a {
    min-height: 0;
    padding: 7px 12px;
    font-size: 14px;
  }

  .toc-foot {
    display: grid;
    gap: 2px;
    margin: 20px 0 0;
    padding: 16px 0 0;
    border-top: 1px solid var(--border);
  }

  .toc-foot a {
    gap: 10px;
    align-items: center;
    color: var(--text-muted);
  }

  .toc-foot .icon {
    width: 16px;
    height: 16px;
  }
}

/* ---------- Legal document ---------- */

.legal-doc {
  min-width: 0;
  padding-top: 28px;
  color: var(--text-body);
  font-size: 16px;
  line-height: 1.72;
}

@media (min-width: 768px) {
  .legal-doc {
    margin-top: 40px;
    padding: 48px 56px 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius-3xl);
    background: var(--surface);
    box-shadow: var(--shadow-card);
    font-size: 17px;
  }
}

@media (min-width: 1024px) {
  .legal-doc {
    margin-top: 0;
    padding: 56px 64px 32px;
  }
}

.legal-doc p {
  margin: 0 0 16px;
}

.legal-doc .doc-intro {
  margin: 0;
  color: var(--text);
  font-size: 1.04em;
}

.legal-doc h2 {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 0;
  color: var(--text);
  font-size: clamp(21px, 2.4vw, 25px);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.015em;
}

.legal-doc h3 {
  margin: 30px 0 8px;
  color: var(--text);
  font-size: 1.03em;
  font-weight: 600;
  line-height: 1.45;
}

.legal-doc ul {
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}

.legal-doc ul > li {
  position: relative;
  margin: 0 0 10px;
  padding-left: 24px;
}

.legal-doc ul > li::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 0.72em;
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0.75;
}

.legal-doc ul ul {
  margin: 10px 0 0;
}

.legal-doc > :last-child,
.doc-section > :last-child {
  margin-bottom: 0;
}

.doc-section {
  padding-block: 40px;
  border-top: 1px solid var(--border);
  scroll-margin-top: calc(var(--header-h) + var(--toc-bar-h) + 12px);
}

@media (min-width: 768px) {
  .doc-section {
    padding-block: 48px;
  }
}

@media (min-width: 1024px) {
  .doc-section {
    scroll-margin-top: calc(var(--header-h) + 24px);
  }
}

.glance + .doc-section {
  border-top: 0;
}

.sec-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 18px;
}

.sec-num {
  flex: none;
  min-width: 2ch;
  color: var(--accent-text);
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.anchor {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: none;
  margin-left: auto;
  border-radius: 8px;
  color: var(--text-muted);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.anchor .icon {
  width: 16px;
  height: 16px;
}

.sec-head:hover .anchor,
.anchor:focus-visible {
  opacity: 1;
}

.anchor:hover {
  color: var(--accent-text);
  background: var(--accent-soft);
}

@media (hover: none) {
  .anchor {
    opacity: 0.55;
  }
}

/* "At a glance" summary */
.glance {
  margin: 28px 0 8px;
  padding: 24px 22px;
  border-radius: var(--radius-2xl);
  background: var(--surface-2);
}

@media (min-width: 768px) {
  .glance {
    margin-top: 32px;
    padding: 28px 32px;
  }
}

.glance h2 {
  margin: 0 0 6px;
  font-size: 19px;
}

.glance .glance-sub {
  margin: 0 0 18px;
  color: var(--text-muted);
  font-size: 0.9em;
}

.glance ul {
  display: grid;
  gap: 14px;
  margin: 0;
}

.glance ul > li {
  display: flex;
  gap: 14px;
  margin: 0;
  padding: 0;
  line-height: 1.6;
}

.glance ul > li::before {
  content: none;
}

.glance .glance-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: none;
  margin-top: 1px;
  border-radius: 10px;
  background: var(--surface);
  color: var(--accent-text);
}

.glance .glance-ico .icon {
  width: 17px;
  height: 17px;
}

/* Callouts */
.callout {
  margin: 24px 0;
  padding: 20px 22px;
  border: 1px solid var(--accent-soft-strong);
  border-radius: var(--radius-xl);
  background: var(--accent-soft);
}

.callout > :last-child {
  margin-bottom: 0;
}

.callout-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px !important;
  color: var(--text);
  font-weight: 600;
}

.callout-title .icon {
  color: var(--accent-text);
}

.callout--key {
  position: relative;
  overflow: hidden;
  padding: 24px 24px 22px;
  border-color: var(--border-strong);
  background: var(--surface-2);
}

.callout--key::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--accent);
}

/* Third-party services */
.vendors {
  display: grid;
  gap: 10px;
  margin: 8px 0 20px;
}

.vendors > div {
  display: grid;
  gap: 4px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

@media (min-width: 768px) {
  .vendors > div {
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 4px 24px;
    background: transparent;
  }
}

.vendors dt {
  color: var(--text);
  font-weight: 600;
  line-height: 1.45;
}

.vendors dt span {
  display: block;
  color: var(--text-muted);
  font-size: 0.85em;
  font-weight: 500;
}

.vendors dd {
  margin: 0;
  font-size: 0.94em;
  line-height: 1.6;
}

.vendors dd a {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.92em;
  font-weight: 500;
}

/* Contact card */
.contact-card {
  display: grid;
  gap: 18px;
  margin: 8px 0 18px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  background: var(--surface-2);
}

@media (min-width: 640px) {
  .contact-card {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    padding: 28px;
  }
}

.contact-card img {
  width: 52px;
  height: 52px;
  border-radius: 14px;
}

.contact-card .contact-title {
  margin: 0 0 4px;
  color: var(--text);
  font-size: 1.05em;
  font-weight: 600;
}

.contact-card p {
  margin: 0 0 16px;
}

.contact-card .btn {
  max-width: 100%;
}

.legal-doc address {
  font-style: normal;
}

.doc-end {
  margin: 0;
  padding: 28px 0 8px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 14px;
}

/* ---------- Landing ---------- */

.home-hero {
  position: relative;
  overflow: hidden;
}

.home-hero .grain {
  -webkit-mask-position: 60% 50%;
  mask-position: 60% 50%;
}

.home-hero .container {
  position: relative;
  display: grid;
  gap: 40px;
  align-items: center;
  padding-block: 40px 64px;
}

@media (min-width: 900px) {
  .home-hero .container {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 64px;
    padding-block: 80px 104px;
  }
}

.home-title {
  margin: 0 0 20px;
  text-wrap: balance;
  color: var(--text);
  font-size: clamp(38px, 6vw, 64px);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -0.032em;
}

.home-title em {
  color: var(--accent-text);
  font-style: normal;
}

.store-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 8px 20px 8px 16px;
  border-radius: var(--radius-lg);
  background: var(--text);
  color: var(--bg);
  text-decoration: none;
}

.store-btn svg {
  width: 26px;
  height: 26px;
}

.store-btn small {
  display: block;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  opacity: 0.8;
}

.store-btn span {
  display: block;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.2;
}

@media (max-width: 420px) {
  .store-row {
    gap: 10px;
  }

  .store-btn {
    gap: 10px;
    padding: 8px 14px 8px 12px;
  }

  .store-btn svg {
    width: 22px;
    height: 22px;
  }

  .store-btn span {
    font-size: 15px;
  }
}

.hero-note {
  margin: 16px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

.hero-visual {
  position: relative;
  aspect-ratio: 4 / 5;
  max-height: 640px;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 32px;
  background: var(--surface-2);
  box-shadow: var(--shadow-pop);
}

@media (max-width: 899px) {
  .hero-visual {
    aspect-ratio: 4 / 3.4;
  }
}

.hero-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 62%;
}

.hero-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, var(--photo-scrim));
  pointer-events: none;
}

.scan-frame {
  position: absolute;
  top: 9%;
  left: 9%;
  z-index: 1;
  width: 82%;
  height: 82%;
  max-width: none;
  color: #fff;
  opacity: 0.92;
  filter: drop-shadow(0 1px 6px rgb(0 0 0 / 0.25));
}

.hero-chip {
  position: absolute;
  left: 50%;
  bottom: 20px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 10px 12px;
  border: 1px solid rgb(255 255 255 / 0.35);
  border-radius: 999px;
  background: rgb(26 20 15 / 0.55);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transform: translateX(-50%);
}

.hero-chip .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6fcf8e;
  box-shadow: 0 0 0 4px rgb(111 207 142 / 0.25);
}

.section {
  padding-block: 24px 72px;
}

@media (min-width: 768px) {
  .section {
    padding-block: 32px 96px;
  }
}

.section-head {
  max-width: 40em;
  margin-bottom: 28px;
}

.section-head h2 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.section-head p {
  margin: 0;
  color: var(--text-muted);
}

.card-grid {
  display: grid;
  gap: 16px;
}

@media (min-width: 720px) {
  .card-grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .card-grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.card {
  position: relative;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.card h3 {
  margin: 16px 0 6px;
  color: var(--text);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.35;
}

.card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 15px;
}

.card-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--accent-text);
}

.card-ico .icon {
  width: 22px;
  height: 22px;
}

.card-link {
  display: flex;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.25s var(--ease-out), box-shadow 0.25s ease;
}

.card-link:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-pop);
  transform: translateY(-2px);
}

.card-link:focus-visible {
  border-radius: var(--radius-2xl);
}

.card-link .card-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  color: var(--accent-text);
  font-size: 15px;
  font-weight: 600;
}

.card-link .card-cta .icon {
  width: 18px;
  height: 18px;
  transition: transform 0.2s ease;
}

.card-link:hover .card-cta .icon {
  transform: translateX(3px);
}

.fine-print {
  margin: 20px 0 0;
  color: var(--text-muted);
  font-size: 14px;
}

/* ---------- 404 ---------- */

.error-page {
  display: grid;
  place-items: center;
  padding-block: 72px 96px;
  text-align: center;
}

.error-page .card {
  max-width: 580px;
  padding: 40px 28px;
}

.error-page .error-code {
  margin: 0 0 8px;
  color: var(--accent-text);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.1em;
}

.error-page h1 {
  margin: 0 0 12px;
  color: var(--text);
  font-size: clamp(28px, 5vw, 36px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.error-page p {
  margin: 0 0 28px;
  color: var(--text-muted);
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-tint);
  color: var(--text-muted);
  font-size: 14px;
}

.footer-inner {
  display: grid;
  gap: 20px;
  padding-block: 40px 28px;
}

@media (min-width: 768px) {
  .footer-inner {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-brand img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.footer-brand strong {
  display: block;
  font-size: 16px;
}

.footer-brand p {
  margin: 0;
  line-height: 1.4;
}

.footer-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 4px;
  margin: 0 -10px;
  padding: 0;
  list-style: none;
}

.footer-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--text-muted);
  font-weight: 500;
  text-decoration: none;
}

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

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 16px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

@media (min-width: 768px) {
  .footer-bottom {
    grid-column: 1 / -1;
  }
}

.footer-bottom p {
  margin: 0;
}

/* ---------- Toast (copy link feedback) ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 60;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-pop);
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity 0.2s ease, transform 0.25s var(--ease-out);
  pointer-events: none;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- Motion ---------- */

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.reveal {
  animation: rise 0.6s var(--ease-out) both;
  animation-delay: calc(var(--d, 0) * 80ms);
}

/* Applied by site.js for the length of a theme switch only. */
html.theme-anim,
html.theme-anim *,
html.theme-anim *::before,
html.theme-anim *::after {
  transition-property: background-color, color, border-color, fill, stroke, box-shadow, opacity, transform !important;
  transition-duration: 0.3s !important;
  transition-timing-function: ease !important;
  transition-delay: 0s !important;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Print ---------- */

@media print {
  :root:root:root {
    color-scheme: light;
    --bg: #fff;
    --bg-tint: #fff;
    --surface: #fff;
    --surface-2: #f5f5f5;
    --text: #000;
    --text-body: #111;
    --text-muted: #444;
    --border: #ccc;
    --border-strong: #999;
    --accent: #000;
    --accent-text: #000;
    --accent-soft: transparent;
    --accent-soft-strong: #ccc;
    --ph-bg: #fff;
    --ph-text: #000;
    --ph-border: #000;
    --shadow-card: none;
    --shadow-pop: none;
  }

  .site-header,
  .toc,
  .site-footer,
  .skip-link,
  .anchor,
  .grain,
  .toast {
    display: none !important;
  }

  .legal-hero .container {
    padding-block: 0 16px;
  }

  .legal-layout {
    display: block;
    padding-block: 0;
  }

  .legal-doc {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 11pt;
  }

  .doc-section {
    padding-block: 16px;
    break-inside: auto;
  }

  .sec-head {
    break-after: avoid;
  }

  .legal-doc a[href^="http"]::after,
  .legal-doc a[href^="mailto"]::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
  }

  .reveal {
    animation: none;
  }
}
