/* Agentic Constitution Studio */

:root {
  --ink: #0e1420;
  --ink-2: #151d2e;
  --ink-3: #1d2739;
  --line: #2a3550;
  --paper: #f4efe6;
  --text: #dfe6f2;
  --muted: #8fa0bd;
  --gold: #d4a94a;
  --gold-soft: #e8c877;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, "Segoe UI", Inter, Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--ink);
  color: var(--text);
  line-height: 1.6;
}

.container { max-width: 1060px; margin: 0 auto; padding: 0 24px; }

h1, h2, h3, .brand { font-family: var(--serif); }

section { padding: 72px 0; }

.kicker {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 4px 14px;
  margin-bottom: 18px;
}

/* header */
header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(14, 20, 32, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { font-size: 19px; color: var(--paper); }
.brand em { color: var(--gold); font-style: normal; }
.nav-links { display: flex; gap: 22px; align-items: center; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: 14px; }
.nav-links a:hover { color: var(--text); }

/* buttons */
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--gold); color: #1a1408;
  font-weight: 700; font-size: 15px;
  border: none; border-radius: 8px;
  padding: 12px 22px; cursor: pointer;
  transition: transform 0.12s, background 0.12s;
}
.btn-primary:hover { background: var(--gold-soft); transform: translateY(-1px); }
.btn-primary.big { width: 100%; justify-content: center; padding: 16px; font-size: 17px; margin-top: 22px; }
.btn-ghost {
  background: none; color: var(--text);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 11px 20px; font-size: 14px; cursor: pointer;
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-soft); }

/* hero */
.hero { padding: 96px 0 80px; text-align: center; position: relative; overflow: hidden; }
.hero::before {
  content: "§";
  position: absolute; top: -60px; right: -30px;
  font-family: var(--serif); font-size: 420px; line-height: 1;
  color: var(--ink-2); z-index: -1;
}
.hero h1 {
  font-size: clamp(34px, 5.4vw, 58px);
  line-height: 1.12; color: var(--paper);
  max-width: 820px; margin: 0 auto 22px;
}
.hero h1 em { color: var(--gold); font-style: italic; }
.hero p.sub { font-size: 19px; color: var(--muted); max-width: 640px; margin: 0 auto 34px; }
.hero .cta-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero .tagline { margin-top: 46px; font-family: var(--serif); font-style: italic; color: var(--gold-soft); font-size: 17px; }

/* how it works */
.steps-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 36px; }
.step-card {
  background: var(--ink-2); border: 1px solid var(--line); border-radius: 12px; padding: 26px;
}
.step-card .num { font-family: var(--serif); font-size: 30px; color: var(--gold); }
.step-card h3 { margin: 10px 0 8px; color: var(--paper); font-size: 19px; }
.step-card p { color: var(--muted); font-size: 14.5px; }

/* kit table */
.kit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 34px; }
.kit-item {
  display: flex; gap: 14px; align-items: baseline;
  background: var(--ink-2); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px;
}
.kit-item code { font-family: var(--mono); font-size: 12.5px; color: var(--gold-soft); white-space: nowrap; }
.kit-item span { color: var(--muted); font-size: 14px; }

/* wizard */
#wizard { background: var(--ink-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.wizard-shell {
  background: var(--ink); border: 1px solid var(--line); border-radius: 16px;
  padding: 34px; max-width: 860px; margin: 36px auto 0;
}
#wizard-progress { display: flex; gap: 6px; margin-bottom: 18px; }
#wizard-progress span { height: 4px; flex: 1; border-radius: 2px; background: var(--ink-3); }
#wizard-progress span.done { background: var(--gold); opacity: 0.45; }
#wizard-progress span.now { background: var(--gold); }
#wizard-stepnum { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
#wizard-title { font-size: 27px; color: var(--paper); margin: 6px 0 6px; }
#wizard-hint { color: var(--muted); font-size: 14.5px; margin-bottom: 24px; }

.opt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.opt-card {
  display: flex; gap: 10px; align-items: flex-start; text-align: left;
  background: var(--ink-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 13px 15px; font-size: 14.5px; cursor: pointer; font-family: var(--sans);
  transition: border-color 0.1s, background 0.1s;
}
.opt-card:hover { border-color: var(--gold); }
.opt-card.selected { border-color: var(--gold); background: rgba(212, 169, 74, 0.09); }
.opt-card .check {
  flex: 0 0 20px; height: 20px; border: 1px solid var(--line); border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--gold); background: var(--ink);
}
.opt-card.selected .check { border-color: var(--gold); }
.opt-card small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 3px; line-height: 1.45; }
.opt-card strong { color: var(--paper); font-weight: 600; }

.grid-label { font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); margin: 22px 0 10px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 14px; margin-bottom: 7px; color: var(--text); }
.field .req { color: var(--gold); font-size: 11.5px; margin-left: 6px; }
.field .opt { color: var(--muted); font-size: 11.5px; margin-left: 6px; }
.field input {
  width: 100%; background: var(--ink-2); border: 1px solid var(--line); border-radius: 8px;
  color: var(--text); padding: 12px 14px; font-size: 15px; font-family: var(--sans);
}
.field input:focus { outline: none; border-color: var(--gold); }

.wizard-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 28px; }
#wizard-error { color: #e07a6a; font-size: 13.5px; }

.summary { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-top: 4px; }
.summary > div { background: var(--ink-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.summary span { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.summary strong { color: var(--paper); font-size: 14px; font-weight: 600; }
.fineprint { text-align: center; color: var(--muted); font-size: 12.5px; margin-top: 12px; }

/* output */
#output.hidden { display: none; }
#output-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 28px 0 0; }
.tab {
  background: var(--ink-2); color: var(--muted); border: 1px solid var(--line);
  border-radius: 8px 8px 0 0; border-bottom: none;
  padding: 9px 16px; font-size: 13.5px; cursor: pointer; font-family: var(--sans);
}
.tab.active { color: var(--gold); background: var(--ink-3); font-weight: 600; }
.output-pane { background: var(--ink-3); border: 1px solid var(--line); border-radius: 0 10px 10px 10px; }
.output-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; border-bottom: 1px solid var(--line);
}
#output-filename { font-family: var(--mono); font-size: 12.5px; color: var(--gold-soft); }
.output-actions { display: flex; gap: 8px; }
.output-actions .btn-ghost { padding: 7px 14px; font-size: 12.5px; }
#output-pre {
  font-family: var(--mono); font-size: 12.8px; line-height: 1.6;
  color: var(--text); padding: 20px 22px; margin: 0;
  max-height: 520px; overflow: auto; white-space: pre-wrap;
}

/* verticals */
.vertical-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 34px; }
.vertical-card {
  background: var(--ink-2); border: 1px solid var(--line); border-radius: 12px; padding: 22px;
}
.vertical-card h3 { color: var(--paper); font-size: 17px; margin-bottom: 6px; }
.vertical-card p { color: var(--muted); font-size: 13.5px; }
.vertical-card .soon { display: inline-block; margin-top: 12px; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); }

/* pricing */
.price-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 34px; }
.price-card {
  background: var(--ink-2); border: 1px solid var(--line); border-radius: 12px; padding: 24px;
  display: flex; flex-direction: column;
}
.price-card.featured { border-color: var(--gold); position: relative; }
.price-card.featured::before {
  content: "Most popular"; position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  background: var(--gold); color: #1a1408; font-size: 11px; font-weight: 700;
  padding: 2px 12px; border-radius: 99px; letter-spacing: 0.04em;
}
.price-card h3 { color: var(--paper); font-size: 16px; }
.price-card .price { font-family: var(--serif); font-size: 34px; color: var(--gold-soft); margin: 8px 0 2px; }
.price-card .per { color: var(--muted); font-size: 12px; margin-bottom: 14px; }
.price-card ul { list-style: none; flex: 1; }
.price-card li { color: var(--muted); font-size: 13.5px; padding: 4px 0 4px 18px; position: relative; }
.price-card li::before { content: "—"; position: absolute; left: 0; color: var(--gold); }

/* email */
.email-band { background: var(--ink-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: center; }
#email-form { display: flex; gap: 10px; justify-content: center; margin-top: 22px; flex-wrap: wrap; }
#email-input {
  width: min(360px, 100%); background: var(--ink); border: 1px solid var(--line); border-radius: 8px;
  color: var(--text); padding: 12px 14px; font-size: 15px;
}
#email-input:focus { outline: none; border-color: var(--gold); }

/* section headings */
.sec-h { text-align: center; max-width: 680px; margin: 0 auto; }
.sec-h h2 { font-size: clamp(26px, 3.6vw, 36px); color: var(--paper); margin-bottom: 12px; }
.sec-h p { color: var(--muted); font-size: 16px; }

/* footer */
footer { border-top: 1px solid var(--line); padding: 36px 0 46px; }
footer .container { display: flex; flex-direction: column; gap: 10px; }
footer p { color: var(--muted); font-size: 12.5px; }
footer .brand { font-size: 16px; }

/* flash */
#flash {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--gold); color: #1a1408; font-weight: 700; font-size: 14px;
  padding: 10px 22px; border-radius: 99px; opacity: 0; pointer-events: none;
  transition: opacity 0.2s, transform 0.2s; z-index: 99;
}
#flash.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* responsive */
@media (max-width: 860px) {
  .steps-3, .vertical-grid { grid-template-columns: 1fr; }
  .price-grid { grid-template-columns: 1fr 1fr; }
  .kit-grid, .two-col, .summary { grid-template-columns: 1fr; }
  .wizard-shell { padding: 22px; }
  .nav-links a:not(.btn-primary) { display: none; }
}
@media (max-width: 520px) {
  .price-grid { grid-template-columns: 1fr; }
}
