/* Seasonal — design tokens
   Background : deep ink #0C1018 (near-black, cool tint)
   Warm scale : #F59E5B -> #F2654C  (high season / markup)
   Cool scale : #5FA8D3 -> #3E5C76  (low season / markdown)
   Neutral    : #8B93A1
   Display    : Archivo (variable width grotesque)
   Data       : JetBrains Mono */

:root {
  --bg: #0C1018;
  --panel: #131927;
  --panel-2: #1A2233;
  --line: #232C40;
  --text: #E8ECF3;
  --muted: #8B93A1;
  --warm: #F59E5B;
  --warm-2: #F2654C;
  --cool: #5FA8D3;
  --cool-2: #3E5C76;
  --ok: #7BC47F;
}

* { box-sizing: border-box; margin: 0; }
/* The app toggles sections via the `hidden` attribute; keep it authoritative
   over rules like `#processing { display: grid }`. */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg); color: var(--text);
  font-family: 'Archivo', system-ui, sans-serif;
  font-variation-settings: 'wdth' 100;
  line-height: 1.55; min-height: 100vh;
}
.mono { font-family: 'JetBrains Mono', monospace; }

nav {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.1rem clamp(1rem, 4vw, 3rem);
}
.logo {
  font-weight: 800; letter-spacing: .35em; font-size: .85rem;
  font-variation-settings: 'wdth' 125;
  background: linear-gradient(90deg, var(--cool), var(--warm));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- Landing ---------- */
.hero { max-width: 760px; margin: 0 auto; padding: clamp(2rem,7vh,5rem) 1.25rem 2rem; text-align: center; }
h1 {
  font-size: clamp(2.6rem, 8vw, 5rem); line-height: .95; font-weight: 800;
  font-variation-settings: 'wdth' 118; letter-spacing: -.02em;
  margin-bottom: 1rem;
}
.sub { color: var(--muted); font-size: 1.05rem; max-width: 540px; margin: 0 auto 2.2rem; }

.dropzone {
  border: 1.5px dashed var(--line); border-radius: 16px;
  background: var(--panel); padding: 2.2rem 1.5rem; cursor: pointer;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.dropzone:hover, .dropzone:focus-visible, .dropzone.drag {
  border-color: var(--warm); transform: translateY(-2px);
  box-shadow: 0 8px 40px -18px rgba(245,158,91,.45); outline: none;
}
.dz-inner { display: flex; flex-direction: column; align-items: center; gap: .6rem; color: var(--muted); }
.dz-inner strong { color: var(--text); font-size: 1.05rem; }
.dz-inner span { font-size: .85rem; }

.btn {
  font: inherit; font-weight: 600; border-radius: 10px; cursor: pointer;
  padding: .65rem 1.3rem; border: 1px solid var(--line);
  background: transparent; color: var(--text); transition: all .15s;
}
.btn.primary {
  background: linear-gradient(90deg, var(--warm), var(--warm-2));
  border: none; color: #14100C;
}
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost:hover { border-color: var(--muted); }
.btn:disabled { opacity: .6; cursor: default; }
.nav-actions { display: flex; gap: .6rem; flex-wrap: wrap; }

.tiny { color: var(--muted); font-size: .78rem; margin-top: .9rem; }
.tiny em { color: var(--cool); font-style: normal; }
.sample-cta { margin-top: 1.4rem; }

/* Guided tour */
.tour-spot {
  position: relative; z-index: 10001; border-radius: 14px;
  box-shadow: 0 0 0 3px var(--warm), 0 0 0 9999px rgba(8,11,18,.62);
  transition: box-shadow .2s ease;
}
.tour-card {
  position: fixed; z-index: 10002; width: min(320px, 92vw);
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 1rem 1.1rem; box-shadow: 0 20px 60px -20px rgba(0,0,0,.7);
}
.tour-title { font-weight: 700; font-size: 1rem; margin-bottom: .35rem; }
.tour-body { color: var(--muted); font-size: .85rem; line-height: 1.5; }
.tour-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: .9rem; }
.tour-dots { display: flex; gap: .3rem; }
.tour-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); display: inline-block; }
.tour-dots i.on { background: var(--warm); }
.tour-btns { display: flex; gap: .4rem; }
.tour-btns button { font: 600 .78rem 'JetBrains Mono'; border-radius: 8px; padding: .35rem .7rem;
  cursor: pointer; border: 1px solid var(--line); background: transparent; color: var(--muted); }
.tour-btns .tour-next { background: linear-gradient(90deg, var(--warm), var(--warm-2)); color: #14100C; border: none; }
.tour-btns button:hover { filter: brightness(1.08); }
@media (prefers-reduced-motion: reduce) { .tour-spot { transition: none; } }

.steps {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr));
  gap: 1rem; max-width: 860px; margin: 3.5rem auto 4rem; padding: 0 1.25rem;
}
.step { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 1.2rem; }
.step-k { font-size: .72rem; letter-spacing: .25em; color: var(--warm); }
.step p { color: var(--muted); font-size: .88rem; margin-top: .5rem; }

/* ---------- Landing: Seasonal Terrain (WebGL) ---------- */
#landing { position: relative; overflow: hidden; }
#landing nav, #landing .hero, #landing .steps { position: relative; z-index: 1; }
#landing .hero { min-height: 84vh; display: flex; flex-direction: column; justify-content: center; }
.hero-terrain {
  position: absolute; top: 0; left: 0; right: 0; height: 100vh; z-index: 0;
  pointer-events: none; overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 58%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 58%, transparent 100%);
}
.hero-terrain canvas { display: block; width: 100%; height: 100%; }
.hero-terrain.fallback { background:
  radial-gradient(120% 90% at 22% 18%, rgba(245,158,91,.20), transparent 52%),
  radial-gradient(120% 90% at 82% 26%, rgba(95,168,211,.18), transparent 56%); }
.hero-terrain.fallback canvas { display: none; }
.terrain-months {
  position: absolute; bottom: 13vh; left: 0; right: 0;
  display: flex; justify-content: space-between; padding: 0 max(6vw, 1rem);
  color: var(--muted); font-size: .6rem; letter-spacing: .15em; opacity: .55;
}
@media (max-width: 760px) {
  .terrain-months { display: none; }
  #landing .hero { min-height: auto; }
}

/* ---------- Processing ---------- */
#processing { display: grid; place-items: center; min-height: 70vh; }
.proc-card { text-align: center; color: var(--muted); }
.wave { display: flex; gap: 5px; justify-content: center; align-items: flex-end; height: 64px; margin-bottom: 1.2rem; }
.wave span {
  width: 9px; border-radius: 4px;
  background: linear-gradient(180deg, var(--warm), var(--cool-2));
  animation: rise 1.4s ease-in-out infinite;
}
.wave span:nth-child(odd) { animation-delay: .15s; }
.wave span:nth-child(3n) { animation-delay: .3s; }
.wave span:nth-child(4n) { animation-delay: .45s; }
@keyframes rise { 0%,100% { height: 14px } 50% { height: 58px } }
@media (prefers-reduced-motion: reduce) {
  .wave span { animation: none; height: 32px; }
  * { transition: none !important; }
}

/* Upload progress bar */
.progress {
  width: min(360px, 80vw); height: 8px; margin: 1.1rem auto .5rem;
  background: var(--panel-2); border-radius: 999px; overflow: hidden;
}
.progress .bar {
  position: relative; height: 100%; width: 0; border-radius: 999px; overflow: hidden;
  background: linear-gradient(90deg, var(--warm), var(--warm-2));
  transition: width .25s ease;
}
.progress .bar::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.4), transparent);
  transform: translateX(-100%); animation: shimmer 1.3s ease-in-out infinite;
}
@keyframes shimmer { 100% { transform: translateX(100%); } }
.progress-pct { font-size: .72rem; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .progress .bar::after { animation: none; display: none; } }

/* ---------- Dashboard ---------- */
#dashboard { padding-bottom: 3rem; }
.banner {
  margin: 0 clamp(1rem,4vw,3rem) 1rem; padding: .7rem 1rem; border-radius: 10px;
  background: rgba(245,158,91,.1); border: 1px solid rgba(245,158,91,.35);
  color: var(--warm); font-size: .85rem;
}
.banner.info { background: rgba(95,168,211,.1); border-color: rgba(95,168,211,.35); color: var(--cool); }

.kpis {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr));
  gap: .8rem; padding: 0 clamp(1rem,4vw,3rem) 1rem;
}
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.1rem; }
.kpi .v { font-family: 'JetBrains Mono'; font-size: 1.75rem; font-weight: 600; line-height: 1.1; }
.kpi .l { color: var(--muted); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; margin-top: .25rem; }

/* Overview header + insight callout */
.dash-head { padding: 0 clamp(1rem,4vw,3rem) .5rem; }
.dash-title { font-size: clamp(1.6rem,4vw,2.1rem); line-height: 1.05; letter-spacing: -.01em; }
.dash-sub { color: var(--muted); font-size: .82rem; margin-top: .25rem; font-family: 'JetBrains Mono'; }
.insight {
  margin: 0 clamp(1rem,4vw,3rem) 1.3rem; padding: 1.1rem 1.3rem; border-radius: 14px;
  background: linear-gradient(120deg, rgba(245,158,91,.10), rgba(95,168,211,.07));
  border: 1px solid var(--line);
}
.insight-lead { font-size: 1.06rem; line-height: 1.5; }
.insight-lead b { color: var(--text); font-weight: 700; }
.insight .chips { margin-top: .8rem; }
.chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.chip { font: 600 .74rem 'JetBrains Mono'; padding: .3rem .65rem; border-radius: 999px; white-space: nowrap; }
.chip.markup { background: rgba(242,101,76,.16); color: var(--warm); border: 1px solid rgba(242,101,76,.4); }
.chip.markdown { background: rgba(95,168,211,.15); color: var(--cool); border: 1px solid rgba(95,168,211,.4); }
.chip.flat { background: rgba(139,147,161,.14); color: var(--muted); border: 1px solid var(--line); }

/* Seasonal rhythm strip */
.strip { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; }
.strip-col { display: flex; flex-direction: column; align-items: center; gap: .35rem; }
.strip-val { font-size: .62rem; color: var(--muted); }
.strip-track { position: relative; width: 100%; height: 104px; display: flex; align-items: flex-end;
  background: var(--panel-2); border-radius: 7px; overflow: hidden; }
.strip-bar { width: 100%; border-radius: 7px 7px 0 0; transition: height .35s ease; }
.strip-base { position: absolute; left: 0; right: 0; border-top: 1px dashed rgba(139,147,161,.45); }
.strip-m { font-size: .64rem; color: var(--muted); }
.month-detail { margin-top: .85rem; background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 10px; padding: .7rem .9rem; font-size: .85rem; line-height: 1.55; color: var(--text); }
.month-detail b { color: var(--text); }
.strip-col[role="button"] { cursor: pointer; }
.strip-col[role="button"]:hover .strip-track { outline: 1px solid var(--line); outline-offset: 1px; }
.strip-col.sel .strip-track { outline: 2px solid var(--text); outline-offset: 1px; }
.strip-col:focus-visible { outline: none; }
.strip-col:focus-visible .strip-track { outline: 2px solid var(--cool); outline-offset: 1px; }
@media (max-width: 560px) { .strip { grid-template-columns: repeat(6, 1fr); row-gap: 1rem; } }

.grid {
  display: flex; flex-direction: column; gap: 1rem;
  padding: 0 clamp(1rem,4vw,3rem);
}
.contents { display: contents; }
.section-label { color: var(--muted); font-size: .72rem; letter-spacing: .2em; text-transform: uppercase;
  margin: 1rem 0 -.1rem .15rem; font-family: 'JetBrains Mono'; }
.section-label:first-child { margin-top: 0; }
.prod-count { color: var(--muted); font-weight: 400; font-size: .72rem; margin-left: .5rem; }
/* Category pricing rows */
.catrow { border-top: 1px solid var(--line); padding: .85rem 0; }
.catrow:first-child { border-top: none; padding-top: .2rem; }
.catrow-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.row-top { display: grid; grid-template-columns: 2fr 1fr; gap: 1rem; align-items: stretch; }
.stat-stack { display: flex; flex-direction: column; gap: 1rem; }
.card.stat { justify-content: center; }
.stat-k { color: var(--muted); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
.stat-v { font: 700 1.5rem 'JetBrains Mono'; margin-top: .35rem; line-height: 1.12; }
.stat-sub { color: var(--muted); font-size: .72rem; margin-top: .4rem; line-height: 1.45; }
.trend-growing { color: var(--ok); } .trend-declining { color: var(--warm-2); } .trend-flat { color: var(--cool); }
.dq-row { display: flex; justify-content: space-between; gap: 1rem; font-size: .8rem; padding: .22rem 0; }
.dq-row span { color: var(--muted); } .dq-row b { color: var(--text); }
@media (max-width: 900px) { .row-top { grid-template-columns: 1fr; } }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 1.2rem 1.3rem; }
.span2 { grid-column: span 2; }
.card h2 { font-size: 1rem; font-weight: 700; margin-bottom: .9rem; letter-spacing: .01em; }
.hint { color: var(--muted); font-weight: 400; font-size: .78rem; margin-left: .4rem; }
.card-bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.card-bar h2 { margin-bottom: .9rem; }
.card-note { color: var(--muted); font-size: .76rem; line-height: 1.5; margin-top: .85rem; }

/* Segmented toggle (Over time / Year over year) */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { background: transparent; color: var(--muted); border: none; cursor: pointer;
  font: 600 .72rem 'JetBrains Mono'; padding: .35rem .7rem; }
.seg button.on { background: var(--panel-2); color: var(--text); }

/* Sort control */
.ctl { color: var(--muted); font-size: .72rem; display: inline-flex; align-items: center; gap: .45rem; }
.ctl select { background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 7px; padding: .3rem .5rem; font: 600 .75rem 'JetBrains Mono'; cursor: pointer; }
@media (max-width: 760px) { .grid { grid-template-columns: 1fr; } .span2 { grid-column: span 1; } }

/* Heatmap */
.heat-scroll { overflow-x: auto; }
.heat { border-collapse: separate; border-spacing: 3px; width: 100%; min-width: 640px; }
.heat th { font: 600 .68rem 'JetBrains Mono'; color: var(--muted); padding: .2rem .3rem; text-align: center; }
.heat td.rowh { font-size: .78rem; color: var(--text); padding-right: .6rem; white-space: nowrap; text-align: right; }
.heat td.cell { border-radius: 6px; height: 38px; min-width: 52px; text-align: center;
  font: 700 .66rem 'JetBrains Mono'; cursor: default; }
.heat td.cell.empty { background: var(--panel-2); }
.legend { display: flex; gap: 1.2rem; margin-top: .7rem; color: var(--muted); font-size: .7rem; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }
.sw.warm { background: var(--warm-2); } .sw.mid { background: #4A5468; } .sw.cool { background: var(--cool); }

/* Product pricing windows — cards in a responsive grid (2-up on wide screens) */
#prodList { display: grid; grid-template-columns: repeat(auto-fill, minmax(430px, 1fr)); gap: .9rem; }
.prod { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.1rem; }
@media (max-width: 520px) { #prodList { grid-template-columns: 1fr; } }
.prod-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: .8rem; }
.prod-right { display: flex; flex-direction: column; align-items: flex-end; gap: .45rem; }
.spark { display: block; opacity: .8; }
.meta .up { color: var(--ok); }
.prod-filter { background: rgba(95,168,211,.1); border: 1px solid rgba(95,168,211,.3); color: var(--cool);
  border-radius: 10px; padding: .55rem .8rem; font-size: .82rem; margin-bottom: .7rem; }
.linklike { background: none; border: none; color: var(--warm); cursor: pointer; font: inherit; text-decoration: underline; padding: 0; }
.prod .name { font-weight: 700; font-size: 1.02rem; }
.prod .meta { color: var(--muted); font-size: .8rem; margin-top: .2rem; font-family: 'JetBrains Mono'; }
.conf { font: 700 .6rem 'JetBrains Mono'; padding: .15rem .5rem; border-radius: 99px; margin-left: .55rem; vertical-align: 2px; }
.conf.high { background: rgba(123,196,127,.15); color: var(--ok); }
.conf.medium { background: rgba(245,158,91,.15); color: var(--warm); }
.conf.low { background: rgba(139,147,161,.15); color: var(--muted); }
.cal { display: grid; grid-template-columns: repeat(12, 1fr); gap: 5px; }
.cal .m {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: 7px; padding: .45rem 0; min-height: 46px;
  font: 700 .62rem 'JetBrains Mono';
}
.cal .m small { font-size: .82rem; font-weight: 700; margin-top: .12rem; }
.action { color: var(--muted); font-size: .85rem; margin-top: .8rem; }
.action b { color: var(--text); }
.lowconf { color: var(--warm); font-size: .78rem; margin-top: .5rem; line-height: 1.45; }
@media (max-width: 560px) { .cal { grid-template-columns: repeat(6, 1fr); } }

/* Expandable price-sensitivity panel */
details.ps { margin-top: .8rem; border-top: 1px dashed var(--line); padding-top: .6rem; }
details.ps summary { cursor: pointer; color: var(--cool); font: 600 .78rem 'JetBrains Mono'; list-style: none; }
details.ps summary::-webkit-details-marker { display: none; }
details.ps summary::before { content: "▸ "; }
details.ps[open] summary::before { content: "▾ "; }
.ps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .5rem; margin-top: .7rem; }
.ps-grid div { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: .5rem .7rem; display: flex; flex-direction: column; gap: .2rem; }
.ps-grid span { color: var(--muted); font-size: .66rem; }
.ps-grid b { font-size: 1rem; color: var(--text); }
.ps-caveat { color: var(--muted); font-size: .72rem; line-height: 1.5; margin-top: .55rem; }

.ai-out { margin-top: 1rem; background: var(--panel-2); border-radius: 10px; padding: 1rem 1.2rem; font-size: .9rem; white-space: pre-wrap; }
.muted { color: var(--muted); font-size: .88rem; margin-bottom: .8rem; }
footer { text-align: center; padding: 2rem 1.25rem 0; }
footer a { color: var(--cool); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ---------- Static content pages (about / faq / privacy / terms) ---------- */
.logo-link { text-decoration: none; }
.page { max-width: 720px; margin: 0 auto; padding: clamp(1.5rem,5vh,3.5rem) 1.25rem 2rem; }
.page h1 { font-size: clamp(2rem,6vw,3rem); line-height: 1.02; letter-spacing: -.02em; margin-bottom: .7rem; }
.page .lead { font-size: 1.1rem; color: var(--muted); margin-bottom: 1.6rem; }
.page .updated { color: var(--muted); font-size: .8rem; margin-bottom: 2rem; }
.page h2 { font-size: 1.12rem; font-weight: 700; margin: 1.9rem 0 .5rem; }
.page p { margin-bottom: .9rem; }
.page ul { margin: .2rem 0 1rem 1.2rem; }
.page li { margin-bottom: .45rem; }
.page a { color: var(--cool); }

/* ---------- Shared site footer ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 3rem; padding: 1.6rem 1.25rem 2.2rem; text-align: center; }
.foot-links { display: flex; flex-wrap: wrap; gap: .4rem .8rem; justify-content: center; align-items: center; font-size: .82rem; }
.foot-links a { color: var(--muted); text-decoration: none; }
.foot-links a:hover { color: var(--text); }
.foot-links span { color: var(--line); }
.foot-copy { color: var(--muted); font-size: .72rem; margin-top: .7rem; }
