/* BackStageIQ — "Market Intelligence Broadsheet" design system.
   Editorial · warm paper · forest brand · electric-lime signal · clay accent. */

@import url("/static/fonts/fonts.css");

/* ---------- tokens ---------- */
:root {
  /* surfaces */
  --paper:      #F4F1E9;
  --paper-2:    #ECE6D7;
  --paper-3:    #E3DCC9;
  --night:      #12150F;
  --night-2:    #1B1F17;

  /* ink */
  --ink:        #15130D;
  --ink-soft:   #444036;
  --muted:      #847E6C;

  /* brand */
  --forest:     #0E3B32;
  --forest-deep:#082821;
  --lime:       #C9F24A;
  --lime-deep:  #A9D72B;
  --clay:       #DD5F33;

  /* lines & shadow */
  --line:       #DCD5C2;
  --line-ink:   rgba(20,18,13,.12);
  --shadow-sm:  0 1px 2px rgba(20,18,13,.06), 0 2px 8px rgba(20,18,13,.05);
  --shadow-md:  0 10px 30px -12px rgba(14,59,50,.28);
  --shadow-lg:  0 30px 70px -28px rgba(14,59,50,.45);

  /* type */
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans:  "Hanken Grotesk", -apple-system, system-ui, sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;

  /* spacing rhythm */
  --container: 1180px;
  --radius:    14px;
  --radius-lg: 22px;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  /* Sticky footer + vertical balance: content fills the viewport, footer sits at the bottom. */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
/* Main content grows to fill space and centers vertically (no clip on tall pages —
   it grows to content height, so centering is neutral there). */
main {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
/* App workspace pages stay top-aligned (they have their own layout). */
main:has(.app-main) { justify-content: flex-start; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }

/* ---------- type ---------- */
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.04; letter-spacing: -.02em; }
.display {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.9rem, 7vw, 5.6rem);
  line-height: .98;
  letter-spacing: -.035em;
  font-optical-sizing: auto;
}
.display em { font-style: italic; font-weight: 400; color: var(--forest); }
.eyebrow {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--clay);
  font-weight: 500;
}
.lead { font-size: clamp(1.05rem, 1.6vw, 1.3rem); color: var(--ink-soft); line-height: 1.5; }
.mono { font-family: var(--mono); font-feature-settings: "tnum" 1; }

/* ---------- layout ---------- */
.container { width: min(100% - 3rem, var(--container)); margin-inline: auto; }
.section { padding: clamp(4rem, 9vw, 8rem) 0; }
.grid { display: grid; gap: 2rem; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(140%) blur(10px);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 70px; }
.brand { display: inline-flex; align-items: center; gap: .6rem; font-family: var(--serif); font-weight: 600; font-size: 1.35rem; letter-spacing: -.03em; }
.brand .mark {
  width: 36px; height: 36px; border-radius: 9px;
  background: var(--forest); position: relative; flex: none;
  box-shadow: inset 0 0 0 2px var(--forest-deep);
}
.brand .mark::after {
  content: "\266B";              /* ♫ music notes */
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--lime); font-size: 20px; line-height: 1;
}
.nav-links { display: flex; align-items: center; gap: 2rem; }
.nav-links a.link { font-weight: 500; font-size: .95rem; color: var(--ink-soft); transition: color .2s; }
.nav-links a.link:hover { color: var(--ink); }
.nav-cta { display: flex; align-items: center; gap: .9rem; }

/* ---------- buttons ---------- */
.btn {
  --bg: var(--forest); --fg: var(--paper);
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .8rem 1.4rem; border-radius: 999px; border: 1px solid transparent;
  background: var(--bg); color: var(--fg); font-weight: 600; font-size: .95rem;
  cursor: pointer; transition: transform .18s cubic-bezier(.34,1.56,.64,1), box-shadow .25s, background .2s;
  box-shadow: var(--shadow-sm);
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }
.btn--lime { --bg: var(--lime); --fg: var(--forest-deep); font-weight: 700; }
.btn--ghost { --bg: transparent; --fg: var(--ink); border-color: var(--line); box-shadow: none; }
.btn--ghost:hover { background: var(--paper-2); }
.btn--lg { padding: 1rem 1.8rem; font-size: 1.02rem; }
.btn--block { width: 100%; }

/* ---------- badge / pill ---------- */
.pill {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase;
  padding: .4rem .8rem; border-radius: 999px; border: 1px solid var(--line);
  background: var(--paper-2); color: var(--ink-soft);
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--lime-deep); box-shadow: 0 0 0 3px color-mix(in srgb, var(--lime) 40%, transparent); }

/* ---------- hero ---------- */
.hero { position: relative; padding-top: clamp(3rem, 7vw, 6rem); padding-bottom: clamp(3rem, 6vw, 5rem); overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -20% -10% auto -10%; height: 80%;
  background:
    radial-gradient(60% 70% at 78% 18%, color-mix(in srgb, var(--lime) 32%, transparent), transparent 60%),
    radial-gradient(55% 65% at 12% 8%, color-mix(in srgb, var(--forest) 18%, transparent), transparent 62%);
  filter: blur(8px); z-index: 0; pointer-events: none;
}
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.15fr .85fr; gap: 3rem; align-items: center; }
.hero h1 { margin: 1.4rem 0; }
.hero .lead { max-width: 34ch; }
.hero-actions { display: flex; gap: 1rem; margin-top: 2rem; flex-wrap: wrap; }
.hero-visual { display: flex; justify-content: center; }
.hero-visual img { width: 100%; max-width: 480px; height: auto; border-radius: 16px; }
.hero-meta { margin-top: 2.4rem; display: flex; gap: 2.4rem; }
.hero-meta .stat b { font-family: var(--serif); font-size: 1.9rem; display: block; line-height: 1; }
.hero-meta .stat span { font-family: var(--mono); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

/* hero visual — data room collapsing into one report */
.dataroom { position: relative; height: 420px; }
.dataroom .doc, .dataroom .report {
  position: absolute; border-radius: var(--radius); background: var(--paper); border: 1px solid var(--line);
  box-shadow: var(--shadow-md); padding: 1rem;
}
.dataroom .doc { width: 150px; height: 190px; }
.dataroom .doc i { display: block; height: 6px; border-radius: 3px; background: var(--paper-3); margin: 7px 0; }
.dataroom .doc i:first-child { width: 60%; background: var(--clay); height: 8px; }
.dataroom .d1 { top: 8%;  left: 2%;  transform: rotate(-8deg);  animation: float1 7s ease-in-out infinite; }
.dataroom .d2 { top: 0;   left: 32%; transform: rotate(3deg);   animation: float2 8s ease-in-out infinite; }
.dataroom .d3 { top: 14%; left: 60%; transform: rotate(10deg);  animation: float1 9s ease-in-out infinite reverse; }
.dataroom .report {
  bottom: 0; left: 18%; width: 320px; height: 220px; background: var(--forest); color: var(--paper);
  border-color: var(--forest-deep); box-shadow: var(--shadow-lg); padding: 1.2rem 1.3rem;
}
.dataroom .report .tag { font-family: var(--mono); font-size: .62rem; letter-spacing: .2em; color: var(--lime); text-transform: uppercase; }
.dataroom .report h4 { color: var(--paper); font-size: 1.15rem; margin: .4rem 0 .8rem; }
.dataroom .report .row { display: flex; justify-content: space-between; font-family: var(--mono); font-size: .72rem; padding: .35rem 0; border-top: 1px solid rgba(244,241,233,.14); }
.dataroom .report .row b { color: var(--lime); }
@keyframes float1 { 50% { transform: translateY(-14px) rotate(-6deg); } }
@keyframes float2 { 50% { transform: translateY(-10px) rotate(5deg); } }

/* ---------- ticker ---------- */
.ticker { border-block: 1px solid var(--line); background: var(--paper-2); overflow: hidden; }
.ticker-track { display: flex; gap: 3rem; padding: .9rem 0; width: max-content; animation: scroll 32s linear infinite; }
.ticker-track span { font-family: var(--mono); font-size: .8rem; letter-spacing: .1em; color: var(--ink-soft); text-transform: uppercase; white-space: nowrap; }
.ticker-track span b { color: var(--clay); }
@keyframes scroll { to { transform: translateX(-50%); } }

/* ---------- feature cards ---------- */
.section-head { max-width: 60ch; margin-bottom: 3rem; }
.section-head h2 { font-size: clamp(2rem, 4vw, 3.1rem); margin: .8rem 0 1rem; }
.cards-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 1.8rem; position: relative; transition: transform .25s, box-shadow .25s, border-color .25s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--paper-3); }
.card .num { font-family: var(--mono); font-size: .72rem; letter-spacing: .2em; color: var(--clay); }
.card h3 { font-size: 1.45rem; margin: 1rem 0 .6rem; }
.card p { color: var(--ink-soft); font-size: .98rem; }
.card .ic { width: 46px; height: 46px; border-radius: 12px; background: var(--forest); display: grid; place-items: center; color: var(--lime); font-family: var(--serif); font-size: 1.4rem; margin-bottom: .2rem; }

/* ---------- how it works ---------- */
.steps { display: grid; grid-template-columns: repeat(3,1fr); gap: 1.4rem; counter-reset: step; }
.step { padding: 1.6rem; border-left: 2px solid var(--line); }
.step::before { counter-increment: step; content: "0" counter(step); font-family: var(--mono); color: var(--lime-deep); font-size: .8rem; letter-spacing: .2em; }
.step h3 { font-size: 1.25rem; margin: .6rem 0 .4rem; }
.step p { color: var(--ink-soft); font-size: .95rem; }

/* ---------- band (dark cta) ---------- */
.band { background: var(--forest); color: var(--paper); border-radius: var(--radius-lg); padding: clamp(2.5rem,5vw,4.5rem); position: relative; overflow: hidden; }
.band::after { content: ""; position: absolute; inset: auto -10% -60% auto; width: 60%; height: 120%; background: radial-gradient(circle, color-mix(in srgb, var(--lime) 22%, transparent), transparent 60%); }
.band h2 { color: var(--paper); font-size: clamp(2rem,4vw,3rem); max-width: 18ch; }
.band .lead { color: color-mix(in srgb, var(--paper) 78%, transparent); }

/* ---------- pricing ---------- */
.tiers { display: grid; grid-template-columns: repeat(4,1fr); gap: 1.4rem; align-items: stretch; }
@media (max-width: 980px) { .tiers { grid-template-columns: repeat(2,1fr); } }
.tier {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 2rem 1.8rem; display: flex; flex-direction: column; position: relative; transition: transform .25s, box-shadow .25s;
}
.tier:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.tier--featured { background: var(--forest); color: var(--paper); border-color: var(--forest-deep); box-shadow: var(--shadow-lg); }
.tier--featured .tier-name, .tier--featured h3 { color: var(--paper); }
.tier--featured .price-amt { color: var(--lime); }
.tier--featured .feat li { color: color-mix(in srgb, var(--paper) 82%, transparent); border-color: rgba(244,241,233,.14); }
.tier--featured .feat li::before { color: var(--lime); }
.tier .badge-top { position: absolute; top: -12px; right: 1.5rem; background: var(--lime); color: var(--forest-deep); font-family: var(--mono); font-size: .64rem; letter-spacing: .18em; text-transform: uppercase; padding: .35rem .7rem; border-radius: 999px; font-weight: 700; }
.tier-name { font-family: var(--mono); font-size: .76rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.price-amt { font-family: var(--serif); font-size: 3rem; line-height: 1; letter-spacing: -.03em; margin: .8rem 0 .2rem; }
.price-amt small { font-family: var(--mono); font-size: .9rem; color: var(--muted); letter-spacing: 0; }
.tier .desc { font-size: .92rem; color: var(--ink-soft); min-height: 3em; }
.tier--featured .desc { color: color-mix(in srgb, var(--paper) 75%, transparent); }
.feat { list-style: none; padding: 0; margin: 1.4rem 0; flex: 1; }
.feat li { padding: .6rem 0 .6rem 1.6rem; border-top: 1px solid var(--line); position: relative; font-size: .94rem; }
.feat li::before { content: "→"; position: absolute; left: 0; color: var(--forest); font-weight: 700; }

/* ---------- forms / auth ---------- */
.auth-wrap { min-height: calc(100vh - 70px); display: grid; place-items: center; padding: 3rem 0; position: relative; }
.auth-wrap::before { content:""; position:absolute; inset:0; background: radial-gradient(50% 50% at 50% 0%, color-mix(in srgb, var(--lime) 16%, transparent), transparent 70%); pointer-events:none; }
.auth-card {
  position: relative; width: min(100% - 3rem, 440px);
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 2.4rem; box-shadow: var(--shadow-lg);
}
.auth-card h1 { font-size: 1.9rem; }
.auth-sub { color: var(--ink-soft); font-size: .95rem; margin: .5rem 0 1.6rem; }
.field { margin-bottom: 1rem; }
.field label { display: block; font-size: .82rem; font-weight: 600; color: var(--ink-soft); margin-bottom: .35rem; }
.input {
  width: 100%; padding: .8rem .9rem; border-radius: 11px; border: 1px solid var(--line);
  background: var(--paper-2); transition: border-color .2s, box-shadow .2s, background .2s;
}
.input:focus { outline: none; border-color: var(--forest); background: var(--paper); box-shadow: 0 0 0 4px color-mix(in srgb, var(--forest) 14%, transparent); }
textarea.input { min-height: 5rem; resize: vertical; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.captcha-box { display: flex; flex-direction: column; gap: .5rem; }
.captcha-box img { border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.alert { background: color-mix(in srgb, var(--clay) 12%, var(--paper)); border: 1px solid color-mix(in srgb, var(--clay) 40%, var(--line)); color: #9a3a16; padding: .7rem .9rem; border-radius: 11px; font-size: .9rem; margin-bottom: 1rem; }
.code-input { font-family: var(--mono); font-size: 1.8rem; letter-spacing: .5em; text-align: center; }
.muted-link { color: var(--muted); font-size: .88rem; }
.muted-link a { color: var(--forest); font-weight: 600; }

/* ---------- dashboard ---------- */
.app-main { padding: 2.5rem 0 5rem; }
.app-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 2rem; flex-wrap: wrap; }
.app-head h1 { font-size: 2.2rem; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.8rem; box-shadow: var(--shadow-sm); }
.panel + .panel { margin-top: 1.4rem; }
.panel h2 { font-size: 1.4rem; margin-bottom: 1.2rem; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: .7rem .6rem; border-bottom: 1px solid var(--line); font-size: .92rem; }
.table th { font-family: var(--mono); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.report-output { margin-top: 1.5rem; }
.report-output table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.report-output th, .report-output td { border: 1px solid var(--line); padding: .5rem .7rem; font-size: .9rem; }
.report-output h2, .report-output h3 { font-family: var(--serif); margin: 1.2rem 0 .6rem; }
.report-output ul, .report-output ol { padding-left: 1.4rem; margin: .5rem 0; }
.report-output li { list-style: disc; margin: .3rem 0; }       /* subsection = filled bullet */
.report-output li ul li { list-style: circle; }                /* nested items = hollow circle */
.report-output ol li { list-style: disc; }                     /* never show 1./2./3. numbers */
.htmx-request .btn { opacity: .55; pointer-events: none; }

/* Toasts + in-page confirms */
#toasts { position: fixed; bottom: 1.2rem; right: 1.2rem; z-index: 1000;
  display: flex; flex-direction: column; gap: .6rem; max-width: 360px; }
.toast { background: var(--forest, #1f3d2b); color: #fff; padding: .8rem 1rem;
  border-radius: 10px; box-shadow: 0 6px 24px rgba(0,0,0,.18); font-size: .9rem;
  cursor: pointer; opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; }
.toast--in { opacity: 1; transform: translateY(0); }
.toast--error { background: #8c2b2b; }
.toast--success { background: #2f7d4f; }
.toast--info { background: #243b53; }
.toast--confirm { background: #fff; color: #1a1a1a; cursor: default;
  border: 1px solid var(--line, #ddd); }
.toast-actions { display: flex; gap: .5rem; justify-content: flex-end; margin-top: .7rem; }
.toast-actions .btn { padding: .35rem .8rem; font-size: .82rem; }

/* Sample dossier page */
.sample-grid { display: grid; grid-template-columns: 240px 1fr; gap: 1.6rem; align-items: start; margin-top: 2rem; }
.sample-rail { display: flex; flex-direction: column; gap: .8rem; position: sticky; top: 1.2rem; }
.callout { border: 1px solid var(--line, #ddd); border-left: 3px solid var(--lime, #b6e34a);
  border-radius: 8px; padding: .7rem .85rem; background: var(--paper, #fff); }
.callout b { display: block; font-size: .85rem; }
.callout span { display: block; color: var(--muted, #777); font-size: .78rem; margin-top: .15rem; }
.sample-cover { text-align: center; border: 1px solid var(--line, #ddd); border-radius: 12px;
  padding: 2rem 1rem; margin-bottom: 1.4rem; background: var(--paper-2, #f7f5ef); }
.sample-logo { display: inline-block; border: 1px dashed var(--muted, #aaa); color: var(--muted, #888);
  padding: .8rem 1.2rem; border-radius: 8px; font-size: .8rem; letter-spacing: 1px; margin-bottom: 1rem; }
.sample-co { font-weight: 700; font-size: 1.05rem; }
.sample-kicker { color: var(--muted, #888); letter-spacing: 2px; text-transform: uppercase; font-size: .72rem; margin-top: 1.2rem; }
.sample-title { font-family: var(--serif); font-size: 2rem; font-weight: 700; margin: .2rem 0; }
.sample-date { color: var(--muted, #888); font-size: .8rem; }
@media (max-width: 820px) { .sample-grid { grid-template-columns: 1fr; } .sample-rail { position: static; } }
.dossier-loader { display: inline-flex; gap: .4rem; margin: .6rem 0; }
.dossier-loader span { width: .6rem; height: .6rem; border-radius: 50%; background: var(--forest);
  display: inline-block; animation: dossier-bounce 1s infinite ease-in-out both; }
.dossier-loader span:nth-child(2) { animation-delay: .15s; }
.dossier-loader span:nth-child(3) { animation-delay: .3s; }
@keyframes dossier-bounce { 0%,80%,100% { transform: scale(.5); opacity: .4; } 40% { transform: scale(1); opacity: 1; } }

/* ---------- footer ---------- */
.footer { background: var(--night); color: color-mix(in srgb, var(--paper) 70%, transparent); padding: 4rem 0 2.5rem; }
.footer .brand { color: var(--paper); }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 2rem; padding-bottom: 3rem; border-bottom: 1px solid rgba(244,241,233,.12); }
.footer h5 { font-family: var(--mono); font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: var(--lime); margin-bottom: 1rem; font-weight: 500; }
.footer a { display: block; color: color-mix(in srgb, var(--paper) 66%, transparent); padding: .3rem 0; font-size: .92rem; transition: color .2s; }
.footer a:hover { color: var(--paper); }
.footer-bottom { display: flex; justify-content: space-between; padding-top: 1.6rem; font-size: .82rem; color: var(--muted); font-family: var(--mono); letter-spacing: .04em; flex-wrap: wrap; gap: .6rem; }

/* ---------- reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(22px); animation: reveal .8s cubic-bezier(.2,.7,.2,1) forwards; }
.reveal[data-d="1"] { animation-delay: .08s; }
.reveal[data-d="2"] { animation-delay: .16s; }
.reveal[data-d="3"] { animation-delay: .24s; }
.reveal[data-d="4"] { animation-delay: .32s; }
.reveal[data-d="5"] { animation-delay: .40s; }
@keyframes reveal { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; opacity: 1; transform: none; }
  .ticker-track, .dataroom .doc { animation: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .dataroom { height: 320px; margin-top: 1rem; }
  .cards-3, .steps, .tiers, .footer-grid { grid-template-columns: 1fr; }
  .nav-links .link { display: none; }
}
@media (max-width: 560px) {
  .row-2 { grid-template-columns: 1fr; }
  .hero-meta { gap: 1.4rem; }
}
