/* Kindling Editorial Studio — warm paper, terracotta, forest green, serif headings. */
:root {
    --paper: #FAF6F1;
    --paper-deep: #F3ECE3;
    --card: #FFFDFA;
    --ink: #1C1917;
    --ink-soft: #57534E;
    --ink-faint: #8A817A;
    --line: #E7DED3;
    --line-strong: #D6C9BA;
    --primary: #9A3412;
    --primary-dark: #7C2D12;
    --primary-tint: #FBEDE4;
    --green: #166534;
    --green-tint: #E7F3EA;
    --amber: #B45309;
    --amber-tint: #FDF3E1;
    --red: #9F1239;
    --red-tint: #FCE8EC;
    --radius: 8px;
    --serif: "Newsreader", "Fraunces", Georgia, serif;
    --sans: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
    --shadow: 0 1px 2px rgba(28, 25, 23, .04), 0 8px 24px rgba(28, 25, 23, .05);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.6 var(--sans); }
a { color: var(--primary); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 .5em; }
h1 { font-size: clamp(2.1rem, 4.2vw, 3.4rem); }
h2 { font-size: 1.7rem; }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.muted, .meta { color: var(--ink-soft); }
.small { font-size: .88rem; }
.kicker { font-size: .78rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--primary); margin-bottom: .6em; }
.lede { font-size: 1.22rem; color: var(--ink-soft); max-width: 46ch; }
.serif { font-family: var(--serif); }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- navigation ---------- */
.topbar { border-bottom: 1px solid var(--line); background: rgba(250, 246, 241, .92); backdrop-filter: blur(6px); position: sticky; top: 0; z-index: 10; }
.nav { display: flex; align-items: center; gap: 28px; min-height: 68px; }
.brand { font-family: var(--serif); font-size: 1.6rem; font-weight: 700; color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 8px; }
.brand-mark { width: 26px; height: 26px; border-radius: 50% 50% 50% 8px; background: var(--primary); display: inline-block; transform: rotate(-45deg); }
.nav-links { display: flex; gap: 22px; flex: 1; }
.nav-links a, .nav-actions > a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: .95rem; }
.nav-links a:hover, .nav-links a.active { color: var(--primary); }
.nav-actions { display: flex; align-items: center; gap: 14px; }
.nav-actions form { margin: 0; }

/* ---------- buttons & badges ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--primary); background: var(--primary); color: #fff; padding: 10px 18px; border-radius: var(--radius); font: 600 .95rem/1.2 var(--sans); text-decoration: none; cursor: pointer; transition: background .15s; }
.btn:hover { background: var(--primary-dark); color: #fff; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn.ghost:hover { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn.green { background: var(--green); border-color: var(--green); }
.btn.small { padding: 6px 12px; font-size: .85rem; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.linkish { background: none; border: 0; color: var(--primary); font: inherit; cursor: pointer; padding: 0; text-decoration: underline; }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; background: var(--paper-deep); color: var(--ink-soft); border: 1px solid var(--line); white-space: nowrap; }
.badge.live, .badge.funded, .badge.verified { background: var(--green-tint); color: var(--green); border-color: #C7E2CF; }
.badge.upcoming, .badge.in_review, .badge.prototype { background: var(--amber-tint); color: var(--amber); border-color: #F3DDB4; }
.badge.failed { background: var(--red-tint); color: var(--red); border-color: #F4C7D1; }
.badge.draft, .badge.closed, .badge.submitted { background: var(--paper-deep); }
.badge.community { background: var(--primary-tint); color: var(--primary); border-color: #F1CDB9; }
.badge.ready { background: var(--green); color: #fff; border-color: var(--green); }
.badge.mode { background: transparent; }

/* ---------- surfaces ---------- */
.panel, .card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.panel { padding: 24px; }
.panel + .panel { margin-top: 18px; }
.grid > .panel + .panel, .plan-grid > .panel + .panel, .stat-cards > .panel + .panel, .mode-tiles > .panel + .panel { margin-top: 0; }
.flash { background: var(--green-tint); border: 1px solid #C7E2CF; color: var(--green); padding: 12px 16px; border-radius: var(--radius); margin: 18px 0 0; }
.errors { background: var(--red-tint); border: 1px solid #F4C7D1; color: var(--red); padding: 12px 16px; border-radius: var(--radius); margin: 18px 0 0; }
.errors ul { margin: 0; padding-left: 18px; }
.notice { background: var(--amber-tint); border: 1px solid #F3DDB4; color: #7A3E06; padding: 12px 16px; border-radius: var(--radius); font-size: .93rem; }
.notice.paper { background: var(--paper-deep); border-color: var(--line); color: var(--ink-soft); }

section.block { padding: 48px 0 8px; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 20px; }
.section-head h2 { margin: 0; }

/* ---------- hero ---------- */
.hub-hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; padding: 56px 0 24px; align-items: center; }
.hub-hero h1 em { font-style: italic; color: var(--primary); }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.hero-stats { display: flex; gap: 32px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.hero-stats strong { display: block; font-family: var(--serif); font-size: 1.6rem; }
.hero-stats span { color: var(--ink-soft); font-size: .88rem; }

.mode-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.mode-tile { padding: 18px; text-decoration: none; color: var(--ink); display: block; transition: border-color .15s, transform .15s; }
.mode-tile:hover { border-color: var(--primary); transform: translateY(-2px); color: var(--ink); }
.mode-tile h3 { font-size: 1.1rem; margin-bottom: .3em; }
.mode-tile p { font-size: .9rem; color: var(--ink-soft); margin: 0; }
.mode-tile .count { font-size: .8rem; color: var(--primary); font-weight: 600; }

/* ---------- campaign cards ---------- */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.grid.two { grid-template-columns: repeat(2, 1fr); }
.grid.four { grid-template-columns: repeat(4, 1fr); }
.card { overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .15s; }
.card:hover { box-shadow: var(--shadow); }
.card .cover { aspect-ratio: 3 / 2; }
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-body h3 { margin: 0; font-size: 1.2rem; }
.card-body h3 a { color: var(--ink); text-decoration: none; }
.card-body h3 a:hover { color: var(--primary); }
.card-body .summary { color: var(--ink-soft); font-size: .93rem; margin: 0; flex: 1; }
.card-meta { display: flex; justify-content: space-between; font-size: .85rem; color: var(--ink-soft); }
.card-meta strong { color: var(--ink); }
.badges { display: flex; gap: 6px; flex-wrap: wrap; }

.cover { position: relative; background:
    radial-gradient(circle at 78% 22%, rgba(255,255,255,.35) 0 14%, transparent 15%),
    radial-gradient(circle at 18% 88%, rgba(0,0,0,.12) 0 22%, transparent 23%),
    linear-gradient(135deg, var(--accent, #9a3412), color-mix(in srgb, var(--accent, #9a3412) 55%, #1C1917)); }
.cover .initial { position: absolute; left: 18px; bottom: 12px; font-family: var(--serif); font-size: 3rem; color: rgba(255,255,255,.85); line-height: 1; }

/* ---------- funding bar ---------- */
.funding { display: flex; flex-direction: column; gap: 10px; }
.bar { position: relative; height: 10px; background: var(--paper-deep); border-radius: 999px; border: 1px solid var(--line); }
.bar.thin { height: 6px; }
.bar .fill { position: absolute; inset: 0 auto 0 0; background: var(--primary); border-radius: 999px; }
.bar .fill.done { background: var(--green); }
.bar .marker { position: absolute; top: -5px; bottom: -5px; width: 2px; background: var(--ink); }
.bar .marker.opt { background: var(--green); }
.bar .marker.stretch { background: var(--amber); width: 0; border-left: 2px dashed var(--amber); }
.bar-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .82rem; color: var(--ink-soft); }
.bar-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.funding-numbers { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 8px; }
.funding-numbers > div:first-child { grid-column: 1 / -1; }
.funding-numbers > div:first-child strong { font-size: 2rem; }
.funding-numbers strong { display: block; font-family: var(--serif); font-size: 1.55rem; line-height: 1.1; }
.funding-numbers span { font-size: .82rem; color: var(--ink-soft); }

/* ---------- campaign detail ---------- */
.detail-hero { display: grid; grid-template-columns: 1.35fr .9fr; gap: 40px; padding: 40px 0 24px; }
.detail-hero .cover { aspect-ratio: 16 / 9; border-radius: var(--radius); }
.detail-hero h1 { margin-top: 10px; }
.creator-line { display: flex; align-items: center; gap: 10px; color: var(--ink-soft); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--primary-tint); color: var(--primary); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-family: var(--serif); flex-shrink: 0; }
.sidebar { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 88px; align-self: start; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; margin-top: 12px; }
.tabs a { padding: 12px 14px; color: var(--ink-soft); text-decoration: none; font-weight: 600; font-size: .95rem; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.active { color: var(--primary); border-bottom-color: var(--primary); }
.tabs a .count { font-size: .75rem; color: var(--ink-faint); margin-left: 4px; }
.detail-layout { display: grid; grid-template-columns: 1fr 360px; gap: 40px; padding: 28px 0 40px; }
.prose { max-width: 70ch; }
.prose h2 { margin-top: 1.4em; font-size: 1.45rem; }
.prose h2:first-child { margin-top: 0; }
.plan-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 24px; }
.plan-grid .panel { padding: 18px; }
.plan-grid h3 { font-size: 1rem; font-family: var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--primary); }
.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--line); }
.timeline li { padding: 0 0 18px 20px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--card); border: 2px solid var(--primary); }
.timeline strong { display: block; font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: var(--primary); }
table.budget { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.budget th, table.budget td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.budget th { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); }
table.budget td.num { text-align: right; white-space: nowrap; }
.pct-bar { height: 6px; background: var(--paper-deep); border-radius: 999px; margin-top: 6px; }
.pct-bar span { display: block; height: 100%; background: var(--primary); border-radius: 999px; }
.reward { padding: 18px; }
.reward h3 { margin-bottom: .2em; }
.reward .price { font-family: var(--serif); font-size: 1.3rem; color: var(--primary); }
.reward.sold-out { opacity: .6; }
.update, .comment, .post { padding: 16px 0; border-bottom: 1px solid var(--line); }
.update:last-child, .comment:last-child, .post:last-child { border-bottom: 0; }
.update h3 { margin-bottom: .2em; }
.locked { background: repeating-linear-gradient(-45deg, var(--paper-deep), var(--paper-deep) 8px, var(--paper) 8px, var(--paper) 16px); border: 1px dashed var(--line-strong); padding: 14px; border-radius: var(--radius); color: var(--ink-soft); font-size: .93rem; }
.supporter { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.team { display: flex; flex-wrap: wrap; gap: 14px; }
.team .member { display: flex; gap: 10px; align-items: center; }
.faq dt { font-weight: 600; margin-top: 14px; }
.faq dd { margin: 4px 0 0; color: var(--ink-soft); }
.terms dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; margin: 0; }
.terms dt { color: var(--ink-soft); }
.terms dd { margin: 0; font-weight: 600; }

/* ---------- forms ---------- */
label { font-weight: 600; font-size: .93rem; display: block; margin-bottom: 6px; }
.hint { font-weight: 400; color: var(--ink-soft); font-size: .85rem; display: block; margin-top: 2px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], select, textarea {
    width: 100%; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: #fff; font: inherit; font-size: .97rem; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--primary) 35%, transparent); border-color: var(--primary); }
input[disabled], select[disabled] { background: var(--paper-deep); color: var(--ink-soft); }
textarea { min-height: 110px; resize: vertical; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.row.three { grid-template-columns: repeat(3, 1fr); }
.row.four { grid-template-columns: 2fr 1fr 1fr 1fr; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 400; }
.check input { width: auto; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 0; background: var(--paper); }
legend { font-family: var(--serif); font-weight: 600; font-size: 1.1rem; padding: 0 6px; }
.repeat-row { display: grid; gap: 10px; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.repeat-row:last-child { border-bottom: 0; }
.repeat-row.budget-row { grid-template-columns: 2fr 90px 2fr; }
.repeat-row.stretch-row { grid-template-columns: 140px 1fr; }
.repeat-row.pair { grid-template-columns: 1fr 2fr; }
.total-line { font-weight: 600; margin-top: 8px; }
.total-line.ok { color: var(--green); }
.total-line.bad { color: var(--red); }

/* ---------- wizard ---------- */
.wizard { display: grid; grid-template-columns: 260px 1fr; gap: 36px; padding: 36px 0 48px; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; position: sticky; top: 88px; align-self: start; }
.steps li { counter-increment: step; }
.steps a, .steps span { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius); color: var(--ink-soft); text-decoration: none; font-weight: 600; font-size: .95rem; }
.steps a::before, .steps span::before { content: counter(step); width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line-strong); display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; background: var(--card); flex-shrink: 0; }
.steps .done a::before { content: "✓"; background: var(--green); border-color: var(--green); color: #fff; }
.steps .current a { background: var(--card); color: var(--primary); border: 1px solid var(--line); }
.steps .current a::before { background: var(--primary); border-color: var(--primary); color: #fff; }
.steps span { opacity: .55; }
.wizard-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }
.checklist .ok { color: var(--green); font-weight: 600; }
.checklist .missing { color: var(--red); font-weight: 600; }

/* ---------- community hub ---------- */
.pipeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.pipeline-col { background: var(--paper-deep); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; min-height: 180px; }
.pipeline-col h3 { display: flex; justify-content: space-between; align-items: center; font-size: 1.05rem; }
.idea { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-top: 12px; }
.idea h4 { font-size: 1.05rem; margin-bottom: .25em; }
.idea h4 a { color: var(--ink); text-decoration: none; }
.idea p { font-size: .88rem; color: var(--ink-soft); margin-bottom: 10px; }
.vote { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.vote form { margin: 0; }
.vote-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-strong); background: #fff; border-radius: var(--radius); padding: 5px 10px; font: 600 .85rem var(--sans); cursor: pointer; color: var(--ink); }
.vote-btn:hover { border-color: var(--primary); color: var(--primary); }
.vote-btn.voted { background: var(--primary-tint); border-color: var(--primary); color: var(--primary); }
.ask { padding: 14px 0; border-bottom: 1px solid var(--line); }

/* ---------- dashboard ---------- */
table.list { width: 100%; border-collapse: collapse; }
table.list th, table.list td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; font-size: .95rem; vertical-align: middle; }
table.list th { font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 24px 0; }
.stat-cards .panel { padding: 16px 18px; }
.stat-cards strong { font-family: var(--serif); font-size: 1.8rem; display: block; }

/* ---------- auth ---------- */
.auth { max-width: 440px; margin: 56px auto; }

/* ---------- footer ---------- */
footer.site { margin-top: 64px; border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--ink-soft); font-size: .9rem; }
footer.site .wrap { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }

@media (max-width: 960px) {
    .hub-hero, .detail-hero, .detail-layout, .wizard { grid-template-columns: 1fr; }
    .grid, .grid.four, .mode-tiles, .pipeline, .stat-cards { grid-template-columns: repeat(2, 1fr); }
    .sidebar, .steps { position: static; }
    .nav-links { display: none; }
}
@media (max-width: 620px) {
    .grid, .grid.two, .grid.four, .mode-tiles, .pipeline, .row, .row.three, .row.four, .plan-grid, .stat-cards { grid-template-columns: 1fr; }
    .repeat-row.budget-row, .repeat-row.stretch-row, .repeat-row.pair { grid-template-columns: 1fr; }
}
