/* ==========================================================================
   THE KLECKNER FAMILY HISTORY — v4
   A lucid genealogical archive / family-history invitation.

   Archival editorial direction: warm paper and dark ink, a restrained
   oxblood accent, ruled registers, catalogue cards, and a single engraved
   plate. Self-contained — no external fonts, scripts, images or requests.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  --paper:    #F4EDE0;
  --paper-2:  #ECE2CE;
  --paper-3:  #FBF6EC;
  --ink:      #241E16;
  --ink-2:    #4A4034;
  --muted:    #6E6354;
  --accent:   #8C3B2E;
  --gold:     #9A6B2F;
  --rule:     rgba(36, 30, 22, 0.16);
  --rule-2:   rgba(36, 30, 22, 0.30);
  --shadow:   0 24px 60px -40px rgba(36, 30, 22, 0.55);

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua",
           Georgia, "Times New Roman", Times, serif;
  --sans:  ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
           "Helvetica Neue", Arial, sans-serif;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --wrap: 1140px;
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */
*, *::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-family: var(--serif);
  font-size: clamp(17px, 0.6vw + 15.4px, 19px);
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }

h1, h2, h3 { font-weight: 400; line-height: 1.06; letter-spacing: -0.015em; margin: 0; text-wrap: balance; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--accent); text-underline-offset: 3px; }

::selection { background: var(--accent); color: var(--paper-3); }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--ink); color: var(--paper-3);
  padding: 12px 20px; font-family: var(--sans); font-size: 0.82rem;
  letter-spacing: 0.04em; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}

.wrap {
  width: 100%; max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 64px);
}
.wrap-narrow { max-width: 760px; }

/* --------------------------------------------------------------------------
   3. Masthead
   -------------------------------------------------------------------------- */
.masthead {
  position: relative;
  min-height: 100svh;
  display: flex; align-items: center;
  padding-block: clamp(28px, 6vh, 72px);
  background:
    radial-gradient(120% 90% at 78% 12%, rgba(154, 107, 47, 0.10), transparent 60%),
    linear-gradient(180deg, var(--paper-3), var(--paper) 62%);
  border-bottom: 1px solid var(--rule);
}

/* a faint ledger rule across the whole masthead */
.masthead::before {
  content: "";
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(
    to bottom, transparent 0 43px, var(--rule) 43px 44px);
  opacity: 0.35;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,.5), transparent 85%);
          mask-image: linear-gradient(180deg, rgba(0,0,0,.5), transparent 85%);
}

.masthead-grid {
  position: relative;
  width: 100%; max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 64px);
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
}

.masthead-copy { min-width: 0; }

.register {
  display: flex; justify-content: space-between; gap: 1rem;
  font-family: var(--sans);
  font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.26em; text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 clamp(20px, 4vh, 40px);
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--rule-2);
}
.register-l { color: var(--ink-2); }
.register-r { color: var(--accent); }

.eyebrow {
  font-family: var(--sans);
  font-size: 0.75rem; font-weight: 700;
  letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.9rem;
}

.title {
  font-size: clamp(2.6rem, 6.4vw, 5rem);
  line-height: 0.96;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin: 0 0 clamp(18px, 3vh, 30px);
}
.title-em { font-style: italic; color: var(--accent); }

.lede {
  font-size: clamp(1.06rem, 1.1vw + 0.8rem, 1.32rem);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 46ch;
  margin: 0 0 clamp(18px, 3vh, 28px);
}
.lede em { font-style: italic; color: var(--ink); }

.honest {
  font-family: var(--sans);
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 42ch;
  margin: 0;
  padding-left: 1rem;
  border-left: 2px solid var(--accent);
}
.honest strong { color: var(--accent); }

/* ---- the plate ---- */
.plate {
  margin: 0;
  border: 1px solid var(--rule-2);
  background: var(--paper-3);
  box-shadow: var(--shadow);
  padding: clamp(10px, 1.4vw, 18px);
}
.plate-svg { width: 100%; height: auto; }

.plate-cap {
  margin: clamp(12px, 1.6vw, 18px) 0 0;
  padding-top: 0.8rem;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--ink-2);
}
.plate-cap .fig {
  font-family: var(--serif);
  font-style: italic;
  color: var(--accent);
  margin-right: 0.35em;
}

/* --------------------------------------------------------------------------
   4. Bands
   -------------------------------------------------------------------------- */
.band { padding-block: clamp(56px, 9vw, 118px); }

.band-what {
  background: var(--paper-2);
  border-bottom: 1px solid var(--rule);
}

.kicker {
  font-family: var(--sans);
  font-size: 0.75rem; font-weight: 700;
  letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.8rem;
}

.h2 {
  font-size: clamp(1.9rem, 3.4vw, 3rem);
  color: var(--ink);
  margin: 0 0 clamp(16px, 2.4vw, 26px);
}

.section-lede {
  font-size: clamp(1.02rem, 0.5vw + 0.9rem, 1.18rem);
  color: var(--ink-2);
  max-width: 62ch;
  margin: 0 0 clamp(30px, 4vw, 52px);
}

/* ---- catalogue cards ---- */
.catalogue {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: clamp(16px, 2vw, 26px);
}

/* On wide screens the three cards fill one row evenly. */
@media (min-width: 940px) {
  .catalogue { grid-template-columns: repeat(6, 1fr); }
  .card { grid-column: span 2; }
}

.card {
  position: relative;
  background: var(--paper-3);
  border: 1px solid var(--rule-2);
  border-top: 3px solid var(--accent);
  padding: clamp(20px, 2.2vw, 30px) clamp(20px, 2.2vw, 30px) clamp(22px, 2.4vw, 32px);
  box-shadow: 0 18px 40px -34px rgba(36, 30, 22, 0.6);
}
.card-no {
  display: block;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
  font-size: 1.18rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
}
.card-title {
  font-size: clamp(1.16rem, 1vw + 0.9rem, 1.4rem);
  color: var(--ink);
  margin: 0 0 0.5rem;
}
.card-body {
  font-size: 1rem;
  line-height: 1.6;
  color: #3B3227;
  margin: 0;
}

/* ---- where this begins ---- */
.band-where { background: var(--paper); }

.prose p {
  font-size: clamp(1.04rem, 0.6vw + 0.9rem, 1.22rem);
  line-height: 1.7;
  color: var(--ink-2);
  margin: 0 0 1.1em;
  text-wrap: pretty;
}
.prose p:last-child { margin-bottom: 0; }

.drop::first-letter {
  float: left;
  font-size: 3.05em;
  line-height: 0.86;
  padding: 0.04em 0.11em 0 0;
  color: var(--accent);
  font-style: italic;
}

/* ---- inline url token (a placeholder, deliberately not a link) ---- */
.url {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.86em;
  color: var(--accent);
  background: rgba(140, 59, 46, 0.08);
  border-radius: 3px;
  padding: 0.05em 0.34em;
  white-space: nowrap;
}

/* ---- status line ---- */
.status {
  display: inline-flex; align-items: center; gap: 0.6rem;
  margin: clamp(26px, 3vw, 38px) 0 0;
  font-family: var(--sans);
  font-size: 0.82rem; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-2);
  background: var(--paper-3);
  border-left: 3px solid var(--gold);
  padding: 0.7rem 1rem;
}
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(154, 107, 47, 0.18);
}

/* ---- template: mock browser + note ---- */
.tpl-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(24px, 3.4vw, 48px);
  align-items: center;
}

.mock {
  border: 1px solid var(--rule-2);
  background: var(--paper-3);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.mock-bar {
  display: flex; align-items: center; gap: 0.8rem;
  padding: 0.6rem 0.9rem;
  background: var(--paper-2);
  border-bottom: 1px solid var(--rule-2);
}
.mock-dots { display: inline-flex; gap: 5px; }
.mock-dots i {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--rule-2); display: block;
}
.mock-url {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.78rem; color: var(--ink-2);
  background: var(--paper-3);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 0.18rem 0.7rem;
}
.mock-body { padding: clamp(20px, 2.6vw, 34px); }
.mock-kicker {
  font-family: var(--sans); font-size: 0.66rem; font-weight: 700;
  letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--gold); margin: 0 0 0.5rem;
}
.mock-name {
  font-family: var(--serif); font-size: clamp(1.5rem, 2vw + 0.6rem, 2.1rem);
  color: var(--ink); margin: 0 0 0.4rem;
}
.mock-line { font-size: 1rem; color: var(--muted); margin: 0 0 1.4rem; }
.mock-blocks { display: grid; gap: 0.6rem; }
.mock-block {
  border: 1px dashed var(--rule-2);
  border-radius: 6px;
  padding: 0.7rem 0.9rem;
  font-family: var(--sans); font-size: 0.82rem;
  color: var(--ink-2);
  background: repeating-linear-gradient(135deg, transparent 0 13px,
              rgba(36, 30, 22, 0.018) 13px 26px);
}

.tpl-cap {
  font-family: var(--sans); font-size: 0.9rem; line-height: 1.6;
  color: var(--ink-2);
  margin: 0 0 1.1rem;
  padding-left: 1rem;
  border-left: 2px solid var(--accent);
}
.tpl-link { margin: 0; }
.tpl-link a {
  font-family: var(--sans); font-size: 0.9rem; font-weight: 700;
  letter-spacing: 0.04em; text-decoration: none;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 2px;
}
.tpl-link a:hover { color: var(--ink); border-color: var(--ink); }

/* ---- what this is not ---- */
.nots {
  list-style: none; margin: 0; padding: 0;
  border-top: 1px solid var(--rule-2);
}
.nots li {
  padding: 1.1rem 0 1.1rem 1.6rem;
  border-bottom: 1px solid var(--rule);
  position: relative;
  color: var(--ink-2);
  font-size: clamp(1rem, 0.4vw + 0.9rem, 1.1rem);
}
.nots li::before {
  content: "";
  position: absolute; left: 0; top: 1.55rem;
  width: 8px; height: 8px;
  background: var(--accent);
  transform: rotate(45deg);
}
.nots strong { color: var(--ink); font-weight: 600; }

/* --------------------------------------------------------------------------
   5. Colophon
   -------------------------------------------------------------------------- */
.colophon {
  background: var(--ink);
  color: #D9CFBC;
  padding-block: clamp(30px, 4vw, 46px);
}
.colophon-inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 1rem;
}
.colophon-brand {
  display: inline-flex; align-items: center; gap: 0.8rem;
  margin: 0;
  font-family: var(--serif);
  font-size: 1.12rem;
  color: var(--paper-3);
}
.seal { width: 44px; height: 44px; }
.colophon-note {
  margin: 0;
  font-family: var(--sans);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: #C8BCA2;
}

/* --------------------------------------------------------------------------
   6. Reveal (progressive enhancement; content is visible without JS)
   -------------------------------------------------------------------------- */
.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.js .reveal.is-in { opacity: 1; transform: none; }

/* --------------------------------------------------------------------------
   7. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .masthead { min-height: 0; padding-block: clamp(30px, 7vh, 64px); }
  .masthead-grid {
    grid-template-columns: 1fr;
    gap: clamp(26px, 5vw, 40px);
  }
  .plate { max-width: 520px; }
  .lede { max-width: none; }
  .tpl-grid { grid-template-columns: 1fr; }
}

/* The drop cap needs a wide enough measure to wrap cleanly; below that,
   the paragraph reads better without it. */
@media (max-width: 640px) {
  .drop::first-letter {
    float: none;
    font-size: inherit;
    line-height: inherit;
    padding: 0;
    color: inherit;
    font-style: inherit;
  }
}

@media (max-width: 560px) {
  .title { font-size: clamp(2.2rem, 11vw, 3rem); }
  .register { font-size: 0.6rem; letter-spacing: 0.2em; }
  .catalogue { grid-template-columns: 1fr; }
  .colophon-inner { flex-direction: column; align-items: flex-start; }
}

/* --------------------------------------------------------------------------
   8. Motion preferences
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .js .reveal { opacity: 1 !important; transform: none !important; }
}

/* --------------------------------------------------------------------------
   9. Print
   -------------------------------------------------------------------------- */
@media print {
  .skip-link { display: none; }
  body { background: #fff; color: #000; }
  .masthead { min-height: 0; background: #fff; }
  .masthead::before { display: none; }
  .band-what { background: #fff; }
  .card { box-shadow: none; }
  .colophon { background: #fff; color: #000; }
  .colophon-brand, .colophon-note { color: #000; }
}
