/* Sano legal site — matches app auth palette (theme.ts / authTheme.ts) */

:root {
  color-scheme: light;
  --bg: #f5f0e8;
  --bg-accent: #ede4d6;
  --surface: #ffffff;
  --text: #4a2e1f;
  --text-secondary: #6b5344;
  --muted: #8b7355;
  --accent: #4a2e1f;
  --accent-hover: #6b4a35;
  --cream: #f5f0e8;
  --cream-deep: #ede4d6;
  --border: #e8ddd0;
  --shadow: 0 1px 2px rgba(74, 46, 31, 0.06), 0 8px 24px rgba(74, 46, 31, 0.08);
  --shadow-lg: 0 4px 6px rgba(74, 46, 31, 0.05), 0 20px 48px rgba(74, 46, 31, 0.12);
  --radius: 16px;
  --radius-lg: 24px;
  --max: 72rem;
  --prose: 42rem;
  --header-h: 4rem;
  --font: 'Quicksand', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --warning-bg: #fef3e2;
  --warning-border: #f5d9a8;
  --warning-text: #92400e;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #14110f;
    --bg-accent: #1c1814;
    --surface: #221c18;
    --text: #f5f0e8;
    --text-secondary: #c9b8a8;
    --muted: #9a8775;
    --accent: #d4c4b0;
    --accent-hover: #e8ddd0;
    --cream: #2a231c;
    --cream-deep: #1c1814;
    --border: #2e2820;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 8px 24px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.2), 0 20px 48px rgba(0, 0, 0, 0.35);
    --warning-bg: #2a2010;
    --warning-border: #4a3820;
    --warning-text: #f5d9a8;
  }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

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

a:hover {
  color: var(--accent-hover);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: #4a2e1f;
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 8px 0;
}

.skip-link:focus {
  left: 0;
}

/* ── Header ── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  height: 100%;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

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

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

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

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 600;
  padding: 0.5rem 0.875rem;
  border-radius: 999px;
  transition: color 0.15s, background 0.15s;
}

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

.site-nav a[aria-current='page'] {
  color: #4a2e1f;
  background: var(--cream-deep);
}

/* ── Main layouts ── */

main {
  flex: 1;
}

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── Landing page ── */

.page-home {
  background: var(--bg);
}

.site-nav .nav-cta {
  color: #fff;
  background: #4a2e1f;
}

.site-nav .nav-cta:hover {
  color: #fff;
  background: #6b4a35;
}

/* Hero */

.hero {
  position: relative;
  overflow: hidden;
  padding: 2rem 0 4rem;
}

.hero-blob {
  position: absolute;
  border-radius: 50%;
  background: var(--bg-accent);
  pointer-events: none;
  opacity: 0.65;
}

.hero-blob--1 {
  width: 22rem;
  height: 22rem;
  top: -6rem;
  right: -5rem;
}

.hero-blob--2 {
  width: 16rem;
  height: 16rem;
  top: 8rem;
  left: -6rem;
  opacity: 0.45;
}

.hero-blob--3 {
  width: 10rem;
  height: 10rem;
  bottom: 2rem;
  right: 15%;
  opacity: 0.35;
}

.hero-inner {
  position: relative;
  display: flex;
  justify-content: center;
  padding: 1rem 0 2rem;
}

.hero-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 36rem;
}

.hero-illustration {
  width: min(100%, 20rem);
  height: auto;
  margin-bottom: 1.5rem;
  filter: drop-shadow(0 20px 40px rgba(74, 46, 31, 0.12));
  animation: float 5s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.hero-eyebrow {
  display: inline-block;
  margin: 0 0 0.75rem;
  padding: 0.35rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: var(--cream-deep);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.hero-copy h1 {
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 0 0 1rem;
  color: var(--text);
}

.hero-tagline {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-secondary);
  max-width: 26rem;
  margin: 0 auto 2rem;
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.btn-lg {
  padding: 0.9rem 1.75rem;
  font-size: 1rem;
}

.btn-secondary {
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.btn-secondary:hover {
  color: var(--text);
  background: var(--cream-deep);
  border-color: var(--border);
}

/* Sections */

.section {
  padding: 5rem 0;
}

.section-header {
  text-align: center;
  max-width: 36rem;
  margin: 0 auto 3rem;
}

.section-header h2 {
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
  color: var(--text);
}

.section-header p {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.6;
}

.features {
  background: color-mix(in srgb, var(--surface) 55%, var(--bg));
  border-block: 1px solid var(--border);
}

.feature-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.25rem;
}

.feature-card {
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.feature-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-bottom: 1rem;
  font-size: 1.35rem;
  background: var(--bg);
  border-radius: 12px;
}

.feature-card h3 {
  font-size: 1.0625rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: var(--text);
}

.feature-card p {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.55;
}

/* Plus */

.plus-card {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2rem;
  align-items: center;
  padding: 2.5rem;
  background: linear-gradient(145deg, #faf7f2 0%, #f5f0e8 45%, #ede4d6 100%);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius-lg) + 4px);
  color: #4a2e1f;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  position: relative;
}

@media (max-width: 768px) {
  .plus-card {
    grid-template-columns: 1fr;
    padding: 2rem 1.5rem;
    text-align: center;
  }
}

.plus-badge {
  display: inline-block;
  margin-bottom: 0.75rem;
  padding: 0.3rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6b5344;
  background: rgba(74, 46, 31, 0.08);
  border: 1px solid rgba(74, 46, 31, 0.12);
  border-radius: 999px;
}

.plus-copy h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  margin: 0 0 0.75rem;
  letter-spacing: -0.02em;
}

.plus-copy > p {
  margin: 0 0 1.25rem;
  font-weight: 600;
  line-height: 1.55;
  color: #6b5344;
}

.plus-list {
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 1rem;
  font-size: 0.9375rem;
  font-weight: 700;
}

@media (max-width: 768px) {
  .plus-list {
    grid-template-columns: 1fr;
    justify-items: center;
  }
}

.plus-list li::before {
  content: '✓ ';
  opacity: 0.85;
}

.plus-price {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #6b5344;
}

.plus-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 10rem;
}

.plus-orbit {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(74, 46, 31, 0.12);
}

.plus-orbit--1 {
  width: 9rem;
  height: 9rem;
}

.plus-orbit--2 {
  width: 12rem;
  height: 12rem;
  opacity: 0.5;
}

.plus-icon {
  position: relative;
  border-radius: 22px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

/* Download */

.download {
  padding-bottom: 6rem;
}

.download-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 2rem 3rem;
  padding: 2.5rem;
  background: linear-gradient(145deg, #ffffff 0%, #f5f0e8 55%, #ede4d6 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  color: #4a2e1f;
}

.download-hero {
  width: 12rem;
  height: auto;
  opacity: 0.95;
}

.download-copy {
  flex: 1;
  min-width: 16rem;
  max-width: 28rem;
  text-align: center;
}

@media (min-width: 640px) {
  .download-copy {
    text-align: left;
  }
}

.download-copy h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
  color: #4a2e1f;
}

.download-copy > p {
  margin: 0 0 1.5rem;
  font-weight: 600;
  color: #6b5344;
  line-height: 1.55;
}

.store-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

@media (min-width: 640px) {
  .store-buttons {
    justify-content: flex-start;
  }
}

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1.25rem 0.65rem 1rem;
  background: #1a1a1a;
  color: #ffffff;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.125rem;
  line-height: 1.2;
  transition: transform 0.15s, background 0.15s;
}

.store-badge svg {
  flex-shrink: 0;
  color: #ffffff;
}

.store-badge:hover {
  color: #ffffff;
  background: #333333;
  transform: translateY(-1px);
}

.store-badge small {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  opacity: 0.8;
  letter-spacing: 0.02em;
}

.download-note {
  margin: 1.25rem 0 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: #8b7355;
}

.download-note a {
  font-weight: 700;
  color: #4a2e1f;
}

/* Legal document layout */

.legal-page {
  padding: 2rem 0 4rem;
}

.legal-header {
  max-width: var(--prose);
  margin-bottom: 2rem;
}

.breadcrumb {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 1rem;
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--accent);
}

.breadcrumb span {
  margin: 0 0.35rem;
}

.legal-header h1 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-size: 0.875rem;
  color: var(--muted);
  font-weight: 500;
}

.legal-grid {
  display: grid;
  grid-template-columns: 14rem 1fr;
  gap: 3rem;
  align-items: start;
}

@media (max-width: 768px) {
  .legal-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

.toc {
  position: sticky;
  top: calc(var(--header-h) + 1.5rem);
}

@media (max-width: 768px) {
  .toc {
    position: static;
    margin-bottom: 1.5rem;
  }
}

.toc-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.125rem;
}

.toc-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.8125rem;
  font-weight: 600;
}

.toc li {
  margin: 0;
}

.toc a {
  display: block;
  padding: 0.35rem 0;
  color: var(--text-secondary);
  text-decoration: none;
  line-height: 1.35;
}

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

/* Prose */

.prose {
  max-width: var(--prose);
}

.prose > p.lead {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.prose h2 {
  font-size: 1.0625rem;
  font-weight: 700;
  margin: 2.5rem 0 0.75rem;
  padding-top: 0.5rem;
  scroll-margin-top: calc(var(--header-h) + 1rem);
  color: var(--text);
}

.prose h2:first-of-type {
  margin-top: 0;
}

.prose p,
.prose ul {
  margin: 0 0 1rem;
  color: var(--text-secondary);
}

.prose ul {
  padding-left: 1.25rem;
}

.prose li {
  margin-bottom: 0.4rem;
}

.prose strong {
  color: var(--text);
  font-weight: 700;
}

.prose a {
  font-weight: 600;
}

.callout {
  margin: 1.5rem 0 2rem;
  padding: 1rem 1.125rem;
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  border-radius: var(--radius);
  font-size: 0.9375rem;
  color: var(--warning-text);
  line-height: 1.55;
}

.callout strong {
  color: var(--warning-text);
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  margin-top: auto;
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--text);
}

.footer-brand img {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 6px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-copy {
  width: 100%;
  font-size: 0.8125rem;
  color: var(--muted);
  margin: 0.5rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* 404 */

.error-page {
  padding: 5rem 1.5rem;
  text-align: center;
}

.error-page h1 {
  font-size: 4rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: var(--accent);
  line-height: 1;
}

.error-page p {
  color: var(--muted);
  margin: 0 0 1.5rem;
}

.store-badge--pending {
  cursor: default;
  pointer-events: none;
  opacity: 0.9;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-family: var(--font);
  font-size: 0.9375rem;
  font-weight: 700;
  color: #fff;
  background: #4a2e1f;
  border: none;
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s;
}

.btn:hover {
  background: #6b4a35;
  color: #fff;
}

/* Print */

@media print {
  .site-header,
  .toc,
  .site-footer,
  .skip-link {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }

  .legal-grid {
    display: block;
  }

  .prose h2 {
    page-break-after: avoid;
  }

  a[href^='mailto:']::after {
    content: ' (' attr(href) ')';
    font-size: 0.85em;
  }
}
