/* ============================================================
   style.css — Personal site
   One file. No preprocessor. No build step. No JavaScript.
   ============================================================ */

/* ── 1. Fonts ──────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&family=IBM+Plex+Sans:ital,wght@0,400;0,500;1,400&family=IBM+Plex+Serif:ital,wght@0,400;0,700;1,400&display=swap');

/* ── 2. Custom properties ───────────────────────────────────── */
:root {
  /* Colors — liminal / nasa / coffee / coastal */
  --bg:         #F2EDE4;   /* bone — aged paper, coffee cream */
  --bg-surface: #EDE8DF;   /* warm white — card bg, diner counter */
  --text:       #1C1A17;   /* dark espresso */
  --text-muted: #6B6460;   /* ash, cigarette smoke — 4.6:1 contrast on --bg */
  --accent:     #A83A0A;   /* NASA rust — mission patches, burnt orange — 5.5:1 contrast */
  --accent-2:   #2E6E6A;   /* hanoi teal — lacquerware, coastal water — 4.8:1 contrast */
  --border:     #C9C3B8;   /* wet sand, photo borders */
  --grey:       #A8A8A4;   /* liminal grey — decorative only, not for body text */
  --code-bg:    #1E1E1E;   /* terminal dark — mission control screens */
  --code-text:  #C8D8A8;   /* phosphor green — CRT glow */

  /* Typography */
  --font-serif: 'IBM Plex Serif', Georgia, 'Times New Roman', serif;
  --font-sans:  'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --font-mono:  'IBM Plex Mono', 'Courier New', monospace;

  /* Type scale — Major Third (1.25×), fluid via clamp() */
  --text-xs:   0.75rem;    /* 12px minimum — never below for legibility */
  --text-sm:   0.875rem;   /* 14px — nav, metadata */
  --text-base: 1rem;       /* 16px — body */
  --text-lg:   1.25rem;    /* 20px — taglines, lead text */
  --text-xl:   clamp(1.25rem, 1.1rem + 0.75vw, 1.563rem);
  --text-2xl:  clamp(1.563rem, 1.3rem + 1.2vw, 1.953rem);
  --text-3xl:  clamp(1.953rem, 1.5rem + 2vw, 2.441rem);
  --text-4xl:  clamp(2.2rem, 1.6rem + 3vw, 3.052rem);

  /* Spacing — 4pt grid */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.25rem;
  --sp-6: 1.5rem;
  --sp-8: 2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-16: 4rem;
}

/* ── 3. Reset ───────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

/* ── 4. Base ────────────────────────────────────────────────── */
html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

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

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.65;         /* 1.65 — comfortable for prose, not too airy */
  overflow-wrap: break-word;
  hyphens: auto;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--sp-4);
  z-index: 100;
  padding: var(--sp-2) var(--sp-4);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  text-decoration: none;
  border: 2px solid var(--accent);
}

.skip-link:focus {
  top: var(--sp-4);
}

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

/* ── 5. Layout ──────────────────────────────────────────────── */
.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 var(--sp-5);
}

/* ── 6. Header + Nav ────────────────────────────────────────── */
header {
  padding: var(--sp-5) 0;
  border-bottom: 2px solid var(--accent);
  margin-bottom: var(--sp-10);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--sp-2) var(--sp-6);
}

.site-title {
  font-family: var(--font-mono);
  font-size: var(--text-base);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text);
  text-decoration: none;
  /* include letter-spacing so the expansion feels intentional */
  transition: color 0.15s ease-out, letter-spacing 0.22s cubic-bezier(0.25, 0, 0, 1);
}

.site-title:hover {
  color: var(--accent);
  /* Subtle tracking expansion — the name opens up slightly */
  letter-spacing: 0.07em;
}

nav {
  display: flex;
  gap: var(--sp-5);
  align-items: baseline;
}

nav a {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  letter-spacing: 0.06em;
  text-transform: lowercase;
  color: var(--text-muted);
  text-decoration: none;
  /* animated underline — grows left→right like post-list links */
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: color 0.15s ease-out,
              background-size 0.22s cubic-bezier(0.25, 0, 0, 1);
}

nav a:hover,
nav a[aria-current="page"] {
  color: var(--accent);
  background-size: 100% 1px;
}

/* ── 7. Typography ──────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 700;
  color: var(--text);
  font-kerning: normal;
  font-optical-sizing: auto;
}

/* Tighten line-height and tracking at larger sizes — letterforms need less air */
h1 {
  font-size: var(--text-3xl);
  line-height: 1.1;
  letter-spacing: -0.015em;
}

h2 {
  font-size: var(--text-2xl);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

h3 {
  font-size: var(--text-xl);
  line-height: 1.2;
}

h4 {
  font-size: var(--text-lg);
  line-height: 1.25;
}

p {
  margin-bottom: var(--sp-4);
}

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

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-skip-ink: auto;
  transition: color 0.15s ease-out;
}

a:hover {
  color: var(--accent-2);
}

/* Keyboard focus — visible ring that matches brand */
a:focus-visible,
.site-title:focus-visible,
nav a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 1px;
}

/* Suppress focus ring for mouse users */
a:focus:not(:focus-visible) {
  outline: none;
}

strong {
  font-weight: 500;
}

ul, ol {
  padding-left: var(--sp-6);
  margin-bottom: var(--sp-4);
}

li {
  margin-bottom: var(--sp-2);
}

blockquote {
  margin: var(--sp-6) 0;
  padding: var(--sp-4) var(--sp-5);
  font-style: italic;
  color: var(--text-muted);
  position: relative;

  /* HUD panel: scan-line tint + warm orange wash */
  background:
    repeating-linear-gradient(
      0deg,
      transparent 0px, transparent 3px,
      rgba(168, 58, 10, 0.022) 3px, rgba(168, 58, 10, 0.022) 4px
    ),
    rgba(168, 58, 10, 0.05);

  /* Asymmetric border — thick signal edge on left, whisper on right */
  border-top:    1px solid rgba(168, 58, 10, 0.2);
  border-bottom: 1px solid rgba(168, 58, 10, 0.2);
  border-left:   3px solid var(--accent);
  border-right:  none;

  /* Persona 5 diagonal cut — bottom-right corner */
  clip-path: polygon(
    0 0,
    100% 0,
    100% calc(100% - 10px),
    calc(100% - 10px) 100%,
    0 100%
  );
}

/* Bottom-right corner bracket — echoes brewing card geometry */
blockquote::after {
  content: '';
  position: absolute;
  bottom: 5px;
  right: 5px;
  width: 8px;
  height: 8px;
  border-bottom: 1.5px solid rgba(168, 58, 10, 0.45);
  border-right:  1.5px solid rgba(168, 58, 10, 0.45);
}

blockquote p:last-child {
  margin-bottom: 0;
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--sp-10) 0;
}

pre {
  background: var(--code-bg);
  color: var(--code-text);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: 1.5;
  padding: var(--sp-5);
  overflow-x: auto;
  border-left: 3px solid var(--accent);
  border-top: 1px solid rgba(168, 58, 10, 0.35);
  border-right: 1px solid rgba(168, 58, 10, 0.15);
  border-bottom: 1px solid rgba(168, 58, 10, 0.15);
  margin: var(--sp-6) 0;
  position: relative;

  /* Diagonal cut — top-right corner */
  clip-path: polygon(
    0 0,
    calc(100% - 10px) 0,
    100% 10px,
    100% 100%,
    0 100%
  );
}

/* HUD label band across the top of code blocks */
pre::before {
  content: 'TERMINAL';
  display: block;
  font-size: 0.5rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--accent);
  opacity: 0.55;
  background: rgba(168, 58, 10, 0.12);
  margin: calc(-1 * var(--sp-5)) calc(-1 * var(--sp-5)) var(--sp-4);
  padding: 0.3em var(--sp-5);
  border-bottom: 1px solid rgba(168, 58, 10, 0.2);
}

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 0.1em 0.35em;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* ── 8. Section labels ──────────────────────────────────────── */
.section-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);   /* --text-muted passes WCAG AA at 4.6:1 */
  display: block;
}

/* ▸ marker matches the brewing card label — unified HUD language */
.section-label::before {
  content: '▸ ';
  color: var(--accent);
  letter-spacing: 0;
  font-weight: 400;
}

/* ── 9. Post list ───────────────────────────────────────────── */
.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.post-list li {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: var(--sp-2) var(--sp-5);
  /* sp-4 gives rows more air — reading a list should feel unhurried */
  padding: var(--sp-4) 0;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
  position: relative;
}

/* Orange accent bar slides in from left on hover */
.post-list li::before {
  content: '';
  position: absolute;
  left: -var(--sp-5);
  left: calc(-1 * var(--sp-5));
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: center;
  transition: transform 0.2s cubic-bezier(0.25, 0, 0, 1);
}

.post-list li:hover::before {
  transform: scaleY(1);
}

.post-list li:first-child {
  border-top: 1px solid var(--border);
}

.post-list .date {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  white-space: nowrap;
  padding-top: 2px;
  font-variant-numeric: tabular-nums;  /* dates align consistently */
  transition: color 0.15s ease-out;
}

/* Date picks up accent color when the row is hovered */
.post-list li:hover .date {
  color: var(--accent);
}

.post-list a {
  font-family: var(--font-serif);
  font-size: var(--text-base);
  color: var(--text);
  text-decoration: none;
  /* Underline grows left→right on hover — discovered, not announced */
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size 0.25s cubic-bezier(0.25, 0, 0, 1),
              color 0.15s ease-out;
}

.post-list a:hover {
  color: var(--accent);
  background-size: 100% 1px;
}

/* ── 10. Section (homepage blocks) ─────────────────────────── */
.section {
  margin-bottom: var(--sp-12);
}

/* The last section (Elsewhere) is lighter — less space needed */
.section:last-of-type {
  margin-bottom: var(--sp-6);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: var(--sp-4);
}

.section-header .see-all {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.06em;
}

.section-header .see-all:hover {
  color: var(--accent);
}

/* ── 11. Intro block (homepage) ─────────────────────────────── */
.intro {
  /* More space after the intro — it's the face of the site */
  margin-bottom: var(--sp-16);
}

.intro h1 {
  font-size: var(--text-4xl);
  margin-bottom: var(--sp-2);
  letter-spacing: -0.02em;   /* tighter at display size */
  line-height: 1.05;
}

.intro .tagline {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--text-lg);
  color: var(--text-muted);
  /* More space between tagline and bio — lets the name breathe */
  margin-bottom: var(--sp-8);
  display: block;
}

/* ── 12. Elsewhere links ────────────────────────────────────── */
.elsewhere-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-6);
  margin-top: var(--sp-4);
}

.elsewhere-list a {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.04em;
}

.elsewhere-list a::before {
  content: '↗';
  display: inline-block;
  margin-right: 0.35em;
  color: var(--grey);
  transition: transform 0.15s cubic-bezier(0.25, 0, 0, 1), color 0.15s ease-out;
}

.elsewhere-list a:hover {
  color: var(--accent);
}

/* ↗ nudges toward the link destination */
.elsewhere-list a:hover::before {
  transform: translate(2px, -2px);
  color: var(--accent);
}

/* ── 13. Post page ──────────────────────────────────────────── */
.post-header {
  margin-bottom: var(--sp-8);
}

.post-header h1 {
  font-size: var(--text-3xl);
  margin-bottom: var(--sp-4);
  line-height: 1.1;
  letter-spacing: -0.015em;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-5);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);   /* --text-muted passes WCAG AA at 4.6:1 */
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  padding: var(--sp-3) var(--sp-3) var(--sp-3);
  margin-bottom: var(--sp-2);

  /* Scan-line strip — same tint as the card, ties post headers to HUD system */
  background:
    repeating-linear-gradient(
      0deg,
      transparent 0px, transparent 3px,
      rgba(168, 58, 10, 0.018) 3px, rgba(168, 58, 10, 0.018) 4px
    ),
    rgba(168, 58, 10, 0.035);

  border-top:    2px solid var(--accent);
  border-left:   2px solid var(--accent);
  border-right:  1px solid rgba(168, 58, 10, 0.25);
  border-bottom: 1px solid rgba(168, 58, 10, 0.25);

  /* Diagonal cut — top-right corner */
  clip-path: polygon(
    0 0,
    calc(100% - 10px) 0,
    100% 10px,
    100% 100%,
    0 100%
  );
}

.post-meta .tag {
  color: var(--accent-2);
}

.post-content {
  margin-top: var(--sp-8);
  margin-bottom: var(--sp-12);
  /* 65ch ≈ optimal 65-character line length for sustained reading */
  max-width: 65ch;
}

.post-content h2 {
  margin-top: var(--sp-10);
  margin-bottom: var(--sp-4);
}

.post-content h3 {
  margin-top: var(--sp-8);
  margin-bottom: var(--sp-3);
}

.post-content > p + p {
  margin-top: 0;
}

.post-nav {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: var(--sp-5) 0;
  border-top: 1px solid var(--border);
  gap: var(--sp-4);
}

.post-nav a {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-decoration: none;
  max-width: 46%;
}

.post-nav a:hover {
  color: var(--accent);
}

.post-nav .prev::before {
  content: '←';
  display: inline-block;
  margin-right: 0.4em;
  transition: transform 0.15s cubic-bezier(0.25, 0, 0, 1);
}

.post-nav .prev:hover::before {
  transform: translateX(-3px);
}

.post-nav .next {
  text-align: right;
  margin-left: auto;
}

.post-nav .next::after {
  content: '→';
  display: inline-block;
  margin-left: 0.4em;
  transition: transform 0.15s cubic-bezier(0.25, 0, 0, 1);
}

.post-nav .next:hover::after {
  transform: translateX(3px);
}

.back-link {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: var(--sp-6);
  text-transform: uppercase;
}

.back-link::before {
  content: '←';
  display: inline-block;
  margin-right: 0.4em;
  transition: transform 0.15s cubic-bezier(0.25, 0, 0, 1);
}

.back-link:hover {
  color: var(--accent);
}

/* Arrow nudges left — like it's pulling you back */
.back-link:hover::before {
  transform: translateX(-3px);
}

/* ── 14. Images ─────────────────────────────────────────────── */
figure {
  margin: var(--sp-6) 0;
}

figure img {
  width: 100%;
}

figcaption {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--sp-2);
  letter-spacing: 0.04em;
}

/* Dithered image style — grayscale + slight contrast boost */
.dithered {
  filter: grayscale(1) contrast(1.2);
}

/* ── 15. Footer ─────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  /* top padding removed — ::before skyline provides the visual breathing room */
  padding: 0 0 var(--sp-10);
  margin-top: var(--sp-12);
  color: var(--text-muted);
}

/* Minimal horizon mark */
footer::before {
  content: '';
  display: block;
  width: 100%;
  height: 64px;
  margin-bottom: var(--sp-5);
  background: url('assets/skyline.svg') no-repeat center bottom / 100% 64px;
  pointer-events: none;
}

.footer-inner {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  letter-spacing: 0.04em;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--sp-2) var(--sp-6);
}

.footer-inner a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer-inner a:hover {
  color: var(--accent);
}

.footer-links {
  display: flex;
  gap: var(--sp-4);
}

.footer-links a {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.04em;
}

.footer-links a:hover {
  color: var(--accent);
}

/* ── 16. About page ─────────────────────────────────────────── */
.about-header {
  margin-bottom: var(--sp-10);
}

.about-header h1 {
  font-size: var(--text-3xl);
  margin-bottom: var(--sp-3);
}

.about-header .tagline {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--text-lg);
  color: var(--text-muted);
}

.about-content h2 {
  margin-top: var(--sp-10);
  margin-bottom: var(--sp-4);
  font-size: var(--text-xl);
}

/* ── 17. Blog archive ───────────────────────────────────────── */
.archive-header {
  margin-bottom: var(--sp-8);
}

.archive-header h1 {
  font-size: var(--text-3xl);
  margin-bottom: var(--sp-3);
}

.archive-header p {
  color: var(--text-muted);
  font-style: italic;
}

.archive-header p a {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-style: normal;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  text-decoration: none;
}

.archive-header p a:hover {
  color: var(--accent);
}

/* ── 18b. HUD history logs ──────────────────────────────────── */
.history-empty {
  color: var(--text-muted);
  font-style: italic;
}

.history-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.history-list li {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: var(--sp-2) var(--sp-5);
  padding: var(--sp-4) 0;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
}

.history-list li:first-child {
  border-top: 1px solid var(--border);
}

.history-list .date {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.history-detail {
  min-width: 0;
}

.history-primary {
  display: block;
  font-family: var(--font-serif);
  font-size: var(--text-base);
  color: var(--text);
  line-height: 1.25;
}

.history-list--brewing .history-primary {
  color: var(--accent);
}

.history-primary--vocab {
  color: var(--accent-2);
  font-style: italic;
}

.history-secondary {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  letter-spacing: 0.03em;
  margin-top: 0.2em;
}

.history-def {
  display: block;
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: 0.25em;
  line-height: 1.4;
}

.history-list li.is-current .date::after {
  content: ' · now';
  color: var(--accent);
}

.history-list--vocab li.is-current .date::after {
  color: var(--accent-2);
}

.hud-log-link {
  display: block;
  pointer-events: auto;
  margin-top: 0.45em;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  opacity: 0.55;
  transition: opacity 0.15s ease-out;
}

.hud-log-link--brewing {
  color: var(--accent);
}

.hud-log-link--vocab {
  color: var(--accent-2);
}

.hud-log-link:hover,
.hud-log-link:focus-visible {
  opacity: 1;
}

@media (max-width: 480px) {
  .history-list li {
    grid-template-columns: 1fr;
    gap: var(--sp-1);
  }
}

/* ── 18. 404 page ───────────────────────────────────────────── */
.error-page {
  text-align: center;
  padding: var(--sp-16) 0;
}

.error-code {
  font-family: var(--font-mono);
  font-size: 6rem;
  font-weight: 600;
  color: var(--border);
  display: block;
  line-height: 1;
  margin-bottom: var(--sp-6);
  letter-spacing: -0.02em;
}

.error-page h1 {
  font-size: var(--text-xl);
  margin-bottom: var(--sp-4);
}

.error-page p {
  color: var(--text-muted);
  margin-bottom: var(--sp-6);
}

/* ── 19. Photos gallery ─────────────────────────────────────── */

/* Wider container for photo pages */
.container-wide {
  max-width: 920px;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--sp-4);
  /* archive-header already has sp-8 bottom — no need to double up */
  margin: var(--sp-4) 0 var(--sp-8);
}

.photo-grid figure {
  margin: 0;
  overflow: hidden;
}

.photo-grid figure a {
  display: block;
  overflow: hidden;
  background: var(--bg-surface);
  border: 1px solid var(--border);
}

.photo-grid figure a img {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: cover;
  filter: grayscale(0.15) contrast(1.05);
  /* ease-out-quart — natural deceleration */
  transition: filter 0.25s cubic-bezier(0.25, 0, 0, 1),
              transform 0.25s cubic-bezier(0.25, 0, 0, 1);
}

.photo-grid figure a:hover img {
  filter: grayscale(0) contrast(1);
  transform: scale(1.025);
}

.photo-grid figcaption {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--sp-2);
  letter-spacing: 0.04em;
}

/* ── Pure CSS lightbox (no JavaScript) ──────────────────────── */
/*
   How it works:
   - Each photo thumbnail links to a fragment: <a href="#photo-1">
   - The lightbox div has a matching id: <div id="photo-1" class="lightbox">
   - CSS :target selector shows it when the URL fragment matches
   - Clicking the close link (<a href="#">) clears the fragment, hiding it
*/

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(28, 26, 23, 0.93);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: var(--sp-6);
}

.lightbox:target {
  display: flex;
}

.lightbox-inner {
  max-width: min(90vw, 960px);
  text-align: center;
  margin: 0;
}

.lightbox-inner img {
  display: block;
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  margin: 0 auto;
}

.lightbox-inner figcaption {
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  margin-top: var(--sp-3);
  letter-spacing: 0.06em;
  opacity: 0.75;
}

.lightbox-close {
  position: fixed;
  top: var(--sp-4);
  right: var(--sp-5);
  font-family: var(--font-mono);
  font-size: var(--text-base);
  color: var(--bg);
  text-decoration: none;
  opacity: 0.6;
  line-height: 1;
  /* 44×44px minimum touch target */
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s ease-out;
}

.lightbox-close:hover {
  opacity: 1;
  color: var(--bg);
}

/* ── 20. Responsive ─────────────────────────────────────────── */
@media (max-width: 480px) {
  :root {
    font-size: 15px;
  }

  .intro h1 {
    font-size: var(--text-2xl);
  }

  .post-header h1 {
    font-size: var(--text-2xl);
  }

  .post-list li {
    grid-template-columns: 1fr;
    gap: var(--sp-1);
  }

  .post-list .date {
    font-size: var(--text-xs);
  }

  .hud-stack {
    display: none;
  }

  footer::before {
    display: none;
  }
}

@media (max-width: 900px) {
  .hud-stack {
    display: none;
  }
}

/* ── 21. Reduced motion ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* ── 22. HUD stack — right-side overlay ─────────────────────── */

.hud-stack {
  position: fixed;
  top: var(--sp-4);
  right: var(--sp-4);
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--sp-3);
  width: 164px;
  pointer-events: none;
}

@media (max-width: 600px) {
  .hud-stack {
    width: 142px;
  }
}

/* ── 23. Brewing card ───────────────────────────────────────── */
@keyframes hud-glow {
  0%, 100% { filter: drop-shadow(0 0 4px rgba(168, 58, 10, 0.45))
                     drop-shadow(0 0 12px rgba(168, 58, 10, 0.2)); }
  50%       { filter: drop-shadow(0 0 8px rgba(168, 58, 10, 0.85))
                     drop-shadow(0 0 28px rgba(168, 58, 10, 0.45)); }
}

/*
   Marathon geometry + Persona 5 colour energy.
   Warm translucent panel — no dark background, won't clash with page.
   Update the three spans in every HTML file when you switch bags.
   pointer-events: none — never blocks anything.
*/

.brewing-card {
  position: relative;
  width: 100%;
  pointer-events: none;

  /* Warm translucent tint + orange scan lines — blends with page */
  background:
    repeating-linear-gradient(
      0deg,
      transparent 0px, transparent 3px,
      rgba(168, 58, 10, 0.028) 3px, rgba(168, 58, 10, 0.028) 4px
    ),
    rgba(168, 58, 10, 0.06);

  /* Bold orange border system — thick on load-bearing edges */
  border-top:    3px solid var(--accent);
  border-left:   3px solid var(--accent);
  border-right:  1.5px solid rgba(168, 58, 10, 0.42);
  border-bottom: 1.5px solid rgba(168, 58, 10, 0.42);

  /* Double diagonal cut — top-right AND bottom-left (Persona 5) */
  clip-path: polygon(
    0 0,
    calc(100% - 13px) 0,
    100% 13px,
    100% 100%,
    13px 100%,
    0 calc(100% - 13px)
  );

  padding: 0 0.65rem 0.65rem;

  /* drop-shadow follows clip-path shape; box-shadow would be clipped */
  animation: hud-glow 3.5s ease-in-out infinite;
}

/* Top-left inner corner bracket */
.brewing-card::before {
  content: '';
  position: absolute;
  top: 6px;
  left: 6px;
  width: 9px;
  height: 9px;
  border-top:  1.5px solid rgba(168, 58, 10, 0.55);
  border-left: 1.5px solid rgba(168, 58, 10, 0.55);
}

/* Bottom-right inner corner bracket */
.brewing-card::after {
  content: '';
  position: absolute;
  bottom: 6px;
  right:  6px;
  width: 9px;
  height: 9px;
  border-bottom: 1.5px solid rgba(168, 58, 10, 0.55);
  border-right:  1.5px solid rgba(168, 58, 10, 0.55);
}

/* Orange header band — extends edge to edge */
.brewing-card-label {
  display: block;
  background: rgba(168, 58, 10, 0.11);
  margin: 0 -0.65rem 0.48em;
  padding: 0.3em 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  border-bottom: 1px solid rgba(168, 58, 10, 0.22);
}

.brewing-card-label::before {
  content: '▸';
  margin-right: 0.38em;
}

/* Trailing dashes — Persona 5 header fill */
.brewing-card-label::after {
  content: ' ──';
  opacity: 0.35;
  letter-spacing: 0;
}

/* Bean name — the primary readout, full orange */
.brewing-card-bean {
  display: block;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.88rem;
  color: var(--accent);
  line-height: 1.22;
  margin-bottom: 0.22em;
}

.brewing-card-roaster {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: rgba(168, 58, 10, 0.6);
  letter-spacing: 0.03em;
}

.brewing-card-process {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: rgba(168, 58, 10, 0.82);
  letter-spacing: 0.13em;
  text-transform: uppercase;
  margin-top: 0.34em;
}

.brewing-card-process::before {
  content: '■';
  margin-right: 0.34em;
  font-size: 0.46rem;
  color: var(--accent);
}

@media (max-width: 600px) {
  .hud-stack .brewing-card,
  .hud-stack .vocab-card {
    width: 100%;
  }
}

/* ── 24. Vocab card ─────────────────────────────────────────── */
/*
   Teal bookend to the orange brewing card.
   Stacked with brewing in .hud-stack (top-right).
   pointer-events: none — never blocks anything.
*/

@keyframes vocab-glow {
  0%, 100% { filter: drop-shadow(0 0 4px rgba(46, 110, 106, 0.45))
                     drop-shadow(0 0 12px rgba(46, 110, 106, 0.2)); }
  50%       { filter: drop-shadow(0 0 8px rgba(46, 110, 106, 0.85))
                     drop-shadow(0 0 28px rgba(46, 110, 106, 0.45)); }
}

.vocab-card {
  position: relative;
  width: 100%;
  pointer-events: none;

  /* Teal scan-line tint */
  background:
    repeating-linear-gradient(
      0deg,
      transparent 0px, transparent 3px,
      rgba(46, 110, 106, 0.028) 3px, rgba(46, 110, 106, 0.028) 4px
    ),
    rgba(46, 110, 106, 0.06);

  /* Flipped asymmetry: thick on bottom + right (mirror of brewing card) */
  border-top:    1.5px solid rgba(46, 110, 106, 0.42);
  border-left:   1.5px solid rgba(46, 110, 106, 0.42);
  border-bottom: 3px solid var(--accent-2);
  border-right:  3px solid var(--accent-2);

  /* Same double diagonal cut as brewing card */
  clip-path: polygon(
    0 0,
    calc(100% - 13px) 0,
    100% 13px,
    100% 100%,
    13px 100%,
    0 calc(100% - 13px)
  );

  padding: 0 0.65rem 0.65rem;

  /* Offset by half the brewing card cycle so they pulse alternately */
  animation: vocab-glow 3.5s ease-in-out infinite;
  animation-delay: 1.75s;
}

/* Top-left inner corner bracket */
.vocab-card::before {
  content: '';
  position: absolute;
  top: 6px;
  left: 6px;
  width: 9px;
  height: 9px;
  border-top:  1.5px solid rgba(46, 110, 106, 0.55);
  border-left: 1.5px solid rgba(46, 110, 106, 0.55);
}

/* Bottom-right inner corner bracket */
.vocab-card::after {
  content: '';
  position: absolute;
  bottom: 6px;
  right:  6px;
  width: 9px;
  height: 9px;
  border-bottom: 1.5px solid rgba(46, 110, 106, 0.55);
  border-right:  1.5px solid rgba(46, 110, 106, 0.55);
}

/* Teal header band */
.vocab-card-label {
  display: block;
  background: rgba(46, 110, 106, 0.11);
  margin: 0 -0.65rem 0.48em;
  padding: 0.3em 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-2);
  border-bottom: 1px solid rgba(46, 110, 106, 0.22);
}

.vocab-card-label::before {
  content: '▸';
  margin-right: 0.38em;
}

.vocab-card-label::after {
  content: ' ──';
  opacity: 0.35;
  letter-spacing: 0;
}

/* The word itself — large, serif italic, full teal */
.vocab-card-word {
  display: block;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--accent-2);
  line-height: 1.15;
  margin-bottom: 0.15em;
}

/* Romanization / pronunciation */
.vocab-card-roman {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: rgba(46, 110, 106, 0.65);
  letter-spacing: 0.06em;
  margin-bottom: 0.3em;
}

/* English definition */
.vocab-card-def {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.68rem;
  color: rgba(46, 110, 106, 0.82);
  line-height: 1.35;
}

/* ── 25. Print ──────────────────────────────────────────────── */
@media print {
  nav,
  .back-link,
  .post-nav,
  footer,
  .hud-stack { display: none; }

  body {
    background: white;
    color: black;
    max-width: 100%;
    font-size: 12pt;
  }

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: var(--text-muted);
  }

  pre {
    white-space: pre-wrap;
    border: 1px solid var(--border);
  }
}
