:root {
  --ink: #16161d;
  --ink-2: #3b3b47;
  --muted: #6b6b78;
  --line: #e7e3da;
  --bg: #faf8f3;
  --bg-alt: #f3efe5;
  --card: #ffffff;
  --accent: #ffc53d;
  --accent-ink: #4a3500;
  --success: #1f7a4d;
  --success-bg: #e6f4ec;
  --danger: #b42318;
  --danger-bg: #fdecea;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(22, 22, 29, 0.04), 0 4px 16px rgba(22, 22, 29, 0.05);
  --font: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; padding-bottom: 64px; }
a { color: var(--ink); text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 0.4em; }
h1 { font-size: clamp(1.8rem, 3vw, 2.4rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
img, svg { max-width: 100%; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .container { padding: 0 24px; } }
.narrow { max-width: 760px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.nowrap { white-space: nowrap; }
.inline { display: inline; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.stack { display: grid; gap: 16px; }
.stack-sm { display: grid; gap: 10px; }

/* Header */
.site-header { background: rgba(250, 248, 243, 0.9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; text-decoration: none; letter-spacing: -0.02em; }
.logo { width: 32px; height: 32px; flex: none; }
.nav-links { display: flex; align-items: center; gap: 6px 18px; flex-wrap: wrap; }
.nav-links > a:not(.btn) { text-decoration: none; color: var(--ink-2); font-weight: 500; }
.nav-links > a:not(.btn):hover { color: var(--ink); }
@media (max-width: 560px) { .hide-sm { display: none; } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 6px 12px; font-size: 0.9rem; border-radius: 8px; }
.btn-lg { padding: 13px 22px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #2a2a35; }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { background: #ffb800; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); background: var(--card); }
.btn-ghost:hover { border-color: #cfc9bc; }
.btn-danger-ghost { background: transparent; border-color: #f2c4bf; color: var(--danger); }
.btn-danger-ghost:hover { background: var(--danger-bg); }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--ink-2); font-weight: 500; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.nav-links .link-btn { text-decoration: none; }
.btn:focus-visible, .link-btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(255, 197, 61, 0.7); outline-offset: 2px;
}

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--bg-alt); color: var(--ink-2); font-size: 0.8rem; font-weight: 600; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; background: var(--bg-alt); color: var(--ink-2); }
.badge-available, .badge-accepted { background: var(--success-bg); color: var(--success); }
.badge-sold { background: var(--ink); color: var(--accent); }
.badge-pending { background: #fff4d6; color: #7a5600; }
.badge-declined { background: var(--danger-bg); color: var(--danger); }

/* Flash & notices */
.flash { margin: 16px 0 0; padding: 12px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); }
.flash-success { background: var(--success-bg); border-color: #b9e0c9; color: #135a37; }
.flash-error { background: var(--danger-bg); border-color: #f2c4bf; color: var(--danger); margin-top: 0; margin-bottom: 16px; }
.notice { padding: 12px 14px; border-radius: 10px; background: var(--bg-alt); font-size: 0.95rem; }
.notice-success { background: var(--success-bg); color: #135a37; }

/* Hero */
.hero { padding: 56px 0 48px; border-bottom: 1px solid var(--line); background:
  radial-gradient(600px 300px at 85% 10%, rgba(255, 197, 61, 0.25), transparent 70%), var(--bg); }
.hero-inner { display: grid; gap: 32px; align-items: center; }
@media (min-width: 900px) { .hero-inner { grid-template-columns: 1.5fr 1fr; } .hero { padding: 88px 0 72px; } }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); letter-spacing: -0.035em; }
.highlight { background: linear-gradient(transparent 60%, rgba(255, 197, 61, 0.6) 60%); }
.eyebrow { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.8rem; font-weight: 700; color: var(--muted); margin-bottom: 12px; }
.lead { font-size: 1.15rem; color: var(--ink-2); max-width: 36em; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.hero-stats { display: grid; padding: 8px 24px; }
.hero-stats .stat { padding: 18px 0; border-bottom: 1px solid var(--line); }
.hero-stats .stat:last-child { border-bottom: 0; }
.stat { display: flex; flex-direction: column; }
.stat-value { font-size: 1.9rem; font-weight: 800; letter-spacing: -0.03em; }
.stat-label { color: var(--muted); font-size: 0.9rem; }

/* Sections */
.section { padding: 56px 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-title { font-size: clamp(1.5rem, 3vw, 2rem); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.arrow-link { font-weight: 600; text-decoration: none; }
.how-grid { display: grid; gap: 20px; margin-top: 20px; }
@media (min-width: 800px) { .how-grid { grid-template-columns: 1fr 1fr; } }
.how-card { padding: 28px; }
.steps { padding-left: 1.2em; margin: 12px 0 24px; display: grid; gap: 10px; color: var(--ink-2); }
.trust { display: grid; gap: 24px; }
@media (min-width: 800px) { .trust { grid-template-columns: repeat(3, 1fr); } }
.trust-item { display: flex; gap: 14px; align-items: flex-start; }
.trust-icon { flex: none; width: 44px; height: 44px; border-radius: 12px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 1.3rem; }
.cta-band { background: var(--ink); color: #fff; padding: 48px 0; }
.cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.cta-inner h2 { margin: 0; }

/* Idea grid */
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.idea-card { display: flex; flex-direction: column; gap: 8px; padding: 20px; text-decoration: none; transition: transform 0.12s ease, box-shadow 0.12s ease; }
.idea-card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(22, 22, 29, 0.05), 0 12px 28px rgba(22, 22, 29, 0.08); }
.idea-card h3 { margin: 4px 0 0; }
.idea-card p { margin: 0; flex: 1; }
.card-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-foot { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.price { font-weight: 800; font-size: 1.15rem; }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Browse */
.page-head { padding: 40px 0 8px; }
.filters { display: grid; gap: 10px; padding: 14px; margin: 16px 0 24px; grid-template-columns: 1fr; }
@media (min-width: 800px) { .filters { grid-template-columns: 2fr 1.2fr 1fr 1.2fr auto; } }
.empty { padding: 40px 24px; text-align: center; }
.empty-sm { padding: 18px 20px; margin: 0; }

/* Forms */
label { display: grid; gap: 6px; font-weight: 600; font-size: 0.95rem; }
label .muted { font-weight: 400; }
input:not([type='checkbox']):not([type='radio']), select, textarea {
  width: 100%; font: inherit; font-weight: 400; color: var(--ink);
  padding: 10px 12px; border: 1px solid #d9d4c8; border-radius: 10px; background: #fff;
}
textarea { resize: vertical; }
.form { padding: 24px; display: grid; gap: 18px; }
@media (min-width: 720px) { .form { padding: 32px; } }
.row-2 { display: grid; gap: 18px; }
@media (min-width: 600px) { .row-2 { grid-template-columns: 1fr 1fr; } }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.field-error { color: var(--danger); font-weight: 500; font-size: 0.875rem; margin: 0; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 0.9rem; color: var(--ink-2); }
.check input { margin-top: 4px; }
.narrow > h1 { margin-top: 40px; }

.auth { display: grid; place-items: center; padding-top: 48px; }
.auth-card { width: 100%; max-width: 460px; }
.role-pick { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.role-option { position: relative; cursor: pointer; }
.role-option input { position: absolute; opacity: 0; }
.role-option > span { display: grid; gap: 4px; padding: 14px; border: 2px solid var(--line); border-radius: 12px; height: 100%; }
.role-option input:checked + span { border-color: var(--ink); background: #fffaf0; }
.role-option input:focus-visible + span { outline: 3px solid rgba(255, 197, 61, 0.7); }
.company-only { display: none; }
form:has(input[value='company']:checked) .company-only { display: grid; }

/* Idea detail */
.detail { padding-top: 24px; }
.back-link { display: inline-block; margin-bottom: 20px; text-decoration: none; color: var(--muted); font-weight: 500; }
.detail-grid { display: grid; gap: 28px; align-items: start; }
@media (min-width: 900px) { .detail-grid { grid-template-columns: minmax(0, 1fr) 340px; } .detail-side { position: sticky; top: 88px; } }
.detail-main h1 { margin-top: 12px; }
.h-sub { font-size: 1.15rem; margin-top: 32px; }
.summary { font-size: 1.1rem; color: var(--ink-2); }
.details-body { padding: 22px; white-space: pre-wrap; overflow-wrap: anywhere; }
.detail-side { padding: 22px; display: grid; gap: 14px; }
.detail-side p { margin: 0; }
.big-price { font-size: 2.2rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.facts { margin: 0; display: grid; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.facts div { display: flex; justify-content: space-between; gap: 12px; font-size: 0.95rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; text-align: right; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 0.85rem; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.locked { position: relative; padding: 22px; overflow: hidden; min-height: 200px; }
.locked-lines { display: grid; gap: 12px; filter: blur(3px); }
.locked-lines span { height: 12px; border-radius: 6px; background: #ebe6db; }
.locked-lines span:nth-child(2n) { width: 85%; }
.locked-lines span:nth-child(3n) { width: 65%; }
.locked-overlay { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; text-align: center; padding: 16px; background: rgba(255, 255, 255, 0.55); gap: 4px; }
.locked-overlay p { margin: 0; }

/* Tables */
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.table th, .table td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); background: #fdfcf9; }
.table tr:last-child td { border-bottom: 0; }
.table td .inline + .inline { margin-left: 6px; }
.table .msg { max-width: 320px; color: var(--ink-2); }

/* Dashboard */
.dash { padding-top: 40px; }
.stat-row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); margin: 8px 0 12px; }
.stat-row .stat { padding: 18px 20px; }

.error-page { padding-top: 80px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 32px 0; background: var(--bg); }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer-inner p { margin: 8px 0 0; }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; align-items: center; }
.footer-links a { color: var(--ink-2); text-decoration: none; }
