/* Vanguard · vanguard.ryansite.org — warm paper, deep forest, ember. No JS. */

:root {
  --paper: #f4eee3;
  --paper-2: #ebe2d2;
  --card: #fbf8f2;
  --ink: #1e231e;
  --ink-soft: #4d544b;
  --rule: #d8cdb8;
  --ember: #a5491f;
  --ember-ink: #8c3c17;
  --ember-soft: #f0dccd;
  --forest: #233024;
  --forest-2: #2d3d2e;
  --on-forest: #efe8da;
  --on-forest-soft: #bfc7b5;
  --moss: #56683f;
  --ok: #3f6b3a;
  --bad: #a3322a;
  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
  --wrap: 1120px;
  --radius: 14px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #151915;
    --paper-2: #1b201b;
    --card: #1f251f;
    --ink: #ece5d6;
    --ink-soft: #b6ae9f;
    --rule: #343c32;
    --ember: #e28a5b;
    --ember-ink: #eda27a;
    --ember-soft: #3a261b;
    --forest: #0f1410;
    --forest-2: #182019;
    --on-forest: #ece5d6;
    --on-forest-soft: #a9b39f;
    --moss: #a3b784;
    --ok: #8fc283;
    --bad: #f08b80;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--sans);
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: var(--ember-ink); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--ember); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.12; letter-spacing: -.01em; margin: 0 0 .5em; }
h1 { font-size: clamp(2.4rem, 6.2vw, 4.4rem); font-weight: 400; letter-spacing: -.02em; }
h1 em { font-style: italic; color: var(--ember); white-space: nowrap; }
h2 { font-size: clamp(1.75rem, 3.6vw, 2.6rem); font-weight: 400; }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--card); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.eyebrow {
  font: 600 .8rem/1.2 var(--sans);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ember-ink);
  margin-bottom: 1rem;
}

/* Header */
.site-head { border-bottom: 1px solid var(--rule); background: var(--paper); position: sticky; top: 0; z-index: 5; }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; }
.wordmark {
  display: inline-flex; align-items: center; gap: .55rem;
  font: 600 1.05rem/1 var(--sans); letter-spacing: .22em; text-transform: uppercase;
  color: var(--ink); text-decoration: none;
}
.mark { width: 28px; height: 28px; color: var(--ember); flex: none; }
.head-nav { display: flex; align-items: center; gap: 1.25rem; }
.head-nav a:not(.btn) { color: var(--ink-soft); text-decoration: none; font-weight: 600; font-size: .95rem; }
.head-nav a:not(.btn):hover { color: var(--ink); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 1.4rem;
  border: 2px solid var(--ember); border-radius: 999px;
  background: var(--ember); color: #fff8f0;
  font: 600 1rem/1 var(--sans); text-decoration: none; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--ember-ink); border-color: var(--ember-ink); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn-ghost:hover { background: var(--paper-2); color: var(--ink); border-color: var(--ink-soft); }
.btn-small { min-height: 38px; padding: 0 1rem; font-size: .92rem; }
.btn-block { width: 100%; }
@media (prefers-color-scheme: dark) { .btn { color: #1a120c; } .btn:hover { color: #1a120c; } }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }
.actions form { margin: 0; }
.text-link { font-weight: 600; color: var(--on-forest); }

/* Hero */
.hero { padding: clamp(48px, 8vw, 104px) 0 clamp(48px, 7vw, 88px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.lede { font-size: clamp(1.15rem, 1.8vw, 1.32rem); color: var(--ink-soft); max-width: 36em; }
.hero.narrow .wrap { max-width: 760px; }

.when-card {
  background: var(--forest); color: var(--on-forest);
  border-radius: var(--radius); padding: clamp(24px, 3vw, 36px);
  box-shadow: 0 1px 0 rgba(0,0,0,.04), 0 24px 48px -28px rgba(20, 30, 20, .55);
}
.when-card hr { border: 0; border-top: 1px solid rgba(239, 232, 218, .18); margin: 1.25rem 0; }
.when-label { font: 600 .78rem/1.2 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--on-forest-soft); margin-bottom: .6rem; }
.when-time { font: 400 clamp(1.5rem, 2.6vw, 1.95rem)/1.15 var(--serif); margin: 0 0 .2rem; }
.when-time.alt { color: var(--on-forest-soft); font-size: clamp(1.15rem, 2vw, 1.35rem); }
.when-first { font: 400 1.2rem/1.3 var(--serif); margin-bottom: .75rem; }
.when-first span { display: block; font: 600 .78rem/1.2 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: #f0a77f; margin-bottom: .35rem; }
.when-where { color: var(--on-forest-soft); font-size: .98rem; }

/* Event hero */
.date-stamp {
  display: inline-grid; grid-template-rows: auto auto auto; justify-items: center;
  border: 2px solid var(--ember); border-radius: 12px; padding: .55rem 1.1rem .6rem;
  margin-bottom: 1.25rem; color: var(--ember-ink); background: var(--card);
}
.ds-day, .ds-mon { font: 600 .78rem/1.1 var(--sans); letter-spacing: .18em; text-transform: uppercase; }
.ds-num { font: 400 3.1rem/1 var(--serif); color: var(--ink); margin: .1rem 0; }
.event-when { font: 400 clamp(1.2rem, 2.2vw, 1.5rem)/1.4 var(--serif); margin-bottom: 1rem; }
.event-when strong { font-weight: 600; }

/* Bands */
.band { padding: clamp(56px, 8vw, 96px) 0; border-top: 1px solid var(--rule); }
.section-head { max-width: 46rem; margin-bottom: clamp(28px, 4vw, 48px); }
.section-lede { font-size: 1.15rem; color: var(--ink-soft); }
.minor-head { font-size: 1.35rem; font-weight: 600; margin-top: 2.5rem; }

.pillars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 36px); }
.pillars article { border-top: 3px solid var(--ember); padding-top: 1.1rem; }
.pillars p { color: var(--ink-soft); }

.rules { background: var(--forest); color: var(--on-forest); border-top: 0; }
.rules .eyebrow { color: #f0a77f; }
.rules .section-lede, .rules .norms li { color: var(--on-forest-soft); }
.rules .norms strong { color: var(--on-forest); }
.rule-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2.5vw, 28px); }
.rule-list li { background: var(--forest-2); border-radius: var(--radius); padding: 1.6rem 1.5rem; display: grid; gap: .9rem; align-content: start; }
.rule-list p { color: var(--on-forest-soft); margin: 0; }
.rule-n {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  border: 1.5px solid #f0a77f; color: #f0a77f; font: 400 1.35rem/1 var(--serif);
}
.norms { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 3rem; }
.norms li { break-inside: avoid; padding: .7rem 0; border-top: 1px solid var(--rule); color: var(--ink-soft); }
.rules .norms li { border-top-color: rgba(239, 232, 218, .16); }

.books { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(20px, 3vw, 36px); }
.book { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: clamp(22px, 3vw, 34px); position: relative; overflow: hidden; }
.book::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 6px; background: var(--moss); }
.book:first-child::before { background: var(--ember); }
.book h3 { font-size: clamp(1.5rem, 2.6vw, 1.9rem); font-weight: 400; margin-bottom: .2rem; }
.book-when { font: 600 .78rem/1.2 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--ember-ink); margin-bottom: .7rem; }
.book-by { color: var(--ink-soft); font-style: italic; font-family: var(--serif); margin-bottom: 1rem; }

.fit { background: var(--paper-2); }
.fit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(28px, 5vw, 64px); }
.fit-col h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
.fit-col ul { list-style: none; padding: 0; margin: 0; }
.fit-col li { position: relative; padding: .85rem 0 .85rem 2rem; border-top: 1px solid var(--rule); }
.fit-col li::before { position: absolute; left: 0; top: .8rem; font: 600 1.1rem/1.4 var(--sans); }
.fit-col.yes li::before { content: "✓"; color: var(--ok); }
.fit-col.no li::before { content: "✕"; color: var(--bad); }

.host-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(24px, 4vw, 48px); }
.host { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 1.4rem; align-items: start; }
.portrait {
  width: 112px; height: 112px; border-radius: 50%; object-fit: cover;
  border: 3px solid var(--card); box-shadow: 0 0 0 1px var(--rule), 0 12px 24px -14px rgba(30, 25, 15, .5);
  background: var(--paper-2);
}
.host h3 { margin-bottom: .1rem; font-size: 1.5rem; }
.host-role { font: 600 .8rem/1.3 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--ember-ink); margin-bottom: .8rem; }
.host p:last-child { color: var(--ink-soft); }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; max-width: 54rem; }
.timeline li { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: 1.25rem; padding: 1.1rem 0; border-top: 1px solid var(--rule); }
.timeline time { font: 400 1.5rem/1.2 var(--serif); color: var(--ember-ink); font-variant-numeric: tabular-nums; }
.timeline h3 { margin-bottom: .25rem; }
.timeline p { color: var(--ink-soft); margin: 0; }

/* Join */
.join { background: var(--forest); color: var(--on-forest); padding: clamp(56px, 8vw, 104px) 0; scroll-margin-top: 64px; }
.join-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
.join .eyebrow { color: #f0a77f; }
.join-copy p { color: var(--on-forest-soft); font-size: 1.1rem; }
.join-when { font: 400 1.25rem/1.45 var(--serif); color: var(--on-forest) !important; border-left: 3px solid #f0a77f; padding-left: 1rem; margin-top: 1.5rem; }
.join-form {
  background: var(--card); color: var(--ink); border-radius: var(--radius);
  padding: clamp(22px, 3vw, 36px); display: grid; gap: .35rem;
  box-shadow: 0 30px 60px -34px rgba(0, 0, 0, .6);
}
.join-form label { font-weight: 600; font-size: .95rem; margin-top: .65rem; }
.join-form .opt { font-weight: 400; color: var(--ink-soft); }
.join-form input:not([type="checkbox"]), .join-form textarea {
  width: 100%; min-height: 48px; padding: .7rem .9rem;
  border: 1.5px solid var(--rule); border-radius: 10px;
  background: var(--paper); color: var(--ink); font: 400 1.05rem/1.4 var(--sans);
}
.join-form textarea { min-height: 220px; resize: vertical; }
.join-form input:focus, .join-form textarea:focus { border-color: var(--ember); outline: none; box-shadow: 0 0 0 3px var(--ember-soft); }
.join-form [aria-invalid="true"] { border-color: var(--bad); }
.join-form .check { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: .7rem; align-items: start; font-weight: 400; margin: 1rem 0 .4rem; line-height: 1.45; }
.join-form .check input { width: 20px; height: 20px; margin: .12rem 0 0; accent-color: var(--ember); }
.join-form .btn { margin-top: .9rem; }
.field-error { color: var(--bad); font-size: .92rem; font-weight: 600; margin: .15rem 0 0; }
.form-alert { background: #f7ddd8; color: #7a2119; border-radius: 10px; padding: .75rem 1rem; font-weight: 600; margin: 0 0 .5rem; }
@media (prefers-color-scheme: dark) { .form-alert { background: #3d1f1b; color: #f6c0b7; } }
.fine { font-size: .85rem; color: var(--ink-soft); margin: .6rem 0 0; text-align: center; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Thanks */
.confirm-card { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: clamp(22px, 3vw, 36px); margin: 2rem 0; }
.confirm-card .when-label { color: var(--ember-ink); margin-top: 1rem; }
.confirm-card .when-label:first-child { margin-top: 0; }
.confirm-big { font: 400 clamp(1.3rem, 2.6vw, 1.7rem)/1.3 var(--serif); margin-bottom: .5rem; overflow-wrap: anywhere; }
.hero.narrow .norms { columns: 1; }

/* Footer */
.site-foot { border-top: 1px solid var(--rule); padding: 40px 0 56px; color: var(--ink-soft); font-size: .95rem; }
.foot-grid { display: grid; grid-template-columns: 1.5fr 2fr 1.1fr; gap: 1.5rem; align-items: start; }
.foot-brand { display: flex; align-items: center; gap: .5rem; font-weight: 600; color: var(--ink); }
.foot-brand .mark { width: 22px; height: 22px; }

/* Admin */
.admin { padding: 40px 0 72px; }
.admin h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
.admin-nav { display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; align-items: center; margin-bottom: 2rem; padding-bottom: 1rem; border-bottom: 1px solid var(--rule); }
.admin-nav a { font-weight: 600; text-decoration: none; }
.admin-nav form { margin: 0 0 0 auto; }
.link-btn { background: none; border: 0; padding: 0; font: 600 1rem var(--sans); color: var(--ember-ink); cursor: pointer; text-decoration: underline; text-underline-offset: .18em; }
.link-btn.danger { color: var(--bad); font-size: .9rem; }
.admin-login { max-width: 420px; margin: 4vh auto; }
.stats { font-size: 1.1rem; }
.flash { background: var(--ember-soft); border-radius: 10px; padding: .75rem 1rem; font-weight: 600; }
.table-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: 12px; background: var(--card); }
table.data { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.data th, table.data td { text-align: left; padding: .65rem .85rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
table.data th { font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); background: var(--paper-2); }
table.data tr:last-child td { border-bottom: 0; }
.inline-form { margin: 0; }
.pill { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 600; }
.pill.ok { background: rgba(63, 107, 58, .15); color: var(--ok); }
.pill.off { background: var(--paper-2); color: var(--ink-soft); }
.pill.bad { background: rgba(163, 50, 42, .14); color: var(--bad); }
.empty { color: var(--ink-soft); }
.row-form { display: flex; flex-wrap: wrap; gap: .75rem; max-width: 560px; }
.row-form input { flex: 1 1 240px; min-height: 40px; padding: .4rem .8rem; border: 1.5px solid var(--rule); border-radius: 10px; background: var(--card); color: var(--ink); font: inherit; }
.compose { max-width: 760px; }
.mail-preview { background: var(--card); border: 1px solid var(--rule); border-radius: 12px; padding: 1.25rem 1.4rem; max-width: 760px; }
.mail-preview p { margin: 0 0 .35rem; }
.mail-preview p span { display: inline-block; min-width: 6.5rem; color: var(--ink-soft); font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; }
.mail-preview pre { white-space: pre-wrap; font: 400 1rem/1.55 var(--sans); margin: 1rem 0 0; padding-top: 1rem; border-top: 1px solid var(--rule); }
.hidden-field { display: none; }

/* Responsive */
@media (max-width: 900px) {
  .hero-grid, .join-grid { grid-template-columns: minmax(0, 1fr); }
  .rule-list, .pillars { grid-template-columns: minmax(0, 1fr); }
  .host-list, .books, .fit-grid { grid-template-columns: minmax(0, 1fr); }
  .foot-grid { grid-template-columns: minmax(0, 1fr); gap: .5rem; }
}
@media (max-width: 600px) {
  body { font-size: 1rem; }
  .head-nav a:not(.btn) { display: none; }
  .norms { columns: 1; }
  .host { grid-template-columns: 96px minmax(0, 1fr); gap: 1rem; }
  .portrait { width: 96px; height: 96px; }
  .timeline li { grid-template-columns: minmax(0, 1fr); gap: .2rem; }
  .actions .btn { flex: 1 1 100%; }
  .admin-nav form { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
