/* ==========================================================================
   Mirth & Myth — site styles
   --------------------------------------------------------------------------
   Colours and fonts live in :root just below.
   Fonts load from Google Fonts: see the <link> in each page's <head>.
   To change a font, edit that link AND the two --font-* lines below.
   ========================================================================== */

:root {
  --bg: #161616;            /* page background */
  --surface: #1f1c1b;       /* raised panels: contact pop-up, note cards */
  --text: #eee8df;          /* near-white body text */
  --muted: #b9b0a4;         /* secondary text */
  --wine: #7a2233;          /* accent fills: buttons, rules */
  --wine-hover: #8e2a3b;
  --rose: #cf7f8c;          /* wine tint for small text on dark: eyebrows, links */
  --line: rgba(238, 232, 223, 0.14);
  --paper: #ece4d6;         /* light paper for the prompt slip */

  --font-display: "Cormorant Garamond", Garamond, "Times New Roman", serif;
  --font-body: "Libre Baskerville", Baskerville, Georgia, serif;

  --wrap: 1180px;
  --measure: 40rem;         /* comfortable reading width */
  --gutter: clamp(16px, 4vw, 40px);
  --space: clamp(44px, 6.5vw, 88px);   /* half the gap between two sections */
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

:root { color-scheme: dark; }
html {
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
}
@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: clamp(1rem, 0.95rem + 0.2vw, 1.09rem);
  line-height: 1.8;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--rose); }

p { margin: 0 0 1.1em; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: 0;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.9rem, 1.8rem + 4.6vw, 5.4rem); }
h2 { font-size: clamp(2.25rem, 1.6rem + 2.5vw, 3.5rem); }
h3 { font-size: clamp(1.65rem, 1.35rem + 1.1vw, 2.25rem); }
h4 { font-size: 1.3rem; }

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

::selection { background: var(--wine); color: var(--text); }

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--text); color: var(--bg);
  padding: 8px 14px; border-radius: 4px; text-decoration: none;
}
.skip-link:focus { top: 12px; color: var(--bg); }

/* Eyebrow: the small line above a title. Italic, sentence case, wine tint. */
.eyebrow {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--rose);
  margin: 0 0 0.75rem;
}

.muted { color: var(--muted); }

/* ---------- Buttons & links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  font-family: var(--font-body);
  font-size: 0.92rem;
  line-height: 1.2;
  padding: 0.9em 1.6em;
  border-radius: 999px;
  border: 1px solid var(--wine);
  background: var(--wine);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.btn:hover { background: var(--wine-hover); border-color: var(--wine-hover); color: var(--text); }

.btn--ghost { background: transparent; border-color: rgba(238, 232, 223, 0.4); }
.btn--ghost:hover { background: transparent; border-color: var(--rose); color: var(--rose); }

.btn--small { font-size: 0.85rem; padding: 0.65em 1.25em; }

/* A button for something not yet available (e.g. a PDF still to come) */
.btn[aria-disabled="true"] {
  background: transparent;
  border: 1px dashed rgba(238, 232, 223, 0.3);
  color: var(--muted);
  cursor: default;
}
.btn[aria-disabled="true"]:hover { color: var(--muted); }

.text-link {
  color: var(--rose);
  text-decoration: underline;
  text-decoration-color: rgba(207, 127, 140, 0.45);
}
.text-link:hover { text-decoration-color: currentColor; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-top: 1.8rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  background: rgba(22, 22, 22, 0.9);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }

.header-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 84px;
}

.wordmark {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 1.4rem + 0.6vw, 1.85rem);
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
}
.wordmark:hover { color: var(--text); }

.brand { display: block; line-height: 0; }
.brand img { height: 60px; width: auto; }

.nav { display: flex; align-items: center; gap: clamp(14px, 2.6vw, 34px); list-style: none; margin: 0; padding: 0; }
.nav a:not(.btn) { text-decoration: none; font-size: 0.92rem; }
.nav a:not(.btn):hover { color: var(--rose); }
.nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--wine); text-underline-offset: 0.35em; text-decoration-thickness: 2px; }

@media (max-width: 480px) {
  .header-inner { min-height: 64px; }
  .brand img { height: 44px; }
  .nav { gap: 14px; }
  .nav a:not(.btn) { font-size: 0.98rem; }
  .nav .btn--small { padding: 0.5em 0.95em; }
}

/* ---------- Ornament divider (hand-drawn pieces between sections) ---------- */
.divider {
  display: flex; align-items: center; gap: clamp(16px, 3vw, 32px);
  max-width: calc(var(--wrap) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.divider img { width: var(--orn-w, clamp(96px, 11vw, 140px)); opacity: 0.72; }

/* ---------- Home: hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: center;
  padding-block: clamp(40px, 7vw, 96px) var(--space);
}

.hero-logo { margin: 0; }
.hero-logo img { width: 100%; max-width: 640px; }
@media (prefers-reduced-motion: no-preference) {
  .hero-logo img { animation: logo-in 1.8s cubic-bezier(.2, .6, .2, 1) both; }
  @keyframes logo-in { from { opacity: 0; transform: translateY(6px); filter: blur(3px); } to { opacity: 1; transform: none; filter: none; } }
}

.hero-tagline {
  font-family: var(--font-display);
  font-size: clamp(2rem, 1.4rem + 1.8vw, 2.85rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: 0;
  margin-bottom: 1.4rem;
  text-wrap: balance;
}
.hero-text p:not(.hero-tagline) { color: var(--muted); max-width: 34em; }
.hero-text p:not(.hero-tagline):first-of-type { color: var(--text); }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .hero-logo img { max-width: 520px; }
}

/* ---------- Home: Imaginal Pattern Studies feature ---------- */
.feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 5.5vw, 88px);
  align-items: center;
  padding-block: var(--space);
}
.feature-media { margin: 0; position: relative; }
.feature-media img { width: 100%; }
/* thin frame line set just inside the photograph, like a mount */
.feature-media::after {
  content: ""; position: absolute; inset: 10px;
  border: 1px solid rgba(238, 232, 223, 0.22);
  pointer-events: none;
}
.feature-body h2 { margin-bottom: 0.6em; }
.feature-body > p { max-width: 33em; }
.feature-note { color: var(--muted); font-size: 0.95em; font-style: italic; margin-top: 1.4rem; }

@media (max-width: 860px) {
  .feature { grid-template-columns: 1fr; }
}

/* ---------- Home: Additional Reading & Material ---------- */
.reading { padding-block: var(--space); }

.section-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
  padding-bottom: clamp(20px, 3vw, 32px);
  border-bottom: 1px solid var(--line);
}
.section-head h2 { margin: 0; }
.section-head img { width: clamp(90px, 12vw, 150px); opacity: 0.6; margin-bottom: 6px; }

.reading-list { list-style: none; margin: 0; padding: 0; }
.reading-item { border-bottom: 1px solid var(--line); }

.reading-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr);
  gap: clamp(24px, 5vw, 72px);
  align-items: center;
  padding-block: clamp(32px, 5vw, 56px);
}
.reading-card h3 { margin-bottom: 0.45em; }
.reading-card h3 a { text-decoration: none; }
.reading-card h3 a:hover { color: var(--text); text-decoration: underline; text-decoration-color: var(--wine); text-decoration-thickness: 2px; }
.reading-excerpt { color: var(--muted); max-width: 32em; }
.reading-thumb { display: block; overflow: hidden; aspect-ratio: 3 / 2; }
.reading-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s ease; }
.reading-card:hover .reading-thumb img { transform: scale(1.025); }

@media (max-width: 760px) {
  .reading-card { grid-template-columns: 1fr; }
  .reading-thumb { order: -1; }
}

/* ---------- Closing invitation band ---------- */
.closing {
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
  padding-block: var(--space);
}
.closing h2 { font-size: clamp(2rem, 1.5rem + 1.8vw, 2.9rem); }
.closing p { color: var(--muted); max-width: 36em; }

.plate {
  margin: 0;
  background: #f4efe6;
  padding: 10px 10px 8px;
  width: 100%;
  max-width: 300px;
  box-shadow: 0 24px 48px -24px rgba(0, 0, 0, 0.9);
  transform: rotate(-1.2deg);
}
.plate img { width: 100%; filter: sepia(0.25) contrast(1.02); }

@media (max-width: 760px) {
  .closing { grid-template-columns: 1fr; }
  .plate { max-width: 260px; }
}

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding-top: clamp(48px, 7vw, 80px); margin-top: var(--space); }
.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) auto auto;
  gap: 32px clamp(32px, 6vw, 96px);
  align-items: start;
}
.footer-brand p { color: var(--muted); max-width: 26em; margin-top: 0.6rem; font-size: 0.98rem; }
.footer-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-nav a { text-decoration: none; }
.footer-contact p { margin: 0 0 6px; color: var(--muted); font-size: 0.98rem; }
.footer-contact a { color: var(--text); }
.footer-base {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-top: clamp(40px, 6vw, 72px);
  padding-block: 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}
.footer-base p { margin: 0; }
.footer-base img { width: 84px; opacity: 0.5; }

@media (max-width: 760px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

/* ---------- Generic page header (inner pages) ---------- */
.page-head { padding-block: clamp(48px, 8vw, 104px) clamp(32px, 5vw, 56px); }
.standfirst {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 1.2rem + 0.9vw, 1.95rem);
  line-height: 1.3;
  color: var(--muted);
  max-width: 34em;
  text-wrap: pretty;
}

/* ---------- Long-form text (articles, bios) ---------- */
.prose { max-width: var(--measure); }
.prose > * + * { margin-top: 0; }
.prose p { margin-bottom: 1.15em; }
.prose > h2:first-child { margin-top: 0; }
.prose h2 { font-size: clamp(2rem, 1.5rem + 1.7vw, 2.75rem); margin: 2.4em 0 0.6em; scroll-margin-top: 100px; }
.prose h3 { font-size: clamp(1.5rem, 1.3rem + 0.8vw, 1.9rem); margin: 2em 0 0.55em; }
.prose h4 { font-family: var(--font-body); font-style: italic; font-size: 0.92rem; color: var(--rose); margin: 1.8em 0 0.6em; letter-spacing: 0; }
.prose ol, .prose ul { padding-left: 1.35em; margin: 0 0 1.3em; }
.prose li { margin-bottom: 0.65em; padding-left: 0.3em; }
.prose ol > li::marker { font-family: var(--font-display); color: var(--rose); }
.prose blockquote {
  margin: 1.8em 0;
  padding: 0.2em 0 0.2em 1.4em;
  border-left: 2px solid var(--wine);
  font-style: italic;
  color: var(--text);
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose a { color: var(--rose); text-decoration-color: rgba(207, 127, 140, 0.45); }
.prose a:hover { text-decoration-color: currentColor; }
.prose em { font-style: italic; }
.prose hr { border: 0; height: 1px; background: var(--line); margin: 3em 0; }

.dropcap::first-letter {
  float: left;
  font-family: var(--font-display);
  font-size: 4.6em;
  line-height: 0.8;
  padding: 0.06em 0.1em 0 0;
  color: var(--text);
}

/* ---------- About ---------- */
.about {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr);
  gap: clamp(40px, 7vw, 112px);
  align-items: start;
  padding-block: clamp(48px, 8vw, 104px) var(--space);
}
.about-portrait { position: sticky; top: 112px; }
/* Portrait: a plain rectangle, by choice. */
.portrait { margin: 0; max-width: 480px; }
.portrait img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }

.about-body h1 { margin-bottom: 0.15em; }
.role { font-style: italic; color: var(--rose); font-size: 1rem; margin-bottom: 2rem; }
.about-body .prose p:first-child { color: var(--text); font-size: 1.08em; }

@media (max-width: 860px) {
  .about { grid-template-columns: 1fr; }
  .about-portrait { position: static; max-width: 420px; }
}

/* ---------- Imaginal Pattern Studies landing ---------- */
.ips-hero { position: relative; }
.ips-hero-media { margin: 0; }
.ips-hero-media img { width: 100%; max-height: 88vh; object-fit: cover; object-position: center 40%; }
.ips-hero-text {
  position: absolute;
  left: 50%; top: 63%;
  isolation: isolate;
  transform: translate(-50%, -50%);
  width: min(54%, 680px);
  text-align: center;
}
.ips-hero-text::before {
  content: ""; position: absolute; inset: -18% -12%; z-index: -1;
  background: radial-gradient(closest-side, rgba(18, 18, 18, 0.62), rgba(18, 18, 18, 0));
}
.ips-hero-text h1 { text-shadow: 0 2px 24px rgba(0, 0, 0, 0.6); }
.ips-hero-text .standfirst { color: var(--text); margin-inline: auto; text-shadow: 0 1px 16px rgba(0, 0, 0, 0.7); }
@media (max-width: 860px) {
  .ips-hero-text { position: static; transform: none; width: auto; text-align: left; padding: 32px var(--gutter) 0; }
  .ips-hero-text::before { display: none; }
  .ips-hero-text .standfirst { color: var(--muted); margin-inline: 0; }
}

.ips-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 15rem);
  gap: clamp(32px, 6vw, 96px);
  padding-block: calc(var(--space) * 2) 0;
}
.ips-intro aside { padding-top: 0.6rem; }
.ips-intro aside img { width: 100%; max-width: 230px; opacity: 0.55; }
.ips-intro .lead { font-size: 1.12em; }
@media (max-width: 860px) {
  .ips-intro { grid-template-columns: 1fr; }
  .ips-intro aside { display: none; }
}

.pdf-slot {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px;
  margin-top: 2rem; padding-top: 1.4rem; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 0.98rem;
}
.pdf-slot p { margin: 0; flex: 1 1 18em; }

.steps-section { padding-block: calc(var(--space) * 2) 0; }
.steps {
  list-style: none; margin: clamp(28px, 4vw, 48px) 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(24px, 4vw, 56px);
  counter-reset: step;
}
.steps li { counter-increment: step; border-top: 1px solid var(--line); padding-top: 1.4rem; }
.steps li::before {
  content: counter(step);
  display: block;
  font-family: var(--font-display);
  font-size: 2.6rem; line-height: 1;
  color: var(--rose);
  margin-bottom: 0.9rem;
}
.steps h3 { font-size: 1.65rem; }
.steps p { color: var(--muted); font-size: 0.98em; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }

/* the "found note" prompt */
.try {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: center;
  padding-block: calc(var(--space) * 2) 0;
}
.slip {
  background: var(--paper);
  color: #2a2422;
  padding: clamp(28px, 4vw, 48px) clamp(28px, 4vw, 52px);
  transform: rotate(-2deg);
  box-shadow: 0 30px 60px -28px rgba(0, 0, 0, 0.95);
  max-width: 440px;
  justify-self: center;
  position: relative;
}
.slip::before { /* a torn top edge */
  content: ""; position: absolute; left: 0; right: 0; top: -7px; height: 8px;
  background: linear-gradient(135deg, transparent 50%, var(--paper) 50%) 0 0 / 12px 8px repeat-x,
              linear-gradient(225deg, transparent 50%, var(--paper) 50%) 0 0 / 12px 8px repeat-x;
}
.slip p {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(2.2rem, 1.6rem + 2vw, 3.1rem);
  line-height: 1.2;
  margin: 0;
}
.try-text p { max-width: 32em; }
.try-text .muted { font-size: 0.95em; font-style: italic; }
@media (max-width: 860px) { .try { grid-template-columns: 1fr; } .slip { justify-self: start; } }

.workbooks { padding-block: calc(var(--space) * 2) 0; }
.workbooks > .section-intro { color: var(--muted); max-width: 36em; margin-top: 1rem; }

.workbook {
  margin-top: clamp(32px, 5vw, 56px);
  border-top: 1px solid var(--line);
  padding-top: clamp(32px, 5vw, 56px);
}
.workbook-media { margin: 0 0 clamp(28px, 4vw, 48px); }
.workbook-media img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.credit { font-size: 0.85rem; color: var(--muted); margin-top: 0.7rem; font-style: italic; }

.workbook-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 96px);
}
.workbook-grid h3 { font-size: clamp(2.3rem, 1.7rem + 2.1vw, 3.3rem); }
.workbook-contents h4 { font-family: var(--font-body); font-style: italic; color: var(--rose); font-size: 0.92rem; letter-spacing: 0; margin-bottom: 1rem; }
.workbook-contents ol { margin: 0; padding-left: 1.6em; }
.workbook-contents li { padding: 0.35em 0 0.35em 0.3em; border-bottom: 1px solid var(--line); }
.workbook-contents li::marker { font-family: var(--font-display); color: var(--muted); }
@media (max-width: 860px) { .workbook-grid { grid-template-columns: 1fr; } }

.excerpt {
  margin-top: clamp(40px, 6vw, 72px);
  background: var(--surface);
  border-left: 2px solid var(--wine);
  padding: clamp(28px, 4vw, 52px);
}
.excerpt h4 { font-size: clamp(1.6rem, 1.35rem + 0.9vw, 2.05rem); margin-bottom: 0.2em; }
.excerpt .eyebrow { margin-bottom: 0.4rem; }
.excerpt .prose { max-width: 42rem; }

.forthcoming {
  margin-top: clamp(32px, 5vw, 56px);
  display: grid;
  grid-template-columns: minmax(0, 180px) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: center;
  border: 1px dashed rgba(238, 232, 223, 0.22);
  padding: clamp(24px, 4vw, 40px);
}
.forthcoming .plate { transform: rotate(1.5deg); }
.forthcoming h3 { font-size: 1.75rem; margin-bottom: 0.3em; }
.forthcoming p { color: var(--muted); margin: 0; max-width: 34em; }
@media (max-width: 640px) { .forthcoming { grid-template-columns: 1fr; } }

.references { padding-block: calc(var(--space) * 2) var(--space); }
.references ul { list-style: none; padding: 0; margin: 1.5rem 0 0; max-width: 46rem; }
.references li { padding: 1.1rem 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.98em; }
.references li strong { color: var(--text); font-weight: 400; font-style: italic; }

/* ---------- Reading (article) pages ---------- */
.article-head { padding-block: clamp(48px, 8vw, 104px) clamp(32px, 5vw, 56px); }
.article-head > * { max-width: 52rem; }
.article-head h1 { font-size: clamp(2.5rem, 1.5rem + 4vw, 4.4rem); }
.back-link { display: inline-block; margin-bottom: 2rem; color: var(--muted); text-decoration: none; font-size: 0.9rem; }
.back-link:hover { color: var(--rose); }
.article-hero { margin-block: 0 clamp(48px, 7vw, 88px); }
.article-hero img { width: 100%; max-height: 78vh; object-fit: cover; }

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 15rem) minmax(0, var(--measure));
  gap: clamp(40px, 6vw, 96px);
  justify-content: start;
}

.toc { font-size: 0.85rem; }
.toc summary { cursor: pointer; font-style: italic; color: var(--rose); list-style: none; margin-bottom: 0.8rem; }
.toc summary::-webkit-details-marker { display: none; }
.toc summary::after { content: " +"; }
.toc[open] summary::after { content: " –"; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc li { margin: 0; }
.toc a { display: block; padding: 0.4em 0 0.4em 1em; text-decoration: none; color: var(--muted); line-height: 1.35; margin-left: -1px; border-left: 1px solid transparent; }
.toc a:hover, .toc a.is-active { color: var(--text); border-left-color: var(--rose); }

@media (min-width: 1000px) {
  .toc-wrap { position: sticky; top: 108px; align-self: start; max-height: calc(100vh - 140px); overflow: auto; }
  .toc summary { pointer-events: none; }
  .toc summary::after { content: ""; }
}
@media (max-width: 999px) {
  .article-layout { grid-template-columns: 1fr; }
  .toc { border: 1px solid var(--line); padding: 1rem 1.2rem; }
  .toc summary { margin: 0; }
  .toc[open] summary { margin-bottom: 0.8rem; }
}

.article-foot { margin-top: 3.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.92rem; }

/* ---------- Contact pop-up ---------- */
.contact {
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.9);
}
.contact::backdrop { background: rgba(10, 8, 8, 0.72); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
@media (prefers-reduced-motion: no-preference) {
  .contact[open] { animation: dialog-in 0.28s ease-out; }
  @keyframes dialog-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
}
.contact-inner { position: relative; padding: clamp(28px, 5vw, 44px); }
.contact-ornament { width: 54px; opacity: 0.6; margin-bottom: 0.8rem; }
.contact h2 { font-size: clamp(2.2rem, 1.8rem + 1.4vw, 2.7rem); margin-bottom: 0.3em; }
.contact-intro { color: var(--muted); margin-bottom: 1.6rem; }
.contact-close {
  position: absolute; top: 14px; right: 14px;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  background: transparent; border: 1px solid transparent; border-radius: 999px;
  color: var(--muted); font-size: 1.6rem; line-height: 1; cursor: pointer;
}
.contact-close:hover { color: var(--text); border-color: var(--line); }

.field { margin-bottom: 1.1rem; }
.field label { display: block; font-size: 0.9rem; margin-bottom: 0.4rem; }
.field input, .field textarea {
  width: 100%;
  font: inherit; font-size: 0.95rem;
  color: var(--text);
  background: #161414;
  border: 1px solid rgba(238, 232, 223, 0.22);
  border-radius: 4px;
  padding: 0.7em 0.85em;
  transition: border-color 0.2s ease;
}
.field textarea { resize: vertical; min-height: 8em; line-height: 1.5; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--rose); box-shadow: 0 0 0 3px rgba(207, 127, 140, 0.18); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 1.4rem; }
.form-note { margin: 0; color: var(--muted); font-size: 0.95rem; }
.form-note a { color: var(--text); }
.form-status { margin: 1rem 0 0; font-size: 0.98rem; min-height: 1.4em; }
.form-status.is-error { color: #f0a3ae; }
.contact .btn[disabled] { opacity: 0.6; cursor: progress; }

/* ---------- Simple centred pages (thanks, 404) ---------- */
.simple-page { text-align: center; padding-block: clamp(64px, 12vw, 160px); }
.simple-page .plate { margin: 0 auto 2.5rem; transform: rotate(-1.5deg); width: min(320px, 80%); }
.simple-page p { color: var(--muted); max-width: 30em; margin-inline: auto; }
.simple-page .actions { justify-content: center; }

/* practice numbers in article headings, titles inside credits */
.prose h3 .num { color: var(--rose); margin-right: 0.3em; }
.credit span { font-style: normal; }
.hero-logo picture { display: block; }
.feature-note .title { font-style: normal; }
.ips-closing-space { padding-bottom: var(--space); }

/* Very narrow phones: the Reading link drops out of the header (it stays in the footer) */
@media (max-width: 430px) { .nav-reading { display: none; } }
