/* 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 {
  --bg: #FDFBF7;
  --surface: #FFFFFF;
  --surface-variant: #EAE3D5;
  --text: #2C2F33;
  --muted: #6B6E73;
  --primary: #E05631;
  --primary-press: #C94A28;
  --on-primary: #FFFFFF;
  --secondary: #6A8F4A;
  --outline: #CFC6B6;
  --hairline: #E6DFD2;

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

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

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111112;
    --surface: #1C1D1F;
    --surface-variant: #2C2E33;
    --text: #FDFBF7;
    --muted: #B0AEAC;
    --primary: #EE6A43;
    --primary-press: #D85C37;
    --secondary: #7AA855;
    --outline: #45474C;
    --hairline: #2E3034;
    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; justify-content: space-between; height: 60px; gap: 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: 22px; height: 22px; border-radius: var(--r-sm); background: var(--primary); position: relative; }
.wordmark-mark::after {
  content: ''; position: absolute; left: 6px; top: 7px; width: 10px; height: 10px;
  border-top: 2px solid var(--on-primary); border-left: 2px solid var(--on-primary);
  transform: rotate(45deg); transform-origin: center;
}
.header-nav { display: flex; align-items: center; gap: 20px; font-size: 15px; font-weight: 500; }
.header-nav a:not(.btn) { text-decoration: none; color: var(--muted); }
.header-nav a:not(.btn):hover { color: var(--text); }

/* ---------- 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: 36px; 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-primary:disabled { cursor: default; opacity: 0.7; }
.btn-block { width: 100%; }

/* ---------- Hero ---------- */
.hero { padding: 56px 0 72px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: center; }
.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(34px, 5vw, 52px); font-weight: 700; }
.lede { margin-top: 20px; font-size: 18px; color: var(--muted); max-width: 34em; }
.fine-print { margin-top: 12px; font-size: 13px; color: var(--muted); }

.store-buttons { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.store-buttons-center { justify-content: center; }
.store-btn {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 52px; padding: 8px 16px;
  background: var(--text); color: var(--bg);
  border-radius: var(--r-md); text-decoration: none;
  transition: transform 90ms ease-out;
}
.store-btn:active { transform: scale(0.97); }
.store-btn svg { width: 22px; height: 22px; fill: currentColor; flex: none; }
.store-btn span { display: flex; flex-direction: column; font-weight: 600; font-size: 16px; line-height: 1.15; }
.store-btn small { font-weight: 400; font-size: 11px; opacity: 0.8; }
.store-btn[aria-disabled="true"] { cursor: default; }

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

.icon-btn {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; 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: 10px; 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: 32px; padding: 0 11px; cursor: pointer;
  font: inherit; font-size: 13px; 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));
}
.pro-badge {
  font-size: 10px; font-weight: 700; letter-spacing: 0.06em; color: var(--primary);
  padding: 1px 5px; border: 1px solid var(--primary); border-radius: var(--r-xs);
}

.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); }
/* Soft fade at the reel's top and bottom edges: flat colour, no shadow. */
.reel::before, .reel::after {
  content: ''; position: absolute; left: 0; right: 0; height: 28px; 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: 10px; padding: 16px 20px;
}
.reel-item .cat { font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--secondary); }
.reel-item .title { font-size: 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: 8px; 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); }
/* Details only show once the reel has landed. */
.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; }

/* ---------- Sections ---------- */
.section { padding: 72px 0; border-top: 1px solid var(--hairline); }
.section-muted { background: var(--surface-variant); border-top: 0; }
.section-title { font-size: clamp(26px, 3.5vw, 34px); font-weight: 700; margin-bottom: 32px; }

.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.feature {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  padding: 20px;
}
.feature-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; margin-bottom: 16px;
  border: 1px solid var(--outline); border-radius: var(--r-sm);
  color: var(--primary); font-size: 18px;
}
.feature h3 { font-size: 17px; font-weight: 600; margin-bottom: 8px; }
.feature p { font-size: 15px; color: var(--muted); }

/* Venture+ */
.section-lede { margin-top: -20px; margin-bottom: 36px; font-size: 17px; color: var(--muted); max-width: 40em; }
.subhead { font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--secondary); }
.subhead-note { margin-top: 6px; margin-bottom: 16px; font-size: 15px; color: var(--muted); }
#venture-plus .feature { display: flex; flex-direction: column; }
#venture-plus .feature p { flex: 1; }
.pack-count { margin-top: 12px; font-size: 13px; font-weight: 600; color: var(--secondary); }
#venture-plus .subhead + .perk-list { margin-top: 12px; }
#venture-plus .feature-grid + .subhead { margin-top: 36px; }
.perk-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.perk-list li {
  background: var(--surface); border: 1px solid var(--outline); border-radius: var(--r-sm);
  padding: 8px 14px; font-weight: 500; font-size: 15px;
}

.promise { text-align: center; }
.promise .section-title { margin-bottom: 20px; }
.promise-list { list-style: none; padding: 0; margin: 0; display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }
.promise-list li {
  background: var(--surface); border: 1px solid var(--outline); border-radius: var(--r-sm);
  padding: 10px 16px; font-weight: 500; font-size: 15px;
}

.cta-inner { text-align: center; }
.cta-inner .section-title { margin-bottom: 12px; }
.cta-inner > p { color: var(--muted); font-size: 17px; }

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

/* ---------- Legal pages ---------- */
.legal { padding: 48px 0 72px; }
.legal .container { max-width: 760px; }
.legal h1 { font-size: 34px; margin-bottom: 16px; }
.legal h2 { font-size: 20px; color: var(--primary); margin: 36px 0 10px; }
.legal h3 { font-size: 17px; margin: 22px 0 6px; }
.legal p, .legal li { color: var(--text); }
.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-block; margin-bottom: 24px; font-size: 14px; color: var(--muted); text-decoration: none; }
.back-link:hover { color: var(--text); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  /* Mobile hero: the wheel fills the first screen; scrolling reveals the
     pitch, then the store buttons. Visual order only; the DOM keeps the h1
     first for screen readers. */
  .hero { padding-top: 12px; }
  .hero-grid { display: flex; flex-direction: column; gap: 0; }
  .hero-copy { display: contents; }
  .wheel-card {
    order: -1;
    display: flex; flex-direction: column;
    /* Screen minus the 60px header, its 1px border and the 12px gaps. svh
       stays put when the mobile URL bar collapses, so nothing jumps. */
    height: calc(100vh - 85px);
    height: calc(100svh - 85px);
    min-height: 520px;
  }
  /* The reel takes all spare height and stays exactly one quest tall. */
  .reel { flex: 1 1 0; height: auto; min-height: var(--reel-item); container-type: size; }
  .reel-item { height: 100cqh; }
  .wheel-card { padding: 16px; }
  .filter-group { gap: 4px; }
  .pill { flex: 1 1 auto; padding: 0 6px; }
  .reel-item .title { font-size: 26px; }
  .reel-item .desc { font-size: 15px; }
  .eyebrow { margin-top: 48px; align-self: flex-start; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  :root { --reel-item: 208px; }
  .hero { padding: 12px 0 56px; }
  .section { padding: 56px 0; }
  .feature-grid { grid-template-columns: 1fr; }
  .header-nav a:not(.btn) { display: none; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

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