/* ============================================================
   Annarium — site stylesheet  ·  "Almanac"
   A printed register: ruled, tabular, factual.
   Single file, no build step, no dependencies.
   Retheme the whole site from the tokens in :root.
   ============================================================ */

:root {
  /* --- Colour ------------------------------------------------ */
  --paper:        #F5F2E8;   /* newsprint ground */
  --paper-2:      #EDE7D6;   /* tinted panels, table highlights */
  --paper-3:      #E0D8C2;   /* filled cells */
  --white:        #FBFAF5;

  --ink:          #1A1916;   /* headings, rules */
  --body:         #3A362E;   /* body copy */
  --muted:        #5E594C;   /* secondary */
  --faint:        #6E6857;   /* labels, captions */
  --ghost:        #8A8474;   /* disabled / not-yet states only */

  --rule:         #CFC7B4;   /* hairlines */
  --rule-2:       #DDD6C4;   /* lightest */

  --red:          #A8301F;   /* the one accent */
  --red-dark:     #7C2116;

  --button:       var(--red-dark);   /* filled buttons (.btn--red keeps its old name) */
  --button-hover: #5C180F;
  --button-text:  #FFFFFF;

  /* --- Type -------------------------------------------------- */
  --display: "Libre Baskerville", Georgia, "Times New Roman", serif;
  --text:    "Libre Franklin", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --mono:    "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* --- Space ------------------------------------------------- */
  --gutter: 36px;
  --max:    1240px;
}

/* --- Reset ---------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--body);
  font-family: var(--text);
  font-size: 17px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 {
  font-family: var(--display);
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0 0 .5em 0;
  line-height: 1.16;
}
h1 { font-size: clamp(34px, 4.4vw, 50px); line-height: 1.1; }
h2 { font-size: clamp(25px, 3vw, 34px); }
h3 { font-size: clamp(18px, 1.9vw, 21px); line-height: 1.3; }
h4 { font-size: 17px; }

p { margin: 0 0 1.05em 0; }
p:last-child { margin-bottom: 0; }

a { color: var(--red); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--red-dark); }

ul, ol { margin: 0 0 1.05em 0; padding-left: 1.15em; }
li { margin-bottom: .38em; }

em { font-style: italic; }

hr { border: none; border-top: 1px solid var(--rule); margin: 40px 0; }
hr.rule--heavy { border-top: 2px solid var(--ink); }

:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: var(--paper);
  padding: 12px 18px; z-index: 100;
}
.skip-link:focus { left: 0; }

/* --- Layout ---------------------------------------------------- */
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

.section { padding: 62px 0; border-top: 1px solid var(--rule); }
.section--first { border-top: none; }
.section--tight { padding: 42px 0; }
.section--tint { background: var(--paper-2); }
.section--ink { background: var(--ink); color: #CFC9B8; border-top: none; }
.section--ink h1, .section--ink h2, .section--ink h3, .section--ink h4 { color: var(--paper); }
.section--ink a { color: #E2A599; }
.section--ink a:hover { color: #F0C3BA; }
.section--ink .label { color: #E2A599; }
.section--ink .register__row { border-color: #33312B; }

.measure { max-width: 66ch; }
.center { text-align: center; margin-left: auto; margin-right: auto; }

.lede { font-size: clamp(17px, 1.9vw, 19px); line-height: 1.6; color: var(--body); max-width: 62ch; }

/* --- Labels (the mono voice) ------------------------------------ */
.label {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 14px;
}
.label--quiet { color: var(--faint); }
.mono { font-family: var(--mono); }
.figure { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* --- Masthead --------------------------------------------------- */
.masthead { border-top: 6px solid var(--ink); background: var(--paper); }

.masthead__top {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 78px; border-bottom: 1px solid var(--ink);
}
.masthead__meta {
  font-family: var(--mono); font-size: 11px; letter-spacing: .1em;
  color: var(--faint); width: 200px; flex-shrink: 0;
}
.masthead__meta--right { text-align: right; }
.masthead__name {
  font-family: var(--display); font-size: clamp(24px, 3.6vw, 36px);
  font-weight: 700; letter-spacing: .16em; color: var(--ink);
  text-decoration: none; white-space: nowrap;
}
.masthead__name:hover { color: var(--ink); }

.masthead__strap {
  display: flex; align-items: center; justify-content: center;
  min-height: 34px; border-bottom: 3px solid var(--ink);
  font-family: var(--mono); font-size: 11px; letter-spacing: .22em;
  color: var(--ink); text-align: center;
}

/* --- Nav bar ---------------------------------------------------- */
.navbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--paper); border-bottom: 1px solid var(--ink);
}
.navbar__inner { display: flex; align-items: center; gap: 18px; min-height: 52px; }
.navbar ul { display: flex; gap: 24px; list-style: none; margin: 0; padding: 0; flex-grow: 1; }
.navbar li { margin: 0; }
.navbar a {
  font-family: var(--text); font-size: 14px; font-weight: 500;
  color: var(--body); text-decoration: none;
  padding: 4px 0; border-bottom: 2px solid transparent;
}
.navbar a:hover { color: var(--ink); border-bottom-color: var(--red); }
.navbar a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--red); }

.nav-toggle {
  display: none; width: 44px; height: 44px; margin-left: auto;
  align-items: center; justify-content: center;
  background: none; border: 1px solid var(--ink); cursor: pointer;
}

/* --- Buttons ---------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 12px 26px;
  font-family: var(--text); font-size: 15px; font-weight: 600; line-height: 1.2;
  text-decoration: none; cursor: pointer;
  border: 1px solid transparent; border-radius: 0;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn--ink   { background: var(--ink); color: var(--paper); }
.btn--ink:hover { background: #33312B; color: var(--paper); }
.btn--red   { background: var(--button); color: var(--button-text); }
.btn--red:hover { background: var(--button-hover); color: var(--button-text); }
.btn--line  { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn--line:hover { background: var(--ink); color: var(--paper); }
.btn--sm { min-height: 40px; padding: 8px 16px; font-size: 14px; }

/* The menu's waitlist button. The .navbar a link rules outrank .btn,
   so the button restates its own size and colours here. */
.navbar a.btn { display: inline-flex; width: auto; padding: 8px 16px; font-size: 14px; font-weight: 600; border-bottom: 1px solid transparent; }
.navbar a.btn--red, .navbar a.btn--red:hover { color: var(--button-text); border-bottom-color: transparent; }

.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 26px; }
.center .btn-row, .btn-row.center { justify-content: center; }

.textlink { font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }

/* --- Grids ------------------------------------------------------- */
.grid { display: grid; gap: 30px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--split { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }

/* --- Ruled column (replaces cards) -------------------------------- */
.col { border-top: 2px solid var(--ink); padding-top: 16px; }
.col h3 { margin-bottom: 8px; }
.col p { font-size: 15px; line-height: 1.58; }

.block {
  background: var(--white);
  border: 1px solid var(--ink);
  padding: 22px;
}
.block h3 { margin-bottom: 10px; }
.block p, .block li { font-size: 15px; line-height: 1.58; }
.block--tint { background: var(--paper-2); }

.numeral {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; margin-bottom: 12px;
  background: var(--red); color: #FFFFFF;
  font-family: var(--mono); font-size: 15px; font-weight: 600;
}

/* --- Register (the ruled table) ----------------------------------- */
.register { border-top: 2px solid var(--ink); }
.register__head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 9px 0; border-bottom: 1px solid var(--ink);
  font-family: var(--mono); font-size: 11px; letter-spacing: .12em; color: var(--faint);
}
.register__row {
  display: flex; align-items: baseline; gap: 14px;
  padding: 11px 0; border-bottom: 1px solid var(--rule);
}
.register__year { font-family: var(--mono); font-size: 15px; font-weight: 500; color: var(--ink); width: 54px; flex-shrink: 0; }
.register__what { flex-grow: 1; font-size: 15px; color: var(--body); }
.register__count { font-family: var(--mono); font-size: 13px; color: var(--muted); flex-shrink: 0; }
.register__row--now { background: var(--paper-2); border-bottom-color: var(--ink); padding-left: 8px; padding-right: 8px; margin: 0 -8px; }
.register__row--now .register__year,
.register__row--now .register__count { color: var(--red); font-weight: 600; }
.register__row--now .register__what { font-weight: 600; color: var(--ink); }
.register__row--waiting .register__year,
.register__row--waiting .register__what,
.register__row--waiting .register__count { color: var(--ghost); }

/* --- Year grid (a whole life, 53 cells) ---------------------------- */
.yeargrid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; }
.yearcell {
  aspect-ratio: 1 / .82;
  min-height: 52px;
  padding: 6px 7px;
  display: flex; flex-direction: column; justify-content: space-between;
  border: 1px solid var(--rule-2);
  background: transparent;
}
.yearcell__num { font-family: var(--mono); font-size: 12px; color: var(--ghost); }
.yearcell__mark { font-family: var(--mono); font-size: 9px; letter-spacing: .05em; color: var(--ghost); }
.yearcell--written { background: var(--paper-3); border-color: #C2B9A2; }
.yearcell--written .yearcell__num { color: var(--ink); font-weight: 600; }
.yearcell--written .yearcell__mark { color: var(--faint); }
.yearcell--now { background: var(--red); border-color: var(--ink); }
.yearcell--now .yearcell__num { color: var(--paper); font-weight: 600; }
.yearcell--now .yearcell__mark { color: #F0D6D1; }

.legend { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 18px; }
.legend span { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11px; letter-spacing: .1em; color: var(--faint); }
.swatch { width: 12px; height: 12px; flex-shrink: 0; }
.swatch--written { background: var(--paper-3); border: 1px solid #C2B9A2; }
.swatch--now { background: var(--red); }
.swatch--waiting { border: 1px solid var(--rule-2); }

/* --- Agent index --------------------------------------------------- */
.index-list { border-top: 2px solid var(--ink); }
.index-row {
  display: flex; align-items: baseline; gap: 16px;
  padding: 13px 0; border-bottom: 1px solid var(--rule);
}
.index-row__n { font-family: var(--mono); font-size: 12px; color: var(--ghost); width: 30px; flex-shrink: 0; }
.index-row__name { font-family: var(--display); font-size: 18px; font-weight: 700; color: var(--ink); width: 160px; flex-shrink: 0; }
.index-row__desc { flex-grow: 1; font-size: 15px; line-height: 1.5; color: var(--body); }
.index-row__tag { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; color: var(--red); border: 1px solid var(--red); padding: 2px 7px; flex-shrink: 0; }

/* --- Pricing -------------------------------------------------------- */
.tier { border-top: 3px solid var(--ink); padding-top: 18px; display: flex; flex-direction: column; gap: 12px; }
.tier--now { border-top-color: var(--red); }
.tier__name { font-family: var(--display); font-size: 22px; font-weight: 700; color: var(--ink); }
.tier__price { font-family: var(--mono); font-size: 26px; font-weight: 600; color: var(--ink); }
.tier__price small { display: block; font-family: var(--text); font-size: 13px; font-weight: 400; color: var(--muted); margin-top: 2px; }
.tier ul { list-style: none; padding: 0; margin: 4px 0 0 0; }
.tier li { font-size: 15px; line-height: 1.5; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.tier .btn { margin-top: auto; }

.placeholder { background: #EFE2C6; border-bottom: 1px dotted var(--red); padding: 0 4px; font-style: normal; }

/* --- Forms ----------------------------------------------------------- */
.form { display: flex; flex-direction: column; gap: 18px; max-width: 520px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink); }
.field .hint { font-size: 13px; color: var(--muted); text-transform: none; letter-spacing: 0; font-family: var(--text); }

.field input[type="text"], .field input[type="email"], .field select, .field textarea {
  width: 100%; min-height: 50px; padding: 12px 14px;
  background: var(--white); border: 1px solid var(--ink); border-radius: 0;
  font-family: var(--text); font-size: 16px; color: var(--ink);
}
.field textarea { min-height: 116px; resize: vertical; line-height: 1.55; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--red); }

.checkline { display: flex; align-items: flex-start; gap: 11px; }
.checkline input { margin-top: 4px; width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--red); }
.checkline label { font-family: var(--text); font-size: 15px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--body); line-height: 1.5; }

.form-note { font-size: 13px; line-height: 1.5; color: var(--muted); }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.formmsg { padding: 13px 15px; font-size: 15px; border: 1px solid var(--ink); background: var(--paper-2); }
.formmsg--ok { border-color: #4A6B45; background: #E9EFE5; color: #2C4428; }
.formmsg--err { border-color: var(--red); background: #F6E7E3; color: var(--red-dark); }

/* --- Colophon (footer) ------------------------------------------------ */
.colophon { background: var(--ink); color: #A9A395; border-top: 6px solid var(--red); padding: 52px 0 28px; font-size: 15px; }
.colophon__grid { display: grid; grid-template-columns: 1.5fr repeat(3, minmax(0, 1fr)); gap: 36px; }
.colophon h4 { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: #A9A395; margin-bottom: 12px; }
.colophon a { color: var(--paper); text-decoration: none; }
.colophon a:hover { color: #E2A599; text-decoration: underline; }
.colophon ul { list-style: none; padding: 0; margin: 0; }
.colophon li { margin-bottom: 8px; }
.colophon__name { font-family: var(--display); font-size: 21px; font-weight: 700; letter-spacing: .14em; color: var(--paper); }
.colophon__blurb { font-size: 15px; line-height: 1.6; margin-top: 12px; max-width: 34ch; }
.colophon__bottom {
  margin-top: 40px; padding-top: 20px; border-top: 1px solid #33312B;
  display: flex; flex-wrap: wrap; gap: 14px; align-items: center;
  font-family: var(--mono); font-size: 11px; letter-spacing: .08em; color: #8E8879;
}
.colophon__bottom p { margin: 0; }
.colophon__bottom .spacer { margin-left: auto; }

/* --- Utilities ---------------------------------------------------------- */
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.mt-24 { margin-top: 24px; } .mt-40 { margin-top: 40px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* --- Responsive ---------------------------------------------------------- */
@media (max-width: 1080px) {
  .yeargrid { grid-template-columns: repeat(9, minmax(0, 1fr)); }
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--split { grid-template-columns: 1fr; }
  .colophon__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  :root { --gutter: 22px; }

  .masthead__meta { display: none; }
  .masthead__top { justify-content: center; min-height: 62px; }
  .masthead__strap { font-size: 10px; letter-spacing: .14em; padding: 6px 0; line-height: 1.4; }

  .nav-toggle { display: inline-flex; }
  .navbar__inner { position: relative; }
  .navbar ul {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; gap: 0;
    background: var(--paper-2); border-bottom: 1px solid var(--ink);
    padding: 0 var(--gutter);
  }
  .navbar ul.is-open { display: flex; }
  .navbar li { border-bottom: 1px solid var(--rule); }
  .navbar li:last-child { border-bottom: none; }
  .navbar a { display: block; padding: 14px 0; font-size: 16px; border-bottom: none; }
  .navbar a.btn { margin-left: auto; }
  .nav-toggle { order: 1; margin-left: 0; }

  .grid--2, .grid--3 { grid-template-columns: 1fr; }
  .yeargrid { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .index-row { flex-wrap: wrap; gap: 6px 14px; }
  .index-row__name { width: auto; }
  .index-row__desc { width: 100%; }
  .section { padding: 44px 0; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .yeargrid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .grid--4 { grid-template-columns: 1fr; }
  .colophon__grid { grid-template-columns: 1fr; gap: 26px; }
  .btn { width: 100%; }
  .btn-row { flex-direction: column; align-items: stretch; }
  .register__row { flex-wrap: wrap; gap: 4px 12px; }
  .register__what { width: 100%; order: 3; }
}

@media print {
  .navbar, .colophon, .nav-toggle, .btn-row { display: none !important; }
  body { background: #FFF; color: #000; font-size: 11pt; }
  .section { padding: 16pt 0; }
}

/* A link to a heading on the same page stops below the sticky navbar, not under it. */
html { scroll-padding-top: 72px; }
