/* SideVenture landing — Rustic Charm
   Flat surfaces, 1px hairlines, earth tones, max 8px radius, no shadows.
   Colors mirror lib/shared/theme/app_colors.dart + app_theme.dart. */

/* Inter (SIL OFL 1.1, see fonts/OFL.txt), self-hosted: no requests to
   third-party font servers, so visitors' IPs are not shared with anyone. */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Rustic Cream */
  --bg: #FFFCF2;
  --surface: #FFFEFA;
  --surface-variant: #EFEADF;
  --text: #252422;
  --muted: #6B665E;
  --primary: #B64B27;
  --primary-press: #9E3F1F;
  --on-primary: #FFFFFF;
  --secondary: #226F54;
  --outline: #CCC5B9;
  --hairline: #E4DED2;

  --r-xs: 2px;
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 6px;

  --reel-item: 224px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Rustic Ember */
    --bg: #252422;
    --surface: #2E2C29;
    --surface-variant: #38352F;
    --text: #FFFCF2;
    --muted: #B8B2A7;
    --primary: #EB5E28;
    --primary-press: #D4531F;
    --on-primary: #252422;
    --secondary: #4FA884;
    --outline: #55514C;
    --hairline: #403D39;
    color-scheme: dark;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -0.02em; }
p { margin: 0; }
a { color: inherit; }

.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }

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

.skip-link {
  position: absolute; left: 16px; top: -48px;
  background: var(--surface); border: 1px solid var(--outline);
  padding: 8px 12px; border-radius: var(--r-sm); z-index: 10;
}
.skip-link:focus { top: 12px; }

.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;
}

/* ---------- Header ---------- */
.site-header { border-bottom: 1px solid var(--hairline); background: var(--bg); }
.header-inner { display: flex; align-items: center; flex-wrap: wrap; min-height: 60px; gap: 0 16px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; text-decoration: none; letter-spacing: -0.01em; }
.wordmark-mark { width: 26px; height: 26px; background: url('/brand/logo-mark.svg') center / contain no-repeat; }
@media (prefers-color-scheme: dark) {
  .wordmark-mark { background-image: url('/brand/logo-mark-dark.svg'); }
}
.header-nav { order: 1; margin-left: auto; display: flex; align-items: center; gap: 4px; font-size: 15px; font-weight: 500; }
.header-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; text-decoration: none; color: var(--muted); }
.header-nav a:hover { color: var(--text); }
.header-cta { order: 2; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px;
  font: 600 15px/1 var(--font); letter-spacing: 0.01em;
  border: 1px solid transparent; border-radius: var(--r-sm);
  cursor: pointer; text-decoration: none;
  transition: transform 90ms ease-out, background-color 150ms ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn-small { min-height: 44px; padding: 0 14px; font-size: 14px; border-color: var(--outline); background: var(--surface); }
.btn-small:hover { border-color: var(--text); }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover:not(:disabled) { background: var(--primary-press); }
.btn-outline { border-color: var(--outline); background: var(--surface); color: var(--text); }
.btn-outline:hover { border-color: var(--text); }
.btn-primary:disabled { cursor: default; opacity: 0.7; }
.btn-block { width: 100%; }

/* ---------- Hero ---------- */
.hero { padding: 56px 0 24px; }
.eyebrow {
  display: inline-block; font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--secondary); margin-bottom: 16px;
}
.hero h1 { font-size: clamp(32px, 6vw, 56px); font-weight: 700; }
.lede { margin-top: 20px; font-size: clamp(16px, 2.4vw, 19px); color: var(--muted); max-width: 36em; }
.fine-print { margin-top: 16px; font-size: 13px; color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-actions-center { justify-content: center; }

/* ---------- Compass ---------- */
.wheel-card {
  max-width: 640px; margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: 20px;
}
.wheel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.wheel-head h2 { font-size: 18px; font-weight: 600; }
.wheel-count { font-size: 13px; color: var(--muted); }

.icon-btn {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0; cursor: pointer;
  background: transparent; color: var(--muted);
  border: 1px solid var(--hairline); border-radius: var(--r-sm);
}
.icon-btn:hover { color: var(--text); border-color: var(--outline); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn path { fill: currentColor; }
.icon-btn path.wave { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.icon-btn .icon-off, .icon-btn.is-muted .icon-on { display: none; }
.icon-btn.is-muted .icon-off { display: block; }

.filters { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.filter-group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.filter-label {
  flex-basis: 100%; display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
}
.pill {
  min-height: 44px; padding: 0 12px; cursor: pointer;
  font: inherit; font-size: 14px; color: var(--muted);
  background: var(--bg); border: 1px solid var(--hairline); border-radius: var(--r-sm);
  transition: border-color 150ms ease, color 150ms ease, background-color 150ms ease;
}
.pill:hover { color: var(--text); }
.pill[aria-pressed="true"] {
  color: var(--primary); font-weight: 600;
  border-color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, var(--bg));
}
.reel {
  position: relative;
  /* content-box: the 1px border must not shrink the viewport below one item,
     or every item scrolled past drifts the landing position. */
  box-sizing: content-box;
  height: var(--reel-item);
  overflow: hidden;
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  background: var(--bg);
  margin-bottom: 16px;
  transition: border-color 200ms ease;
}
.reel.is-spinning { border-color: var(--primary); }
.reel::before, .reel::after {
  content: ''; position: absolute; left: 0; right: 0; height: 24px; z-index: 1; pointer-events: none;
}
.reel::before { top: 0; background: linear-gradient(var(--bg), transparent); }
.reel::after { bottom: 0; background: linear-gradient(transparent, var(--bg)); }

.reel-strip { will-change: transform; }
.reel-item {
  height: var(--reel-item);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 8px; padding: 14px 16px;
}
.reel-item .title { font-size: clamp(19px, 5vw, 22px); font-weight: 700; letter-spacing: -0.01em; }
.reel-item .desc { font-size: 14px; color: var(--muted); max-width: 30em; }
.reel-item .tags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.tag {
  font-size: 12px; font-weight: 600; padding: 3px 8px;
  border-radius: var(--r-xs); border: 1px solid var(--outline); color: var(--muted);
}
.tag-xp { border-color: var(--secondary); color: var(--secondary); }
.reel-item .desc, .reel-item .tags { opacity: 0; transition: opacity 200ms ease; }
.reel-item.is-landed .desc, .reel-item.is-landed .tags { opacity: 1; }

.wheel-hint { margin-top: 10px; font-size: 13px; color: var(--muted); text-align: center; min-height: 1.4em; }
.wheel-cta { margin: 10px 0 0; font-size: 14px; line-height: 1.4; text-align: center; }
.wheel-cta a { display: inline-block; padding: 12px 4px; color: var(--primary); font-weight: 600; text-decoration: none; }
.wheel-cta a:hover { text-decoration: underline; }
.wheel-cta.is-hot { padding: 4px 12px; border: 1px solid var(--primary); border-radius: var(--r-md); background: var(--surface-variant); }

/* ---------- Domain pigments (Thought Cabinet): mineral, light tint, dark tint ---------- */
.dom-outdoor  { --dom: #226F54; --dom-tint: #E8F2EC; }
.dom-learning { --dom: #2A586D; --dom-tint: #E6F0F5; }
.dom-health   { --dom: #B64B27; --dom-tint: #FAECE6; }
.dom-food     { --dom: #C2842E; --dom-tint: #FAF3E6; }
.dom-social   { --dom: #8E4138; --dom-tint: #F7EBE8; }
.dom-shelter  { --dom: #403D39; --dom-tint: #ECEBE8; }
@media (prefers-color-scheme: dark) {
  .dom-outdoor  { --dom-tint: #15382B; }
  .dom-learning { --dom-tint: #18333F; }
  .dom-health   { --dom-tint: #481818; }
  .dom-food     { --dom-tint: #3B280E; }
  .dom-social   { --dom-tint: #3A1A16; }
  .dom-shelter  { --dom-tint: #1E1D1B; }
}
.dom-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 4px 8px; color: var(--text);
  background: var(--dom-tint); border: 1px solid var(--dom); border-radius: var(--r-xs);
}
.dom-badge::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--dom); flex: none; }

/* ---------- Sections ---------- */
.section { padding: 64px 0; border-top: 1px solid var(--hairline); }
.hero + .section { border-top: 0; }
.section-title { font-size: clamp(24px, 4vw, 34px); font-weight: 700; margin-bottom: 24px; }
.section-lede { margin-top: -8px; margin-bottom: 28px; font-size: clamp(16px, 2.2vw, 17px); color: var(--muted); max-width: 40em; }

.domain-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.domain {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--dom-tint); border: 1px solid var(--dom); border-radius: var(--r-md); padding: 18px;
}
.domain h3 { font-size: 17px; font-weight: 700; }
.domain p { flex: 1; font-size: 15px; color: var(--muted); }
.domain-count { font-size: 13px; font-weight: 700; color: var(--text); }
.filter-notes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 12px; }

.feature-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.feature {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  padding: 20px;
}
.feature h3 { font-size: 17px; font-weight: 600; margin-bottom: 8px; }
.feature p { font-size: 15px; color: var(--muted); }

.faq { max-width: 720px; }
.faq details { background: var(--surface); border: 1px solid var(--outline); border-radius: var(--r-sm); margin-bottom: 10px; }
.faq summary { padding: 12px 16px; min-height: 44px; font-weight: 600; cursor: pointer; }
.faq summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.faq details p { padding: 0 16px 14px; color: var(--muted); }

.cta { background: var(--surface-variant); }
.cta-inner { text-align: center; }
.cta-inner .section-title { margin-bottom: 12px; }
.cta-inner > p { color: var(--muted); font-size: 17px; }
.badge-list { list-style: none; padding: 0; margin: 24px 0 0; display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }
.badge {
  display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px;
  background: var(--surface); border: 1px solid var(--secondary); border-radius: var(--r-sm);
  padding: 10px 16px; font-size: 14px; text-align: left;
}
.badge strong { font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--secondary); }
.badge-soon { border-color: var(--outline); }
.badge-soon strong { color: var(--muted); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--hairline); padding: 24px 0; font-size: 14px; color: var(--muted); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; }
.site-footer nav { display: flex; gap: 4px 8px; flex-wrap: wrap; }
.site-footer nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px; text-decoration: none; }
.site-footer a:hover { color: var(--text); text-decoration: underline; }

/* ---------- Legal pages ---------- */
.legal { padding: 32px 0 64px; }
.legal .container { max-width: 760px; }
.legal h1 { font-size: clamp(28px, 6vw, 34px); margin-bottom: 16px; }
.legal h2 { font-size: 20px; color: var(--primary); margin: 32px 0 10px; }
.legal h3 { font-size: 17px; margin: 22px 0 6px; }
.legal p, .legal li { color: var(--text); overflow-wrap: anywhere; }
.legal p + p { margin-top: 12px; }
.legal ul { padding-left: 22px; }
.legal li { margin: 6px 0; }
.legal table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 14px; border: 1px solid var(--hairline); }
.legal th, .legal td { text-align: left; padding: 10px 12px; border: 1px solid var(--hairline); vertical-align: top; overflow-wrap: anywhere; }
.legal th { background: var(--surface-variant); font-weight: 600; }
.legal .table-wrap { overflow-x: auto; }
.back-link { display: inline-flex; align-items: center; min-height: 44px; margin-bottom: 12px; font-size: 14px; color: var(--muted); text-decoration: none; }
.back-link:hover { color: var(--text); }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .hero { padding-top: 32px; }
  .section { padding: 48px 0; }
  .domain-grid, .feature-grid, .filter-notes { grid-template-columns: 1fr; }
  .wheel-card { padding: 16px; }
  .pill { flex: 1 1 auto; padding: 0 8px; }
  .hero-actions .btn { flex: 1 1 100%; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 640px) {
  .header-cta { margin-left: auto; }
  .header-nav { order: 3; flex-basis: 100%; margin-left: 0; overflow-x: auto; border-top: 1px solid var(--hairline); }
}
@media (max-width: 400px) {
  :root { --reel-item: 252px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .reel, .reel-item .desc, .reel-item .tags { transition: none; }
}

/* ---------- Field-guide finish: paper grain, mono index tags, uneven layout ---------- */
:root { --mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, 'Liberation Mono', monospace; }

/* Paper grain over every surface. Noise comes from an inline SVG filter (no request). */
body::before {
  content: ''; position: fixed; inset: 0; z-index: 50; pointer-events: none; opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1.4 -.2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) {
  body::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 .99 0 0 0 0 .95 0 0 0 1.4 -.2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  }
}

.idx {
  display: inline-block; margin-bottom: 10px;
  font: 600 11px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
}
.domain .idx { color: var(--text); opacity: 0.7; margin-bottom: 0; }
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; }

/* Left-aligned heading column beside the content, instead of a centred stack. */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 40px; align-items: start; }
.split-head { position: sticky; top: 16px; }
.split-head .section-title { margin-bottom: 16px; }
.split-head .section-lede { margin: 0; }
.domain-grid { grid-template-columns: repeat(2, 1fr); }
.domain-grid .domain:first-child, .domain-grid .domain:last-child { grid-column: span 2; }

.systems-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 12px; }
.systems-grid .feature:nth-child(1), .systems-grid .feature:nth-child(4) { grid-column: span 7; }
.systems-grid .feature:nth-child(2), .systems-grid .feature:nth-child(3) { grid-column: span 5; }
.feature .idx { margin-bottom: 14px; }

@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; gap: 24px; }
  .split-head { position: static; }
}
@media (max-width: 768px) {
  .domain-grid { grid-template-columns: 1fr; }
  .domain-grid .domain:first-child, .domain-grid .domain:last-child { grid-column: auto; }
  .systems-grid { grid-template-columns: 1fr; }
  .systems-grid .feature:nth-child(n) { grid-column: auto; }
}
