@font-face { font-family: "Cormorant SC"; src: url("/a/fonts/cormorant-sc-500.1fa9e1700d.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Cormorant SC"; src: url("/a/fonts/cormorant-sc-600.9777be10ff.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("/a/fonts/eb-garamond.68fd4b247d.woff2") format("woff2"); font-weight: 400 600; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("/a/fonts/eb-garamond-italic.078bb1c082.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Pinyon Script"; src: url("/a/fonts/pinyon-script.4bf65668f8.woff2") format("woff2"); font-weight: 400; font-display: swap; }

/* Day is buttercream, black ribbon and blush, from Angel's cakes. Night is red velvet. */
:root {
  color-scheme: light dark;
  --page: light-dark(oklch(0.972 0.018 80), oklch(0.19 0.035 15));
  --surface: light-dark(oklch(0.99 0.01 80), oklch(0.275 0.035 28));
  --surface-muted: light-dark(oklch(0.94 0.028 25), oklch(0.33 0.045 20));
  --text: light-dark(oklch(0.22 0.012 20), oklch(0.94 0.022 75));
  --muted: light-dark(oklch(0.44 0.02 25), oklch(0.78 0.03 50));
  --border: light-dark(oklch(0.86 0.03 45), oklch(0.36 0.05 15));
  --border-strong: light-dark(oklch(0.55 0.025 25), oklch(0.52 0.045 30));
  /* Night cards catch a little lamplight across the top, so they read as paper, not holes */
  /* Piped bead dividers: her teal on the warm day glow, blush against the teal night glow */
  --piping: light-dark(oklch(0.6 0.085 205), oklch(0.62 0.11 10));
  --sheen: light-dark(transparent, oklch(0.95 0.03 70 / .06));
  /* Primary: ink and rose. Secondary: Angel’s teal blue for labels and the highlighter. Tertiary: blush piping, decoration only. */
  --accent: light-dark(oklch(0.47 0.14 8), oklch(0.83 0.08 10));
  --on-accent: light-dark(oklch(0.975 0.015 80), oklch(0.19 0.035 15));
  --slate: light-dark(oklch(0.44 0.075 215), oklch(0.82 0.075 200));
  /* Angel’s favourite colours, blue and teal, as the highlighter */
  --marker: light-dark(oklch(0.86 0.09 195 / .7), oklch(0.5 0.1 210 / .75));
  --blush: light-dark(oklch(0.86 0.065 10), oklch(0.5 0.12 10));
  --focus: light-dark(oklch(0.5 0.17 8), oklch(0.85 0.1 10));
  --shadow: 0 1px 2px oklch(0.3 0.05 20 / .08), 0 14px 34px -14px oklch(0.3 0.05 20 / .3);
  --grain-blend: multiply;
  --grain-opacity: .75;
  --vignette: oklch(0.55 0.06 40 / .16);
  --bloom: oklch(0.9 0.09 70 / .55);
  --ease: cubic-bezier(.2, .7, .2, 1);
  /* Lab data colours: one sequential ramp, separate from the interface */
  --viz-low: oklch(0.26 0.07 285);
  --viz-high: oklch(0.93 0.14 100);
  --radius: 6px;
  --display: "Cormorant SC", "Cormorant Garamond", Georgia, serif;
  --serif: "EB Garamond", Georgia, serif;
  --script: "Pinyon Script", cursive;
  color: var(--text);
  background: var(--page);
  font: 1.1875rem/1.6 var(--serif);
}
html[data-theme="day"] { color-scheme: light; }
html[data-theme="night"] { color-scheme: dark; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="day"]) { --grain-blend: screen; --grain-opacity: .45; --vignette: oklch(0.08 0.02 15 / .55); --bloom: oklch(0.7 0.13 55 / .32); } }
html[data-theme="night"] { --grain-blend: screen; --grain-opacity: .45; --vignette: oklch(0.08 0.02 15 / .55); --bloom: oklch(0.7 0.13 55 / .32); }

* { box-sizing: border-box; }
body {
  margin: 0; min-height: 100vh; position: relative; isolation: isolate;
  background:
    radial-gradient(ellipse 70% 50% at 85% 0%, color-mix(in oklch, var(--blush) 35%, transparent), transparent 70%),
    radial-gradient(ellipse 60% 40% at 0% 100%, color-mix(in oklch, var(--blush) 22%, transparent), transparent 70%),
    var(--page);
  background-attachment: fixed;
}
/* Paper: fine grain plus coarse mottling, then a soft vignette, like a printed menu card */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; mix-blend-mode: var(--grain-blend); opacity: var(--grain-opacity);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .42 0 0 0 0 .32 0 0 0 0 .27 0 0 0 .34 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1000' height='1000'%3E%3Cfilter id='m'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.008' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .55 0 0 0 0 .42 0 0 0 0 .32 0 0 0 .22 -.07'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23m)'/%3E%3C/svg%3E");
}
/* With WebGL the flow shader is the surface; the CSS paper above is the fallback. */
.flow { position: fixed; inset: 0; z-index: -2; width: 100%; height: 100%; pointer-events: none; }
html.has-flow body::before { display: none; }
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse 120% 90% at 50% 40%, transparent 55%, var(--vignette) 100%);
}
a { color: inherit; text-decoration-color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { color: var(--accent); }
button, select { font: inherit; color: inherit; }
button, select, summary { cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.skip-link { position: absolute; z-index: 5; inset: .75rem auto auto .75rem; padding: .5rem .75rem; color: var(--on-accent); background: var(--accent); translate: 0 -200%; }
.skip-link:focus { translate: 0; color: var(--on-accent); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.shell { width: min(1100px, calc(100% - 3rem)); margin-inline: auto; }

/* Masthead and theme drawer */
.masthead, nav, .footer { display: flex; align-items: center; gap: clamp(1rem, 3vw, 2rem); }
.masthead { justify-content: space-between; padding-block: 1.25rem; }
.masthead a { text-decoration: none; }
nav { font: 600 1.05rem/1 var(--display); letter-spacing: .08em; }
nav a { padding-block: .4rem; border-bottom: 1px solid transparent; }
nav a:hover, nav a[aria-current="page"] { color: var(--accent); border-color: currentColor; }
.home-mark { display: grid; place-items: center; min-width: 44px; min-height: 44px; color: var(--text); }
.home-mark:hover { color: var(--accent); }
.masthead-tools { display: flex; align-items: center; gap: clamp(.5rem, 2vw, 1.5rem); }
.controls { display: flex; align-items: center; gap: .1rem; }
.theme-toggle, .sound { user-select: none; -webkit-user-select: none; position: relative; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--text); }
.theme-toggle:hover, .sound:hover { color: var(--accent); background: var(--surface-muted); }
.theme-label {
  position: absolute; top: calc(100% + .2rem); left: 50%; translate: -50% -4px; white-space: nowrap; pointer-events: none;
  padding: .15rem .55rem; border-radius: 999px; background: var(--text); color: var(--page); font: 600 .85rem/1.4 var(--display); letter-spacing: .1em;
  opacity: 0; transition: opacity .2s ease, translate .25s var(--ease);
}
.theme-toggle.show-label .theme-label, .theme-toggle:hover .theme-label, .theme-toggle:focus-visible .theme-label { opacity: 1; translate: -50% 0; }
.sound svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.sound .mute { display: none; }
.sound[aria-pressed="false"] .mute { display: inline; }
.sound[aria-pressed="false"] .wave { display: none; }
.sound[aria-pressed] { background: none; color: var(--text); }
.sound[aria-pressed]:hover { color: var(--accent); background: var(--surface-muted); }

/* Type: Sosa's engraved capitals, a book serif and one script flourish */
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1; margin: 0; }
h1 { font-size: clamp(3.4rem, 9vw, 7rem); letter-spacing: .01em; }
h2 { font-size: clamp(2.1rem, 4.4vw, 3.2rem); letter-spacing: .04em; color: var(--slate); }
h3 { font-size: 1.5rem; letter-spacing: .12em; color: var(--slate); }
p { margin: 0 0 1rem; }
figure { margin: 0; }
img { max-width: 100%; }
.script { font-family: var(--script); font-weight: 400; letter-spacing: 0; color: var(--accent); }
.eyebrow { font: 600 1.05rem/1.3 var(--display); letter-spacing: .18em; color: var(--slate); }
.lead { font-size: clamp(1.3rem, 2.2vw, 1.5rem); line-height: 1.45; font-style: italic; }
.small { font-size: 1rem; color: var(--muted); }
.measure { max-width: 38rem; }

.button { display: inline-flex; align-items: center; min-height: 44px; padding: .45rem 1.3rem; border: 1px solid var(--text); border-radius: 999px; background: var(--text); color: var(--page); text-decoration: none; font: 600 1.05rem/1 var(--display); letter-spacing: .1em; }
.button:hover { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
.button-quiet { background: transparent; color: var(--text); }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }

/* Hero */
.hero { display: grid; grid-template-columns: 1.25fr .75fr; align-items: center; gap: clamp(2rem, 6vw, 5rem); padding-block: clamp(2rem, 6vw, 4.5rem) clamp(3rem, 7vw, 5rem); }
.hello { font-size: clamp(2.4rem, 5vw, 3.6rem); line-height: 1; margin: 0 0 -.15em .1em; rotate: -4deg; transform-origin: left; }
.hero .eyebrow { margin: 1.25rem 0 1.5rem; }
.intro-copy { font-size: clamp(1.2rem, 1.9vw, 1.35rem); max-width: 34rem; }
.arch { overflow: hidden; border-radius: 999px 999px var(--radius) var(--radius); border: 1px solid var(--border-strong); padding: .5rem; background: var(--surface); box-shadow: var(--shadow); }
.arch img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 999px 999px 3px 3px; }
.hero-photo { position: relative; isolation: isolate; }
/* Bloom: warm light behind the cake, like a candle just out of frame */
.hero-photo::before {
  content: ""; position: absolute; inset: -12% -18% 0; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, var(--bloom), transparent); filter: blur(30px);
}
/* Halation: a faint warm glow that bleeds off the bright frame edge */
.arch { box-shadow: var(--shadow), 0 0 42px -6px var(--bloom); }
.hero-photo figcaption, .project-photo figcaption { display: flex; align-items: center; justify-content: center; gap: .5rem; padding-top: .9rem; font-style: italic; color: var(--muted); font-size: 1rem; }
.bow { width: 2.4rem; height: auto; fill: none; stroke: var(--text); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* Piped bead border between courses */
.piping {
  height: 18px; width: min(1100px, calc(100% - 3rem)); margin: 0 auto;
  background: radial-gradient(circle at 50% 50%, var(--piping) 5.5px, transparent 6.5px) center / 18px 18px repeat-x;
}

.section { padding-block: clamp(3rem, 7vw, 5.5rem); }
.split { display: grid; grid-template-columns: 1fr 1.4fr; gap: clamp(1.5rem, 6vw, 5rem); }
.note { font-size: clamp(1.9rem, 3.2vw, 2.4rem); margin: .6rem 0 0; rotate: -3deg; }

/* About: laid out like Sosa's price list, with the title written up the side */
.bill { display: grid; grid-template-columns: auto 1fr; gap: clamp(1.5rem, 6vw, 5rem); }
.side-title {
  writing-mode: vertical-rl; rotate: 180deg; margin: 0; font-size: clamp(3.5rem, 7vw, 5.5rem); line-height: 1;
  display: flex; align-items: center; gap: 1.5rem;
}
.side-title::before { content: ""; flex: 1; border-inline-start: 1px solid var(--border-strong); min-height: 6rem; }
.bill-body { display: grid; gap: clamp(2rem, 4vw, 3rem); }
.course h3 { margin-bottom: 1rem; }
.menu { margin: 0; display: grid; gap: .8rem; }
.menu > div { display: flex; align-items: baseline; gap: .6rem; }
.menu > div::after { content: ""; order: 1; flex: 1 1 2rem; min-width: 2rem; border-bottom: 2px dotted var(--border-strong); translate: 0 -.3em; }
.menu dt { font-size: clamp(1.15rem, 1.8vw, 1.3rem); }
.menu dd { order: 2; margin: 0; white-space: nowrap; font: 600 1.15rem/1.2 var(--display); letter-spacing: .06em; }
.menu-roles { margin-block: 2rem 1.25rem; gap: 1.2rem; }
.menu-roles dt { font: 600 1.55rem/1.15 var(--display); letter-spacing: .04em; }
.menu-roles dt span:not(.cite) { display: block; font: italic 1.05rem/1.4 var(--serif); letter-spacing: 0; color: var(--muted); }
.menu-roles > div::after { align-self: center; translate: 0; }
.stories p:first-child { font-size: 1.3rem; font-style: italic; }

/* Sosa Bakes */
.bakes-head { display: grid; justify-items: center; text-align: center; }
.bakes h2 .script { font-size: clamp(4rem, 10vw, 7rem); line-height: 1.1; display: block; }
.bakes-head .lead { margin-top: .5rem; }
.sosa-logo { width: 6.5rem; height: 6.5rem; border-radius: 50%; box-shadow: var(--shadow); margin-bottom: .25rem; }
.gallery {
  list-style: none; margin: clamp(2rem, 5vw, 3rem) calc(50% - 50vw) 0; padding: .5rem max(1.5rem, calc(50vw - 550px)) 2.5rem;
  display: grid; grid-auto-flow: column; grid-auto-columns: clamp(12rem, 22vw, 16rem); gap: clamp(.75rem, 2vw, 1.5rem);
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: max(1.5rem, calc(50vw - 550px)); scrollbar-width: none;
}
.gallery::-webkit-scrollbar { display: none; }
.gallery li { scroll-snap-align: start; border-radius: 999px 999px var(--radius) var(--radius); overflow: hidden; border: 1px solid var(--border-strong); padding: .4rem; background: var(--surface); box-shadow: var(--shadow); }
.gallery li:nth-child(even) { translate: 0 1.5rem; }
.gallery img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 999px 999px 3px 3px; }
.gallery-hint { text-align: end; margin: 0; font-style: italic; }
.then-now { display: grid; grid-template-columns: repeat(2, minmax(0, 15rem)) 1fr; align-items: end; gap: clamp(1rem, 4vw, 2.5rem); margin-top: clamp(3rem, 6vw, 4.5rem); }
.then-now figcaption { display: grid; justify-items: center; padding-top: .6rem; font-style: italic; color: var(--muted); font-size: 1rem; text-align: center; }
.then-now figcaption .script { font-size: 2.2rem; line-height: 1; font-style: normal; }
.then-now-note { font-size: clamp(1.3rem, 2.2vw, 1.6rem); font-style: italic; line-height: 1.4; max-width: 20rem; align-self: center; }
.bakes-cta { text-align: center; margin-top: 2.5rem; }
.menu-bakes { max-width: 40rem; margin: clamp(3rem, 6vw, 4rem) auto 0; }

/* Lab teaser */
.lab-card { display: grid; gap: .75rem; padding: clamp(1.5rem, 4vw, 2.5rem); text-decoration: none; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: var(--shadow); }
.lab-card h2 { color: var(--text); }
.lab-card:hover { color: inherit; border-color: var(--accent); }
.lab-card:hover h2 { color: var(--accent); }
.lab-link { font: 600 1.05rem/1 var(--display); letter-spacing: .1em; color: var(--accent); }
.lab-link::after { content: " →"; }

/* Lab teaser as a recipe index card: ruled lines, a blush margin, a slight tilt */
.recipe {
  position: relative; gap: 1.1rem; padding: clamp(1.5rem, 4vw, 2.5rem) clamp(1.25rem, 4vw, 2.5rem) clamp(1.5rem, 4vw, 2.5rem) clamp(2.5rem, 6vw, 4rem);
  background:
    linear-gradient(90deg, transparent calc(clamp(1.75rem, 4.5vw, 3rem) - 1px), color-mix(in oklch, var(--accent) 45%, transparent) calc(clamp(1.75rem, 4.5vw, 3rem) - 1px) clamp(1.75rem, 4.5vw, 3rem), transparent clamp(1.75rem, 4.5vw, 3rem)),
    repeating-linear-gradient(transparent 0 1.95rem, color-mix(in oklch, var(--slate) 22%, transparent) 1.95rem 2rem),
    linear-gradient(175deg, var(--sheen), transparent 55%),
    var(--surface);
  rotate: -.6deg;
}
.recipe::before { content: ""; position: absolute; top: -.7rem; left: 50%; width: 7rem; height: 1.5rem; translate: -50% 0; rotate: 2deg; background: color-mix(in oklch, var(--blush) 70%, transparent); }
.recipe-cols { display: grid; grid-template-columns: 1fr 1.3fr; gap: clamp(1rem, 4vw, 3rem); }
.recipe-head { display: block; margin-bottom: .4rem; font: 600 1.15rem/1.2 var(--display); letter-spacing: .14em; color: var(--slate); }
.recipe-list { display: grid; gap: .1rem; counter-reset: step; }
.recipe-list > span { line-height: 2rem; }
.recipe-list:not(.recipe-steps) > span::before { content: "—"; margin-right: .5rem; color: var(--accent); }
.recipe-steps > span { counter-increment: step; }
.recipe-steps > span::before { content: counter(step) "."; display: inline-block; min-width: 1.4rem; font: 600 1.1rem var(--display); color: var(--accent); }
.recipe-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .5rem 1.5rem; font-style: italic; color: var(--muted); }
.recipe:hover { rotate: 0deg; }

/* 404: a sponge that sank in the middle */
.lost { display: grid; justify-items: start; padding-block: clamp(2rem, 6vw, 4rem) clamp(3rem, 7vw, 5rem); max-width: 44rem; }
.lost h1 { font-size: clamp(2.6rem, 7vw, 4.6rem); margin-bottom: 1.25rem; }
.lost .hello { margin-top: .5rem; }
.lost .course { width: 100%; margin-top: 1.5rem; }
.lost .menu a { text-decoration-color: var(--accent); }
.sunken-cake { width: clamp(9rem, 26vw, 13rem); height: auto; fill: none; stroke: var(--text); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 1rem; }
.sunken-cake .cake { fill: var(--surface); }
.sunken-cake .icing { stroke: var(--accent); }
.sunken-cake .candle { fill: var(--blush); }
.sunken-cake .smoke { stroke: var(--muted); }
@media (prefers-reduced-motion: no-preference) {
  .sunken-cake .smoke { animation: drift-up 3s ease-in-out infinite; }
  .sunken-cake .candle { transform-origin: 108px 70px; animation: wobble 4s ease-in-out infinite; }
}
@keyframes drift-up { 0% { opacity: 0; translate: 0 4px; } 40% { opacity: .9; } 100% { opacity: 0; translate: 3px -10px; } }
@keyframes wobble { 0%, 100% { rotate: 0deg; } 50% { rotate: 4deg; } }

/* Lab: jump to the experiment */
#lab-try { scroll-margin-top: 1.5rem; }
.try-link { margin-top: .5rem; }

/* Lab page */
.lab-intro h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); margin: .75rem 0 1.25rem; }
.lab h2 { margin-bottom: .5rem; }
.project-photo .arch img { aspect-ratio: 4 / 5; }
.results { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin: 2rem 0 0; }
.results > div { display: flex; flex-direction: column; border-top: 2px dotted var(--border-strong); padding-top: .75rem; }
.results dt { font-size: 1rem; color: var(--muted); }
.results dd { order: -1; margin: 0; font: 600 clamp(2rem, 3.6vw, 2.8rem)/1.1 var(--display); white-space: nowrap; }
.lab .measure { margin-top: .5rem; }

.lab-controls, .choices, .direction { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
.lab-controls { justify-content: space-between; gap: 1rem; margin: 2rem 0 1rem; }
.direction { gap: .75rem; }
button, select { background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); min-height: 44px; padding: .5rem 1rem; }
button[aria-pressed="false"]:hover { background: var(--surface-muted); }
button[aria-pressed="true"] { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }

/* Lab steps: one frame, five stages */
.step-tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.step-tabs button { display: inline-flex; align-items: center; gap: .5rem; border-radius: 999px; padding: .35rem .9rem .35rem .4rem; }
.step-tabs span { display: grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--surface-muted); font: 600 .95rem/1 var(--display); }
.step-tabs button[aria-pressed="true"] span { background: var(--on-accent); color: var(--accent); }
.step-stage { display: grid; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.step { grid-area: 1 / 1; display: grid; grid-template-columns: minmax(0, 26rem) 1fr; align-items: center; gap: clamp(1rem, 4vw, 3rem); padding: clamp(.75rem, 2vw, 1.25rem); transition: opacity .5s var(--ease), translate .6s var(--ease), filter .5s ease, visibility .5s; }
.step:not(.is-on) { opacity: 0; translate: 2rem 0; filter: blur(3px); visibility: hidden; }
.step img, .step canvas { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 4px; background: var(--viz-low); }
.step canvas { image-rendering: pixelated; }
.step figcaption { display: grid; gap: .5rem; max-width: 26rem; }
.step figcaption strong { font: 600 clamp(1.6rem, 3vw, 2.2rem)/1.1 var(--display); letter-spacing: .04em; color: var(--slate); }
.step figcaption span { font-size: 1.15rem; color: var(--muted); }
.step .pairs-note:empty { display: none; }
.step .pairs-note { font-size: 1.05rem; color: var(--text); margin-top: .5rem; }
/* A recipe-card margin note: a short rule and a small-caps label, no box */
.step .pairs-note::before { content: "What to look for"; display: block; width: fit-content; padding-top: .6rem; margin-bottom: .3rem; border-top: 1px solid var(--border-strong); font: 600 .95rem/1.2 var(--display); letter-spacing: .14em; color: var(--slate); }
.verdict-card { aspect-ratio: 1; display: grid; align-content: center; gap: .75rem; padding: clamp(1rem, 4vw, 2rem); border-radius: 4px; background: var(--surface-muted); }
.verdict-card .eyebrow { margin: 0; }
.verdict-name { margin: 0; font: 600 clamp(2rem, 5vw, 3.2rem)/1 var(--display); color: var(--accent); }
.bars { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; gap: .45rem; }
.bars li { display: grid; grid-template-columns: 4.5rem 1fr 2.75rem; align-items: center; gap: .6rem; font-size: 1rem; }
.bars li span:last-child { text-align: end; font-variant-numeric: tabular-nums; }
.bars meter { width: 100%; height: .7rem; }
.bars meter::-webkit-meter-bar { background: var(--page); border: 0; border-radius: 999px; height: .7rem; }
.bars meter::-webkit-meter-optimum-value { background: var(--slate); border-radius: 999px; }
.bars meter::-moz-meter-bar { background: var(--slate); border-radius: 999px; }
.steps { position: relative; }
.steps[data-dropping]::after {
  content: attr(data-drop-label); position: absolute; inset: -.5rem; z-index: 2; display: grid; place-items: center; pointer-events: none;
  border: 2px dashed var(--accent); border-radius: calc(var(--radius) + 4px); background: color-mix(in oklch, var(--page) 82%, transparent);
  font: 600 clamp(1.4rem, 3vw, 2rem)/1 var(--display); letter-spacing: .08em; color: var(--accent);
}
.step-nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: .75rem; }
.step-nav span { color: var(--muted); font-style: italic; }
.readout { margin-top: 1rem; font-family: ui-monospace, monospace; font-size: .875rem; color: var(--muted); }

/* Bespoke direction picker, built over the native select by texture.js */
.picker { position: relative; }
.picker-trigger { display: inline-flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-width: 9.5rem; text-align: start; }
.picker-trigger::after {
  content: ""; width: .45rem; height: .45rem; margin-top: -.25rem;
  border: solid var(--accent); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg);
}
.picker-trigger:hover, .picker-trigger[aria-expanded="true"] { background: var(--surface-muted); }
.picker-trigger[aria-expanded="true"]::after { margin-top: .25rem; transform: rotate(-135deg); }
.picker-list {
  position: absolute; z-index: 2; top: calc(100% + .375rem); inset-inline: 0;
  margin: 0; padding: .3rem; list-style: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.picker-list[hidden] { display: none; }
.picker-list [role="option"] {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: 44px; padding: .5rem .7rem; border-radius: 2px; cursor: pointer;
}
.picker-list [role="option"]:hover, .picker-list [role="option"]:focus-visible { background: var(--surface-muted); }
.picker-list [role="option"]:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.picker-list [aria-selected="true"] { color: var(--accent); font-weight: 600; }
.picker-list [aria-selected="true"]::after {
  content: ""; width: .3rem; height: .6rem; margin-top: -.15rem;
  border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg);
}

/* While a new sample loads, the maps still show the previous one */
.panels img, .panels canvas { transition: opacity .2s ease; }
.panels[aria-busy="true"] :is(img, canvas) { opacity: .45; }

/* Disclosures: the methods accordion and the photo credits */
.methods { margin-top: clamp(2.5rem, 5vw, 3.5rem); max-width: 44rem; }
.methods h3 { margin: 0 0 .75rem; }
.disclosure { border-top: 1px solid var(--border); }
.disclosure:last-child { border-bottom: 1px solid var(--border); }
.disclosure summary {
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  min-height: 44px; padding-block: .9rem; list-style: none;
  font: 600 clamp(1.2rem, 1.8vw, 1.35rem)/1.3 var(--display); letter-spacing: .05em;
}
.disclosure summary::-webkit-details-marker { display: none; }
.disclosure summary::after {
  content: ""; flex: none; width: .75rem; height: .75rem;
  background: linear-gradient(var(--accent), var(--accent)) center / 100% 1.5px no-repeat,
              linear-gradient(var(--accent), var(--accent)) center / 1.5px 100% no-repeat;
}
.disclosure[open] summary::after { background-size: 100% 1.5px, 1.5px 0; }
.disclosure summary:hover { color: var(--accent); }
.disclosure-body { padding-bottom: 1.1rem; max-width: 40rem; color: var(--muted); }
.disclosure-body p { margin: 0; }
.disclosure-quiet { margin-top: 1.5rem; max-width: 44rem; border-bottom: 1px solid var(--border); }
.disclosure-quiet summary { min-height: 44px; padding-block: .6rem; font: italic 1rem/1.4 var(--serif); letter-spacing: 0; color: var(--muted); }
.disclosure-quiet .disclosure-body { font-size: .9rem; }

.footer { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: .5rem 2rem; padding-block: 2rem 2.5rem; border-top: 1px solid var(--border); font-size: 1rem; color: var(--muted); }
.footer .sign-off { margin: 0; font-size: 2rem; }
.footer-links { justify-self: end; display: flex; flex-wrap: wrap; gap: .25rem 1.5rem; font: inherit; letter-spacing: 0; }
.footer-meta { grid-column: 1 / -1; margin: 0; font-size: .9rem; }

/* Intro: the AAA mark pipes itself, the name settles, the cover lifts */
.intro { display: none; }
html[data-intro] .intro {
  position: fixed; inset: 0; z-index: 10; display: grid; place-content: center; justify-items: center; gap: 1rem;
  color: var(--text); background: var(--page);
  transition: opacity .6s var(--ease), translate .7s var(--ease);
}
html[data-intro="done"] .intro { opacity: 0; translate: 0 -3%; pointer-events: none; }
.intro-mark { width: min(46vw, 260px); height: auto; overflow: visible; }
.intro-mark path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: pipe 1.25s cubic-bezier(.6, .1, .3, 1) .1s forwards; }
.intro-name { margin: 0; font: 600 clamp(1.2rem, 3vw, 1.6rem)/1 var(--display); letter-spacing: .4em; padding-left: .4em; opacity: 0; animation: settle .6s var(--ease) 1s forwards; }
.intro-skip { position: absolute; inset: auto 1.25rem 1.25rem auto; min-height: 44px; border: 0; background: transparent; font: italic 1rem var(--serif); color: var(--muted); text-decoration: underline; text-underline-offset: .2em; }
@keyframes pipe { to { stroke-dashoffset: 0; } }
@keyframes settle { from { opacity: 0; letter-spacing: .6em; } to { opacity: 1; } }


/* Theme trigger: a cupcake. Day lights the candle; Night blows it out. */
.cupcake { width: 30px; height: 30px; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: round; }
.cupcake .icing { fill: var(--surface); }
.cupcake .candle { fill: var(--blush); }
.cupcake .flame { fill: oklch(0.85 0.15 75); stroke: oklch(0.65 0.17 45); stroke-width: 1; transform-origin: 16px 9.5px; transition: scale .35s cubic-bezier(.3, 1.6, .5, 1), opacity .25s ease; }
.cupcake .smoke { stroke: var(--muted); stroke-width: 1.6; opacity: 0; }
:root[data-theme="night"] .cupcake .flame { scale: 0; opacity: 0; transition-duration: .18s; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .cupcake .flame { scale: 0; opacity: 0; } }
.cupcake.puff .smoke { animation: smoke 1.4s ease-out forwards; }
@keyframes smoke { 0% { opacity: 0; translate: 0 2px; } 20% { opacity: .9; } 100% { opacity: 0; translate: 1px -5px; } }

/* Hero: one frame, three hats */
.hats { display: flex; flex-wrap: wrap; align-items: center; gap: .1rem .5rem; }
.hats button { min-height: 36px; padding: .15rem 0; border: 0; border-bottom: 1px solid transparent; border-radius: 0; background: none; color: var(--slate); font: inherit; letter-spacing: inherit; }
.hats button[aria-pressed="true"] { color: var(--accent); background: none; border-color: currentColor; }
.hats button:hover { color: var(--accent); }
.stage { position: relative; }
.stage .scene { transition: opacity .7s var(--ease), scale .9s var(--ease), filter .7s ease; }
.stage .scene:not(.is-on) { opacity: 0; scale: 1.04; filter: blur(4px); pointer-events: none; }
.stage .scene:not(img) { position: absolute; inset: .5rem; border-radius: 999px 999px 3px 3px; overflow: hidden; display: grid; }
.scene-code { background: oklch(0.2 0.02 20); color: oklch(0.93 0.025 75); align-content: center; padding: 3.5rem 1.4rem 1.5rem; }
.scene-code pre { margin: 0; white-space: pre-wrap; font: .9rem/1.75 ui-monospace, "SF Mono", Menlo, monospace; }
.scene-code .prompt::before { content: "> "; color: oklch(0.8 0.09 10); }
.scene-code .out { color: oklch(0.82 0.09 150); }
.scene-code code::after { content: ""; display: inline-block; width: .55em; height: 1.1em; margin-left: .1em; vertical-align: -.2em; background: oklch(0.8 0.09 10); animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.scene-teach { background: var(--surface-muted); color: var(--text); }
.scene-teach svg { width: 100%; height: 100%; }
.scene-teach .fill { fill: var(--surface); }
.scene-teach .b1 .fill { fill: color-mix(in oklch, var(--blush) 55%, var(--surface)); }
.scene-teach .edge { fill: none; stroke: currentColor; stroke-width: 1.6; }
.scene-teach .b4 .fill { fill: color-mix(in oklch, var(--blush) 55%, var(--surface)); }
.scene-teach pattern path { opacity: .35; }
.scene-teach text { font-family: var(--display); text-anchor: middle; fill: currentColor; }
.scene-teach .digits text { font-size: 56px; font-weight: 600; }
.scene-teach .labels text { font: italic 15px var(--serif); fill: var(--muted); }
@media (prefers-reduced-motion: no-preference) {
  .scene-teach.is-on .block, .scene-teach.is-on .digits text, .scene-teach.is-on .labels text { animation: drop .6s cubic-bezier(.3, 1.4, .5, 1) both; }
  .scene-teach.is-on .b2 { animation-delay: .35s; } .scene-teach.is-on .b3 { animation-delay: .5s; } .scene-teach.is-on .b4 { animation-delay: .7s; }
  .scene-teach.is-on .digits text:nth-child(1) { animation-delay: 1.1s; } .scene-teach.is-on .digits text:nth-child(2) { animation-delay: 1.25s; } .scene-teach.is-on .digits text:nth-child(3) { animation-delay: 1.4s; }
  .scene-teach.is-on .labels text { animation-delay: 1.7s; }
  .cupcake .flame { animation: flicker 2.6s ease-in-out infinite; }
}
@keyframes drop { from { opacity: 0; translate: 0 -24px; } }
@keyframes flicker { 0%, 100% { rotate: 0deg; } 30% { rotate: 4deg; } 60% { rotate: -3deg; } }

/* Scroll: the piping is piped, leaders run out, the side title writes itself, bakes rise into place */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .piping { animation: pipe-across linear both; animation-timeline: view(); animation-range: entry 0% entry 100%; }
    .menu > div::after { transform-origin: left; animation: leader linear both; animation-timeline: view(); animation-range: entry 0% entry 100%; }
    .side-title { animation: write-up linear both; animation-timeline: view(); animation-range: entry 0% entry 100%; }
    .course, .stories p, .menu-roles > div, .bakes-head > *, .lab-card { animation: rise linear both; animation-timeline: view(); animation-range: entry 0% entry 70%; }
    .gallery, .then-now figure { animation: rise linear both; animation-timeline: view(); animation-range: entry 0% cover 30%; }
    .hero-photo { animation: drift linear both; animation-timeline: scroll(root); animation-range: 0 90vh; }
  }
}
@keyframes pipe-across { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0); } }
@keyframes leader { from { transform: scaleX(0); } }
@keyframes write-up { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0); } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes rise-far { from { opacity: 0; transform: translateY(60px) rotate(-2deg); } }
@keyframes drift { to { transform: translateY(-36px); } }


/* Highlighter marks, drawn in two passes, after owenabel.com */
.cite, .mark {
  --pass: linear-gradient(100deg, transparent .25em, var(--marker) .45em, var(--marker) calc(100% - .4em), transparent calc(100% - .15em));
  color: inherit; background-color: transparent;
  background-image: var(--pass), var(--pass); background-position: 0 70%, 0 70%; background-repeat: no-repeat; background-size: 0% 72%, 0% 72%;
  box-decoration-break: clone; -webkit-box-decoration-break: clone;
  transition: background-size .52s cubic-bezier(.3, .7, .2, 1) var(--draw-delay, 0ms), text-decoration-color .16s ease;
}
.mark[data-drawn], .cite[data-drawn] { background-size: 0% 72%, 100% 72%; }
.cite { text-decoration: underline dotted; text-decoration-color: var(--slate); text-decoration-thickness: 1.5px; text-underline-offset: .22em; cursor: help; }
a.cite { cursor: pointer; }
.cite:hover, .cite:focus-visible { background-size: 100% 72%, 100% 72%; text-decoration-color: transparent; transition-delay: 0ms; color: inherit; }
.cite-card {
  position: fixed; inset: auto; margin: 0; width: min(300px, calc(100vw - 24px)); padding: .8rem 1rem;
  border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); color: var(--text); box-shadow: var(--shadow);
  font: 1rem/1.5 var(--serif); opacity: 0; translate: 0 4px; transition: opacity .16s ease, translate .2s var(--ease), display .2s allow-discrete, overlay .2s allow-discrete;
}
.cite-card:popover-open { opacity: 1; translate: 0; }
@starting-style { .cite-card:popover-open { opacity: 0; translate: 0 4px; } }
@media (prefers-reduced-motion: reduce) { .cite, .mark, .cite-card { transition: none; } }

/* Lab: your own photo and the verdict */
.upload { position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: .5rem 1rem; border: 1px dashed var(--border-strong); border-radius: var(--radius); cursor: pointer; }
.upload:hover, .upload:focus-within { border-color: var(--accent); color: var(--accent); }
.upload:focus-within { outline: 3px solid var(--focus); outline-offset: 3px; }
.upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.verdict { margin: .25rem 0 .5rem; font-size: 1.15rem; }
.verdict strong { font-weight: 600; background: linear-gradient(100deg, transparent .2em, var(--marker) .4em, var(--marker) calc(100% - .3em), transparent) 0 70% / 100% 72% no-repeat; }

@media (max-width: 760px) {
  .shell, .piping { width: calc(100% - 2rem); }
  :root { font-size: 1.0625rem; }
  .masthead { flex-wrap: wrap; row-gap: .25rem; }
  .masthead, .masthead nav { gap: .9rem; }
  .hero, .split { grid-template-columns: 1fr; }
  .hero-photo { max-width: 22rem; margin-inline: auto; }
  .bill { grid-template-columns: 1fr; }
  .side-title { writing-mode: horizontal-tb; rotate: -3deg; font-size: 3.2rem; }
  .side-title::before { display: none; }
  .menu > div { flex-direction: column; gap: 0; }
  .menu > div::after { display: none; }
  .menu dd { font-size: 1rem; color: var(--muted); }
  .menu-roles dd { display: none; }
  .gallery { grid-auto-columns: 62vw; }
  .then-now { grid-template-columns: 1fr 1fr; }
  .then-now-note { grid-column: 1 / -1; }
  .recipe-cols { grid-template-columns: 1fr; }
  .step { grid-template-columns: 1fr; align-content: start; }
  .step-tabs button { padding-right: .7rem; font-size: 1rem; }
  .footer { grid-template-columns: 1fr; }
  .footer-links { justify-self: start; }
}

@media (prefers-reduced-motion: reduce) {
  .panels img, .panels canvas { transition: none; }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  :focus-visible { transition: outline-offset .15s var(--ease); }
  a { transition: color .15s ease, text-underline-offset .2s var(--ease), border-color .15s ease; }
  a:hover { text-underline-offset: .3em; }
  .button, button { transition: background-color .15s ease, border-color .15s ease, color .15s ease, translate .2s var(--ease); }
  .button:hover { translate: 0 -1px; }
  .gallery li { transition: rotate .4s var(--ease), translate .4s var(--ease); }
  .gallery li:hover { rotate: -1.5deg; }
  .lab-card { transition: border-color .2s ease, translate .3s var(--ease), rotate .4s var(--ease); }
  .lab-card:hover { translate: 0 -3px; }
  .picker-trigger::after, .disclosure summary::after { transition: transform .2s var(--ease), margin .2s var(--ease), background-size .2s var(--ease); }
  .picker-list { transition: opacity .14s ease, translate .14s var(--ease), display .14s allow-discrete; }
  @starting-style { .picker-list { opacity: 0; translate: 0 -4px; } }
  .disclosure { interpolate-size: allow-keywords; }
  .disclosure::details-content { height: 0; overflow: clip; transition: height .25s var(--ease), content-visibility .25s allow-discrete; }
  .disclosure[open]::details-content { height: auto; }
  #sample { view-transition-name: sample-photo; }
  #lbp { view-transition-name: lbp-map; }
  #glcm { view-transition-name: glcm-map; }
  ::view-transition-group(*) { animation-duration: .24s; animation-timing-function: var(--ease); }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }

  /* Between pages: pages are prerendered, so the content swaps in one frame while the masthead and the flow background hold still */
  @view-transition { navigation: auto; types: page; }
  .masthead { view-transition-name: masthead; }
  ::view-transition-old(masthead), ::view-transition-new(masthead), ::view-transition-group(masthead) { animation: none; }
  /* The flow background continues across pages, so it swaps without fading */
  .flow { view-transition-name: flow; }
  ::view-transition-old(flow) { display: none; }
  ::view-transition-new(flow) { animation: none; }
  /* Theme change: the new theme opens out in a circle from the cupcake */
  html:active-view-transition-type(theme)::view-transition-old(*), html:active-view-transition-type(theme)::view-transition-new(*) { animation: none; }
  html:active-view-transition-type(theme)::view-transition-new(root) { animation: theme-reveal .6s var(--ease) both; }
  html:active-view-transition-type(theme) .flow { view-transition-name: none; }
  /* The cupcake and its label switch on the spot rather than being caught half in the circle */
  html:active-view-transition-type(theme) .theme-toggle { view-transition-name: theme-toggle; }
  html:active-view-transition-type(theme)::view-transition-old(theme-toggle) { display: none; }
}
@keyframes theme-reveal { from { clip-path: circle(0 at var(--reveal-x, 100%) var(--reveal-y, 0)); } to { clip-path: circle(150vmax at var(--reveal-x, 100%) var(--reveal-y, 0)); } }
