/* TJ Roark — tjroark.com */

/* ---------- Fonts (self-hosted, variable, subset) ---------- */
@font-face {
  font-family: "Cinzel"; font-style: normal; font-weight: 500 700; font-display: swap;
  src: url("fonts/cinzel-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Cinzel"; font-style: normal; font-weight: 500 700; font-display: swap;
  src: url("fonts/cinzel-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Lora"; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url("fonts/lora-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Lora"; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url("fonts/lora-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Lora"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("fonts/lora-italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Lora"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("fonts/lora-italic-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Source Sans 3"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("fonts/source-sans-3-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Sans 3"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("fonts/source-sans-3-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Design tokens ---------- */
:root {
  /* The brand is dark-only: tell the browser so its own UI (scrollbars, form controls, canvas) matches */
  color-scheme: dark;

  /* Tier 1: literal brand colors */
  --ink-900: #06080F;
  --ink-950: #03050A;
  --navy-900: #0A0F1E;
  --navy-800: #0B1630;
  --navy-700: #0E1C3D;
  --blue-700: #244A9E;
  --blue-600: #2F5BC2;
  --blue-500: #3B6FD6;
  --blue-300: #6FA3FF;
  --silver-100: #E8ECF4;
  --silver-300: #C9D1E0;
  --slate-400: #8C97AD;
  --slate-500: #6B7CA0;
  --white: #fff;

  /* Tier 2: semantic */
  --bg: var(--ink-900);
  --panel: var(--navy-800);
  --panel-2: var(--navy-700);
  --accent: var(--blue-500);
  --accent-bright: var(--blue-300);
  --title: var(--silver-100);
  --text: var(--silver-300);
  --muted: var(--slate-400);
  --cta: var(--blue-600);
  --cta-hover: var(--blue-700);
  --on-cta: var(--white);
  --line: rgb(111 163 255 / 0.18);
  --glow: rgb(59 111 214 / 0.22);
  --cover-bg: var(--ink-950);
  --field-bg: var(--navy-900);
  --field-border: var(--slate-500);
  --error: #FF9A8F;
  --focus-ring: var(--blue-300);
  --backdrop: rgb(3 5 10 / 0.82);
  --shadow-deep: rgb(0 0 0 / 0.7);

  --font-head: "Cinzel", "Trajan Pro", Georgia, serif;
  --font-body: "Lora", Georgia, "Times New Roman", serif;
  --font-ui: "Source Sans 3", "Helvetica Neue", Arial, sans-serif;

  --wrap: 71.25rem;
  --gutter: 1.5rem;
  --header-size: 4.75rem;
  --section-pad: 5.625rem;
  --card-pad: 1.625rem;
  --target-size: 24px;

  /* Gradient interpolation space, only where supported */
  --in-oklab: ;
}
@supports (background: linear-gradient(in oklab, white, black)) {
  :root { --in-oklab: in oklab; }
}
@media (pointer: coarse) {
  :root { --target-size: 44px; }
}
@media (prefers-contrast: more) {
  :root {
    --line: rgb(111 163 255 / 0.5);
    --muted: var(--silver-300);
    --field-border: var(--silver-300);
  }
}
@media (width < 37.5em) {
  :root { --gutter: 1rem; --section-pad: 4rem; }
}

/* ---------- Base ---------- */
html {
  /* Remembers the last scroll direction so the header can step aside while reading */
  container-type: scroll-state;
  /* Keep anchor targets and focused controls clear of the sticky header */
  scroll-padding-block-start: calc(var(--header-size) + 1rem);
  accent-color: var(--accent);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.125rem;
  font-size-adjust: from-font;
  line-height: 1.7;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
@media (width < 37.5em) {
  body { font-size: 1.0625rem; }
}
:where(.wrap, .btn, .card, .form-box, .contact-box, .menu-button, .site-menu, input, button, dialog) {
  box-sizing: border-box;
}
img { max-inline-size: 100%; block-size: auto; display: block; }
a { color: var(--accent-bright); text-decoration: none; }
a:hover { color: var(--title); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.2em; }
::selection { background: var(--cta); color: var(--on-cta); }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-size-adjust: cap-height from-font;
  color: var(--title);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: 0.02em;
  margin-block: 0 0.5em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.6rem, 1.6rem + 4vw, 4.4rem); }
h2 { font-size: clamp(1.9rem, 1.3rem + 2.4vw, 2.8rem); }
h3 { font-size: 1.4rem; }
hgroup { margin: 0; }
p { margin-block: 0 1.1em; text-wrap: pretty; }
li { text-wrap: pretty; }

.wrap { max-inline-size: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.center { text-align: center; }

/* Hides content visually but keeps it in the accessibility tree; shows it again when focused */
.visually-hidden:where(:not(:focus-within, :active)) {
  position: absolute !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  white-space: nowrap !important;
}
.skip {
  position: fixed;
  inset-block-start: 1rem;
  inset-inline-start: 1rem;
  z-index: 999;
  background: var(--cta);
  color: var(--on-cta);
  padding: 0.5rem 0.875rem;
  font-family: var(--font-ui);
  font-size-adjust: from-font;
}

/* Focus: one visible ring everywhere, never removed */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}
main:focus-visible, .form-msg:focus-visible { outline: none; }

/* Target sizes (24px, 44px on touch) */
:where(button, input, nav a, .text-link) {
  min-block-size: var(--target-size);
  min-inline-size: var(--target-size);
}
:where(nav a, .text-link) { display: inline-flex; align-items: center; }

/* ---------- Kicker / labels ---------- */
.kicker {
  font-family: var(--font-ui);
  font-size-adjust: from-font;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-bright);
  margin-block: 0 0.875rem;
}
/* Decorative divider: a border, so it survives forced-colors mode */
.rule { inline-size: 4rem; border-block-start: 2px solid var(--accent); margin-block: 0 1.625rem; }
.center .rule { margin-inline: auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: var(--font-ui);
  font-size-adjust: from-font;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.3;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.9375rem 1.875rem;
  min-block-size: 3rem;
  border-radius: 3px;
  border: 2px solid var(--cta);
  background: var(--cta);
  color: var(--on-cta);
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.15s ease-out, scale 0.15s ease-out;
}
.btn:hover:not(:disabled) {
  background: var(--cta-hover);
  border-color: var(--cta-hover);
  color: var(--on-cta);
  text-decoration: none;
  box-shadow: 0 2px 10px rgb(0 0 0 / 0.45);
}
.btn.ghost { background: transparent; color: var(--title); border-color: var(--accent); }
.btn.ghost:hover:not(:disabled) { background: var(--accent); border-color: var(--accent); color: var(--on-cta); }
.btn:disabled { opacity: 0.7; cursor: progress; }
@media (prefers-reduced-motion: no-preference) {
  .btn:active:not(:disabled) { scale: 0.97; }
}
.btn-row { display: flex; flex-wrap: wrap; gap: 0.875rem; margin-block-start: 1.75rem; }
.text-link {
  font-family: var(--font-ui);
  font-size-adjust: from-font;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.85rem;
}
/* Decorative arrow, kept out of the accessible name */
.text-link::after { content: "\00a0→"; content: "\00a0→" / ""; }
.more-link { margin-block-start: 2.5rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  inset-block-start: 0;
  z-index: 50;
  background: rgb(6 8 15 / 0.92);
  backdrop-filter: blur(8px);
  border-block-end: 1px solid var(--line);
}
@media (prefers-reduced-motion: no-preference) {
  .site-header { transition: translate 0.25s ease-out; }
}
/* Scrolling down: slide the bar out of the way; any scroll up brings it back. Never while it holds focus. */
@container scroll-state((scrolled: bottom) and (scrollable: top)) {
  .site-header:not(:focus-within) { translate: 0 -100%; }
}
.site-header.is-hidden:not(:focus-within) { translate: 0 -100%; }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  min-block-size: var(--header-size);
}
/* Keep the row's natural width measurable */
.header-inner > * { flex-shrink: 0; white-space: nowrap; }
.logo { display: block; }
.logo img { block-size: 2.875rem; inline-size: auto; }

.menu-button {
  anchor-name: --menu-button;
  background: none;
  border: 1px solid var(--field-border);
  color: var(--title);
  font-family: var(--font-ui);
  font-size-adjust: from-font;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.5625rem 0.875rem;
  min-block-size: 2.75rem;
  border-radius: 3px;
  cursor: pointer;
}
.menu-button:hover { border-color: var(--accent-bright); color: var(--accent-bright); }

.site-menu {
  list-style: none;
  /* Collapsed layout: a popover anchored under the Menu button */
  position: fixed;
  inset: auto;
  inset-block-start: var(--header-size);
  inset-block-start: anchor(--menu-button bottom);
  inset-inline-end: 1rem;
  inline-size: min(80dvw, 24rem);
  max-inline-size: calc(100dvw - 2rem);
  block-size: fit-content;
  max-block-size: calc(100dvh - 6rem);
  margin: 0;
  margin-block-start: 0.5rem;
  padding: 0.625rem 1.5rem 1.375rem;
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--field-border);
  border-radius: 4px;
  white-space: normal;
  transform-origin: top right;
}
.site-menu:is(:popover-open, .\:popover-open) { animation: menu-fade 0.15s ease-out both; }
@media (prefers-reduced-motion: no-preference) {
  .site-menu:is(:popover-open, .\:popover-open) { animation: menu-grow 0.2s ease-out both, menu-fade 0.15s ease-out both; }
}
@keyframes menu-grow { from { scale: 0.94; } }
@keyframes menu-fade { from { opacity: 0; } }

.site-menu a {
  font-family: var(--font-ui);
  font-size-adjust: from-font;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
  /* Reserve the current-page marker's space so nothing shifts */
  border-block-end: 2px solid transparent;
}
.site-menu a:hover { color: var(--accent-bright); text-decoration: none; border-block-end-color: currentColor; }
/* Current page: color plus an underline, never color alone */
.site-menu a[aria-current="page"] { color: var(--accent-bright); border-block-end-color: var(--accent-bright); }
.site-menu .btn { padding: 0.625rem 1.125rem; font-size: 0.8rem; min-block-size: 2.75rem; }

/* Collapsed layout only */
.site-header:not(.is-wide) .site-menu li { border-block-end: 1px solid var(--line); }
.site-header:not(.is-wide) .site-menu li:last-child { border-block-end: 0; padding-block-start: 1rem; }
.site-header:not(.is-wide) .site-menu a { display: flex; inline-size: 100%; padding-block: 0.75rem; min-block-size: 2.75rem; border-block-end: 0; }
.site-header:not(.is-wide) .site-menu a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.3em; }

/* Inline layout: script adds .is-wide when the whole row fits */
.site-header.is-wide .menu-button { display: none; }
.site-header.is-wide .site-menu {
  position: static;
  display: flex;
  align-items: center;
  gap: 1.75rem;
  inline-size: auto;
  max-inline-size: none;
  block-size: auto;
  max-block-size: none;
  overflow: visible;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  white-space: nowrap;
  animation: none;
}
.site-header.is-wide .site-menu::backdrop { display: none; }
.site-header.is-measuring, .site-header.is-measuring * { transition: none !important; animation: none !important; }

/* ---------- Sections ---------- */
main > section { container: section / inline-size; padding-block: var(--section-pad); }
.section-alt { background: var(--panel); }
.section-head { max-inline-size: 45rem; margin-block-end: 3.125rem; }
.section-head.center { margin-inline: auto; }

/* Two-column blocks: columns when the section has room, stacked otherwise */
.hero > .wrap, .split, .signup > .wrap, .book-row { display: grid; gap: 2.5rem; }
@container section (inline-size >= 60rem) {
  .hero > .wrap { grid-template-columns: 1.15fr 0.85fr; gap: 3.75rem; align-items: center; }
  .split { grid-template-columns: 0.8fr 1.2fr; gap: 3.75rem; align-items: center; }
  .split.top { align-items: start; }
  .signup > .wrap { grid-template-columns: 1fr 1fr; gap: 3.75rem; align-items: center; }
  .book-row { grid-template-columns: 21.25rem 1fr; gap: 3.5rem; align-items: start; }
}

/* ---------- Hero ---------- */
main > .hero-banner { padding: 0; background: #000; }
.hero-banner img { inline-size: 100%; }
.hero-banner a { display: block; }

.hero {
  position: relative;
  overflow: clip;
  padding-block: 5.625rem 6.25rem;
  background:
    radial-gradient(ellipse at 75% 30% var(--in-oklab), var(--glow), transparent 60%),
    linear-gradient(180deg var(--in-oklab), var(--ink-900) 0%, #0A1226 100%);
}
@media (width < 37.5em) {
  .hero { padding-block: 3.5rem 4.375rem; }
}
.badge {
  display: inline-block;
  font-family: var(--font-ui);
  font-size-adjust: from-font;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--on-cta);
  background: var(--cta);
  border: 1px solid transparent;
  padding: 0.375rem 0.75rem;
  border-radius: 2px;
  margin-block-end: 1.125rem;
}
.subtitle {
  font-family: var(--font-head);
  font-size-adjust: cap-height from-font;
  color: var(--text);
  font-size: 1.3rem;
  letter-spacing: 0.06em;
  margin-block: -0.25rem 0.875rem;
}
.tagline {
  font-family: var(--font-head);
  font-size-adjust: cap-height from-font;
  color: var(--accent-bright);
  font-size: 1.25rem;
  letter-spacing: 0.04em;
  margin-block: 0.375rem 1.375rem;
  text-wrap: balance;
}
.hero .blurb { font-size: 1.12rem; max-inline-size: 35rem; }
.hero-cover img {
  inline-size: 100%;
  max-inline-size: 20rem;
  margin-inline: auto;
  box-shadow: 0 30px 70px var(--shadow-deep), 0 0 0 1px var(--line);
}
@container section (inline-size >= 60rem) {
  .hero-cover img { max-inline-size: 25rem; margin-inline: auto 0; }
}

/* ---------- Interior page head ---------- */
main > .page-head {
  padding-block: 5rem 3.125rem;
  background: radial-gradient(ellipse at 80% 0% var(--in-oklab), var(--glow), transparent 60%), var(--bg);
  border-block-end: 1px solid var(--line);
}
.lead { font-size: 1.15rem; max-inline-size: 45rem; }

/* ---------- Cards ---------- */
.cards {
  container: cards / inline-size;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
  /* Row spacing lives on the cards: a row gap here would be stretched into every subgrid track */
  gap: 0 1.75rem;
  margin-block-end: -1.75rem;
}
.card {
  /* Media, header, content and footer line up across the row */
  display: grid;
  grid-row: span 4;
  grid-template-rows: auto auto 1fr auto;
  grid-template-rows: subgrid;
  row-gap: 0;
  align-content: start;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: var(--card-pad);
  margin-block-end: 1.75rem;
}
.cards.rows-3 .card { grid-row: span 3; grid-template-rows: auto 1fr auto; grid-template-rows: subgrid; }
.cards.rows-2 .card { grid-row: span 2; grid-template-rows: auto 1fr; grid-template-rows: subgrid; }
.section-alt .card { background: var(--bg); }
.card > picture {
  display: block;
  margin: calc(var(--card-pad) * -1) calc(var(--card-pad) * -1) 1.375rem;
  border-block-end: 1px solid var(--line);
  background: var(--cover-bg);
}
.card > picture img { inline-size: 100%; aspect-ratio: 2 / 3; object-fit: cover; }
.card .meta {
  font-family: var(--font-ui);
  font-size-adjust: from-font;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-bright);
  margin-block-end: 0.5rem;
}
.card h3 { margin-block-end: 0.625rem; }
.card > p { font-size: 1rem; }
.card > footer { align-self: end; }
.card .tag {
  display: inline-block;
  font-family: var(--font-ui);
  font-size-adjust: from-font;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--on-cta);
  background: var(--cta);
  border: 1px solid transparent;
  padding: 0.1875rem 0.5625rem;
  border-radius: 2px;
  margin-inline-start: 0.5rem;
  vertical-align: middle;
}
/* One card per row: keep the cover from filling the whole screen */
@container cards (inline-size < 39.75rem) {
  .card > picture { display: flex; justify-content: center; padding-block: 1.125rem; }
  .card > picture img { inline-size: 60%; }
}

/* ---------- Book detail rows (books page) ---------- */
main > .book-section { padding-block: 0 0.625rem; }
.book-section .banner { background: #000; }
.book-section .banner img { inline-size: 100%; }
.book-row { padding-block: 4.375rem; }
.book-row .cover { max-inline-size: 20rem; }
.book-row .cover img { inline-size: 100%; box-shadow: 0 24px 60px rgb(0 0 0 / 0.65), 0 0 0 1px var(--line); }
.book-row .release { font-family: var(--font-ui); font-size-adjust: from-font; color: var(--muted); font-size: 0.95rem; margin-block-end: 1.125rem; }
.book-row .tagline { font-size: 1.2rem; margin-block: 0 1.125rem; }

/* ---------- About ---------- */
.split .photo img { inline-size: 100%; border-radius: 4px; box-shadow: 0 0 0 1px var(--line); }
.pullquote {
  font-family: var(--font-head);
  font-size-adjust: cap-height from-font;
  color: var(--title);
  font-size: 1.2rem;
  border-inline-start: 2px solid var(--accent);
  padding-inline-start: 1.125rem;
  margin-block: 1.625rem;
}
.contact-box {
  display: block;
  margin-block-start: 1rem;
  padding: 1.125rem 1.25rem;
  border-radius: 3px;
  border: 2px solid var(--cta);
  background: var(--cta);
  color: var(--on-cta);
  text-align: center;
  transition: background-color 0.2s, border-color 0.2s;
}
.contact-box:hover { background: var(--cta-hover); border-color: var(--cta-hover); color: var(--on-cta); text-decoration: none; }
.contact-box .label { display: block; font-family: var(--font-ui); font-size-adjust: from-font; font-weight: 700; font-size: 0.95rem; letter-spacing: 0.08em; text-transform: uppercase; }
.contact-box .email { display: block; margin-block-start: 0.375rem; font-size: 1.05rem; letter-spacing: 0.02em; }

/* ---------- Lists with dash markers ---------- */
.signup ul, .plain-list { list-style: none; padding: 0; margin-block: 1.25rem; }
.plain-list { margin-block: 0 0.625rem; }
.signup li, .plain-list li { position: relative; padding-inline-start: 1.625rem; margin-block-end: 0.5rem; }
.plain-list li { margin-block-end: 0.875rem; }
.signup li::before, .plain-list li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  inset-block-start: 0.72em;
  inline-size: 0.75rem;
  border-block-start: 2px solid var(--accent-bright);
}

/* ---------- Signup block and forms ---------- */
.signup {
  background:
    radial-gradient(ellipse at 20% 0% var(--in-oklab), rgb(59 111 214 / 0.25), transparent 60%),
    var(--panel);
  border-block: 1px solid var(--line);
}
.form-box { background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: 2.125rem; }
@media (width < 37.5em) {
  .form-box { padding: 1.5rem 1.125rem; }
}
.form-box.warning { border-color: var(--accent); }
.fine { font-family: var(--font-ui); font-size-adjust: from-font; font-size: 0.85rem; color: var(--muted); margin-block: 1rem 0; }
.form-note { font-family: var(--font-ui); font-size-adjust: from-font; font-size: 0.85rem; color: var(--muted); margin-block: 0 0.875rem; }

.field { margin-block-end: 1rem; }
.field label {
  display: block;
  font-family: var(--font-ui);
  font-size-adjust: from-font;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--title);
  /* Closer to its own input than to the previous field */
  margin-block-end: 0.3125rem;
}
.field input {
  display: block;
  inline-size: 100%;
  min-block-size: 3rem;
  padding: 0.75rem 1rem;
  background: var(--field-bg);
  color: var(--title);
  border: 1px solid var(--field-border);
  border-radius: 3px;
  font: inherit;
  font-family: var(--font-ui);
  font-size-adjust: from-font;
  /* Never below 16px, so iOS does not zoom the page on focus */
  font-size: max(1rem, 1em);
}
.field input:hover { border-color: var(--accent-bright); }
/* Autofilled: a ring as well as the browser's own tint */
.field input:autofill { box-shadow: inset 0 0 0 2px var(--accent-bright); border-color: var(--accent-bright); }
/* Errors appear only after the reader has touched the field or tried to submit */
.error-msg { display: none; font-family: var(--font-ui); font-size-adjust: from-font; font-size: 0.875rem; color: var(--error); margin-block: 0.375rem 0; }
.field input:user-invalid { border-color: var(--error); box-shadow: inset 0 0 0 1px var(--error); }
.field input:user-invalid + .error-msg { display: block; }
.signup-form .btn { inline-size: 100%; }
.form-msg { font-family: var(--font-ui); font-size-adjust: from-font; color: var(--title); font-size: 1rem; margin-block: 0.375rem 0; }
.form-msg:empty { display: none; }
.form-msg strong { color: var(--accent-bright); }

/* ---------- Footer ---------- */
.site-footer { border-block-start: 1px solid var(--line); padding-block: 3.125rem 2.5rem; font-family: var(--font-ui); font-size-adjust: from-font; font-size: 0.9rem; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.5rem; align-items: center; }
.site-footer p { margin: 0; }
.site-footer ul { display: flex; flex-wrap: wrap; gap: 0.25rem 1.375rem; list-style: none; margin: 0; padding: 0; }
.site-footer nav a { color: var(--text); text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.8rem; }
.site-footer .disclosure { inline-size: 100%; font-size: 0.8rem; }

/* ---------- Stay Informed dialog ---------- */
dialog.popup {
  inline-size: min(100% - 2.5rem, 32.5rem);
  max-block-size: 92dvh;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 2.5rem 2.125rem 2.125rem;
  /* Closed state the exit transition returns to */
  opacity: 0;
  transition-property: opacity, translate, display, overlay;
  transition-duration: 0.25s;
  transition-timing-function: ease-out;
  /* Separate declaration so older browsers keep the transition above */
  transition-behavior: allow-discrete;
}
@media (prefers-reduced-motion: no-preference) {
  dialog.popup { translate: 0 0.75rem; }
}
@media (prefers-reduced-motion: reduce) {
  dialog.popup, dialog.popup::backdrop { transition-duration: 0.1s; }
}
dialog.popup[open]:where(:not([data-closing])) {
  opacity: 1;
  @starting-style { opacity: 0; }
  @media (prefers-reduced-motion: no-preference) {
    translate: 0 0;
    @starting-style { translate: 0 0.75rem; }
  }
}
/* Scroll gestures in the dialog or over the backdrop stay off the page behind */
dialog.popup:modal { overscroll-behavior: contain; }
dialog.popup::backdrop {
  overflow: hidden;
  overscroll-behavior: contain;
  background-color: transparent;
  transition-property: background-color, display, overlay;
  transition-duration: 0.25s;
  transition-timing-function: ease-out;
  transition-behavior: allow-discrete;
}
dialog.popup[open]:where(:not([data-closing]))::backdrop {
  background-color: var(--backdrop);
  @starting-style { background-color: transparent; }
}
.popup-close {
  position: absolute;
  inset-block-start: 0.5rem;
  inset-inline-end: 0.625rem;
  display: grid;
  place-items: center;
  inline-size: 2.75rem;
  block-size: 2.75rem;
  background: none;
  border: 0;
  border-radius: 3px;
  color: var(--title);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}
.popup-close:hover { color: var(--accent-bright); background: rgb(111 163 255 / 0.12); }
.popup .fine { margin-block-start: 0.875rem; }

/* ---------- Narrow sections: full-width buttons ---------- */
@container section (inline-size < 37.5rem) {
  .btn-row { flex-direction: column; }
  .btn-row .btn { inline-size: 100%; }
}

/* ---------- Forced colors (Windows High Contrast) ---------- */
@media (forced-colors: active) {
  .btn, .badge, .card .tag, .contact-box { border-color: ButtonText; }
  .site-menu a[aria-current="page"] { border-block-end-color: Highlight; }
  .site-header { border-block-end-color: CanvasText; }
  .field input:user-invalid { outline: 2px solid Mark; }
}

/* The hidden attribute always wins, even over components that set their own display */
[hidden] { display: none !important; }
