/* tpvrm.net — document-register design
   Palette drawn from the book's Figure 1.1 */
:root {
  --ink: #16263f;        /* navy ink: text, masthead */
  --paper: #ffffff;
  --wash: #eef2f6;       /* cool wash: alternating rows, plate bg */
  --steel: #2e5e8c;      /* steel blue: links, rules */
  --signal: #b1500f;     /* signal orange: download affordance */
  --muted: #5a6b82;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #e8edf5;
    --paper: #131c2b;
    --wash: #1b2638;
    --steel: #7fb0dd;
    --signal: #e89a62;
    --muted: #93a3b8;
  }
}
:root[data-theme="dark"] {
  --ink: #e8edf5; --paper: #131c2b; --wash: #1b2638;
  --steel: #7fb0dd; --signal: #e89a62; --muted: #93a3b8;
}

* { box-sizing: border-box; }
html { font-size: 17px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Public Sans", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.55;
}
h1, h2, h3, .plate-title { font-family: "Spectral", Georgia, serif; }

a { color: var(--steel); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; }

.shell { max-width: 62rem; margin: 0 auto; padding: 0 1rem; }

/* Masthead */
.masthead {
  border-bottom: 3px solid var(--ink);
  padding: 1.1rem 0 0.9rem;
}
.masthead .shell { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 0.4rem 1.5rem; }
.wordmark { font-family: "Spectral", Georgia, serif; font-weight: 700; font-size: 1.35rem; letter-spacing: 0.01em; color: var(--ink); text-decoration: none; }
.wordmark span { color: var(--steel); }
nav.site a { margin-left: 1.4rem; font-size: 0.95rem; }
nav.site a[aria-current="page"] { color: var(--ink); font-weight: 600; text-decoration: none; border-bottom: 2px solid var(--signal); }

/* Book plate (home) */
.plate {
  margin: 2.6rem 0 2.2rem;
  display: grid;
  grid-template-columns: minmax(230px, 300px) 1fr;
  gap: 2.2rem;
  align-items: start;
}
.plate-cover {
  background: var(--ink);
  color: #f2f5f9;
  aspect-ratio: 2 / 3;
  padding: 1.4rem 1.2rem;
  display: flex; flex-direction: column; justify-content: space-between;
  border-bottom: 10px solid var(--signal);
}
:root[data-theme="dark"] .plate-cover { background: #0d1522; }
.plate-title { font-size: 1.45rem; font-weight: 600; line-height: 1.25; margin: 0; }
.plate-cover .rule { border: 0; border-top: 1px solid rgba(255,255,255,0.35); margin: 0.9rem 0; }
.plate-cover .byline { font-size: 0.95rem; margin: 0; }
.plate-cover .imprint { font-size: 0.8rem; margin: 0; color: rgba(242,245,249,0.75); }
.plate-body h1 { font-size: 2rem; line-height: 1.2; margin: 0 0 0.9rem; }
.plate-body p { max-width: 38rem; margin: 0 0 1rem; }
.lead-link {
  display: inline-block; margin-top: 0.4rem;
  font-weight: 600; color: var(--paper);
  background: var(--signal);
  padding: 0.6rem 1.1rem; text-decoration: none;
}
.lead-link:hover { filter: brightness(0.94); }

/* Sections */
section { margin: 2.4rem 0; }
section h2 { font-size: 1.35rem; border-bottom: 1px solid var(--steel); padding-bottom: 0.35rem; }
section p { max-width: 42rem; }

/* Register (documents page) */
.register-intro { margin: 2.2rem 0 1.2rem; }
.register-intro h1 { font-size: 1.9rem; margin: 0 0 0.6rem; }
.register-intro p { max-width: 44rem; }
.note { color: var(--muted); font-size: 0.92rem; }

table.register { width: 100%; border-collapse: collapse; margin: 1.2rem 0 2.5rem; }
table.register caption { text-align: left; font-size: 0.92rem; color: var(--muted); padding-bottom: 0.5rem; }
table.register th {
  text-align: left; font-size: 0.85rem; font-weight: 600;
  border-bottom: 2px solid var(--ink); padding: 0.45rem 0.6rem;
}
table.register td { padding: 0.65rem 0.6rem; vertical-align: top; border-bottom: 1px solid var(--wash); }
table.register tbody tr:nth-child(odd) td { background: var(--wash); }
td.num { font-family: "Spectral", Georgia, serif; font-weight: 600; font-size: 1.05rem; white-space: nowrap; }
td.name { font-weight: 600; min-width: 11rem; }
td.name small { display: block; font-weight: 400; color: var(--muted); }
td.chap { white-space: nowrap; color: var(--muted); }
td.dl a { display: inline-block; font-weight: 600; color: var(--signal); margin-right: 0.9rem; white-space: nowrap; }

footer {
  border-top: 3px solid var(--ink);
  margin-top: 3rem; padding: 1.2rem 0 2rem;
  font-size: 0.9rem; color: var(--muted);
}

@media (max-width: 700px) {
  .plate { grid-template-columns: 1fr; }
  .plate-cover { max-width: 260px; }
  table.register, table.register thead, table.register tbody, table.register tr, table.register td, table.register th { display: block; }
  table.register thead { display: none; }
  table.register tr { border-bottom: 2px solid var(--ink); padding: 0.4rem 0; }
  table.register td { border: 0; padding: 0.25rem 0.4rem; }
  table.register tbody tr:nth-child(odd) td { background: var(--wash); }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------- Landing page ---------- */
.hero {
  background: linear-gradient(170deg, #101c31 0%, #16263f 60%, #1b3050 100%);
  color: #eef2f8;
}
.hero .masthead { border-bottom-color: rgba(238,242,248,0.35); }
.hero .wordmark { color: #eef2f8; }
.hero .wordmark span { color: #9cc0e4; }
.hero nav.site a { color: #c7d7ea; }
.hero nav.site a[aria-current="page"] { color: #ffffff; border-bottom-color: #e89a62; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 2.5rem;
  align-items: center;
  padding: 4.2rem 0 4.6rem;
}
.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1.08;
  font-weight: 600;
  margin: 0 0 1.1rem;
  color: #ffffff;
}
.hero .kicker { font-family: "Spectral", Georgia, serif; font-style: italic; font-size: 1.05rem; color: #9cc0e4; margin: 0 0 0.8rem; }
.hero .sub { font-size: 1.08rem; line-height: 1.6; max-width: 34rem; color: #d4e0ee; margin: 0 0 1.6rem; }
.hero .sub em { color: #ffffff; font-style: italic; }
.cta-row { display: flex; gap: 0.9rem; flex-wrap: wrap; }
.cta {
  display: inline-block; padding: 0.7rem 1.25rem; font-weight: 600; text-decoration: none;
}
.cta.primary { background: #e89a62; color: #16263f; }
.cta.primary:hover { filter: brightness(1.05); }
.cta.ghost { color: #eef2f8; border: 1px solid rgba(238,242,248,0.5); }
.cta.ghost:hover { border-color: #ffffff; }
.hero svg { width: 100%; height: auto; display: block; }
.hero .caption { font-size: 0.82rem; color: #8fa6c2; margin-top: 0.5rem; }

@keyframes draw { to { stroke-dashoffset: 0; } }
.web-edge { stroke-dasharray: 340; stroke-dashoffset: 340; animation: draw 1.6s ease-out forwards; }
.web-edge:nth-of-type(2n) { animation-delay: 0.25s; }
.web-edge:nth-of-type(3n) { animation-delay: 0.5s; }
@media (prefers-reduced-motion: reduce) { .web-edge { stroke-dasharray: none; stroke-dashoffset: 0; animation: none; } }

/* bands */
.band { padding: 3rem 0; }
.band h2 { font-size: 1.6rem; margin: 0 0 1.6rem; border: 0; }
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.pillar { border-top: 3px solid var(--steel); padding-top: 0.9rem; }
.pillar:nth-child(2) { border-top-color: #1f6e66; }
.pillar:nth-child(3) { border-top-color: var(--signal); }
.pillar h3 { font-size: 1.12rem; margin: 0 0 0.4rem; }
.pillar p { margin: 0; font-size: 0.97rem; color: var(--muted); }

.pull {
  background: var(--ink); color: #eef2f8; padding: 3.2rem 0;
}
:root[data-theme="dark"] .pull { background: #0d1522; }
.pull blockquote {
  font-family: "Spectral", Georgia, serif; font-size: clamp(1.4rem, 3vw, 2rem);
  line-height: 1.3; margin: 0; max-width: 46rem;
}
.pull figcaption { margin-top: 1rem; color: #9cc0e4; font-size: 0.95rem; }

.cred { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; margin-top: 0.4rem; }
.cred div { border-top: 1px solid var(--steel); padding-top: 0.7rem; }
.cred strong { font-family: "Spectral", Georgia, serif; font-size: 1.7rem; font-weight: 600; display: block; }
.cred span { color: var(--muted); font-size: 0.95rem; }

.teaser-link { font-weight: 600; }

@media (max-width: 760px) {
  .hero-grid { grid-template-columns: 1fr; padding: 2.6rem 0 3rem; }
  .pillars, .cred { grid-template-columns: 1fr; }
}

td.dl .ver { display: block; white-space: nowrap; }
td.dl .ver b { font-weight: 600; color: var(--muted); margin-right: 0.2rem; }
td.name a { color: var(--ink); text-decoration-color: var(--steel); }
