/* ============================================================
   THE KEYSTONE NETWORK
   A society's newspaper of record.
   Ink #121212 on white. Hairlines carry structure. Type does
   the work: blackletter masthead, Georgia headline ladder,
   Libre Franklin UPPERCASE eyebrows at 1px tracking.
   One functional color: editorial blue #326891 on links.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=UnifrakturMaguntia&family=EB+Garamond:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400;1,500;1,600;1,700&display=swap');

:root {
  --canvas:      #ffffff;
  --ink:         #121212;
  --ink-2:       #363636;
  --ink-3:       #5a5a5a;
  --ink-4:       #727272;
  --rule:        #dfdfdf;
  --rule-strong: #c7c7c7;
  --editorial:   #326891;  /* link + the one accent */
  --accent:      #2671dc;  /* link hover / focus */

  --blackletter: 'UnifrakturMaguntia', 'Old English Text MT', serif;  /* titles only */
  --garamond:    'EB Garamond', Garamond, georgia, 'Times New Roman', serif;  /* all non-title text */
  --display:     var(--garamond);
  --serif:       var(--garamond);
  --franklin:    var(--garamond);

  /* legacy aliases (brand.html) */
  --paper: #ffffff; --paper-deep: #f4f4f4; --ink-soft: #5a5a5a;
  --ink-mute: #727272; --brass: #326891; --brass-deep: #26506f;
  --line: #dfdfdf; --line-soft: #ebebeb;
  --serif-display: georgia, serif; --serif-body: georgia, serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 700;            /* all non-title text: bold Garamond */
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.sheet {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 40px);
}

a { color: var(--editorial); text-decoration: none; }
a:hover { color: var(--accent); }

/* ============================================================
   TYPE LADDER
   ============================================================ */
.eyebrow {
  font-family: var(--franklin);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--ink);
  margin: 0 0 10px;
}
.hed {
  font-family: var(--serif);
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}
.dek {
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-2);
}
.meta {
  font-family: var(--franklin);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-4);
}

/* ============================================================
   DATELINE + MASTHEAD
   ============================================================ */
.dateline {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 12px 0 10px;
  border-bottom: 1px solid var(--rule);
  font-family: var(--franklin);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--ink-3);
}

.masthead {
  text-align: center; /* the one centered element on the page */
  padding: clamp(22px, 4vw, 38px) 0 clamp(14px, 2.5vw, 22px);
}
.masthead h1 {
  font-family: var(--blackletter);
  font-weight: 400;
  font-size: clamp(2.1rem, 6.5vw, 4rem);
  line-height: 1;
  margin: 0;
  color: var(--ink);
}
.masthead .tagline {
  margin: 12px 0 0;
  font-family: var(--franklin);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--ink-3);
}

/* double rule under the masthead, print style, with a centered flourish */
.masthead-rule {
  display: flex;
  align-items: center;
  justify-content: center;
}
.mr-line {
  flex: 1 1 auto;
  height: 3px;
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}
.mr-line-l { transform-origin: right center; margin-right: 22px; }
.mr-line-r { transform-origin: left center;  margin-left: 22px; }
.mr-flourish {
  flex: 0 0 auto;
  height: 26px;
  width: auto;
  display: block;
}

/* ============================================================
   FRONT PAGE — asymmetric lead + rail
   ============================================================ */
.front {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 3fr);
  gap: 0 32px;
  padding: clamp(24px, 4vw, 40px) 0 clamp(28px, 5vw, 48px);
}

.lead { padding-right: 32px; border-right: 1px solid var(--rule); }

.lead-hed {
  font-size: clamp(1.5rem, 3.4vw, 2rem);
  line-height: 1.15;
  letter-spacing: 0.1px;
}

/* --- motto reveal: Latin bold ⇄ quiet translation, sequenced fade --- */
.motto-stage { position: relative; display: block; cursor: default; }
.motto-trans {
  display: block;
  font-style: italic;
  font-weight: 400;
  color: var(--ink-2);
  opacity: 0;
  transition: opacity 0.7s ease;
}
.motto-latin {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  font-weight: 700;
  font-style: normal;
  color: var(--ink);
  opacity: 1;
  transition: opacity 0.7s ease 0.75s;
}
.motto-stage.reveal .motto-latin { opacity: 0; transition: opacity 0.7s ease; }
.motto-stage.reveal .motto-trans { opacity: 1; transition: opacity 0.7s ease 0.75s; }
@media (prefers-reduced-motion: reduce) {
  .motto-latin, .motto-trans,
  .motto-stage.reveal .motto-latin, .motto-stage.reveal .motto-trans { transition-duration: 0.01ms; }
}

.lead .lede {
  margin: 18px 0 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-2);
}
.lead .lede em { font-style: italic; }
.lead .translation-note {
  margin: 10px 0 0;
  font-family: var(--franklin);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-4);
}

/* rail */
.rail .item { padding: 0 0 16px; margin: 0 0 16px; border-bottom: 1px solid var(--rule); }
.rail .item:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.rail .item .hed { font-size: 16px; line-height: 1.25; margin-bottom: 6px; }
.rail .item p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--ink-2); }

/* ============================================================
   FORMATS INDEX — four columns over a hairline
   ============================================================ */
.index { border-top: 1px solid var(--rule); padding: 22px 0 30px; }
.index .index-label { margin-bottom: 18px; }
.index .cols {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0 24px;
}
.index .col { padding-left: 24px; border-left: 1px solid var(--rule); }
.index .col:first-child { padding-left: 0; border-left: 0; }
.index .col .hed { font-size: 16px; margin-bottom: 6px; }
.index .col p { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }

/* ============================================================
   BUTTON — ink on white, 3px. No ghost luxury.
   ============================================================ */
.btn {
  display: inline-block;
  font-family: var(--franklin);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--ink);
  background: var(--canvas);
  border: 1px solid var(--ink);
  border-radius: 3px;
  padding: 10px 18px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.btn:hover { background: var(--ink); color: var(--canvas); }
.btn:disabled { opacity: 0.45; cursor: default; }

/* ============================================================
   COVER — the minimal front: masthead, motto, connect
   ============================================================ */
.cover {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}
.cover-arch {
  width: 80px;
  height: auto;
  color: var(--ink);
  margin-bottom: 12px;
}
/* bolder strokes so the mark stays crisp at small size */
.cover-arch path { stroke-width: 2.8; }
.cover-arch g line { stroke-width: 1.6; }
.cover-masthead {
  font-family: var(--blackletter);
  font-weight: 400;
  font-size: clamp(1.85rem, 8vw, 4.6rem);
  line-height: 1.05;
  margin: 0;
  color: var(--ink);
}
.cover-motto {
  margin: 26px 0 0;
  font-family: var(--serif);
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
}
.cover .motto-stage { display: inline-block; white-space: nowrap; }
.cover .motto-latin { justify-content: center; }
.cover .btn { margin-top: 40px; }
@media (max-width: 480px) { .cover .motto-stage { white-space: normal; } }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  border-top: 1px solid var(--rule);
  padding: 14px 0 40px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-family: var(--franklin);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--ink-4);
}

/* ============================================================
   CONNECT PAGE
   ============================================================ */
.masthead.small { padding: 18px 0 12px; }
.masthead.small h1 { font-size: clamp(1.7rem, 4.5vw, 2.4rem); }
.masthead.small h1 a { color: var(--ink); }
.masthead.small h1 a:hover { color: var(--ink); }

.dateline .back {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1;
  color: var(--ink);
  text-decoration: none;
}
.dateline .back:hover { color: var(--accent); }

.connect-single {
  max-width: 560px;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 48px) 0 clamp(40px, 7vw, 72px);
}

.connect-body {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 6fr);
  gap: 0 32px;
  padding: clamp(24px, 4vw, 40px) 0 clamp(32px, 5vw, 56px);
}
.connect-note { padding-right: 32px; border-right: 1px solid var(--rule); }
.connect-note .hed { font-size: clamp(1.3rem, 2.6vw, 1.7rem); line-height: 1.2; margin-bottom: 12px; }
.connect-note p { margin: 0 0 12px; font-size: 15px; line-height: 1.55; color: var(--ink-2); }

.form .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.form .field { display: flex; flex-direction: column; margin-bottom: 16px; }
.form .field.wide { grid-column: 1 / -1; }
.form label {
  font-family: var(--franklin);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--ink);
  margin-bottom: 5px;
}
.form input {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
  background: var(--canvas);
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
  padding: 8px 12px;
  outline: none;
  transition: border-color 0.15s ease;
}
.form input::placeholder { color: var(--ink-4); }
.form input:focus { border-color: var(--ink); }

/* Location: multi-select dropdown with gray confirmation chips */
/* elevate the whole Location field so its open menu overlays the fields below */
.form .loc-field { position: relative; z-index: 40; }
.form .multi { position: relative; }
.form .multi-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
  background: var(--canvas);
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
  padding: 8px 12px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease;
}
.form .multi-toggle:focus { outline: none; border-color: var(--ink); }
.form .multi-toggle #locToggleText { color: var(--ink-4); }
.multi-caret {
  width: 0; height: 0; margin-left: 10px;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--ink-3);
}
.form .multi-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  z-index: 50;
  background: var(--canvas);
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
  box-shadow: 0 6px 22px rgba(18, 18, 18, 0.14);
  padding: 4px 0;
  max-height: 260px;
  overflow: auto;
}
.multi-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
}
.multi-opt:hover { background: var(--paper-deep); }
.multi-opt input { width: 15px; height: 15px; accent-color: var(--ink); cursor: pointer; }

.form .location-other { margin-top: 8px; }

/* the confirmation chips — small gray tabs, black text */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #ebebeb;
  color: #121212;
  border-radius: 3px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 12px;
  padding: 3px 6px 3px 9px;
}
.chip-x {
  border: none;
  background: none;
  color: #121212;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  padding: 0;
}
.chip-x:hover { color: #a61b1e; }
.form .actions { margin-top: 6px; display: flex; align-items: center; gap: 14px; }
.form .status { font-family: var(--franklin); font-size: 12px; font-weight: 500; color: var(--ink-3); }
.form .status.err { color: #a61b1e; }

.thanks .hed { font-size: 22px; margin-bottom: 8px; }
.thanks p { font-size: 15px; color: var(--ink-2); max-width: 46ch; }

.form label .optional {
  font-weight: 500;
  color: var(--ink-4);
  text-transform: none;
  letter-spacing: 0.3px;
}

/* all non-title text is bold Garamond (these selectors set lighter weights) */
.eyebrow, .meta, .dateline, .masthead .tagline, .footer,
.btn, .form label, .form .status, .footnote, .motto-trans {
  font-weight: 700;
}

/* ============================================================
   MOTION — subtle, print-quiet
   ============================================================ */
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
@keyframes draw {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}
@keyframes lineOut {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}
@keyframes bloom {
  from { opacity: 0; transform: scale(0.4); }
  to   { opacity: 1; transform: scale(1); }
}

/* cover: arch, masthead, motto, button arrive in order */
.cover-arch     { animation: rise 0.6s ease-out backwards; }
.cover-masthead { animation: rise 0.6s ease-out 0.12s backwards; }
.cover-motto    { animation: rise 0.6s ease-out 0.26s backwards; }
.cover .btn     { animation: rise 0.6s ease-out 0.4s backwards; }

/* connect: chrome first, then the fields stagger in */
.dateline       { animation: rise 0.45s ease-out backwards; }
.masthead       { animation: rise 0.55s ease-out 0.05s backwards; }
/* rule reveal: flourish blooms at center, then the lines draw outward from it */
.mr-flourish    { animation: bloom 0.55s ease-out 0.18s backwards; }
.mr-line-l,
.mr-line-r      { animation: lineOut 0.6s ease-out 0.42s backwards; }
.form .field:nth-child(1) { animation: rise 0.45s ease-out 0.20s backwards; }
.form .field:nth-child(2) { animation: rise 0.45s ease-out 0.26s backwards; }
.form .field:nth-child(3) { animation: rise 0.45s ease-out 0.32s backwards; }
.form .field:nth-child(4) { animation: rise 0.45s ease-out 0.38s backwards; }
.form .field:nth-child(5) { animation: rise 0.45s ease-out 0.44s backwards; }
.form .field:nth-child(6) { animation: rise 0.45s ease-out 0.50s backwards; }
.form .field:nth-child(7) { animation: rise 0.45s ease-out 0.56s backwards; }
.form .field:nth-child(8) { animation: rise 0.45s ease-out 0.62s backwards; }
.form .actions  { animation: rise 0.45s ease-out 0.70s backwards; }
.thanks         { animation: rise 0.5s ease-out backwards; }

/* button: a quiet press-and-lift */
.btn { transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .cover-arch, .cover-masthead, .cover-motto, .cover .btn,
  .dateline, .masthead, .masthead-rule,
  .mr-line-l, .mr-line-r, .mr-flourish,
  .form .field, .form .actions, .thanks { animation: none; }
  .btn:hover, .btn:active { transform: none; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 820px) {
  .front { grid-template-columns: 1fr; }
  .lead { padding-right: 0; border-right: 0; padding-bottom: 22px; border-bottom: 1px solid var(--rule); margin-bottom: 22px; }
  .index .cols { grid-template-columns: 1fr 1fr; gap: 20px 24px; }
  .index .col:nth-child(odd) { padding-left: 0; border-left: 0; }
  .connect-body { grid-template-columns: 1fr; }
  .connect-note { padding-right: 0; border-right: 0; padding-bottom: 20px; border-bottom: 1px solid var(--rule); margin-bottom: 24px; }
}
@media (max-width: 480px) {
  .index .cols { grid-template-columns: 1fr; }
  .index .col { padding-left: 0; border-left: 0; }
  .form .grid { grid-template-columns: 1fr; }
  .cover { padding: 20px 18px; }
  .cover-arch { width: 64px; }
  .interior { padding: 20px 18px 40px; }
  .dateline { font-size: 9px; letter-spacing: 0.6px; }
  /* menu stays contained on small screens */
  .form .multi-menu { max-height: 220px; }
  .chip { font-size: 11px; }
}
/* avoid any accidental horizontal scroll on phones */
html, body { max-width: 100%; overflow-x: hidden; }
