/* Version 7: sunny palette on warm cream. Contrast (WCAG AA): ink on cream 17.3 | muted on cream 8.7 | red on cream 5.3 | white on red 5.7 | yellow on ink 12.8 */
:root {
  --paper: #fff6e6;   /* warm cream canvas */
  --ink: #1a1208;
  --muted: #4f4536;
  --accent: #c42a14;   /* deep sunny red, AA on cream */
  --paper-deep: #f6e7c8; /* slightly deeper cream for placeholders */
  --font: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(20px, 4vw, 56px);
  --max: 1180px;
  --r: 18px;
  --sun-red: #e8412c; --sun-orange: #ff9f1c; --sun-yellow: #ffd23f; --sun-pink: #f49ac2;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font); font-size: 18px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: inherit; }
::selection { background: var(--ink); color: var(--paper); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; box-shadow: 0 0 0 6px var(--paper); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 14px; z-index: 100; border-radius: 99px; }
.skip:focus { left: 8px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--paper); border-bottom: 2px solid var(--ink); }
.site-header .inner { max-width: var(--max); margin: 0 auto; padding: 12px var(--gutter); display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 1.3rem; text-decoration: none; letter-spacing: -0.02em; display: inline-flex; align-items: center; gap: 10px; }
.nav { display: flex; gap: 6px; flex-wrap: wrap; }
.nav a { font-size: 0.82rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; text-decoration: none; padding: 8px 16px; border-radius: 99px; border: 2px solid transparent; transition: background 0.25s, border-color 0.25s; }
.nav a:hover { border-color: var(--ink); }
.nav a[aria-current="page"] { background: var(--ink); color: var(--paper); }

main { position: relative; overflow: hidden; animation: pagein 0.6s ease both; }
@keyframes pagein { from { opacity: 0; } to { opacity: 1; } }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* Type */
.eyebrow { display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; background: transparent; color: var(--ink); border: 2px solid var(--ink); padding: 4px 14px; border-radius: 99px; margin: 0 0 22px; }
.eyebrow .dot { display: none; }
h1, h2, h3 { line-height: 1.04; letter-spacing: -0.035em; margin: 0; font-weight: 700; }
h1 { font-size: clamp(2.2rem, 5vw, 4.2rem); color: var(--accent); }
h2 { font-size: clamp(1.8rem, 3.8vw, 3.1rem); }
h3 { font-size: clamp(1.3rem, 2.2vw, 1.8rem); line-height: 1.15; }
p { margin: 0 0 1.1em; }
.lead { font-size: clamp(1.15rem, 1.9vw, 1.5rem); line-height: 1.5; max-width: 42ch; }
.muted { color: var(--muted); }

/* Kinetic headline (words rise into place) */
.js .rise .w { display: inline-block; overflow: hidden; vertical-align: top; padding: 0.06em 0.04em 0.16em; margin: -0.06em -0.04em -0.16em; }
.js .rise .w > span { display: inline-block; transform: translateY(115%); animation: rise 0.85s cubic-bezier(.2, 1.1, .3, 1) forwards; animation-delay: calc(var(--i) * 50ms + 150ms); }
@keyframes rise { to { transform: none; } }

/* Hero */
.hero { padding: clamp(48px, 8vw, 110px) 0 clamp(32px, 5vw, 64px); }
.hero-grid { display: grid; grid-template-columns: 1fr; gap: 40px; align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.5fr 0.8fr; } }
.portrait { width: min(320px, 72%); justify-self: start; margin: 0; position: relative; isolation: isolate; }
@media (min-width: 900px) { .portrait { justify-self: center; } }
/* Black panel with a soft lifted shadow, as on the original About page */
.portrait .panel { position: relative; background: #000; line-height: 0; }
.portrait .panel::after { content: ""; position: absolute; left: 8%; right: 8%; bottom: -16px; height: 26px; background: radial-gradient(ellipse at center, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0) 70%); filter: blur(5px); z-index: -1; }
.portrait img { display: block; width: 100%; height: auto; background: none; border: 0; border-radius: 0; box-shadow: none; }
.credit { font-size: 0.78rem; color: var(--muted); margin: 0; padding-top: 36px; text-align: right; }

/* Work list */
.section { padding: clamp(40px, 6vw, 88px) 0; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding-bottom: 18px; }
.work-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.work-row { display: grid; grid-template-columns: 64px 1fr auto; gap: 18px; align-items: center; padding: clamp(18px, 2.6vw, 30px) clamp(18px, 3vw, 34px); background: var(--paper); border: 2px solid var(--ink); border-radius: var(--r); text-decoration: none; transition: transform 0.3s cubic-bezier(.3,1.4,.5,1), box-shadow 0.3s, background 0.25s; }
.work-row .num { width: 48px; height: 48px; border-radius: 50%; background: transparent; border: 2px solid var(--ink); display: grid; place-items: center; font-weight: 700; font-size: 0.9rem; }
.work-row .title { font-weight: 700; font-size: clamp(1.5rem, 3.8vw, 3rem); line-height: 1.05; letter-spacing: -0.03em; }
.work-row .role { display: block; font-size: 0.92rem; font-weight: 500; letter-spacing: 0; color: var(--muted); margin-top: 6px; }
.work-row .arrow { font-size: 2rem; font-weight: 700; transition: transform 0.3s cubic-bezier(.3,1.5,.5,1); }
.work-row:hover, .work-row:focus-visible { background: var(--accent); border-color: var(--accent); color: #fff; transform: translate(-4px, -4px); }
.work-row:hover .role { color: #fff; }
.work-row:hover .num { border-color: #fff; }
.work-row:hover .arrow { transform: translateX(8px); }
.tag { display: inline-block; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; background: var(--ink); color: var(--paper); padding: 4px 10px; border-radius: 99px; margin-left: 12px; vertical-align: middle; }
@media (max-width: 560px) { .work-row { grid-template-columns: 40px 1fr auto; gap: 12px; } .work-row .num { width: 38px; height: 38px; } }

/* Pages */
.page-head { padding: clamp(48px, 8vw, 104px) 0 clamp(24px, 4vw, 48px); }
.page-head p.lead { margin-top: 24px; }
.prose { max-width: 66ch; }
.prose h2 { margin: 1.8em 0 0.6em; }
.prose li { margin-bottom: 0.7em; }
.prose li::marker, .case li::marker { color: var(--accent); font-weight: 700; }
.prose a, .case a { text-decoration-thickness: 2px; text-underline-offset: 3px; text-decoration-color: var(--accent); }
.prose a:hover, .case a:hover { color: var(--accent); }

.case { background: var(--paper); border: 2px solid var(--ink); border-radius: var(--r); padding: clamp(24px, 4vw, 48px); margin-bottom: 24px; display: grid; gap: 28px; }
@media (min-width: 900px) { .case { grid-template-columns: 0.8fr 1.4fr; gap: 56px; } }
.case.featured { background: #fff; box-shadow: 8px 8px 0 var(--ink); }
.case .meta { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; margin-top: 14px; }
.case ul { padding-left: 1.1em; margin: 0 0 1em; }
.case li { margin-bottom: 0.75em; }
.status { font-size: 0.85rem; font-weight: 700; background: var(--ink); color: var(--paper); display: inline-block; padding: 5px 14px; border-radius: 99px; }

/* Image placeholders */
.ph { display: grid; place-items: center; text-align: center; padding: 16px; background: var(--paper-deep); border: 2px dashed var(--ink); border-radius: var(--r); color: var(--ink); font-size: 0.85rem; font-weight: 600; }
.ph span { background: var(--paper); border: 2px solid var(--ink); border-radius: 99px; padding: 6px 14px; }
.hero-img.ph { width: calc(100% - 2 * var(--gutter)); max-width: calc(var(--max) - 2 * var(--gutter)); height: clamp(160px, 26vw, 300px); margin: clamp(24px, 4vw, 48px) auto 0; }
.grid { display: grid; gap: 28px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); margin-top: 24px; }
.card { text-decoration: none; display: block; transition: transform 0.3s cubic-bezier(.3,1.4,.5,1); }
.card:hover { transform: translateY(-6px); }
.card .ph, .card img { aspect-ratio: 4 / 5; width: 100%; object-fit: cover; }
.card.site .ph, .card.site img { aspect-ratio: 1 / 1; }
.card img { border: 2px solid var(--ink); border-radius: var(--r); }
.card h3 { margin-top: 12px; }
.card p { font-size: 0.9rem; color: var(--muted); margin: 4px 0 0; }
.card:hover h3 { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 4px; text-underline-offset: 3px; }

/* Buttons */
.btn { display: inline-block; font-weight: 700; font-size: 0.9rem; letter-spacing: 0.05em; text-transform: uppercase; text-decoration: none; padding: 14px 26px; background: var(--ink); color: var(--paper); border: 2px solid var(--ink); border-radius: 99px; transition: background 0.25s, color 0.25s, transform 0.3s cubic-bezier(.3,1.5,.5,1); }
.btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; transform: translateY(-3px); }
.btn.ghost { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn.ghost:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }

/* Footer */
.site-footer { background: var(--ink); color: var(--paper); margin-top: clamp(48px, 8vw, 96px); }
.site-footer .inner { max-width: var(--max); margin: 0 auto; padding: clamp(40px, 6vw, 72px) var(--gutter) 40px; display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: end; }
.site-footer .cta { font-weight: 700; font-size: clamp(2rem, 6vw, 4.5rem); letter-spacing: -0.035em; line-height: 1; margin: 0; }
.site-footer .cta a { color: #ffd23f; text-decoration: none; display: inline-block; border-bottom: 5px solid #ffd23f; transition: transform 0.3s cubic-bezier(.3,1.5,.5,1), color 0.2s; }
.site-footer .cta a:hover { transform: translateX(8px); color: #d9d9d0; border-color: #d9d9d0; }
.site-footer small { color: #d9d9d0; }

/* Scroll reveal */
.js .reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.6s ease, transform 0.8s cubic-bezier(.2, 1.1, .3, 1); transition-delay: var(--d, 0ms); }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  main { animation: none; }
  .js .rise .w > span { animation: none; transform: none; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  * { transition-duration: 0.01ms !important; }
  .work-row:hover, .btn:hover, .card:hover { transform: none; }
}

/* Butterfly mark: wings flap a few times, then rest */
.bf { display: block; overflow: visible; animation: bf-drift 9s ease-in-out infinite; }
.bf .wing { transform-box: view-box; transform-origin: 32px 32px; animation: bf-flap 9s ease-in-out infinite; }
@keyframes bf-flap {
  0%, 18%, 100% { transform: scaleX(1); }
  3% { transform: scaleX(0.25); }
  6% { transform: scaleX(1); }
  9% { transform: scaleX(0.25); }
  12% { transform: scaleX(1); }
  15% { transform: scaleX(0.4); }
}
@keyframes bf-drift { 0%, 20%, 100% { transform: translateY(0) rotate(0); } 8% { transform: translateY(-3px) rotate(-6deg); } 14% { transform: translateY(-1px) rotate(4deg); } }
.brand:hover .bf .wing { animation: bf-flap-fast 0.45s ease-in-out infinite; }
@keyframes bf-flap-fast { 0%, 100% { transform: scaleX(1); } 50% { transform: scaleX(0.25); } }
@media (prefers-reduced-motion: reduce) { .bf, .bf .wing, .brand:hover .bf .wing { animation: none; } }

/* Blooming flower (scroll-driven): scalloped, cloud-like layers */
.bloom { height: clamp(420px, 78vh, 720px); display: grid; place-items: center; }
.bloom-stage { width: 100%; display: grid; place-items: center; }
.flower { width: auto; height: min(70vh, 600px); max-width: 92vw; overflow: visible; }

/* Work list drops out of the flower (scene mode, set by bloom.js) */
.work-scene.scene-on { position: relative; }
.scene-on .bloom { position: absolute; inset: 0; height: auto; z-index: 0; pointer-events: none; }
.scene-on .work-sec { position: relative; z-index: 1; height: 100%; padding-bottom: 0; display: flex; flex-direction: column; justify-content: center; }
.scene-on .work-sec .wrap { width: 100%; }

/* Compact sizing in scene mode so the whole list fits one screen (scales with window height) */
.scene-on .section-head { padding-bottom: clamp(6px, 1.2vh, 14px); }
.scene-on .section-head h2 { font-size: clamp(1.5rem, 4.4vh, 2.6rem); }
.scene-on .work-list { gap: clamp(6px, 1.3vh, 14px); }
.scene-on .work-row { padding: clamp(8px, 1.5vh, 20px) clamp(16px, 3vw, 34px); }
.scene-on .work-row .title { font-size: clamp(1.15rem, 4.2vh, 2.4rem); }
.scene-on .work-row .role { font-size: clamp(0.78rem, 1.9vh, 0.92rem); margin-top: 2px; }
.scene-on .work-row .num { width: clamp(32px, 5vh, 46px); height: clamp(32px, 5vh, 46px); }
.scene-on .tag { padding: 3px 9px; }
.flower .p-out { fill: var(--sun-red); }
.flower .p-mid { fill: var(--sun-orange); }
.flower .p-in { fill: var(--sun-yellow); }
.flower .core { fill: var(--sun-pink); }
.flower .seed line { stroke: var(--ink); stroke-width: 2.6; stroke-linecap: butt; }

/* Cursor bumblebee trail */
.cbf-layer { position: fixed; inset: 0; pointer-events: none; z-index: 200; overflow: hidden; }
.cbf { position: absolute; left: 0; top: 0; will-change: transform; transition: opacity 0.3s; }
.cbf svg { display: block; width: 100%; height: 100%; overflow: visible; }
.cbf .wing { transform-box: view-box; transform-origin: 32px 32px; animation: bf-flap-fast 0.4s ease-in-out infinite; }
.cbf.fast .wing { animation-duration: 0.12s; }
@media (prefers-reduced-motion: reduce), (hover: none) { .cbf-layer { display: none; } }

/* Illustration cutout: no box, breaks out of the layout */
.portrait.cutout { width: min(340px, 78%); justify-self: start; position: relative; z-index: 3; rotate: -3deg; transition: rotate 0.5s cubic-bezier(.3,1.4,.5,1); }
.portrait.cutout:hover { rotate: 0deg; }
.portrait.cutout img { width: 100%; height: auto; filter: drop-shadow(0 14px 16px rgba(26, 18, 8, 0.22)); }
.portrait.cutout .credit { padding-top: 10px; text-align: center; }
.portrait.cutout .credit a { text-underline-offset: 3px; }
@media (min-width: 900px) {
  .portrait.cutout { width: min(440px, 100%); justify-self: end; margin-right: calc(-1 * var(--gutter) * 0.75); margin-top: calc(-1 * clamp(24px, 4vw, 56px)); margin-bottom: calc(-1 * clamp(40px, 7vw, 110px)); }
}
@media (prefers-reduced-motion: reduce) { .portrait.cutout { transition: none; } }

/* Stem and leaves */
:root { --sun-green: #3f9d56; --sun-green-dk: #2a7a44; }
.flower .stem { fill: none; stroke: var(--sun-green-dk); stroke-width: 9; stroke-linecap: butt; }
.flower .leaf .l1 { fill: var(--sun-green); }
.flower .leaf .l2 { fill: var(--sun-green-dk); }

/* Work dropdown in the top nav */
.nav .has-menu { position: relative; display: flex; }
.nav .has-menu::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 14px; }
.submenu { position: absolute; top: calc(100% + 8px); left: 0; z-index: 60; list-style: none; margin: 0; padding: 8px; min-width: min(360px, 88vw); background: var(--paper); border: 2px solid var(--ink); border-radius: var(--r); box-shadow: 6px 6px 0 var(--ink); opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity 0.2s, visibility 0.2s, transform 0.3s cubic-bezier(.3,1.4,.5,1); }
.has-menu:hover .submenu, .has-menu:focus-within .submenu { opacity: 1; visibility: visible; transform: none; }
.nav .submenu a { display: block; text-transform: none; letter-spacing: 0; font-size: 1rem; font-weight: 700; padding: 10px 14px; border-radius: 12px; border: 2px solid transparent; line-height: 1.25; }
.nav .submenu a .role { display: block; font-size: 0.8rem; font-weight: 500; color: var(--muted); margin-top: 2px; }
.nav .submenu a:hover, .nav .submenu a:focus-visible { background: var(--accent); border-color: var(--accent); color: #fff; }
.nav .submenu a:hover .role, .nav .submenu a:focus-visible .role { color: #fff; }
.nav .submenu a[aria-current="page"] { background: var(--ink); color: var(--paper); }
.nav .submenu a[aria-current="page"] .role { color: #d9d9d0; }
/* Phones: the Work menu opens on tap (see main.js) */
@media (max-width: 700px) {
  .nav .has-menu { position: static; }
  .nav .has-menu::after { display: none; }
  .submenu { left: var(--gutter); right: var(--gutter); top: calc(100% + 6px); min-width: 0; max-height: calc(100vh - 130px); overflow-y: auto; }
  .has-menu:hover .submenu, .has-menu:focus-within .submenu { opacity: 0; visibility: hidden; transform: translateY(-6px); }
  .nav .has-menu > a::after { content: "\25BE"; margin-left: 6px; font-size: 0.85em; }
  .nav .has-menu.open > a::after { content: "\25B4"; }
}

/* Flower motif on every page (scaled back from the homepage) */
.site-footer { position: relative; margin-top: clamp(120px, 16vw, 200px); }
.garden { position: absolute; left: 0; right: 0; bottom: 100%; height: clamp(90px, 14vw, 170px); display: flex; justify-content: space-around; align-items: flex-end; padding: 0 var(--gutter); pointer-events: none; z-index: 5; }
.garden .plant { height: 80%; width: auto; overflow: visible; flex: 0 0 auto; }
@media (max-width: 700px) { .garden .plant:nth-child(n+6) { display: none; } }

/* grow-in states (the markup is fully visible without JS or with reduced motion) */
.garden .g-stem { transform-box: fill-box; transform-origin: 50% 100%; transform: scaleY(0); transition: transform 0.9s cubic-bezier(.4, 0, .2, 1) var(--d, 0s); }
.garden .g-leaf { transform-box: fill-box; transform: scale(0); transition: transform 0.6s cubic-bezier(.3, 1.5, .5, 1) calc(var(--d, 0s) + 0.7s); }
.garden .g-leaf.r { transform-origin: 0% 100%; }
.garden .g-leaf.l { transform-origin: 100% 100%; }
.fl { transform-box: fill-box; transform-origin: center; transform: scale(0) rotate(-45deg); transition: transform 0.9s cubic-bezier(.3, 1.4, .5, 1); }
.garden .fl { transition-delay: calc(var(--d, 0s) + 0.95s); }
.fl-mid { transition-duration: 0.8s; } .fl-in { transition-duration: 0.7s; } .fl-core { transition-duration: 0.5s; }
.fl-mid { transition-delay: 0.15s; } .fl-in { transition-delay: 0.3s; } .fl-core { transition-delay: 0.45s; }
.garden .fl-mid { transition-delay: calc(var(--d, 0s) + 1.1s); } .garden .fl-in { transition-delay: calc(var(--d, 0s) + 1.25s); } .garden .fl-core { transition-delay: calc(var(--d, 0s) + 1.4s); }
.garden.in .g-stem, .garden.in .g-leaf, .garden.in .fl, .pg-flower.in .fl { transform: none; }

/* page-head flower */
.page-head .wrap { position: relative; }
.page-head .wrap > :not(.pg-flower) { position: relative; z-index: 1; }
.pg-flower { display: block; overflow: visible; pointer-events: none; transform: rotate(calc(var(--sy, 0) * 0.05deg)); }
.pg-flower.corner { position: absolute; z-index: 0; right: calc(var(--gutter) * -0.4); top: -10px; width: clamp(110px, 20vw, 250px); height: auto; opacity: 0.95; }
@media (prefers-reduced-motion: reduce) {
  .garden .g-stem, .garden .g-leaf, .fl { transition: none; transform: none; }
  .pg-flower { transform: none; }
}

/* Homepage hero: wider text column, illustration bleeds toward the page edge */
.hero .hero-grid { align-items: start; }
.scroll-cue { display: inline-flex; align-items: center; gap: 10px; margin-top: clamp(20px, 3vw, 36px); padding: 8px 16px 8px 18px; border: 2px solid var(--ink); border-radius: 99px; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none; transition: opacity 0.4s, background 0.25s, color 0.25s; }
.scroll-cue:hover { background: var(--ink); color: var(--paper); }
.scroll-cue svg { animation: cue-bounce 1.6s ease-in-out infinite; }
.scroll-cue.scrolled { opacity: 0; pointer-events: none; }
@keyframes cue-bounce { 0%, 100% { transform: translateY(-2px); } 50% { transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) { .scroll-cue svg { animation: none; } }
@media (min-width: 900px) {
  .hero { --bleed: clamp(0px, calc((100vw - var(--max)) / 2 + var(--gutter) - 16px), 170px); padding-bottom: clamp(16px, 2vw, 28px); }
  .hero .hero-grid { grid-template-columns: minmax(0, 1fr) calc(380px - var(--bleed)); gap: 24px; }
  .hero .portrait.cutout { width: 380px; justify-self: end; margin-right: calc(-1 * var(--bleed)); margin-top: calc(-1 * clamp(24px, 4vw, 56px)); margin-bottom: calc(-1 * clamp(60px, 9vw, 130px)); }
}


/* ---- Homepage adjustments ---- */
/* Illustration: straight at first, tilts on hover, links to About */
.portrait-link { display: block; }
.hero .portrait.cutout { rotate: 0deg; }
.hero .portrait.cutout:hover, .hero .portrait.cutout:focus-within { rotate: -3deg; }

/* Flower sits higher; the Work list sits low, over the stem and leaves */
.scene-on .bloom-stage { height: 100%; align-items: start; padding-top: clamp(4px, 1vh, 14px); }
.scene-on .flower { height: min(70%, 620px); max-height: none; }
.scene-on .work-sec { justify-content: flex-end; padding-bottom: clamp(8px, 2vh, 22px); }
.scene-on .section-head { padding-bottom: clamp(4px, 0.8vh, 10px); }
.scene-on .section-head h2 { font-size: clamp(1.3rem, 3.4vh, 2.1rem); }
.scene-on .work-list { gap: clamp(5px, 0.9vh, 10px); }
.scene-on .work-row { padding: clamp(6px, 1.1vh, 14px) clamp(16px, 3vw, 30px); }
.scene-on .work-row .title { font-size: clamp(1.05rem, 3.3vh, 2rem); }
.scene-on .work-row .role { font-size: clamp(0.74rem, 1.6vh, 0.88rem); margin-top: 1px; }
.scene-on .work-row .num { width: clamp(28px, 4vh, 40px); height: clamp(28px, 4vh, 40px); font-size: 0.8rem; }

/* "Scroll to view my work": follows the cursor, then steps aside once every Work link is in */
.follow-cue { position: fixed; left: 0; top: 0; z-index: 150; pointer-events: none; background: var(--paper); box-shadow: 4px 4px 0 var(--ink); opacity: 0; transition: opacity 0.3s; white-space: nowrap; margin: 0; }
.follow-cue.on { opacity: 1; }
html.cue-follow .scroll-cue:not(.follow-cue) { opacity: 0; }
html.cue-follow .scroll-cue:not(.follow-cue):focus-visible { opacity: 1; }
html.work-in .follow-cue { opacity: 0; }
html.work-in .scroll-cue { opacity: 0; pointer-events: none; }
html.cue-fixed .scroll-cue { position: fixed; z-index: 90; left: 50%; bottom: 18px; margin: 0; background: var(--paper); box-shadow: 4px 4px 0 var(--ink); transform: translateX(-50%); }

/* Short windows: keep the scene, drop the role lines so all five rows fit */
.scene-tight .work-row .role { display: none; }
.scene-tight .work-row { padding-block: clamp(5px, 0.9vh, 10px); }
.scene-tight .work-list { gap: clamp(4px, 0.7vh, 8px); }

/* ---- Round 2 tweaks ---- */
/* Header bee: wings flap continuously */
.bf { animation: none; }
.bf .wing { animation: bf-flap-fast 0.45s ease-in-out infinite; }
.brand:hover .bf .wing { animation-duration: 0.2s; }

/* Work rows: smaller, centred, and layered above the stem and leaves */
.scene-on .flower { height: min(80%, 700px); }
.scene-on .work-sec { z-index: 2; }
.scene-on .work-list, .scene-on .section-head { position: relative; z-index: 2; }
.scene-on .work-sec .wrap { max-width: 760px; }
.scene-on .section-head h2 { font-size: clamp(1.1rem, 2.8vh, 1.7rem); }
.scene-on .work-list { gap: clamp(4px, 0.7vh, 8px); }
.scene-on .work-row { padding: clamp(5px, 0.9vh, 11px) clamp(14px, 2.4vw, 24px); grid-template-columns: 40px 1fr auto; gap: 14px; }
.scene-on .work-row .title { font-size: clamp(0.95rem, 2.5vh, 1.5rem); }
.scene-on .work-row .role { font-size: clamp(0.7rem, 1.4vh, 0.82rem); }
.scene-on .work-row .num { width: clamp(26px, 3.6vh, 36px); height: clamp(26px, 3.6vh, 36px); font-size: 0.75rem; }
.scene-on .work-row .arrow { font-size: 1.4rem; }

/* "Scroll to view my work" button: white, and hidden while hovering the top nav */
.scroll-cue, .follow-cue, html.cue-fixed .scroll-cue { background: #fff; }
.scroll-cue:hover { background: var(--ink); }
html.nav-hover .follow-cue, html.nav-hover .scroll-cue { opacity: 0; pointer-events: none; }

/* Nav: white dropdown, and About / LinkedIn turn white on hover */
.submenu { background: #fff; }
.nav > a:not([aria-current="page"]):hover, .nav > a:not([aria-current="page"]):focus-visible { background: #fff; border-color: var(--ink); }
.scene-on .work-sec .wrap { max-width: 820px; }

/* ---- Round 3 ---- */
/* Work rows: back to the v15 size */
.scene-on .section-head h2 { font-size: clamp(1.5rem, 4.4vh, 2.6rem); }
.scene-on .work-list { gap: clamp(6px, 1.3vh, 14px); }
.scene-on .work-sec .wrap { max-width: var(--max); }
.scene-on .work-row { padding: clamp(8px, 1.5vh, 20px) clamp(16px, 3vw, 34px); grid-template-columns: 64px 1fr auto; gap: 18px; }
.scene-on .work-row .title { font-size: clamp(1.15rem, 4.2vh, 2.4rem); }
.scene-on .work-row .role { font-size: clamp(0.78rem, 1.9vh, 0.92rem); margin-top: 2px; }
.scene-on .work-row .num { width: clamp(32px, 5vh, 46px); height: clamp(32px, 5vh, 46px); font-size: 0.9rem; }
.scene-on .work-row .arrow { font-size: 2rem; }
@media (max-width: 560px) { .scene-on .work-row { grid-template-columns: 40px 1fr auto; gap: 12px; } }

/* Illustration: straight at first, tilts down on hover (About page too) */
.portrait.cutout { rotate: 0deg; }
.portrait.cutout:hover, .portrait.cutout:focus-within { rotate: -3deg; }

/* About page: text starts higher; the illustration sits to the right, out of the text flow */
.page-head:has(.hero-grid) { padding-top: clamp(28px, 4vw, 56px); padding-bottom: clamp(8px, 1.5vw, 16px); }
.page-head:has(.hero-grid) .hero-grid { align-items: start; gap: 12px; }
@media (min-width: 900px) {
  .page-head:has(.hero-grid) .hero-grid { position: relative; grid-template-columns: 1fr; }
  .page-head:has(.hero-grid) .portrait.cutout { position: absolute; right: calc(-0.75 * var(--gutter)); top: calc(-1 * clamp(8px, 2vw, 28px)); width: min(400px, 36vw); margin: 0; }
  .page-head:has(.hero-grid) ~ .wrap .prose > .lead { max-width: calc(100% - min(400px, 36vw) - 24px) !important; }
}

/* About: let the first paragraph run wider (just short of the illustration); body text keeps its measure */
@media (min-width: 900px) {
  .page-head:has(.hero-grid) ~ .wrap .prose { max-width: none; }
  .page-head:has(.hero-grid) ~ .wrap .prose > :not(.lead) { max-width: 66ch; }
  .page-head:has(.hero-grid) ~ .wrap .prose > .lead { max-width: calc(100% - min(400px, 36vw) + var(--gutter) * 0.75 - 16px) !important; }
}
.projects-head { margin: 0 0 clamp(18px, 2.6vw, 28px); }
.case .status { margin: 14px 0 0; line-height: 1.4; cursor: default; }

/* Case-study photos */
figure.photo { margin: 0; }
figure.photo img { width: 100%; height: auto; border: 2px solid var(--ink); border-radius: var(--r); }
.hero-img.photo { width: calc(100% - 2 * var(--gutter)); max-width: calc(var(--max) - 2 * var(--gutter)); margin: clamp(24px, 4vw, 48px) auto 0; }
.hero-img.photo img { height: clamp(160px, 26vw, 300px); object-fit: cover; }
.zine-cover { max-width: 300px; margin-top: 0; }
.hero-img.photo img { height: auto; object-fit: initial; border: 0; border-radius: 0; }

/* NYC page intro box: matches the featured box on the Huge page; photo fills the left column */
.nyc-intro { margin-top: clamp(24px, 4vw, 48px); }
.nyc-intro > div:first-child { display: flex; }
.nyc-intro > div:first-child .photo { width: 100%; }
.nyc-intro > div:first-child .photo img { aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 20%; }
@media (min-width: 900px) {
  .nyc-intro > div:first-child .photo { height: 100%; }
  .nyc-intro > div:first-child .photo img { height: 100%; aspect-ratio: auto; }
}

/* NYC intro photo: natural proportions, top-aligned (no stretching to the box height) */
.nyc-intro > div:first-child { display: block; }
.nyc-intro > div:first-child .photo { height: auto; }
.nyc-intro > div:first-child .photo img { aspect-ratio: auto; height: auto; object-fit: initial; }

/* NYC hero: white-lettered logo on a black banner */
.hero-img.logo-hero { background: #000; border: 2px solid var(--ink); border-radius: var(--r); overflow: hidden; }
.hero-img.logo-hero img { display: block; width: auto; max-width: 100%; height: clamp(240px, 38vw, 440px); margin: 0 auto; object-fit: contain; }

/* Round 4: tighter spacing on work pages */
.page-head { padding: clamp(20px, 3vw, 36px) 0 clamp(6px, 1.2vw, 14px); }
.page-head p.lead { margin-top: 18px; margin-bottom: 0; }
.nyc-intro { margin-top: clamp(12px, 2vw, 20px); }
.case h2 + p:not(.status) { margin-top: 16px; }

/* Round 4b: middle ground between the original and tight spacing */
.page-head { padding: clamp(32px, 5vw, 64px) 0 clamp(14px, 2.5vw, 28px); }
.page-head p.lead { margin-top: 22px; }
.nyc-intro { margin-top: clamp(16px, 2.5vw, 28px); }

/* NYU Langone hero video */
.hero-img.video-hero { width: calc(100% - 2 * var(--gutter)); max-width: min(960px, calc(var(--max) - 2 * var(--gutter))); margin: clamp(20px, 3vw, 36px) auto 0; }
.hero-img.video-hero video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; background: #000; border: 2px solid var(--ink); border-radius: var(--r); }

/* Website cards: small, even squares */
.grid:has(.card.site) { grid-template-columns: repeat(auto-fill, 180px); gap: 28px 24px; }
.card.site img { width: 180px; height: 180px; aspect-ratio: 1 / 1; object-fit: cover; }
.card.site h3 { font-size: 1.05rem; }
.card.site p { font-size: 0.85rem; max-width: 180px; }

/* NYU page: body copy in a white box; website tiles span the full width */
.case.nyu-body { grid-template-columns: 1fr; margin-top: clamp(16px, 2.5vw, 28px); }
.nyu-body .prose { max-width: 75ch; }
.nyu-body .prose > :first-child, .nyu-body .prose p:first-child { margin-top: 0; }
.grid:has(.card.site) { grid-template-columns: repeat(4, 1fr); gap: 28px clamp(14px, 2.4vw, 28px); }
.card.site img { width: 100%; height: auto; aspect-ratio: 1 / 1; }
.card.site p { max-width: none; }
@media (max-width: 700px) { .grid:has(.card.site) { grid-template-columns: repeat(2, 1fr); } }

/* Science for the People hero: same footprint as the old placeholder */
.hero-img.sftp-hero { margin-top: clamp(16px, 2.5vw, 28px); }
.hero-img.sftp-hero img { width: 100%; height: clamp(160px, 26vw, 300px); object-fit: cover; object-position: 50% 50%; }
.hero-img.sftp-hero img { border: 2px solid var(--ink); border-radius: var(--r); }

/* Hero frames (NYC + Science for the People): same footprint, outlined and rounded */
.hero-img.nyc-hero { width: calc(100% - 2 * var(--gutter)); max-width: calc(var(--max) - 2 * var(--gutter)); height: clamp(160px, 26vw, 300px); margin: clamp(16px, 2.5vw, 28px) auto 0; background: #fff; border: 2px solid var(--ink); border-radius: var(--r); overflow: hidden; padding: clamp(8px, 1.5vw, 18px); box-sizing: border-box; }
.hero-img.nyc-hero img { display: block; width: 100%; height: 100%; object-fit: contain; border: 0; border-radius: 0; }
.hero-img.sftp-hero img { object-position: 50% 62%; }


/* ---- v17: accessibility fixes (WCAG AA) ---- */
/* 2.2.2: header bee flaps a few times (about 3.6s), then rests; flaps while hovered */
.bf .wing { animation: bf-flap-fast 0.45s ease-in-out 8; }
.brand:hover .bf .wing { animation: bf-flap-fast 0.2s ease-in-out infinite; }
/* scroll-cue arrow bounces three times, then rests (under 5s) */
.scroll-cue svg { animation: cue-bounce 1.6s ease-in-out 3; }
@media (prefers-reduced-motion: reduce) { .bf .wing, .brand:hover .bf .wing, .scroll-cue svg { animation: none; } }
/* 1.4.13: dropdown can be dismissed with Esc (class set in main.js) */
.has-menu.dismissed .submenu { opacity: 0; visibility: hidden; transform: translateY(-6px); }


/* 2.4.7: the scroll cue must not be focusable while invisible */
html.work-in .scroll-cue, html.work-in .follow-cue, .scroll-cue.scrolled { visibility: hidden; }

/* Footer contact button + pop-out form (contact.js) */
.contact-btn { display: inline-grid; place-items: center; width: 0.78em; height: 0.78em; min-width: 40px; min-height: 40px; margin-left: 0.3em; vertical-align: 0.04em; padding: 0; background: #ffd23f; color: var(--ink); border: 2px solid #ffd23f; border-radius: 50%; cursor: pointer; transition: transform 0.3s cubic-bezier(.3, 1.5, .5, 1), background 0.2s, color 0.2s; }
.contact-btn svg { width: 52%; height: 52%; }
.contact-btn:hover, .contact-btn:focus-visible { transform: rotate(-12deg) scale(1.1); background: var(--ink); color: #ffd23f; }
.site-footer .contact-btn:focus-visible { outline-color: #ffd23f; box-shadow: none; }

.contact-dialog { width: min(480px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto; padding: 0; background: var(--paper); color: var(--ink); border: 2px solid var(--ink); border-radius: var(--r); box-shadow: 8px 8px 0 var(--ink); font-family: var(--font); }
.contact-dialog[open] { animation: contact-pop 0.4s cubic-bezier(.3, 1.4, .5, 1); }
.contact-dialog::backdrop { background: rgba(26, 18, 8, 0.6); }
@keyframes contact-pop { from { opacity: 0; transform: translateY(24px) scale(0.85); } to { opacity: 1; transform: none; } }
.contact-form { position: relative; display: grid; gap: 16px; padding: clamp(24px, 5vw, 36px); }
.contact-form h2 { margin: 0; font-size: 1.8rem; letter-spacing: -0.03em; line-height: 1.1; }
.contact-sub { margin: -8px 0 0; color: var(--muted); font-size: 1rem; }
.contact-form label { display: grid; gap: 6px; font-weight: 700; font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; }
.contact-form input, .contact-form textarea { font: inherit; font-size: 1rem; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--ink); background: #fff; border: 2px solid var(--ink); border-radius: 12px; padding: 10px 14px; width: 100%; }
.contact-form textarea { resize: vertical; min-height: 110px; }
.contact-form .contact-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.contact-close { position: absolute; top: 12px; right: 14px; width: 40px; height: 40px; border: 2px solid var(--ink); border-radius: 50%; background: transparent; color: var(--ink); font-size: 1.5rem; line-height: 1; cursor: pointer; }
.contact-close:hover { background: var(--ink); color: var(--paper); }
.contact-send { cursor: pointer; justify-self: start; }
.contact-send:hover { background: var(--accent); border-color: var(--accent); }
.contact-send:disabled { opacity: 0.6; cursor: default; }
.contact-status { margin: 0; min-height: 1.5em; font-size: 0.95rem; font-weight: 600; }
.contact-status.err { color: var(--accent); }
.contact-status.ok { color: #1f6b3a; }
@media (prefers-reduced-motion: reduce) { .contact-dialog[open] { animation: none; } .contact-btn { transition: none; } .contact-btn:hover, .contact-btn:focus-visible { transform: none; } }

/* ---- v18: mobile fixes ---- */
/* Scroll cue: keep the label on one line so it stays centred, and lift it clear of the Netlify badge */
.scroll-cue { white-space: nowrap; justify-content: center; }
html.cue-fixed .scroll-cue { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
html.menu-open .scroll-cue, html.menu-open .follow-cue { opacity: 0; pointer-events: none; }
/* Open Work menu on phones (placed last so it wins over the hover/dismissed rules) */
@media (max-width: 700px) {
  .has-menu.open .submenu { opacity: 1; visibility: visible; transform: none; }
  /* Work pages: flower gets its own row above the title pill instead of sitting behind it */
  .page-head[data-flower] .wrap { padding-top: 92px; }
  .pg-flower.corner { top: 0; right: var(--gutter); width: 84px; }
}
