/* hustle.sh landing page. Every color reads from a token, so the light and dark themes need no second pass. */

:root {
  --sh-money-deep: #0f5132;
  --sh-money: #85bb65;
  --sh-lime: #c4ff4d;
  --sh-paper: #f4f0e8;
  --sh-ink: #14130f;

  --bg: var(--sh-paper);
  --bg-alt: #ebe5d8;
  --surface: #fbf9f4;
  --text: var(--sh-ink);
  --muted: #5b574c;
  --line: #d8d0bf;
  --mark: var(--sh-money-deep);
  --band: var(--sh-money-deep);
  --band-text: #f4f0e8;
  --band-muted: #c9dccf;
  --action: var(--sh-lime);
  --action-text: var(--sh-ink);
  --dark-btn: var(--sh-ink);
  --dark-btn-text: var(--sh-paper);
  --focus: #1d6b45;
  --code-bg: #efeadf;

  --font-display: "Inter Tight", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --radius: 10px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b100c;
    --bg-alt: #111812;
    --surface: #141c16;
    --text: #ece8de;
    --muted: #a7ab9f;
    --line: #26332a;
    --mark: var(--sh-money);
    --band-muted: #b5d0bd;
    --dark-btn: #ece8de;
    --dark-btn-text: #0b100c;
    --focus: var(--sh-lime);
    --code-bg: #111812;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0b100c;
  --bg-alt: #111812;
  --surface: #141c16;
  --text: #ece8de;
  --muted: #a7ab9f;
  --line: #26332a;
  --mark: var(--sh-money);
  --band-muted: #b5d0bd;
  --dark-btn: #ece8de;
  --dark-btn-text: #0b100c;
  --focus: var(--sh-lime);
  --code-bg: #111812;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.1; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.5rem, 6vw, 4.25rem); font-weight: 800; letter-spacing: -0.025em; }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); font-weight: 800; margin-bottom: 1rem; }
h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 0.5rem; }
p { margin: 0 0 1rem; }
.wrap { width: min(1120px, 100% - 2.5rem); margin-inline: auto; }
.narrow { width: min(760px, 100% - 2.5rem); }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 46rem; }
.fine { font-size: 0.9rem; color: var(--muted); }
.center { text-align: center; justify-content: center; }
.sr, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { position: fixed; top: 8px; left: 8px; z-index: 50; background: var(--surface); padding: 8px 12px; }

/* Header */
.bar { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); }
.bar-in { display: flex; align-items: center; gap: 1.5rem; height: 64px; }
.brand { text-decoration: none; }
.wordmark { font: 800 1.35rem/1 var(--font-display); letter-spacing: -0.02em; }
.wordmark.small { font-size: 1rem; }
.dollar { color: var(--mark); }
.nav { display: flex; gap: 1.25rem; font-size: 0.95rem; }
.nav a { text-decoration: none; color: var(--muted); }
.nav a:hover { color: var(--text); }
.controls { margin-left: auto; display: flex; align-items: center; gap: 0.75rem; }
.link-quiet { text-decoration: none; font-size: 0.95rem; color: var(--muted); }
.link-quiet:hover { color: var(--text); }

/* AI / Human view switch */
.view-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.view-switch button {
  font: 500 0.75rem/1 var(--font-mono); border: 0; background: none; color: var(--muted);
  padding: 7px 10px; border-radius: 999px; cursor: pointer;
}
.view-switch button[aria-checked="true"] { background: var(--text); color: var(--bg); }

/* Theme switch: a sliding pill. Both icons stay visible. The knob slides under the active one. */
.theme-switch {
  position: relative; width: 60px; height: 32px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); padding: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: space-between;
}
.theme-switch .ico { position: relative; z-index: 1; width: 16px; height: 16px; margin: 0 7px; fill: none; stroke: var(--text); stroke-width: 2; stroke-linecap: round; }
.theme-switch .knob {
  position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--sh-lime); transition: transform 200ms ease;
}
.theme-switch[aria-checked="true"] .knob { transform: translateX(28px); }
.theme-switch[aria-checked="false"] .ico.sun, .theme-switch[aria-checked="true"] .ico.moon { stroke: var(--sh-ink); }
@media (prefers-reduced-motion: reduce) { .theme-switch .knob { transition: none; } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; text-decoration: none;
  font: 600 0.95rem/1 var(--font-body); padding: 11px 16px; border-radius: var(--radius); border: 1px solid transparent; cursor: pointer;
}
.btn-lg { padding: 15px 22px; font-size: 1rem; }
.btn-lime { background: var(--action); color: var(--action-text); border-color: var(--action); }
.btn-lime:hover { filter: brightness(0.95); }
.btn-dark { background: var(--dark-btn); color: var(--dark-btn-text); }
.btn-ghost { border-color: var(--line); color: var(--text); background: transparent; }
.btn-ghost:hover { border-color: var(--text); }
.btn-ghost-light { border-color: var(--band-muted); color: var(--band-text); background: transparent; }

/* Hero */
.hero { padding: 72px 0 80px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.hero-copy h1 { margin-bottom: 1.5rem; }
.ticks, .crosses { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; gap: 0.6rem; }
.ticks li, .crosses li { position: relative; padding-left: 1.6rem; }
.ticks li::before { content: ""; position: absolute; left: 0; top: 0.45em; width: 10px; height: 6px; border-left: 2px solid var(--mark); border-bottom: 2px solid var(--mark); transform: rotate(-45deg); }
.crosses li::before { content: ""; position: absolute; left: 2px; top: 0.75em; width: 10px; height: 2px; background: var(--muted); }
.cta-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1rem; }

/* Product preview */
.preview { margin: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; }
.pv-top { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.pv-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.pv-url { margin-left: 10px; font: 500 0.75rem var(--font-mono); color: var(--muted); }
.pv-body { display: grid; grid-template-columns: 170px 1fr; font-size: 0.85rem; }
.pv-side { border-right: 1px solid var(--line); padding: 14px; background: var(--bg-alt); }
.pv-label { font-size: 0.72rem; font-weight: 600; color: var(--muted); margin: 0.8rem 0 0.3rem; }
.pv-label:first-child { margin-top: 0; }
.pv-item { margin: 0; padding: 4px 8px; border-radius: 6px; }
.pv-item.done::after { content: " (done)"; font-size: 0.72rem; color: var(--mark); }
.pv-item.now { background: var(--surface); font-weight: 600; }
.pv-item.lock { color: var(--muted); }
.pv-main { padding: 16px 18px; }
.pv-h { font: 700 1.05rem var(--font-display); display: flex; justify-content: space-between; align-items: baseline; }
.pv-v { font: 500 0.7rem var(--font-mono); color: var(--muted); }
.pv-sub { font-weight: 600; margin: 0.6rem 0 0.2rem; }
.pv-text { margin: 0; color: var(--text); }
.pv-why { margin-top: 0.9rem; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 8px; }
.pv-why .pv-sub { margin-top: 0; }
.preview figcaption { font-size: 0.75rem; color: var(--muted); padding: 8px 14px; border-top: 1px solid var(--line); }

/* Sections */
.section { padding: 88px 0; }
.section.alt { background: var(--bg-alt); }
.band { background: var(--band); color: var(--band-text); padding: 80px 0; }
.band .card { background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.14); }
.band .card p { color: var(--band-muted); }
.band .tools { font-size: 0.85rem; font-weight: 600; color: var(--sh-lime); margin: 0; }
.band-note { color: var(--band-muted); margin-top: 1.5rem; max-width: 46rem; }
.cols3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.cols2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px 40px; }
.card { border-radius: var(--radius); padding: 22px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.loop { margin: 0; padding-left: 1.25rem; display: grid; gap: 1rem; }
.loop li::marker { font-weight: 700; color: var(--mark); }
.stages { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 2rem; }
.stage { border-top: 3px solid var(--mark); padding-top: 16px; }
.stage-n { font-size: 0.85rem; font-weight: 600; color: var(--mark); margin-bottom: 0.4rem; }
.count { font: 400 0.9rem var(--font-body); color: var(--muted); margin-left: 0.4rem; }
.stage p:last-child { color: var(--muted); font-size: 0.95rem; }
.item { border-bottom: 1px solid var(--line); padding-bottom: 1rem; }
.item p { color: var(--muted); }
.fit h3 { margin-bottom: 1rem; }

/* Pricing */
.prices { display: grid; grid-template-columns: repeat(2, minmax(0, 380px)); justify-content: center; gap: 24px; margin: 2rem 0 1.5rem; }
.price { border: 1px solid var(--line); border-radius: 14px; padding: 28px; background: var(--surface); display: flex; flex-direction: column; }
.price.best { border: 2px solid var(--mark); }
.amount { font: 800 2.75rem/1 var(--font-display); margin: 0.5rem 0 1.5rem; }
.amount span { font: 400 1rem var(--font-body); color: var(--muted); }
.price .btn { margin-top: auto; }

/* Questions */
details { border-bottom: 1px solid var(--line); padding: 18px 0; }
summary { cursor: pointer; font-weight: 600; font-size: 1.05rem; }
details p { margin: 0.75rem 0 0; color: var(--muted); }

/* Closer and footer */
.closer { background: var(--band); color: var(--band-text); padding: 96px 0; text-align: center; }
.closer p { color: var(--band-muted); font-size: 1.15rem; }
.closer .cta-row { justify-content: center; margin-top: 1.5rem; }
.foot { padding: 32px 0 96px; font-size: 0.9rem; color: var(--muted); }
.foot-in { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.foot-links { display: flex; gap: 1rem; }

/* AI view: the same page as Markdown, the way an agent reads it */
.ai-view {
  margin: 0; padding: 32px max(20px, calc((100% - 860px) / 2)) 120px; white-space: pre-wrap; word-break: break-word;
  font: 500 0.9rem/1.65 var(--font-mono); background: var(--code-bg); color: var(--text); min-height: calc(100vh - 64px);
}
:root[data-view="ai"] main { display: none; }

/* Chat (AG-UI) */
.chat { position: fixed; right: 20px; bottom: 20px; z-index: 30; }
.chat-panel {
  position: absolute; right: 0; bottom: 56px; width: min(380px, calc(100vw - 40px)); height: min(520px, calc(100vh - 120px));
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16);
}
.chat-panel[hidden] { display: none; }
.chat-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.chat-head p { margin: 0; font-weight: 600; }
.chat-close { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; font-size: 0.85rem; }
.chat-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; font-size: 0.92rem; }
.msg { margin: 0; padding: 9px 12px; border-radius: 10px; max-width: 88%; white-space: pre-wrap; }
.msg.bot { background: var(--bg-alt); align-self: flex-start; }
.msg.me { background: var(--text); color: var(--bg); align-self: flex-end; }
.msg.status { font-size: 0.8rem; color: var(--muted); background: none; padding: 0; }
.msg-actions { display: flex; gap: 6px; flex-wrap: wrap; align-self: flex-start; }
.msg-actions .btn { padding: 7px 10px; font-size: 0.8rem; }
.chat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.chat-form input {
  flex: 1; min-width: 0; font: inherit; font-size: 0.92rem; padding: 9px 11px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text);
}
.flash { animation: flash 1.6s ease-out; }
@keyframes flash { from { box-shadow: inset 0 0 0 3px var(--sh-lime); } to { box-shadow: inset 0 0 0 3px transparent; } }
@media (prefers-reduced-motion: reduce) { .flash { animation: none; } }

/* Small screens */
@media (max-width: 960px) {
  .nav { display: none; }
  .hero-grid, .two { grid-template-columns: 1fr; }
  .stages { grid-template-columns: repeat(2, 1fr); }
  .cols3 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .signin { display: none; }
  .controls { gap: 0.5rem; }
  .controls .btn { padding: 9px 12px; }
  .cols2, .stages, .prices { grid-template-columns: 1fr; }
  .pv-body { grid-template-columns: 1fr; }
  .pv-side { display: none; }
  .hero { padding-top: 48px; }
  .section, .band { padding: 64px 0; }
}
@media (max-width: 420px) {
  .wrap { width: calc(100% - 1.5rem); }
  .bar-in { gap: 0.5rem; }
  .wordmark { font-size: 1.1rem; }
  .controls { gap: 0.4rem; }
  .view-switch button { padding: 6px 7px; }
  .theme-switch { width: 52px; }
  .theme-switch .ico { margin: 0 5px; }
  .theme-switch[aria-checked="true"] .knob { transform: translateX(20px); }
  .controls .btn { padding: 8px 10px; font-size: 0.85rem; }
  .chat { right: 12px; bottom: 12px; }
  .chat-open { padding: 9px 12px; font-size: 0.85rem; }
}
