/* Shared styles for zakbaumann.com. Projects can use these or ignore them entirely. */

/* ---------- Colors ----------
   Two tones taken from a washed black jacket with a cream felt "13" patch:
   light = cream page with washed-black ink, dark = washed-black page with cream ink.
   The accent is the faded brown at the edge of the felt patch.

   Light is the default. Dark applies when the system is dark (unless the
   visitor picked light with the toggle) or when the toggle picked dark. */

:root {
  --bg: #ebe2cf;
  --surface: #e3d8c2;
  --card: #f3ecdd;
  --text: #262624;
  --muted: #6b6559;
  --border: #cdc1a8;
  --accent: #8a6a4b;
  --accent-soft: #ddcfb4;
  --wip: #9a6f22;
  --done: #4d7550;
  --broken: #9e4436;
  /* Faint grain so flat areas look worn rather than printed (a tiny tiled image). */
  --grain: url("/assets/grain-light.webp?v=6544eaa57c");
  --grain-opacity: 0.2;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #252524;
    --surface: #2c2c2a;
    --card: #323230;
    --text: #e8dcc3;
    --muted: #a59c8a;
    --border: #41403c;
    --accent: #c4a27c;
    --accent-soft: #3f3933;
    --wip: #d4a656;
    --done: #93bb8f;
    --broken: #dd8b7c;
    --grain: url("/assets/grain-dark.webp?v=774a76df0f");
    --grain-opacity: 0.11;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #252524;
  --surface: #2c2c2a;
  --card: #323230;
  --text: #e8dcc3;
  --muted: #a59c8a;
  --border: #41403c;
  --accent: #c4a27c;
  --accent-soft: #3f3933;
  --wip: #d4a656;
  --done: #93bb8f;
  --broken: #dd8b7c;
  --grain: url("/assets/grain-dark.webp?v=774a76df0f");
  --grain-opacity: 0.11;
  color-scheme: dark;
}

:root {
  /* The top bar and footer stay washed black with cream text in both themes. */
  --bar-bg: #1d1d1c;
  --bar-text: #e8dcc3;
  --bar-height: 56px;
  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --radius: 4px;
  --max: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: var(--bar-height); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  /* Page column: top bar, content, footer. Content grows so the footer always sits at
     the bottom of the screen, even on short pages. */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
}

body > main,
body > .wrap {
  flex: 1 0 auto;
  width: 100%;
}

.site-footer { flex-shrink: 0; }

/* Washed, slightly grainy finish over the whole page. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  background-image: var(--grain);
  opacity: var(--grain-opacity);
}

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

h1, h2, h3 { letter-spacing: -0.02em; line-height: 1.1; }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 16px 64px;
}

/* ---------- Top bar ---------- */

#site-header { min-height: var(--bar-height); background: var(--bar-bg); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bar-bg);
  color: var(--bar-text);
}

/* Top bar and footer run edge to edge: content sits at the sides of the window
   (with a gutter that grows a little on wide screens), not in a fixed-width column. */
:root { --edge: clamp(16px, 3vw, 40px); }

.site-header-inner {
  height: var(--bar-height);
  padding: 0 var(--edge);
  display: flex;
  align-items: center;
}

.site-name {
  color: inherit;
  text-decoration: none;
  font-size: 1.05rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-name strong {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.site-name span { font-weight: 300; }

/* ---------- Menu (button in the top bar, panel slides in from the right) ---------- */

.site-header-inner { justify-content: space-between; gap: 16px; }

.menu-button {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  padding: 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--bar-text);
}

.menu-button span {
  display: block;
  height: 1.5px;
  background: currentColor;
  transition: width 0.2s ease;
}

.menu-button span:nth-child(1) { width: 22px; }
.menu-button span:nth-child(2) { width: 14px; }
.menu-button span:nth-child(3) { width: 18px; }

.menu-button:hover:not(:disabled) { background: transparent; color: var(--bar-text); }
.menu-button:hover span { width: 22px; }

.menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
}

.site-menu {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  width: min(300px, 85vw);
  padding: 8px 16px 32px;
  background: var(--bar-bg);
  color: var(--bar-text);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  overflow-y: auto;
}

.menu-open .site-menu { transform: translateX(0); }

.menu-close {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 2px auto 16px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--bar-text);
}

.menu-close:hover:not(:disabled) { background: transparent; color: var(--bar-text); opacity: 0.7; }
.menu-close svg { width: 26px; height: 26px; }

.site-menu ul { list-style: none; padding: 0; margin: 0; text-align: center; }

.site-menu a {
  display: block;
  padding: 10px 0;
  color: var(--bar-text);
  text-decoration: none;
  font-weight: 300;
  font-size: 1.05rem;
  opacity: 0.85;
}

.site-menu a:hover, .site-menu a:focus-visible { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }

@media (prefers-reduced-motion: reduce) {
  .site-menu, .menu-button span { transition: none; }
}

/* ---------- Buttons ---------- */

button {
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--text);
  background: transparent;
  color: var(--text);
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 0.9rem;
}

button:hover:not(:disabled) { background: var(--text); color: var(--bg); }
button[aria-pressed="true"] { background: var(--text); color: var(--bg); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 32px;
  padding: 10px 20px;
  border: 1px solid var(--text);
  color: var(--text);
  text-decoration: none;
  font-weight: 300;
  transition: background 0.15s ease, color 0.15s ease;
}

.pill:hover, .pill:focus-visible { background: var(--text); color: var(--bg); outline: none; }
.pill-plus { font-size: 1.2rem; line-height: 1; }

/* ---------- One-page home: hero and bands ---------- */

.hero,
.band {
  position: relative;
  min-height: calc(100svh - var(--bar-height));
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 72px 0 104px;
}

.band { border-top: 1px solid var(--border); }
.band-alt { background: var(--surface); }

.band-inner {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 16px;
}

.hero h1 {
  font-size: clamp(6rem, 30vw, 15rem);
  font-weight: 700;
  letter-spacing: -0.07em;
  line-height: 0.85;
  margin: 0 0 24px;
}

.hero p {
  font-size: clamp(1.15rem, 3vw, 1.6rem);
  font-weight: 300;
  max-width: 640px;
  margin: 0;
}

.dot { color: var(--accent); }

.hero-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero-center p { margin-top: 8px; }

/* Felt varsity-style lettering: ink-colored block letters with a faded brown
   edge, tilted slightly like they were sewn on by hand. */
.patch {
  font-family: "Graduate", Rockwell, "Courier New", serif;
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: -0.02em;
  color: var(--text);
  /* Graduate only comes in one weight; a same-color stroke fattens it up like felt. */
  -webkit-text-stroke: 0.045em var(--text);
  paint-order: stroke fill;
  /* Faded brown edge around the felt. */
  filter:
    drop-shadow(1.5px 0 0 var(--accent))
    drop-shadow(-1.5px 0 0 var(--accent))
    drop-shadow(0 1.5px 0 var(--accent))
    drop-shadow(0 -1.5px 0 var(--accent));
  opacity: 0.92;
  transform: rotate(-3deg);
}

/* ---------- Intro: line-art portrait that pops open into a brain you can click ----------
   States, set by assets/intro.js as classes on .intro:
     is-loaded   the drawing has downloaded; it fades in
     is-open     hat pops off, camera zooms onto the brain (CSS transitions, run on the GPU)
     is-ready    the zoom has finished; the brain regions are clickable
     is-peeking  a region's panel is open; the brain slides aside
   intro.js also measures the screen and sets the portrait's exact size and position,
   plus the camera: --cam-s / --cam-y (zoom onto the brain) and --peek-dx / --peek-dy /
   --peek-s (where the brain goes while a panel is open). */

/* Until the intro opens, the page doesn't scroll; the first scroll opens it instead. */
html.intro-locked { overflow: hidden; overscroll-behavior: none; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.intro {
  --cam-s: 2.4;
  --cam-y: 0px;
  --peek-dx: 0px;
  --peek-dy: 0px;
  --peek-s: 1;
  --open-ease: cubic-bezier(0.65, 0, 0.25, 1);
  position: relative;
}

.intro-stage {
  position: relative;
  height: calc(100vh - var(--bar-height));
  height: calc(100svh - var(--bar-height));
  overflow: hidden;
}

/* Wrapper that slides the brain aside while a panel is open. */
.intro-peek {
  position: absolute;
  inset: 0;
  transform-origin: 50% 49%;
  transition: transform 0.55s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.intro.is-peeking .intro-peek {
  transform: translate(var(--peek-dx), var(--peek-dy)) scale(var(--peek-s));
}

/* Hidden until the drawing has loaded (only when JS is running), then fades in. */
html.js .intro:not(.is-loaded) .intro-peek { opacity: 0; }
.intro.is-loaded .intro-peek { animation: intro-in 0.9s ease-out both; }

@keyframes intro-in {
  from { opacity: 0; translate: 0 14px; }
}

/* The portrait. Size and position are plain math (centered, 88% of the stage height or
   94% of the width, whichever is smaller); intro.js pins exact pixels on top of this. */
.intro-art {
  --art-h: min(calc((100svh - var(--bar-height)) * 0.88), calc(94vw * 1024 / 765));
  --art-w: calc(var(--art-h) * 765 / 1024);
  position: absolute;
  left: calc(50% - var(--art-w) / 2);
  top: calc(50% - var(--art-h) / 2);
  width: var(--art-w);
  height: var(--art-h);
  transform-origin: 50% 27%; /* center of the brain and its title */
  transition: transform 0.6s var(--open-ease);
}

.intro.is-open .intro-art {
  transform: translateY(var(--cam-y)) scale(var(--cam-s));
  transition: transform 1.25s var(--open-ease);
}

.intro:not(.is-open) .intro-art { cursor: pointer; }

/* Drawing layers: the image's lines become a mask over the current ink color. */
.intro-layer {
  position: absolute;
  inset: 0;
}

.intro-head,
.intro-hat::before {
  background-color: currentColor;
  -webkit-mask: var(--art) center / contain no-repeat;
  mask: var(--art) center / contain no-repeat;
}

.intro-head {
  --art: url("/assets/hero/head.webp?v=1b36e0b9ba");
  transition: transform 0.6s var(--open-ease), opacity 0.4s ease;
}

.intro.is-open .intro-head {
  transform: translateY(14%);
  opacity: 0.06;
  transition: transform 0.9s var(--open-ease), opacity 0.6s ease 0.4s;
}

.intro-hat {
  --art: url("/assets/hero/hat.webp?v=1df8fa4fcb");
  transform-origin: 50% 36%;
  transition: transform 0.6s var(--open-ease) 0.15s, opacity 0.35s ease 0.15s;
}

/* The hat pops: a quick lift with a little overshoot, then fades as the camera arrives. */
.intro.is-open .intro-hat {
  transform: translateY(-38%) rotate(-8deg);
  opacity: 0;
  transition: transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.45s ease 0.55s;
}

.intro-hat::before {
  content: "";
  position: absolute;
  inset: 0;
}

/* Outlined "Z" on the front of the hat, drawn like the letter in the original sketch. */
.intro-patch {
  position: absolute;
  left: 48.8%;
  top: 19%;
  font-family: "Graduate", Rockwell, "Courier New", serif;
  font-size: calc(var(--art-w) * 0.27);
  line-height: 1;
  color: var(--text);
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: calc(var(--art-w) * 0.0042) currentColor;
  transform: translate(-50%, -50%) rotate(-2deg);
  user-select: none;
}

/* ----- The brain ----- */

.intro-brain {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

.intro.is-open .intro-brain {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.5s ease 0.3s, visibility 0s;
}

.brain-lines { stroke-width: 2px; }

/* Desktop: lines draw themselves in (each path has pathLength="1"). */
.brain-lines path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 0.3s ease;
}

.intro.is-open .brain-lines path {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s ease-out 0.35s;
}

/* Phones: no draw-in (redrawing the lines every frame is what makes phones stutter);
   the brain just fades in, and lines are a touch heavier since it's zoomed in less. */
@media (max-width: 760px) {
  .brain-lines { stroke-width: 2.6px; }
  .brain-lines path,
  .intro.is-open .brain-lines path {
    stroke-dasharray: none;
    stroke-dashoffset: 0;
    transition: none;
  }
}

/* Clickable regions: invisible until hovered, focused or open. */
.region-shape {
  fill: var(--accent);
  fill-opacity: 0;
  stroke: none;
  pointer-events: none;
  transition: fill-opacity 0.2s ease;
}

.intro.is-ready .region-shape { pointer-events: all; cursor: pointer; }
.intro.is-ready .region-shape:hover { fill-opacity: 0.16; }
.region-shape:focus { outline: none; }
.region-shape:focus-visible { fill-opacity: 0.2; stroke: var(--accent); stroke-width: 2; }
.region-shape.is-open { fill-opacity: 0.24; }

.brain-labels text {
  font-family: var(--font);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-anchor: middle;
  fill: currentColor;
  /* A halo in the page color keeps labels readable over the folds. */
  stroke: var(--bg);
  stroke-width: 7px;
  stroke-linejoin: round;
  paint-order: stroke fill;
  pointer-events: none;
}

.brain-labels text.is-open { fill: var(--accent); }

/* "Poke around in my brain", curved over the top of the brain (an SVG textPath). */
.brain-title {
  font-family: var(--font);
  font-size: 33px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-anchor: middle;
  fill: currentColor;
  pointer-events: none;
}

.brain-labels,
.brain-title {
  opacity: 0;
  transition: opacity 0.2s ease;
}

.intro.is-open .brain-labels,
.intro.is-open .brain-title {
  opacity: 1;
  transition: opacity 0.45s ease 1.05s;
}

/* First-load hint at the bottom; tapping it opens the brain too. */
.intro-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 18px;
  margin: 0 auto;
  width: max-content;
  max-width: calc(100% - 32px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 300;
  transition: opacity 0.4s ease 0.8s, visibility 0s;
}

.intro-hint:hover:not(:disabled) { background: transparent; color: var(--text); }
.intro-hint svg { width: 32px; height: 32px; animation: hint-bob 1.8s ease-in-out infinite; }

.intro.is-open .intro-hint {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0s linear 0.25s;
}

@keyframes hint-bob {
  50% { transform: translateY(5px); }
}

/* Once open, a plain arrow at the bottom leads on to About. */
.intro-next {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0s linear 0.2s;
}

.intro.is-open:not(.is-peeking) .intro-next {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.4s ease 1.1s, visibility 0s;
}

/* ----- Peek panel ----- */

.brain-panel {
  position: absolute;
  z-index: 2;
  top: 50%;
  right: max(16px, calc((100% - var(--max)) / 2 + 16px));
  width: min(360px, calc(100% - 32px));
  max-height: calc(100% - 48px);
  overflow-y: auto;
  padding: 24px 24px 28px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translate(24px, -50%);
  transition: opacity 0.3s ease, transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.intro.is-peeking .brain-panel { opacity: 1; transform: translate(0, -50%); }
.brain-panel[hidden] { display: none; }

.brain-panel-close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.brain-panel-close:hover:not(:disabled) { background: transparent; color: var(--text); }
.brain-panel-close svg { width: 20px; height: 20px; }

.brain-panel .band-label { margin: 0 40px 10px 0; font-size: 1.25rem; }
.brain-panel .band-label::before { width: 24px; }

.brain-panel-blurb {
  margin: 0 0 16px;
  color: var(--muted);
  font-weight: 300;
}

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

.brain-panel-list a {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 2px 10px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
}

.brain-panel-list a:hover strong { color: var(--accent); }
.brain-panel-list .emoji { grid-row: span 2; font-size: 1.4rem; line-height: 1.2; }
.brain-panel-list strong { font-weight: 600; }
.brain-panel-list small { color: var(--muted); font-weight: 300; font-size: 0.9rem; }

.brain-panel-empty {
  padding: 14px 0;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-weight: 300;
}

.brain-panel .pill { margin-top: 18px; }

/* Phones: the panel is a sheet along the bottom; the brain moves up above it and the
   title steps aside to make room. */
@media (max-width: 760px) {
  .brain-panel {
    top: auto;
    right: 8px;
    left: 8px;
    bottom: 8px;
    width: auto;
    max-height: 56%;
    transform: translateY(32px);
  }

  .intro.is-peeking .brain-panel { transform: none; }
  .intro.is-peeking .brain-title { opacity: 0; transition: opacity 0.2s ease; }
}

/* Reduced motion: no animation; the page opens straight onto the clickable brain. */
@media (prefers-reduced-motion: reduce) {
  .intro *,
  .intro *::before {
    transition-duration: 0s !important;
    transition-delay: 0s !important;
    animation: none !important;
  }
}

.hero h1.patch {
  font-size: clamp(5.5rem, 24vw, 14rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  margin: 0 0 32px;
}

/* Thin rule with the section name sitting on it, like ——— Projects ——————— */
.band-label {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 12px;
  font-size: 1.4rem;
  font-weight: 300;
  letter-spacing: 0;
}

.band-label::before,
.band-label::after {
  content: "";
  border-top: 1px solid currentColor;
}

.band-label::before { width: 48px; flex: none; }
.band-label::after { flex: 1; max-width: 640px; }

.band-intro {
  color: var(--muted);
  font-weight: 300;
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 0 32px 62px;
}

.next-section {
  position: absolute;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--muted);
  transition: color 0.15s ease, transform 0.2s ease;
}

.next-section:hover { color: var(--text); transform: translateX(-50%) translateY(3px); }
.next-section.up:hover { transform: translateX(-50%) translateY(-3px); }
.next-section svg { width: 36px; height: 36px; }

@media (max-width: 640px) {
  .hero, .band { min-height: 0; padding: 56px 0 96px; }
  .hero { min-height: calc(100svh - var(--bar-height)); }
  .band-intro { margin-left: 0; }
}

/* ---------- About band ---------- */

.about-text {
  max-width: 620px;
  margin: 24px 0 0 62px;
}

@media (max-width: 640px) {
  .about-text { margin-left: 0; }
}

.about-text p {
  font-weight: 300;
  font-size: 1.2rem;
  line-height: 1.6;
  margin: 0 0 18px;
}

.about-text a {
  color: inherit;
  font-weight: 500;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  white-space: nowrap;
}

.about-text a:hover { color: var(--accent); }

/* Logos drawn in the current text color (via mask), so they follow light/dark mode.
   Set --logo to the SVG's URL and aspect-ratio to its width / height. */
.logo-mask {
  display: inline-block;
  background-color: currentColor;
  -webkit-mask: var(--logo) center / contain no-repeat;
  mask: var(--logo) center / contain no-repeat;
}

.utah-logo {
  --logo: url("/assets/logos/utah.svg?v=9298f35654");
  height: 1.15em;
  aspect-ratio: 250 / 232;
  vertical-align: -0.2em;
  margin-left: 0.15em;
}

.logo-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 40px;
  list-style: none;
  padding: 24px 0 0;
  margin: 28px 0 0;
  border-top: 1px solid var(--border);
}

.logo-row a {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 1.05rem;
  white-space: normal;
  transition: color 0.15s ease;
}

.logo-row a:hover, .logo-row a:focus-visible { color: var(--text); }
.logo-row .logo-mask { height: 44px; }

/* Blackletter "13" sitting in the line of text, a size up. */
.gothic-13 {
  font-family: "UnifrakturCook", "Old English Text MT", serif;
  font-size: 1.6em;
  font-weight: 700;
  line-height: 0;
  vertical-align: -0.08em;
  margin: 0 0.04em;
}

/* ---------- Page headings (list pages, posts) ---------- */

.page-title {
  font-size: clamp(2.6rem, 9vw, 4.5rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  margin: 16px 0 8px;
}

.page-intro {
  color: var(--muted);
  font-size: 1.15rem;
  font-weight: 300;
  max-width: 560px;
  margin: 0;
}

.back-link {
  display: inline-block;
  margin: 28px 0 8px;
  font-weight: 300;
  color: var(--muted);
  text-decoration: none;
}

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

/* ---------- Toolbars and filters ---------- */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 40px 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}

.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters:empty { display: none; }
.filters button { text-transform: capitalize; }

/* ---------- Cards ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  list-style: none;
  padding: 0;
  margin: 0;
}

/* One horizontal row that scrolls sideways (used on the home page). */
.card-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(260px, 300px);
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  list-style: none;
  padding: 4px 0 16px;
  margin: 0;
}

.card-row > li { scroll-snap-align: start; }
.card-row.is-empty { grid-auto-columns: 100%; }

.card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.card:hover,
.card:focus-visible {
  border-color: var(--accent);
  transform: translateY(-2px);
  outline: none;
}

.card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-emoji { font-size: 1.8rem; line-height: 1; }
.card h2, .card h3 { font-size: 1.25rem; margin: 6px 0 0; }
.card p { margin: 0; color: var(--muted); font-size: 0.95rem; font-weight: 300; flex: 1; }

.card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--muted);
}

.tag {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--text);
}

.category {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.72rem;
  color: var(--accent);
}

.status {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1.5px solid currentColor;
}

.status-wip { color: var(--wip); }
.status-done { color: var(--done); }
.status-broken { color: var(--broken); }

.empty {
  grid-column: 1 / -1;
  padding: 48px 20px;
  text-align: center;
  color: var(--muted);
  font-weight: 300;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.empty span { display: block; font-size: 2.2rem; margin-bottom: 8px; }

/* ---------- Articles and recipes ---------- */

.prose {
  max-width: 680px;
  font-size: 1.1rem;
  line-height: 1.65;
}

.prose h2 { font-size: 1.6rem; margin: 40px 0 12px; }
.prose img { max-width: 100%; height: auto; border-radius: var(--radius); }

.recipe-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  margin: 24px 0 8px;
  padding: 14px 0;
  border-top: 2px solid var(--text);
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

.recipe-meta strong {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.ingredients { padding-left: 1.2em; }
.ingredients li { margin: 6px 0; }

.steps { list-style: none; counter-reset: step; padding: 0; }

.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 8px;
  margin: 18px 0;
}

.steps li::before {
  content: counter(step);
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--accent);
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--bar-bg);
  color: var(--bar-text);
}

.site-footer-inner {
  padding: 28px var(--edge);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.socials { display: flex; gap: 20px; list-style: none; padding: 0; margin: 0; }

.socials a {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--bar-text);
  opacity: 0.8;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.socials a:hover, .socials a:focus-visible { opacity: 1; transform: translateY(-2px); }
.socials svg { width: 24px; height: 24px; fill: currentColor; }

.footer-right { display: flex; align-items: center; gap: 16px; font-size: 0.85rem; font-weight: 300; }

.site-footer button { border-color: var(--bar-text); color: var(--bar-text); }
.site-footer button:hover { background: var(--bar-text); color: var(--bar-bg); }
