:root {
  --ink: #171713;
  --paper: #f4f1e9;
  --paper-deep: #e7e0d2;
  --card: #fffdf8;
  --orange: #ef6b2e;
  --orange-dark: #b94413;
  --green: #397b51;
  --muted: #68655e;
  --line: rgba(23, 23, 19, 0.16);
  --shadow: 0 24px 80px rgba(23, 23, 19, 0.1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.shell { width: min(1160px, calc(100% - 40px)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.honeypot { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip-path: inset(100%) !important; white-space: nowrap !important; }
.skip-link { position: fixed; left: 16px; top: -80px; z-index: 100; padding: 12px 16px; background: var(--ink); color: white; }
.skip-link:focus { top: 16px; }
:focus-visible { outline: 3px solid rgba(239, 107, 46, 0.55); outline-offset: 3px; }

.topbar {
  min-height: 94px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand img { display: block; border-radius: 4px; }
.quiet-link { font-size: .86rem; font-weight: 750; border-bottom: 1px solid currentColor; padding-bottom: 3px; }
.quiet-link:hover { color: var(--orange-dark); }

.story-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr);
  gap: clamp(48px, 8vw, 110px);
  align-items: end;
  padding-block: clamp(72px, 10vw, 130px) 84px;
}
.eyebrow, .step-kicker {
  margin: 0 0 18px;
  color: var(--orange-dark);
  font-size: .76rem;
  line-height: 1.2;
  font-weight: 850;
  letter-spacing: .16em;
  text-transform: uppercase;
}
h1, h2, h3, .story-quote {
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: -.045em;
}
h1 { max-width: 800px; margin: 0; font-size: clamp(4.4rem, 9.4vw, 8.4rem); line-height: .84; font-weight: 700; }
.hero-intro { max-width: 680px; margin: 34px 0 0; color: #4f4d47; font-size: clamp(1.14rem, 2vw, 1.38rem); line-height: 1.65; }
.hero-points { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 34px; }
.hero-points span { padding: 9px 13px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .78rem; font-weight: 720; }
.hero-points span::before { content: "✓"; margin-right: 7px; color: var(--green); }
.jenkin-card { margin: 0; padding: 20px; background: var(--ink); color: white; box-shadow: var(--shadow); }
.jenkin-card img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; filter: saturate(.85); }
.jenkin-card div { padding: 24px 12px 8px; }
.jenkin-card p { margin: 0; font-family: Georgia, serif; font-size: 1.28rem; line-height: 1.4; }
.jenkin-card span { display: block; margin-top: 18px; color: rgba(255,255,255,.58); font-size: .75rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }

.form-shell { margin-bottom: 120px; padding: clamp(28px, 5vw, 66px); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.form-progress { max-width: 880px; margin: 0 auto 56px; }
.progress-track { height: 4px; overflow: hidden; background: var(--paper-deep); }
.progress-track span { display: block; width: 25%; height: 100%; background: var(--orange); transition: width 240ms ease; }
.form-progress p { display: flex; justify-content: space-between; margin: 12px 0 0; color: var(--muted); font-size: .76rem; font-weight: 750; letter-spacing: .04em; }
.form-step { max-width: 880px; margin: 0 auto; animation: step-in 240ms ease; }
@keyframes step-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.form-step h2, .success-panel h2 { max-width: 780px; margin: 0; font-size: clamp(2.6rem, 5.6vw, 5rem); line-height: .96; }
.step-intro { max-width: 700px; margin: 22px 0 42px; color: var(--muted); font-size: 1.04rem; line-height: 1.7; }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0; padding: 0; border: 0; }
.choice-card { position: relative; display: block; min-height: 128px; cursor: pointer; }
.choice-card input { position: absolute; opacity: 0; }
.choice-card span { height: 100%; display: flex; flex-direction: column; justify-content: center; padding: 24px 26px; background: var(--paper); border: 1px solid transparent; transition: background 160ms ease, border-color 160ms ease, transform 160ms ease; }
.choice-card strong { font-size: 1.02rem; }
.choice-card small { margin-top: 8px; color: var(--muted); line-height: 1.45; }
.choice-card input:checked + span { background: #fff4ea; border-color: var(--orange); box-shadow: inset 4px 0 0 var(--orange); }
.choice-card input:focus-visible + span { outline: 3px solid rgba(239,107,46,.5); outline-offset: 2px; }
.choice-card:hover span { transform: translateY(-2px); border-color: var(--line); }

.step-actions { display: flex; justify-content: flex-end; margin-top: 42px; }
.step-actions.split { justify-content: space-between; }
.button { min-height: 54px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 14px 22px; border: 1px solid var(--ink); border-radius: 3px; cursor: pointer; font-weight: 820; transition: transform 150ms ease, background 150ms ease; }
.button:hover { transform: translateY(-2px); }
.button.primary { background: var(--ink); color: white; }
.button.primary:hover { background: var(--orange-dark); border-color: var(--orange-dark); }
.button.secondary { background: transparent; color: var(--ink); }
.button:disabled { opacity: .6; cursor: wait; transform: none; }

.field-stack { display: grid; gap: 24px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field > span { font-weight: 780; }
.field em { color: var(--muted); font-size: .75rem; font-style: normal; font-weight: 650; }
.field small { color: var(--muted); line-height: 1.45; }
.field input, .field textarea { width: 100%; border: 1px solid var(--line); border-radius: 2px; background: #fff; color: var(--ink); padding: 15px 16px; transition: border-color 150ms ease, box-shadow 150ms ease; }
.field textarea { resize: vertical; line-height: 1.6; }
.field input:focus, .field textarea:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(239,107,46,.1); outline: none; }
.field [aria-invalid="true"] { border-color: #a92e2e; }
.highlight-field { padding: 24px; background: #fff4ea; border-left: 4px solid var(--orange); }
.character-count { align-self: flex-end; color: var(--muted); font-size: .72rem; }

.media-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.media-card { min-height: 400px; padding: clamp(26px, 4vw, 38px); background: var(--paper); border: 1px solid var(--line); }
.media-card.secondary-media { background: transparent; border-style: dashed; }
.media-card.secondary-media .media-icon { background: var(--paper-deep); color: var(--ink); }
.media-icon { width: 46px; height: 46px; display: grid; place-items: center; margin-bottom: 30px; background: var(--ink); color: white; border-radius: 50%; font-size: 1.2rem; }
.media-card h3 { margin: 0; font-size: 2rem; }
.media-card > p { min-height: 72px; color: var(--muted); line-height: 1.6; }
.upload-button, .record-button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 12px 17px; background: white; border: 1px solid var(--ink); border-radius: 3px; cursor: pointer; font-weight: 780; }
.media-card > small, .media-help { display: block; margin-top: 16px; color: var(--muted); font-size: .72rem; line-height: 1.5; }
.photo-preview { position: relative; margin-top: 18px; }
.photo-preview img { width: 112px; height: 112px; display: block; object-fit: cover; border-radius: 50%; }
.photo-preview button, .recording-result button { margin-top: 10px; padding: 0; border: 0; border-bottom: 1px solid currentColor; background: none; color: var(--orange-dark); cursor: pointer; font-weight: 720; }
.recorder { display: flex; align-items: center; gap: 18px; }
.record-button { gap: 9px; }
.record-button.recording { background: #9e2525; border-color: #9e2525; color: white; }
.record-dot { width: 10px; height: 10px; background: #b82a2a; border-radius: 50%; }
.recording .record-dot { background: white; animation: pulse 1.15s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
#record-time { font-variant-numeric: tabular-nums; font-weight: 800; }
.recording-result { margin-top: 18px; }
.recording-result audio { display: block; width: 100%; max-width: 320px; }

.two-column-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 18px; }
.consent-list { display: grid; gap: 10px; margin: 42px 0 0; padding: 28px; border: 1px solid var(--line); }
.consent-list legend { padding: 0 8px; font-family: Georgia, serif; font-size: 1.55rem; font-weight: 700; }
.consent-list label { display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: start; padding: 9px 0; cursor: pointer; line-height: 1.5; }
.consent-list input { width: 19px; height: 19px; margin: 2px 0 0; accent-color: var(--orange-dark); }
.withdraw-note { margin: 24px 0 0; color: var(--muted); font-size: .78rem; line-height: 1.65; }
.withdraw-note a { color: var(--ink); text-decoration: underline; }
.form-status { max-width: 880px; margin: 0 auto 24px; padding: 14px 16px; background: #fff0ef; border-left: 4px solid #a92e2e; color: #741e1e; line-height: 1.5; }
.button-spinner { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.35); border-top-color: white; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.success-panel { max-width: 760px; margin: 60px auto; text-align: center; outline: 0; }
.success-panel h2 { margin-inline: auto; }
.success-panel > p:not(.step-kicker) { max-width: 580px; margin: 22px auto; color: var(--muted); font-size: 1.06rem; line-height: 1.7; }
.success-mark { width: 58px; height: 58px; display: grid; place-items: center; margin: 0 auto 30px; background: var(--green); color: white; border-radius: 50%; font-size: 1.45rem; }
.success-actions { display: flex; justify-content: center; align-items: center; gap: 24px; margin-top: 34px; }

.footer { min-height: 120px; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); color: var(--muted); font-size: .78rem; }
.footer > div { display: flex; align-items: center; gap: 12px; font-weight: 750; }
.footer img { border-radius: 3px; }
.footer nav { display: flex; gap: 22px; }
.footer a:hover { color: var(--ink); }

/* Public stories */
.stories-page .topbar { border-bottom-color: rgba(255,255,255,.14); }
.stories-page { background: var(--ink); color: white; }
.stories-page .quiet-link { color: white; }
.stories-hero { padding-block: clamp(78px, 12vw, 150px) 72px; }
.stories-hero h1 { max-width: 1000px; }
.stories-hero p:last-child { max-width: 690px; color: rgba(255,255,255,.62); font-size: 1.2rem; line-height: 1.7; }
.stories-toolbar { display: flex; justify-content: space-between; align-items: end; gap: 24px; padding-bottom: 30px; border-bottom: 1px solid rgba(255,255,255,.15); }
.stories-toolbar p { margin: 0; color: rgba(255,255,255,.55); font-size: .82rem; }
.filter-group { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-button { padding: 9px 13px; border: 1px solid rgba(255,255,255,.25); background: transparent; color: rgba(255,255,255,.72); border-radius: 999px; cursor: pointer; font-size: .74rem; font-weight: 750; }
.filter-button.active { background: white; border-color: white; color: var(--ink); }
.stories-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; padding-block: 42px 110px; }
.story-card { min-height: 380px; display: flex; flex-direction: column; padding: clamp(28px, 4vw, 44px); background: #242420; border: 1px solid rgba(255,255,255,.12); }
.story-card.featured { background: var(--paper); color: var(--ink); }
.story-card-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.story-person { display: flex; align-items: center; gap: 13px; }
.story-avatar { width: 52px; height: 52px; display: grid; place-items: center; overflow: hidden; background: var(--orange); color: var(--ink); border-radius: 50%; font-family: Georgia,serif; font-size: 1.18rem; font-weight: 800; }
.story-avatar img { width: 100%; height: 100%; object-fit: cover; }
.story-person strong, .story-person small { display: block; }
.story-person small { margin-top: 4px; color: rgba(255,255,255,.48); font-size: .72rem; }
.featured .story-person small { color: var(--muted); }
.relationship-badge { padding: 7px 9px; border: 1px solid rgba(255,255,255,.2); border-radius: 999px; font-size: .64rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.featured .relationship-badge { border-color: var(--line); color: var(--muted); }
.story-quote { margin: 42px 0 28px; font-size: clamp(1.7rem, 3vw, 2.55rem); line-height: 1.16; }
.story-detail { display: none; margin: 0 0 24px; color: rgba(255,255,255,.6); line-height: 1.7; }
.featured .story-detail { color: var(--muted); }
.story-detail.open { display: block; }
.story-card-actions { display: flex; gap: 18px; align-items: center; margin-top: auto; }
.story-card-actions button, .story-card-actions a { padding: 0 0 3px; border: 0; border-bottom: 1px solid currentColor; background: none; color: inherit; cursor: pointer; font-size: .75rem; font-weight: 750; }
.audio-player { width: 100%; margin: 0 0 24px; }
.empty-state { grid-column: 1 / -1; padding: 84px 24px; background: #242420; border: 1px solid rgba(255,255,255,.12); text-align: center; }
.empty-state h2 { margin: 0; font-size: clamp(2.4rem, 5vw, 4.5rem); }
.empty-state p { max-width: 560px; margin: 18px auto 30px; color: rgba(255,255,255,.6); line-height: 1.7; }
.stories-page .footer { border-top-color: rgba(255,255,255,.14); color: rgba(255,255,255,.48); }

/* Admin */
.admin-page { background: #ece9e1; }
.admin-main { min-height: calc(100vh - 94px); padding-block: 60px 100px; }
.admin-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 34px; }
.admin-heading h1 { font-size: clamp(3rem, 7vw, 6rem); }
.admin-heading p { color: var(--muted); }
.login-card { max-width: 520px; margin: 60px auto; padding: 38px; background: white; border: 1px solid var(--line); box-shadow: var(--shadow); }
.login-card h1 { font-size: 3.4rem; }
.login-card .field { margin: 26px 0; }
.admin-tabs { display: flex; gap: 8px; margin-bottom: 22px; }
.admin-tabs button { padding: 10px 14px; border: 1px solid var(--line); background: transparent; cursor: pointer; border-radius: 999px; font-weight: 760; }
.admin-tabs button.active { background: var(--ink); color: white; }
.admin-list { display: grid; gap: 14px; }
.admin-story { padding: 26px; background: white; border: 1px solid var(--line); }
.admin-story header { display: flex; justify-content: space-between; gap: 18px; }
.admin-story h3 { margin: 0; font-size: 1.55rem; }
.admin-story .meta { color: var(--muted); font-size: .74rem; }
.admin-story blockquote { margin: 24px 0; padding-left: 18px; border-left: 3px solid var(--orange); font-family: Georgia,serif; font-size: 1.25rem; line-height: 1.5; }
.admin-story details { margin: 20px 0; }
.admin-story details p { color: var(--muted); line-height: 1.65; }
.admin-media { display: flex; gap: 20px; align-items: start; margin: 18px 0; }
.admin-media img { width: 120px; height: 120px; object-fit: cover; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 22px; }
.admin-actions button { padding: 10px 13px; border: 1px solid var(--ink); background: transparent; cursor: pointer; font-weight: 760; }
.admin-actions .approve { background: var(--green); border-color: var(--green); color: white; }
.admin-actions .archive { border-color: #8f2929; color: #8f2929; }
.admin-empty { padding: 60px 24px; background: white; border: 1px solid var(--line); text-align: center; color: var(--muted); }

/* Compact embedded carousel */
.widget-page { margin: 0; background: transparent; }
.widget-shell { padding: 18px; background: var(--paper); color: var(--ink); }
.widget-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 20px; }
.widget-heading h2 { margin: 0; font-size: clamp(2rem, 6vw, 4rem); }
.widget-heading a { font-size: .74rem; font-weight: 780; border-bottom: 1px solid; }
.widget-track { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(min(82vw, 430px), 1fr); gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 12px; }
.widget-track .story-card { min-height: 300px; scroll-snap-align: start; background: white; color: var(--ink); border-color: var(--line); }
.widget-track .story-person small { color: var(--muted); }
.widget-track .relationship-badge { border-color: var(--line); color: var(--muted); }

@media (max-width: 780px) {
  .shell { width: min(100% - 28px, 680px); }
  .topbar { min-height: 78px; }
  .topbar .brand img { width: 48px; height: 48px; }
  .story-hero { grid-template-columns: 1fr; padding-block: 58px 54px; }
  h1 { font-size: clamp(3.8rem, 18vw, 6rem); }
  .jenkin-card { display: grid; grid-template-columns: 112px 1fr; align-items: center; padding: 12px; }
  .jenkin-card img { height: 100%; }
  .jenkin-card div { padding: 16px 18px; }
  .jenkin-card p { font-size: 1rem; }
  .jenkin-card span { font-size: .62rem; }
  .form-shell { width: 100%; padding: 32px 20px; margin-bottom: 70px; border-left: 0; border-right: 0; }
  .choice-grid, .media-grid, .two-column-fields, .stories-grid { grid-template-columns: 1fr; }
  .choice-card { min-height: 105px; }
  .media-card { min-height: auto; }
  .media-card > p { min-height: 0; }
  .step-actions { margin-top: 34px; }
  .step-actions .button { min-width: 132px; }
  .consent-list { padding: 20px; }
  .success-actions { flex-direction: column; }
  .footer { min-height: 110px; }
  .footer > div span { display: none; }
  .stories-toolbar { align-items: start; flex-direction: column; }
  .story-card { min-height: 330px; }
  .story-card-top { align-items: start; }
  .relationship-badge { max-width: 110px; text-align: center; line-height: 1.3; }
  .admin-heading { align-items: start; flex-direction: column; }
  .admin-story header { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
