@font-face { font-family: 'Hanken Grotesk'; src: url('/assets/hanken-grotesk-latin.woff2') format('woff2'); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Newsreader'; src: url('/assets/newsreader-latin.woff2') format('woff2'); font-weight: 400 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Caveat'; src: url('/assets/caveat-latin.woff2') format('woff2'); font-weight: 400 700; font-style: normal; font-display: swap; }
:root {
  color-scheme: light;
  --paper: #F0FAFB;
  --ink: #625953;
  --muted: #756b64;
  --accent: #C92C70;
  --forest: #28513c;
  --line: #52776c55;
  --ink-strong: color-mix(in oklch, #625953 35%, black);
  --chip: rgba(252, 254, 254, .92);
  --highlight: color-mix(in oklch, #C92C70 20%, #ffffff);
  /* Keyboard-only focus ring (Tab), raspberry; mouse clicks don't show it */
  --focus-ring: var(--accent);
  --chip-shadow: 0 1px 2px rgba(0,0,0,.06), 0 0.625rem 1.375rem -0.75rem rgba(40,50,60,.45);
  font-family: 'Hanken Grotesk', Arial, sans-serif;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: var(--ink);
  background: var(--paper);
}
/* Night mode: toggled by the corner button, saved in localStorage */
:root.night {
  color-scheme: dark;
  --paper: #121a1d;
  --ink: #cfc7c1;
  --muted: #9d948d;
  --ink-strong: #f2ede8;
  --accent: #e2558f;
  --forest: #9cc4ae;
  --line: #9cc4ae33;
  --chip: rgba(30, 40, 44, .92);
  --highlight: color-mix(in oklch, #e2558f 38%, #121a1d);
  --chip-shadow: 0 1px 2px rgba(0,0,0,.2), 0 0.625rem 1.375rem -0.75rem rgba(0,0,0,.7);
}
:root.night .landscape { opacity: .4; filter: brightness(.75); }
:root.night body::after { opacity: .22; } /* grain reads as grey static on a dark ground */
/* Switch themes in one frame instead of a ragged cascade of per-element transitions */
:root.theme-switching * { transition: none !important; }
/* Light/dark cross-fade (View Transitions, started by the mode button). Dial: 1500ms */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 1000ms; animation-timing-function: cubic-bezier(.4, 0, .2, 1); }
/* Cursors: glyphs from Smileyface Font by Jonathan Macagba (shareware, $5; see Downloads/smileyface/readme.txt).
   Default "a" = smile; clickable "t" = wink. 1.25rem, about the size of the system arrow; hotspot in the middle.
   Day versions have a white halo, night versions a dark one, so they show on either background. */
html { cursor: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='20'%20height='20'%20viewBox='0%200%20578%20578'%3E%3Cg%20transform='translate%28-88.9%20647.0%29%20scale%281%20-1%29'%3E%3Cpath%20d='M527%20517Q527%20505%20517.5%20495.5Q508%20486%20495%20486Q482%20486%20472.5%20495.5Q463%20505%20463%20517Q463%20530%20472.5%20539.5Q482%20549%20495%20549Q508%20549%20517.5%20539.5Q527%20530%20527%20517ZM276%20517Q276%20505%20266.5%20495.5Q257%20486%20245%20486Q232%20486%20222.0%20495.0Q212%20504%20212%20517Q212%20530%20221.5%20539.5Q231%20549%20245%20549Q257%20549%20266.5%20539.5Q276%20530%20276%20517ZM627%20385Q627%20290%20550%20227Q478%20167%20377%20167Q278%20167%20208%20227Q135%20289%20129%20385Q128%20403%20146%20403Q162%20403%20163%20386Q168%20306%20230.5%20253.5Q293%20201%20378%20201Q463%20201%20525.0%20253.5Q587%20306%20592%20386Q593%20403%20609%20403Q627%20403%20627%20385Z'%20fill='%232b2522'%20stroke='%23ffffff'%20stroke-width='74'%20stroke-linejoin='round'%20paint-order='stroke'/%3E%3C/g%3E%3C/svg%3E") 10 10, auto; }
a, button, summary, [role='button'], .note { cursor: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='20'%20height='20'%20viewBox='0%200%20578%20578'%3E%3Cg%20transform='translate%28-88.9%20649.0%29%20scale%281%20-1%29'%3E%3Cpath%20d='M566%20518%20457%20479Q454%20478%20451%20478Q434%20478%20434%20497Q434%20509%20445%20513L553%20552Q556%20553%20559%20553Q577%20553%20577%20533Q577%20522%20566%20518ZM280%20517Q280%20504%20270.0%20495.0Q260%20486%20247%20486Q235%20486%20225.5%20495.5Q216%20505%20216%20517Q216%20530%20225.5%20539.5Q235%20549%20247%20549Q261%20549%20270.5%20539.5Q280%20530%20280%20517ZM627%20385Q627%20290%20550%20227Q478%20167%20377%20167Q278%20167%20208%20227Q135%20289%20129%20385Q128%20403%20146%20403Q162%20403%20163%20386Q168%20306%20230.5%20253.5Q293%20201%20378%20201Q463%20201%20525.0%20253.5Q587%20306%20592%20386Q593%20403%20609%20403Q627%20403%20627%20385Z'%20fill='%232b2522'%20stroke='%23ffffff'%20stroke-width='74'%20stroke-linejoin='round'%20paint-order='stroke'/%3E%3C/g%3E%3C/svg%3E") 10 10, pointer; }
:root.night { cursor: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='20'%20height='20'%20viewBox='0%200%20578%20578'%3E%3Cg%20transform='translate%28-88.9%20647.0%29%20scale%281%20-1%29'%3E%3Cpath%20d='M527%20517Q527%20505%20517.5%20495.5Q508%20486%20495%20486Q482%20486%20472.5%20495.5Q463%20505%20463%20517Q463%20530%20472.5%20539.5Q482%20549%20495%20549Q508%20549%20517.5%20539.5Q527%20530%20527%20517ZM276%20517Q276%20505%20266.5%20495.5Q257%20486%20245%20486Q232%20486%20222.0%20495.0Q212%20504%20212%20517Q212%20530%20221.5%20539.5Q231%20549%20245%20549Q257%20549%20266.5%20539.5Q276%20530%20276%20517ZM627%20385Q627%20290%20550%20227Q478%20167%20377%20167Q278%20167%20208%20227Q135%20289%20129%20385Q128%20403%20146%20403Q162%20403%20163%20386Q168%20306%20230.5%20253.5Q293%20201%20378%20201Q463%20201%20525.0%20253.5Q587%20306%20592%20386Q593%20403%20609%20403Q627%20403%20627%20385Z'%20fill='%23f2ede8'%20stroke='%23121a1d'%20stroke-width='74'%20stroke-linejoin='round'%20paint-order='stroke'/%3E%3C/g%3E%3C/svg%3E") 10 10, auto; }
:root.night a, :root.night button, :root.night summary, :root.night [role='button'], :root.night .note { cursor: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='20'%20height='20'%20viewBox='0%200%20578%20578'%3E%3Cg%20transform='translate%28-88.9%20649.0%29%20scale%281%20-1%29'%3E%3Cpath%20d='M566%20518%20457%20479Q454%20478%20451%20478Q434%20478%20434%20497Q434%20509%20445%20513L553%20552Q556%20553%20559%20553Q577%20553%20577%20533Q577%20522%20566%20518ZM280%20517Q280%20504%20270.0%20495.0Q260%20486%20247%20486Q235%20486%20225.5%20495.5Q216%20505%20216%20517Q216%20530%20225.5%20539.5Q235%20549%20247%20549Q261%20549%20270.5%20539.5Q280%20530%20280%20517ZM627%20385Q627%20290%20550%20227Q478%20167%20377%20167Q278%20167%20208%20227Q135%20289%20129%20385Q128%20403%20146%20403Q162%20403%20163%20386Q168%20306%20230.5%20253.5Q293%20201%20378%20201Q463%20201%20525.0%20253.5Q587%20306%20592%20386Q593%20403%20609%20403Q627%20403%20627%20385Z'%20fill='%23f2ede8'%20stroke='%23121a1d'%20stroke-width='74'%20stroke-linejoin='round'%20paint-order='stroke'/%3E%3C/g%3E%3C/svg%3E") 10 10, pointer; }
* { box-sizing: border-box; }
body { position: relative; margin: 0; isolation: isolate; }
body::after { content: ''; position: fixed; inset: 0; z-index: 5; pointer-events: none; opacity: .65; mix-blend-mode: soft-light; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.5' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath fill='%23000' filter='url(%23n)' opacity='.7' d='M0 0h180v180H0z'/%3E%3C/svg%3E"); background-size: 11.25rem 11.25rem; }
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 0.375rem; border-radius: 2px; }
.skip-link { position: fixed; top: -4.375rem; left: 1.5rem; padding: 0.75rem; background: var(--paper); z-index: 10; }
.skip-link:focus { top: 0.75rem; }
.site-header { position: absolute; top: 1.875rem; left: 1.5rem; }
.name { font-size: 0.875rem; line-height: 1.5rem; letter-spacing: -.2px; }
.name:hover { color: var(--accent); }
.navigation { position: fixed; top: 15rem; left: 1.5rem; display: flex; flex-direction: column; gap: 2px; }
.navigation a { position: relative; width: fit-content; color: var(--muted); font-size: 0.875rem; line-height: 1.6875rem; transition: color 150ms ease; }
.navigation a:hover, .navigation a[aria-current] { color: var(--accent); }
.navigation a[aria-current]::before { content: ''; position: absolute; width: 2px; height: 1.25rem; left: -0.75rem; top: 0.2188rem; background: var(--accent); }
.navigation a[aria-current]::after { content: ''; position: absolute; width: 0.5625rem; height: 0.3125rem; left: -0.6875rem; top: 0.5rem; background: var(--accent); border-radius: 0.5625rem 0 0.5625rem 0; transform: rotate(-30deg) scale(0); transform-origin: left bottom; transition: transform 240ms ease; }
.navigation a[aria-current]:is(:hover, :focus-visible)::after { transform: rotate(-30deg) scale(1); }
/* Like rachelchen.tech: text stays the same size on every screen; the content column (and so the images) widens with the window.
   1120px wide up to a 1512px window (laptop, unchanged), then 74% of the window width. */
main { --content-w: max(70rem, 74.07vw); --center-gap: calc((100vw - var(--content-w)) / 2); margin-left: max(11.75rem, var(--center-gap)); margin-right: max(clamp(1.5rem, 6vw, 6.5rem), var(--center-gap)); width: auto; max-width: var(--content-w); padding-top: 14.4375rem; padding-bottom: 6.25rem; min-height: 75svh; display: flex; flex-direction: column; }
main:focus { outline: none; }
.site-footer { margin-top: auto; padding-top: 15rem; font-size: 0.8125rem; color: var(--muted); }
h1 { font-family: inherit; font-weight: 600; font-size: clamp(3.75rem, 6vw, 5.25rem); letter-spacing: -0.1875rem; line-height: 1.1; margin: 0 0 1.5625rem; }
.heading-dot { color: var(--accent); }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Travel map: fixed 21.25rem, same as the previous portfolio */
.map-block iframe { display: block; width: 100%; height: 21.25rem; border: 0; border-radius: 0; }
.page-gallery .map-block { margin-bottom: 3.5rem; scroll-margin-top: 2.5rem; }
/* About: Patt's photo at the top of the right column, above Previously at */
.about-photo { display: block; width: min(100%, 18rem); height: auto; margin: 0 0 1.75rem; }
.page-about .map-block { margin-top: 3.5rem; scroll-margin-top: 2.5rem; }
.map-block > a { position: relative; display: inline-block; margin-top: 0.875rem; color: var(--accent); font-size: 0.875rem; text-decoration: underline; text-underline-offset: 0.25rem; }
.map-block .map-note { max-width: none; margin: 1.75rem 0 0; font-size: 0.9375rem; line-height: 1.6; color: var(--ink); text-wrap: pretty; }
.content-section { margin-top: 5.875rem; }
h2 { font-size: 0.8125rem; font-weight: 400; color: var(--muted); margin: 0 0 1.125rem; }
@media (max-width: 640px) {
  .site-header { top: 1.5rem; }
  .navigation { top: 0; left: 0; right: 0; z-index: 2; flex-direction: row; gap: 1.25rem; padding: 1.5rem 1.5rem 0.875rem; background: var(--paper); overflow-x: auto; scrollbar-width: none; }
  .site-header { position: fixed; z-index: 3; }
  .navigation a[aria-current]::before { width: 100%; height: 2px; top: auto; bottom: -0.1875rem; left: 0; }
  .navigation a[aria-current]::after { display: none; }
  main { width: auto; margin: 0 1rem; padding-top: 6.875rem; }
  h1 { font-size: 4rem; }
  .content-section { margin-top: 4.375rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.landscape { width: 100%; height: max(46vh, 22.5rem); background: url('/assets/landscape-2400.jpg') center 64% / cover no-repeat; mask-image: linear-gradient(transparent, #000 65%); opacity: .75; }
@media (max-width: 640px) { main { padding-bottom: 4.5rem; } .landscape { height: 23.75rem; } }

/* ---- Prototype layout ---- */
.muted { color: var(--muted); }
.lede { font-size: 1.0625rem; line-height: 1.7; margin: 0 0 3rem; max-width: 56ch; }

/* Home: intro + history */
/* Name in Caveat to match Figma. Handwriting reads small, so size up and keep default tracking */
/* Home name size + gap below it. Gallery/Travel/Writing reserve the same space so their first block lines up with "I'm a recent UW…" */
:root { --name-size: clamp(2.75rem, 4vw, 3.5rem); --name-block: calc(var(--name-size) + 1.5rem); }
/* Every page but About starts its content one name-height down, below the mountain photo; About puts the name in that space */
:is(.page-work, .page-gallery, .page-writing, .page-case)::before { content: ''; display: block; height: var(--name-block); flex: none; }
.page-about h1 { font-family: 'Caveat', 'Bradley Hand', cursive; font-weight: 500; font-size: var(--name-size); letter-spacing: 0; line-height: 1; margin-bottom: 1.5rem; color: var(--ink-strong); }
/* Intro column = its own text measure (58ch); the rest goes to Previously at so each line fits on one row */
.hero { display: grid; grid-template-columns: minmax(0, 58ch) minmax(0, 1fr); gap: clamp(2rem, 9vw, 8rem); align-items: start; }
/* Home value prop: big serif line at the top of Work; name, intro and history live on /about */
.value-prop { margin: 0 0 2rem; max-width: 20ch; font-family: 'Newsreader', Georgia, serif; font-weight: 400; font-size: clamp(2.5rem, 5vw, 4rem); line-height: 1.08; letter-spacing: -0.02em; color: var(--ink-strong); text-wrap: balance; }
.hero-intro p { font-size: 1rem; line-height: 1.65; margin: 0 0 1rem; max-width: 58ch; }
.contact { list-style: none; padding: 0; margin: 1.75rem 0 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.375rem; font-size: 0.875rem; }
.contact li { position: relative; }
.contact a, .copy-email { color: var(--accent); font: inherit; background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 0.25rem; text-decoration-color: color-mix(in oklch, var(--accent) 40%, transparent); }
.contact a:hover, .copy-email:hover { text-decoration-color: var(--accent); }
.copy-email:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 0.375rem; border-radius: 2px; }
.copied { position: absolute; left: 0; top: 100%; margin-top: 0.25rem; font-size: 0.8125rem; color: var(--muted); white-space: nowrap; }
.hero-intro p a { text-decoration: underline; text-underline-offset: 0.1875rem; text-decoration-color: color-mix(in oklch, var(--ink) 40%, transparent); }
.hero-intro p a:hover { color: var(--accent); text-decoration-color: var(--accent); }
/* "Previously at:" disclosure, native <details> like jia.sc. Figma look: no rules, dark first line, grey notes */
.history-block summary { width: fit-content; color: var(--ink-strong); font-size: 1rem; line-height: 1.65; transition: opacity 150ms ease; }
.history-block summary::marker { color: var(--accent); }
.history-block + .history-block { margin-top: 2rem; }
.contact + .history-block { margin-top: 4rem; } /* About: Previously at sits under the contact links */
/* Bigger click area for the disclosure headings (26px line → 44px), invisible */
.history-block summary { position: relative; }
.history-block summary::before { content: ''; position: absolute; inset: -0.5625rem -0.5rem; }
/* Same for Open in Google Maps (14px text → 44px tall) */
.map-block > a::before { content: ''; position: absolute; inset: -0.75rem -0.5rem; }
.history-block summary:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 0.375rem; border-radius: 2px; }
@media (hover: hover) { .history-block summary:hover { opacity: .7; } }
.history-block h2 { display: inline; margin: 0; font-size: inherit; color: inherit; }
/* Same 1rem / 1.65 as the intro. Hierarchy by weight and color, not size:
   bold org + plain role on the left, year on the right, one grey note under it */
.history { list-style: none; padding: 0 0 0 1.25rem; margin: 1rem 0 0; font-size: 1rem; line-height: 1.65; }
.history li { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 1.5rem; margin-bottom: 1.25rem; color: var(--ink-strong); }
.history li:last-child { margin-bottom: 0; }
.history .org { font-weight: 600; }
.history .role { font-weight: 400; color: var(--ink); }
.history .year { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.history .history-note { grid-column: 1 / -1; color: var(--muted); }
.history .history-note strong { font-weight: 600; color: inherit; } /* bold, but same grey as the rest of the line */
/* Bullet's left edge sits on the same 1.25rem line as the history text above; item text follows after it */
.fun-list { list-style: none; padding: 0 0 0 1.25rem; margin: 1rem 0 0; font-size: 1rem; line-height: 1.65; color: var(--ink-strong); }
.fun-list li { position: relative; padding-left: 0.875rem; margin-bottom: 0.375rem; }
.fun-list li::before { content: ''; position: absolute; left: 0; top: calc(0.825em - 2.5px); width: 0.3125rem; height: 0.3125rem; border-radius: 50%; background: var(--muted); }

/* Cards */
.card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.5rem 1.75rem; }
.card { display: block; min-width: 0; }
.card-visual { aspect-ratio: 4 / 3; border-radius: 0.625rem; display: grid; place-items: center; background: color-mix(in oklch, var(--forest) 9%, var(--paper)); outline: 1px solid color-mix(in oklch, var(--forest) 12%, transparent); outline-offset: -1px; overflow: hidden; transition: transform 240ms cubic-bezier(.2, .8, .2, 1); }
.card-visual span { font-size: 1.5rem; font-weight: 600; color: color-mix(in oklch, var(--forest) 70%, var(--paper)); letter-spacing: -1px; }
.card-visual img { width: 100%; height: 100%; object-fit: contain; padding: 18%; }
.card-visual img.cover { object-fit: cover; padding: 0; }
.card-body { padding-top: 0.875rem; }

/* Home projects: two equal columns, square corners, one caption line */
.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.5rem 1.5rem; }
.project-grid .card-visual { aspect-ratio: 16 / 10; border-radius: 0; }
/* Alternative: add class "uneven" to .project-grid for wide + narrow rows that flip each row */
.project-grid.uneven { grid-template-columns: repeat(12, minmax(0, 1fr)); }
.project-grid.uneven > .card { grid-column: span 7; }
.project-grid.uneven > .card:nth-child(4n + 2), .project-grid.uneven > .card:nth-child(4n + 3) { grid-column: span 5; }
.project-grid.uneven .card-visual { aspect-ratio: auto; height: clamp(13.75rem, 24vw, max(20.25rem, 21.43vw)); /* grows with the column above 1512px */ }
/* .card p (margin: 0; line-height: 1.6) was overriding this and gluing the caption to the image.
   0.625rem + half-leading puts the glyphs ~0.8125rem under the image; 2.5rem row gap keeps each caption clearly with its own card (~3:1). */
.project-card .project-caption { margin: 0.625rem 0 0; font-size: 0.9375rem; line-height: 1.4; }
.project-name { color: var(--ink-strong); font-weight: 600; transition: color 150ms ease; }
.project-year { color: var(--muted); font-variant-numeric: tabular-nums; }
/* Card → case study: the name link stretches over the whole card; the ↗ sits above it and goes to the website */
.project-card { position: relative; }
.project-name.stretched::after { content: ''; position: absolute; inset: 0; }
.project-name.stretched:focus-visible { outline: none; }
.project-card:has(.stretched:focus-visible) .card-visual { outline: 2px solid var(--focus-ring); outline-offset: 0.25rem; }
.project-sep { color: var(--muted); }
/* Year and slashes sit above the card-wide link, so they are plain text (not clickable) */
.project-year, .project-sep { position: relative; z-index: 1; cursor: auto; }
.project-external { position: relative; z-index: 1; color: var(--accent); text-decoration: underline; text-underline-offset: 0.1875rem; text-decoration-color: color-mix(in oklch, var(--accent) 35%, transparent); transition: text-decoration-color 150ms ease; }
.project-external::before { content: ''; position: absolute; inset: -0.625rem -0.25rem; } /* ~2.5rem tall hit area */
@media (hover: hover) and (pointer: fine) {
  .has-case:hover:not(:has(.project-external:hover, .project-year:hover, .project-sep:hover)) .project-name { color: var(--accent); }
  .project-external:hover { text-decoration-color: var(--accent); }
}
.card-meta { display: flex; gap: 0.625rem; align-items: center; font-size: 0.8125rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.tag { padding: 2px 0.5rem; border-radius: 6.1875rem; border: 1px solid var(--line); }
.card h3 { font-size: 1.0625rem; font-weight: 600; margin: 0.625rem 0 0.25rem; }
.card p { font-size: 0.9375rem; line-height: 1.6; margin: 0; }
.card .remark { margin-top: 0.5rem; font-size: 0.8125rem; font-style: italic; color: var(--muted); }
.arrow { color: var(--accent); font-weight: 400; }

/* Writing */
.notes { list-style: none; padding: 0; margin: 0; font-size: 0.9375rem; line-height: 1.6; }
.notes li { display: grid; grid-template-columns: 6.875rem 1fr; gap: 1rem; padding: 0.875rem 0; border-top: 1px solid var(--line); }
.notes li:last-child { border-bottom: 1px solid var(--line); }

/* Gallery */
/* Two staggered columns (packed at build time in site.mjs); one column on phones, in list order */
.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; align-items: start; }
.gallery-column { display: flex; flex-direction: column; gap: 1.5rem; }
@media (max-width: 640px) {
  .gallery { display: flex; flex-direction: column; gap: 1.25rem; }
  .gallery-column { display: contents; }
}
.photo { margin: 0; }
.photo img { display: block; width: 100%; height: auto; border-radius: 0; background: color-mix(in oklch, var(--forest) 9%, var(--paper)); }
.photo-fill { border-radius: 0.375rem; background: linear-gradient(calc(var(--i) * 37deg), color-mix(in oklch, var(--forest) 22%, var(--paper)), color-mix(in oklch, var(--accent) 10%, var(--paper))); }
.photo.tall .photo-fill { aspect-ratio: 3 / 4; }
.photo.wide .photo-fill { aspect-ratio: 3 / 2; }
.photo.square .photo-fill { aspect-ratio: 1; }
.photo figcaption { font-size: 0.8125rem; color: var(--muted); padding-top: 0.375rem; }

/* About */

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .card-grid, .project-grid, .project-grid.uneven { grid-template-columns: 1fr; }
  .project-grid.uneven > .card:nth-child(n) { grid-column: auto; }
  .project-grid.uneven .card-visual { height: auto; aspect-ratio: 16 / 10; }
  .history { padding-left: 0; }
  .history .role { display: block; } /* role drops under the org on phones */
  .history .role-sep { display: none; }
  .notes li { grid-template-columns: 1fr; gap: 2px; }
}

/* ---- Polish ---- */
h1, h2, h3 { text-wrap: balance; }
.hero-intro p, .history .history-note, .card p { text-wrap: pretty; }
/* Long placeholder marks ("The AI Collective") stay centered and off the edges in narrow cards */
.card-visual span { padding: 0 1.25rem; text-align: center; text-wrap: balance; user-select: none; }
/* Contact links: 2.75rem-tall hit areas. Vertical extension (0.75rem) = half the row gap; horizontal (0.6875rem) = half the column gap, so neighbors never overlap */
.contact { gap: 1.5rem 1.375rem; line-height: 1.25rem; }
.contact a, .copy-email { position: relative; }
.contact a::before, .copy-email::before { content: ''; position: absolute; inset: -0.75rem -0.6875rem; }
@media (max-width: 640px) {
  /* Horizontal mobile nav: room to grow vertically, 0.625rem each side = half the 1.25rem gap */
  .navigation a::before { content: ''; position: absolute; inset: -0.5rem -0.625rem; }
}
/* Room under the hero for the expanding dropdowns is reserved by the script in site.mjs (reserveHeroSide). */

/* ---- Corner: local clock + light/dark toggle (after cynthwang.com, as in Figma) ---- */
.corner { position: absolute; top: 1.375rem; right: 1.5rem; z-index: 4; display: flex; align-items: center; gap: 0.625rem; }
.clock { height: 2.3125rem; min-width: 6.5rem; /* fits '10:00:00 AM', so the boxes don't shift when the hour gains a digit */ display: grid; place-items: center; padding: 0 0.875rem; background: var(--chip); color: var(--ink-strong); font: 500 0.8125rem/1 'Hanken Grotesk', Arial, sans-serif; font-variant-numeric: tabular-nums; letter-spacing: .02em; white-space: nowrap; box-shadow: var(--chip-shadow); }
.date { border: 0; transition: transform 300ms cubic-bezier(.2, .8, .2, 1); height: 2.3125rem; display: flex; align-items: center; gap: 0.4375rem; padding: 0 0.875rem 0 0.6875rem; background: var(--chip); color: var(--ink-strong); font: 500 0.8125rem/1 'Hanken Grotesk', Arial, sans-serif; font-variant-numeric: tabular-nums; letter-spacing: .02em; white-space: nowrap; box-shadow: var(--chip-shadow); }
.date:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 0.25rem; }
@media (hover: hover) { .date:hover { transform: translateY(-2px); } }
.date:active { transform: scale(.97); }
/* Season menu under the date box */
.season-picker { position: relative; }
.season-menu { position: absolute; top: calc(100% + 0.5rem); left: 0; min-width: 100%; display: grid; padding: 0.3125rem; background: var(--chip); -webkit-backdrop-filter: blur(0.625rem); backdrop-filter: blur(0.625rem); box-shadow: var(--chip-shadow); transform-origin: top left; animation: season-menu-in 160ms cubic-bezier(.2, .8, .2, 1); }
.season-menu[hidden] { display: none; }
@keyframes season-menu-in { from { opacity: 0; transform: translateY(-0.25rem) scale(.97); } }
.season-opt { display: flex; align-items: center; gap: 0.5625rem; width: 100%; padding: 0.5rem 0.625rem; border: 0; background: none; color: var(--ink-strong); font: 500 0.8125rem/1 'Hanken Grotesk', Arial, sans-serif; text-align: left; white-space: nowrap; }
.season-opt svg { width: 1rem; height: 1rem; flex: none; }
@media (pointer: coarse) { .season-opt { min-height: 2.75rem; } } /* finger-sized rows on touch screens (tablets) */
.season-opt small { font-size: 0.75rem; color: var(--muted); font-weight: 400; }
.season-opt::after { content: ''; width: 0.875rem; height: 0.875rem; margin-left: auto; flex: none; }
.season-opt[aria-checked='true']::after { background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat; } /* checkmark in the text color */
.season-opt span { margin-right: 0.875rem; }
.season-opt:focus { outline: none; }
.season-opt:hover, .season-opt:focus-visible { background: color-mix(in oklch, var(--ink-strong) 8%, transparent); }
.season-opt:focus-visible { box-shadow: inset 0 0 0 2px var(--focus-ring); } /* keyboard: same ring color as the date box and mode button */
.ic-auto { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
@media (prefers-reduced-motion: reduce) { .season-menu { animation: none; } }
/* Season icon in the date box: all four are in the HTML, <html data-season> (set in <head>) shows one */
.season-icon { display: grid; }
.season-icon svg { display: none; width: 1rem; height: 1rem; }
[data-season='winter'] .ic-winter, [data-season='spring'] .ic-spring, [data-season='summer'] .ic-summer, [data-season='fall'] .ic-fall { display: block; }
.ic-winter { fill: none; stroke: #5b8db8; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.ic-spring { fill: #ef9fb6; } .ic-spring .ic-center { fill: #f2c94c; }
.ic-summer { fill: #f2b632; } .ic-summer .ic-line { fill: none; stroke: #f2b632; stroke-width: 1.6; stroke-linecap: round; }
.ic-fall { fill: #e8853a; }
.night .ic-winter { stroke: #9cc3e6; }
.mode { width: 2.3125rem; height: 2.3125rem; display: grid; place-items: center; padding: 0; border: 0; background: var(--chip); color: var(--ink-strong); box-shadow: var(--chip-shadow); transition: transform 300ms cubic-bezier(.2, .8, .2, 1); }
.mode:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 0.25rem; }
@media (hover: hover) { .mode:hover { transform: translateY(-2px); } }
.mode:active { transform: scale(.96); }
.mode svg { width: 1.1875rem; height: 1.1875rem; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.mode .moon, .night .mode .sun { display: none; }
.night .mode .moon { display: block; }

html { scroll-behavior: smooth; }
/* Desktop: everything sized in rem is ~6% smaller (15px base). Phones keep 16px */
@media (min-width: 641px) { html { font-size: 93.75%; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

@media (max-width: 640px) {
  /* Top of the screen belongs to the mobile nav: toggle goes bottom-right */
  .corner { position: fixed; top: auto; left: auto; right: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom)); }
  .clock, .date { display: none; }
}

/* ---- Case study pages (/projects/<slug>). Text levels: 1 raspberry group label (Hanken 13) > 2 key insight (Newsreader serif ~26-30) >
   3 sub-point (Hanken 15/600) > 4 content (Hanken 15, grey). Captions/meta Hanken 12 muted.
   Reading only levels 1 + 2 should tell the whole story. ---- */
/* Page title: Newsreader, one step above the section headings (h2 ~26-30px) so it reads as the top of the page */
.case-title { max-width: 24ch; font-family: 'Newsreader', Georgia, serif; font-size: clamp(2.5rem, 4vw, 3.5rem); font-weight: 400; letter-spacing: -0.02em; line-height: 1.08; color: var(--ink-strong); margin: 0 0 0.5rem; text-wrap: balance; }
.case-body { max-width: 47.5rem; font-size: 1rem; line-height: 1.7; color: var(--ink); }
.case-body section { margin-top: 5rem; scroll-margin-top: 2.5rem; }
.case-body section:first-child { margin-top: 2.25rem; }
.case-body h2, .case-body h3, .case-body h4 { font-family: inherit; font-size: 1rem; font-weight: 600; letter-spacing: 0; line-height: 1.5; color: var(--ink-strong); }
.case-body .case-eyebrow { margin: 0 0 0.75rem; font-size: 0.875rem; font-weight: 500; line-height: 1.3; color: var(--accent); }
.case-body h2 { margin: 0 0 1rem; font-family: 'Newsreader', Georgia, serif; font-size: clamp(1.625rem, 2.4vw, 2rem); font-weight: 400; line-height: 1.2; letter-spacing: -0.01em; text-wrap: pretty; color: var(--ink-strong); } /* full column width; pretty only avoids a lone last word */
.case-body h3 { margin: 2.25rem 0 0.5rem; }
.case-body h4 { margin: 1.5rem 0 0.375rem; }
.case-body p { margin: 0 0 1rem; }
.case-body ul, .case-body ol { margin: 0 0 1rem; padding-left: 1.375rem; }
.case-body li { margin-bottom: 0.375rem; }
.case-body strong { color: var(--ink-strong); font-weight: 600; }
.case-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 0.1875rem; text-decoration-color: color-mix(in oklch, var(--accent) 40%, transparent); }
.case-body a:hover { text-decoration-color: var(--accent); }
.case-body blockquote { margin: 0 0 1rem; padding-left: 1rem; border-left: 2px solid var(--line); color: var(--muted); }
.case-body dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 2rem; margin: 1.5rem 0; padding: 1.25rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.case-body dl div { min-width: 0; }
.case-body dt { font-size: 0.8125rem; color: var(--muted); margin-bottom: 2px; }
.case-body dd { margin: 0; font-size: 1rem; line-height: 1.5; color: var(--ink-strong); }
.case-body .case-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; font-size: 0.8125rem; }
.case-body figure { margin: 1.75rem 0; }
.case-body figure img, .case-body figure video { display: block; width: 100%; height: auto; }
.case-body figcaption { margin-top: 0.625rem; font-size: 0.875rem; line-height: 1.5; color: var(--muted); text-align: center; text-wrap: balance; }
.case-body table { width: 100%; border-collapse: collapse; margin: 0 0 1rem; font-size: 0.875rem; }
.case-body th, .case-body td { text-align: left; padding: 0.5rem 0.75rem 0.5rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
/* Impact stats: number 24/600 + label 13 (same 3 sizes), hairline-separated cells */
.case-body .case-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 1px; margin: 0.5rem 0 1rem; background: var(--line); border: 1px solid var(--line); }
.case-body .case-stats div { display: grid; align-content: start; gap: 0.25rem; padding: 1.125rem 1rem; background: var(--paper); }
.case-body .case-stats strong { font-size: 1.5rem; font-weight: 600; line-height: 1.2; letter-spacing: -.2px; color: var(--ink-strong); font-variant-numeric: tabular-nums; }
.case-body .case-stats span { font-size: 0.875rem; line-height: 1.4; color: var(--muted); }
.case-body .case-meta { margin: -0.375rem 0 0.5rem; font-size: 0.8125rem; color: var(--muted); }
.case-body .case-remark { margin-top: 2.5rem; color: var(--muted); font-style: italic; font-synthesis: style; } /* no italic font file: let the browser slant it */
.case-body .case-accent { color: var(--ink-strong); font-variant-numeric: tabular-nums; } /* key numbers: dark + bold, not pink, so pink only ever means "link" */
.case-body em, .case-body i { font-synthesis: style; } /* no italic font file, so let the browser slant it */
.case-body .case-note { font-size: 0.875rem; line-height: 1.5; color: var(--muted); }
.case-body .case-partner { margin-top: 2.25rem; }
.case-body .case-logo { display: block; width: auto; max-width: 100%; height: 2rem; margin-bottom: 0.75rem; }
.case-body .case-logos { display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem 2.25rem; margin: 1.25rem 0 1.75rem; }
.case-body .case-logos img { display: block; width: auto; height: 1.75rem; }
/* Clickable screenshots: a slow, small zoom inside the frame on hover (plus the cursor label from data-note) */
.case-body .case-img-link { display: block; overflow: hidden; text-decoration: none; }
.case-body .case-img-link img { transition: transform 350ms cubic-bezier(0.2, 0.7, 0.2, 1); }
@media (hover: hover) { .case-body .case-img-link:hover img { transform: scale(1.03); } }
.case-body .case-img-link:active img { transform: scale(1.01); transition-duration: 120ms; }
.case-body .case-img-link:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 0.1875rem; }
@media (prefers-reduced-motion: reduce) { .case-body .case-img-link img { transition: none; transform: none !important; } }
.case-body .case-photos.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* Inline diagram (AI Copilot architecture): site font and colours, so it follows light/dark mode */
.case-body .case-diagram { display: block; width: 100%; height: auto; color: var(--muted); font-family: inherit; }
.case-diagram .dg-step { fill: var(--paper); stroke: var(--ink-strong); stroke-width: 1; }
/* colour roles: blue = data and tools, blue tint = privacy step, green = the model step */
.case-diagram { --dg-blue: #2f5f8f; }
:root.night .case-diagram { --dg-blue: #9dbbdc; }
.case-diagram .dg-tool { fill: color-mix(in oklch, var(--dg-blue) 9%, var(--paper)); stroke: var(--dg-blue); stroke-width: 1; stroke-dasharray: 3 3; }
.case-diagram .dg-privacy { fill: color-mix(in oklch, var(--dg-blue) 9%, var(--paper)); stroke: var(--dg-blue); }
.case-diagram .dg-model { fill: color-mix(in oklch, var(--forest) 16%, var(--paper)); stroke: var(--forest); stroke-width: 1.5; }
.case-diagram .dg-name { fill: var(--ink-strong); font-size: 0.8438rem; font-weight: 600; text-anchor: middle; }
.case-diagram .dg-sub { fill: var(--muted); font-size: 0.75rem; text-anchor: middle; }
.case-diagram .dg-title { fill: var(--muted); font-size: 0.75rem; letter-spacing: .02em; }
.case-diagram .dg-arrow { stroke: currentColor; stroke-width: 1; }
/* Tabs (pill style): <div class="case-tabs"> with a role="tablist" row and role="tabpanel" panels */
.case-body .case-tabs { margin-top: 3rem; padding-top: 1.75rem; border-top: 1px solid var(--line); }
.case-body .case-tablist { display: flex; flex-wrap: wrap; gap: 0.375rem 0.5rem; margin-bottom: 1.75rem; }
.case-body .case-tablist [role="tab"] { font: inherit; font-size: 0.9375rem; line-height: 1; padding: 0.4375rem 0.5625rem; border: 0; border-radius: 0; background: transparent; color: var(--muted); transition: color 150ms ease, background-color 150ms ease; }
@media (hover: hover) { .case-body .case-tablist [role="tab"][aria-selected="false"]:hover { color: var(--accent); } }
.case-body .case-tablist [role="tab"][aria-selected="true"] { background: var(--accent); color: var(--paper); }
.case-body .case-tablist [role="tab"]:focus-visible, .case-body .case-tabpanel:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.case-body .case-tabpanel > :first-child { margin-top: 0; }
.case-body .case-tabpanel:focus { outline: none; }
/* Two-column row: <div class="case-split"><div>text</div><figure>media</figure></div>.
   Add "flip" to put the media on the left. Stacks to one column on phones (text first). */
.case-body .case-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 2rem; align-items: center; margin: 2.25rem 0; }
.case-body .case-split > * { min-width: 0; margin: 0; }
.case-body .case-split > * > :first-child { margin-top: 0; }
.case-body .case-split > * > :last-child { margin-bottom: 0; }
.case-body .case-split.flip { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.case-body .case-split.flip > :first-child { order: 2; }
/* Three photos in a row: <figure class="case-photos"><img/><img/><img/><figcaption/></figure> */
.case-body .case-photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; }
.case-body .case-photos img { aspect-ratio: 3 / 2; object-fit: cover; }
.case-body .case-photos figcaption { grid-column: 1 / -1; margin-top: -2px; }
@media (max-width: 640px) {
  .case-body dl { grid-template-columns: 1fr; }
  .case-body .case-photos { grid-template-columns: 1fr; }
  .case-body .case-split, .case-body .case-split.flip { grid-template-columns: 1fr; gap: 1rem; }
  .case-body .case-split.flip > :first-child { order: 0; }
}

/* ---- Writing (Figma 'writing' frame: plain list) ---- */
.writing-title { font-family: 'Hanken Grotesk', Arial, sans-serif; font-size: 1.25rem; font-weight: 700; letter-spacing: 0; line-height: 1.3; color: var(--ink-strong); margin: 0 0 1rem; }
.writing-intro { margin: 0 0 2.5rem; font-size: 1rem; line-height: 1.65; max-width: 58ch; color: var(--muted); text-wrap: pretty; } /* same size as the homepage intro */
.page-writing:not(.page-post) .writing-title { margin-bottom: 2rem; } /* room between the title and the post list */
.writing-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.375rem; font-size: 1rem; line-height: 1.65; } /* same size as the homepage intro */
.writing-list li { display: grid; }
.writing-list a, .writing-list strong { width: fit-content; font-weight: 700; color: var(--ink-strong); transition: color 150ms ease; }
.writing-list span { color: var(--muted); font-variant-numeric: tabular-nums; }
@media (hover: hover) { .writing-list a:hover { color: var(--accent); } }

/* Gallery reveal: only when JS is running (.js-reveal). Opacity + transform only, soft ease-out. */
/* Slow, visible rise: 2.5rem over ~1.1s, fade slightly faster than the move so it never looks transparent at rest */
.gallery.js-reveal .photo { opacity: 0; transform: translateY(2.5rem); transition: opacity 900ms cubic-bezier(0.25, 0.6, 0.3, 1), transform 1100ms cubic-bezier(0.25, 0.6, 0.3, 1); transition-delay: var(--reveal-delay, 0ms); }
.gallery.js-reveal .photo.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .gallery.js-reveal .photo { opacity: 1; transform: none; transition: none; } }

/* ---- Gallery collage prototype: photos only, uneven placement, hover tag ---- */
.gallery-collage { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 1.5rem; row-gap: 3.5rem; align-items: start; }
.collage-item { position: relative; grid-column: var(--start) / span var(--span); margin-top: var(--top); }
.collage-item img { display: block; width: 100%; height: auto; }
/* "place / year" as a small handwritten sticker tag, tilted, tucked over the bottom-left corner */
.photo-tag { position: absolute; left: 0.75rem; bottom: 0.75rem; padding: 2px 0.375rem; background: var(--highlight); color: var(--ink-strong); font: 500 0.8125rem/1.35 'Hanken Grotesk', Arial, sans-serif; white-space: nowrap; pointer-events: none; opacity: 0; }
/* Mouse users: in-photo tags stay hidden (text kept for screen readers); a label follows the cursor instead */
.cursor-tag { position: fixed; left: 0; top: 0; z-index: 6; padding: 2px 0.375rem; background: var(--highlight); color: var(--ink-strong); font: 500 0.8125rem/1.35 'Hanken Grotesk', Arial, sans-serif; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity 150ms ease-out; will-change: transform; }
.cursor-tag.is-visible { opacity: 1; }
/* Hover note in running text: dotted underline (not a link); label follows the mouse via .cursor-tag,
   and shows under the words for keyboard focus and on touch (tap) */
.note { position: relative; text-decoration: underline dotted; text-decoration-thickness: 1.5px; text-underline-offset: 0.1875rem; text-decoration-color: color-mix(in oklch, var(--ink) 55%, transparent); }
.note:focus { outline: none; }
.note:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.note-tag { position: absolute; left: 0; top: calc(100% + 0.375rem); z-index: 6; padding: 2px 0.375rem; background: var(--highlight); color: var(--ink-strong); font: 500 0.8125rem/1.35 'Hanken Grotesk', Arial, sans-serif; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity 150ms ease-out; }
.note:focus-visible .note-tag { opacity: 1; }
@media (hover: none) { .note:focus .note-tag { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .note-tag { transition: none; } }
@media (prefers-reduced-motion: reduce) { .cursor-tag { transition: none; } }
/* No hover on touch: show the tags all the time */
@media (hover: none) { .photo-tag { display: none; } } /* touch: no cursor to reveal it, so photos stand alone */
@media (max-width: 640px) {
  /* Phones: one column, but alternate widths/sides so it still feels uneven */
  .gallery-collage { grid-template-columns: 1fr; row-gap: 2.25rem; }
  .collage-item { grid-column: 1; margin-top: 0; width: 88%; }
  .collage-item:nth-child(even) { justify-self: end; width: 76%; }
}

/* ---- Gallery grid: two columns, same tile size, same gap across and down ---- */
.gallery-grid { --gap: 1.375rem; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.grid-item { position: relative; margin: 0; }
/* Uniform 3:2 tiles; a future portrait/square file gets center-cropped to keep rows aligned */
.grid-item img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; }
/* Tag sits inside the tile so it never spills into the gap */
.gallery-grid .photo-tag { left: 0.75rem; bottom: 0.75rem; }
@media (max-width: 640px) { .gallery-grid { grid-template-columns: 1fr; --gap: 1rem; } }

/* ---- Gallery photo viewer (<dialog>) ---- */
.gallery .photo[role='button']:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 0.25rem; }
html:has(.lightbox[open]) { overflow: hidden; } /* no page scroll behind the viewer */
.lightbox { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; color: var(--ink-strong); overflow: hidden; }
.lightbox::backdrop { background: color-mix(in oklch, var(--paper) 94%, transparent); }
.lightbox-figure { height: 100%; margin: 0; padding: 4.5rem 6rem 3rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.875rem; }
.lightbox-img { display: block; max-width: min(75rem, 100%); max-height: calc(100dvh - 11.25rem); width: auto; height: auto; object-fit: contain; box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 1.5rem 3rem -1.5rem rgba(40,50,60,.45); }
.lightbox-caption { padding: 2px 0.375rem; background: var(--highlight); font: 500 0.8125rem/1.35 'Hanken Grotesk', Arial, sans-serif; }
.lightbox-btn { position: absolute; width: 2.3125rem; height: 2.3125rem; display: grid; place-items: center; padding: 0; border: 0; background: var(--chip); color: var(--ink-strong); box-shadow: var(--chip-shadow); font: 400 1.0625rem/1 'Hanken Grotesk', Arial, sans-serif; transition: transform 150ms ease-out; }
.lightbox-btn:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 0.25rem; }
.lightbox-btn:active { transform: scale(.96); }
.lightbox-close { top: 1.375rem; right: 1.5rem; }
.lightbox-prev, .lightbox-next { top: 50%; margin-top: -1.125rem; }
.lightbox-prev { left: 1.75rem; }
.lightbox-next { right: 1.75rem; }
/* Enter: soft fade + slight scale up; exit is quicker and quieter */
.lightbox[open] .lightbox-figure, .lightbox[open]::backdrop { animation: lightbox-in 220ms cubic-bezier(0.32, 0.72, 0, 1); }
.lightbox.is-closing .lightbox-figure, .lightbox.is-closing::backdrop { animation: lightbox-out 150ms ease-in forwards; }
@keyframes lightbox-in { from { opacity: 0; transform: scale(.97); } }
@keyframes lightbox-out { to { opacity: 0; transform: scale(.98); } }
.lightbox[open]::backdrop { animation-name: lightbox-fade-in; }
.lightbox.is-closing::backdrop { animation-name: lightbox-fade-out; }
@keyframes lightbox-fade-in { from { opacity: 0; } }
@keyframes lightbox-fade-out { to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .lightbox-figure, .lightbox::backdrop { animation: none !important; } }
@media (max-width: 640px) {
  .lightbox-figure { padding: 4rem 0.75rem 6rem; }
  .lightbox-img { max-height: calc(100dvh - 12.5rem); }
  .lightbox-prev, .lightbox-next { top: auto; bottom: calc(1.5rem + env(safe-area-inset-bottom)); margin-top: 0; }
  .lightbox-prev { left: calc(50% - 2.9375rem); }
  .lightbox-next { right: calc(50% - 2.9375rem); }
}

/* Work: cards follow right under the intro and slide down when a dropdown opens */
@media (min-width: 901px) { .page-work .value-prop + .content-section { margin-top: 3.125rem; } } /* gap from the value prop to project cards */

/* The photo viewer takes initial focus on its content (not the ✕), so no ring appears when opened with the mouse */
.lightbox-figure:focus { outline: none; }

/* Card hover: frame stays put, the cover slowly zooms inside it; slight press on click.
   Pointing at the end link (or the plain year/slashes) leaves the card still — only that link reacts.
   Only cards that open a case study move. Mouse/trackpad only; off for reduced motion. */
.project-card .card-visual .cover { transition: transform 450ms cubic-bezier(0.32, 0.72, 0, 1); }
.project-card.has-case .card-visual { transition: transform 150ms ease-out; }
@media (hover: hover) and (pointer: fine) {
  .has-case:hover:not(:has(.project-external:hover, .project-year:hover, .project-sep:hover)) .card-visual .cover { transform: scale(1.035); }
}
.has-case:active:not(:has(.project-external:active, .project-year:active, .project-sep:active)) .card-visual { transform: scale(.985); }
@media (prefers-reduced-motion: reduce) {
  .project-card .card-visual .cover, .project-card.has-case .card-visual { transition: none; }
  .has-case:hover .card-visual .cover, .has-case:active .card-visual { transform: none; }
}

/* ---- Mountain photo at the top: same photo as the bottom, cropped to the peak + lake, fading down into the page ---- */
/* Height adapts to the window: window height minus 26.75rem (= the band Patt liked at 80% browser zoom on a laptop), 8.75rem–23.75rem */
:root { --top-band: clamp(140px, calc(100vh - 485px), 380px); } /* px, so it doesn't shrink with the smaller desktop base size */
.landscape-top { position: absolute; top: 0; left: 0; right: 0; height: var(--top-band); background: url('/assets/landscape-2400.jpg') center 51% / cover no-repeat; mask-image: linear-gradient(#000 55%, transparent); opacity: .75; pointer-events: none; } /* crop: cloud-capped peak + ridge, a wide panoramic strip */
/* Name straddles the photo edge: its vertical center sits on the bottom of the band (end of the fade),
   so the top half is over the (fading) photo and the bottom half is on the background. 1.75rem = half the name's height.
   Dial: the 1 multiplier — lower it to move the name up into the photo. */
main { padding-top: calc(var(--top-band) * 1 - 1.75rem); }
.navigation { top: calc(var(--top-band) * 1 - 1.1875rem); }
:root.night .landscape-top { opacity: .4; filter: brightness(.75); }
/* Seasonal particles (snow / petals / fireflies / leaves) drawn on a canvas over the band (script in site.mjs); same fade so they disappear where the photo ends */
.season-fx { position: absolute; top: 0; left: 0; width: 100%; height: var(--top-band); mask-image: linear-gradient(#000 50%, transparent); pointer-events: none; }
.night .season-fx { opacity: .8; }
@media (max-width: 640px) {
  :root { --top-band: 14.375rem; }
  .landscape-top, .season-fx { top: 3.875rem; } /* start below the fixed mobile nav so the peak isn't hidden */
  .navigation { top: 0; }
  main { padding-top: calc(3.875rem + var(--top-band) + 0.75rem); }
}
.map-block .map-accent { font-weight: 600; color: var(--accent); }

/* ---- Locked case study (password form in place of the body) ---- */
.case-body:focus { outline: none; } /* focused only to hold focus after unlocking */
.case-body:has(.case-lock) { max-width: none; } /* locked: let the card center under the hero, not the text column */
.case-lock { display: grid; justify-items: center; gap: 0.75rem; max-width: 30rem; margin: 3rem auto 1.5rem; padding: 2rem 1.75rem 1.75rem; text-align: center;
  background: var(--chip); box-shadow: var(--chip-shadow); }
.case-lock-icon { display: block; color: var(--accent); transform-origin: 50% 20%; }
.case-body .case-lock-msg { margin: 0; max-width: 38ch; font-size: 0.9375rem; line-height: 1.6; color: var(--ink); text-wrap: balance; }
.case-lock-form { display: grid; justify-items: center; gap: 0.5rem; width: 100%; margin-top: 0.5rem; }
.case-lock-row { display: flex; gap: 0.5rem; width: 100%; max-width: 20rem; }
.case-lock-row input { flex: 1; min-width: 0; height: 2.5rem; padding: 0 0.75rem; border: 1px solid var(--line); border-radius: 0; background: var(--paper); color: var(--ink-strong); font: 400 1rem/1 'Hanken Grotesk', Arial, sans-serif; transition: border-color 150ms ease; } /* 1rem: no iOS zoom */
.case-lock-msg a { white-space: nowrap; }
.case-lock-row input::placeholder { color: var(--muted); opacity: .7; }
.case-lock-row input:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.case-lock-row input[aria-invalid='true'] { border-color: var(--accent); }
.case-lock-row button { height: 2.5rem; padding: 0 1.125rem; border: 0; background: var(--accent); color: #fff; font: 600 0.8125rem/1 'Hanken Grotesk', Arial, sans-serif; letter-spacing: .02em; transition: transform 150ms ease-out, background-color 150ms ease; }
@media (hover: hover) and (pointer: fine) { .case-lock-row button:hover { background: color-mix(in oklch, var(--accent) 88%, black); } }
.case-lock-row button:active { transform: scale(.97); }
.case-lock-row button:disabled { opacity: .6; }
.case-lock-row button:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.case-body .case-lock-error { margin: 0; font-size: 0.8125rem; color: var(--accent); }
/* Wrong password: the padlock gives a little "nope" wiggle, the row a small shake */
.case-lock.is-wrong .case-lock-icon { animation: lock-nope 400ms ease-in-out; }
.case-lock.is-wrong .case-lock-row { animation: lock-shake 320ms ease-in-out; }
@keyframes lock-nope { 25% { transform: rotate(-10deg); } 50% { transform: rotate(8deg); } 75% { transform: rotate(-4deg); } }
@keyframes lock-shake { 25% { transform: translateX(-5px); } 50% { transform: translateX(4px); } 75% { transform: translateX(-2px); } }
@media (prefers-reduced-motion: reduce) { .case-lock.is-wrong .case-lock-icon, .case-lock.is-wrong .case-lock-row { animation: none; } }

/* ---- Typhoon cover: live version of the opentyphoon.ai floating logos (markup: typhoonCover in site.mjs) ---- */
.cover-typhoon { position: relative; width: 100%; height: 100%; overflow: hidden; container-type: size;
  background: radial-gradient(ellipse 70% 60% at 50% 45%, #2a2d4c 0%, transparent 70%), linear-gradient(#21243f, #1c2137);
  /* faint grid, like the original */
  --grid: rgba(150, 160, 230, .05); }
.cover-typhoon::before { content: ''; position: absolute; inset: 0; background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 10cqw 10cqw; }
.ty-ghosts { position: absolute; inset: -10%; }
.cover-typhoon .ty-ghost { position: absolute; width: 7.5cqw; height: auto; opacity: 0; will-change: transform, opacity;
  animation: ty-float linear infinite; }
.cover-typhoon .ty-a { animation-timing-function: cubic-bezier(.45, 0, .55, 1); } /* the original's easeInOut */
.cover-typhoon .ty-b { width: 6cqw; }                                                /* smaller layer stays linear */
/* Drift + one full flip per loop. Opacity starts and ends at 0, so the jump back to the start is never seen */
@keyframes ty-float {
  0%   { transform: perspective(40cqw) translate(0, 0) rotateY(0deg); opacity: 0; }
  50%  { opacity: var(--peak); }
  100% { transform: perspective(40cqw) translate(var(--dx), var(--dy)) rotateY(360deg); opacity: 0; }
}
.ty-lockup { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 4.5cqw; }
.ty-lockup img { width: 14.5cqw; height: auto; padding: 0; }
.ty-lockup span { font: 700 9.5cqw/1 'Hanken Grotesk', Arial, sans-serif; letter-spacing: .02em; color: #fff; }
/* Hover zoom moves the whole cover, ghosts included */
.project-card .card-visual .cover-typhoon { transform-origin: center; }
@media (prefers-reduced-motion: reduce) {
  .cover-typhoon .ty-ghost { animation: none; opacity: .12; } /* still frame: logos scattered, like the old static cover */
}
.card-visual .cover-typhoon img { height: auto; padding: 0; object-fit: fill; } /* undo the generic card logo padding */

/* ---- Speedboat cover: rocking boat + passing bird (markup: speedboatCover in site.mjs) ---- */
.cover-speedboat { position: relative; width: 100%; height: 100%; overflow: hidden; container-type: size; }
.card-visual .cover-speedboat img { position: absolute; padding: 0; height: auto; object-fit: fill; }
.card-visual .cover-speedboat .sb-scene { inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* Placed exactly where the boat sat in the screenshot; rocks around its keel */
.card-visual .cover-speedboat .sb-boat { left: 44.33%; top: 81.33%; width: 11.25%; transform-origin: 50% 95%; will-change: transform;
  animation: sb-rock 6s ease-in-out infinite; }
@keyframes sb-rock {
  0%, 100% { transform: rotate(0) translateY(0); }
  33% { transform: rotate(-2deg) translateY(2%); }
  66% { transform: rotate(2deg) translateY(-2%); }
}
/* Bird: crosses in ~4.4s, then the sky is empty ~3.6s before the next one (8s loop) */
.card-visual .sb-bird { padding: 0; } /* undo the generic .card-visual span padding */
.sb-bird { position: absolute; left: 0; top: 45%; width: 5cqw; aspect-ratio: 2 / 1; will-change: transform; animation: sb-fly 8s linear infinite; }
.sb-bird svg { display: block; width: 100%; height: 100%; overflow: visible; fill: #7a73c4; opacity: .75; }
.sb-wing { transform-origin: 20px 12px; animation: sb-flap 420ms ease-in-out infinite alternate; }
.sb-wing-r { animation-name: sb-flap-r; }
@keyframes sb-flap { from { transform: rotate(-14deg); } to { transform: rotate(22deg); } }
@keyframes sb-flap-r { from { transform: rotate(14deg); } to { transform: rotate(-22deg); } }
@keyframes sb-fly {
  0%   { transform: translate(-6cqw, 0); }
  15%  { transform: translate(24cqw, -2.5cqh); }
  30%  { transform: translate(54cqw, 1cqh); }
  45%  { transform: translate(84cqw, -2cqh); }
  55%, 100% { transform: translate(106cqw, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .card-visual .cover-speedboat .sb-boat { animation: none; }
  .sb-bird { display: none; }
}

/* ---- AI Copilot cover: app window playing the demo loop (markup: copilotCover in site.mjs) ---- */
.cover-copilot { position: relative; width: 100%; height: 100%; overflow: hidden; container-type: size;
  /* very light lavender wash in Typhoon's purple (#726bdf), with the Typhoon cover's faint grid; logos PNG is transparent */
  background: radial-gradient(ellipse 70% 60% at 85% 8%, #e2defc 0%, transparent 70%), radial-gradient(ellipse 80% 70% at 10% 95%, #f9f8ff 0%, transparent 70%),
    linear-gradient(160deg, #f1effe, #e9e6fc);
  --grid: rgba(114, 107, 223, .07); }
.cover-copilot::before { content: ''; position: absolute; inset: 0; background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 10cqw 10cqw; }
.card-visual .cover-copilot .cp-logos { position: absolute; top: 0; right: 0; width: 22.5cqw; height: auto; padding: 0; object-fit: fill; }
/* PromptHub: the app window centred on the brand's soft indigo-to-teal wash (after the Product Hunt gallery) */
.cover-prompthub { position: relative; width: 100%; height: 100%; overflow: hidden; container-type: size;
  background: radial-gradient(ellipse 60% 70% at 0% 0%, #e4e3fd 0%, transparent 70%), radial-gradient(ellipse 60% 70% at 100% 100%, #d3f5ec 0%, transparent 70%), #eef3fb; }
.cover-prompthub .cp-window { left: 50%; top: 50%; width: 82cqw; transform: translate(-50%, -50%); } /* centred, as big as fits with an even margin */
.cp-window { position: absolute; left: 5cqw; top: 12cqh; width: 78cqw; overflow: hidden; border-radius: 1.2cqw; background: #fbfafa;
  box-shadow: 0 1px 2px rgba(30, 50, 60, .12), 0 2.5cqw 5cqw -1.5cqw rgba(30, 60, 80, .35); }
.cp-window video { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 772; }
/* Title bar with the three dots: the video is zoomed past the app's own one, so the window still reads as an app */
.cp-window::before { content: ''; display: block; height: 3cqw; border-bottom: 1px solid #ebe8e8; background:
  radial-gradient(circle at 2.6cqw 50%, #ec6a5e .55cqw, transparent .6cqw), radial-gradient(circle at 4.4cqw 50%, #f4bf4f .55cqw, transparent .6cqw),
  radial-gradient(circle at 6.2cqw 50%, #61c554 .55cqw, transparent .6cqw), #f6f4f4; }

/* ---- Writing post (/writing/<slug>): blog-style reading column. Same fonts and palette, larger type, narrower measure ---- */
.post { max-width: none; }
.post-header { margin-bottom: 2.5rem; padding-bottom: 1.75rem; border-bottom: 1px solid var(--line); }
.writing-title, .post-header .writing-title { font-size: clamp(1.5rem, 2.6vw, 1.875rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 0.75rem; text-wrap: balance; }
.post-meta { margin: 0; font-size: 0.8125rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.post-body { max-width: 68ch; font-size: 1rem; line-height: 1.7; } /* same body size as About and project pages; ~68 characters per line */
.post-body > p:first-child { font-size: 1rem; line-height: 1.7; color: var(--ink-strong); text-wrap: pretty; } /* lead paragraph */
.post-body p { margin-bottom: 1.25rem; text-wrap: pretty; }
.post-body h2 { margin: 2.5rem 0 0.75rem; font-size: 1.25rem; font-weight: 500; letter-spacing: -0.01em; line-height: 1.35; }
.post-body h3 { margin: 1.75rem 0 0.5rem; font-size: 1rem; }
.post-body ul, .post-body ol { margin: 0 0 1.5rem; padding-left: 1.25rem; }
.post-body li { margin-bottom: 0.5rem; padding-left: 0.25rem; color: var(--ink-strong); }
.post-body li::marker { color: var(--accent); }
.post-body li .by { color: var(--muted); }
.post-body blockquote { margin: 1.75rem 0; padding: 0.25rem 0 0.25rem 1.25rem; border-left: 3px solid var(--accent); font-size: 1rem; color: var(--ink-strong); font-style: italic; font-synthesis: style; /* no italic file: let the browser slant it, like case-study emphasis */ }
.post-body figure { margin: 2.25rem 0; }
.post-body img { display: block; max-width: 100%; height: auto; border-radius: 6px; }
.post-body hr { border: 0; margin: 2.75rem 0; text-align: center; color: var(--muted); }
.post-body hr::before { content: '* * *'; letter-spacing: 0.75em; }
.post-body code { font-size: 0.9em; padding: 0.1em 0.3em; border-radius: 4px; background: color-mix(in oklch, var(--ink) 8%, transparent); }
.post-body .fn-ref { font-size: 0.75em; line-height: 0; }
.post-body .fn-ref a { text-decoration: none; padding: 0 0.1em; }
.post-body .footnotes { margin-top: 3.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); font-size: 0.875rem; line-height: 1.6; color: var(--muted); }
.post-body .fn-back { text-decoration: none; }
.post-body :target { scroll-margin-top: 2.5rem; }

/* Back to the Writing list: just the arrow, with a 44px hit area. Sits in the space reserved above the content (net-zero margins), so the title lines up with other pages */
.post-back { align-self: flex-start; display: inline-flex; align-items: center; justify-content: center; min-width: 2.75rem; min-height: 2.75rem; margin: -3.25rem 0 0.5rem -0.75rem; font-size: 1.25rem; line-height: 1; color: var(--muted); text-decoration: none; transition: color 150ms ease, transform 150ms ease; }
@media (hover: hover) { .post-back:hover { color: var(--accent); transform: translateX(-2px); } }
@media (prefers-reduced-motion: reduce) { .post-back { transition: color 150ms ease; } .post-back:hover { transform: none; } }

/* ---- Case study page layout: no mountain band; the project's cover is the top of the page, and a section menu
   takes the site nav's place on the left (← Work, then one link per section; the one you're reading is raspberry) ---- */
main.page-case { margin-left: max(15rem, var(--center-gap)); padding-top: 5.5rem; } /* cover starts below the date / clock / theme buttons */
main.page-case::before { content: none; }
.case-cover { margin: 0 0 2.75rem; }
.case-cover img { display: block; width: 100%; height: auto; aspect-ratio: 5 / 2; object-fit: cover; }
.case-nav { position: fixed; top: 5.5rem; left: 1.5rem; width: 11.5rem; max-height: calc(100vh - 6rem); overflow-y: auto; scrollbar-width: none; padding-left: 0.75rem; margin-left: -0.75rem; font-size: 0.875rem; }
.case-nav-back { display: inline-flex; align-items: center; gap: 0.375rem; margin-bottom: 1.75rem; color: var(--ink-strong); line-height: 1.6875rem; transition: color 150ms ease; }
.case-nav-arrow { display: inline-block; transition: transform 150ms ease; }
@media (hover: hover) { .case-nav-back:hover { color: var(--accent); } .case-nav-back:hover .case-nav-arrow { transform: translateX(-2px); } }
.case-nav-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.case-nav-list:empty { display: none; }
.case-nav-list a { position: relative; display: block; padding: 0.1875rem 0; color: var(--muted); line-height: 1.35; text-wrap: pretty; transition: color 150ms ease; }
.case-nav-list a:hover, .case-nav-list a[aria-current] { color: var(--accent); }
.case-nav-list a[aria-current]::before { content: ''; position: absolute; left: -0.75rem; top: 0.25rem; bottom: 0.25rem; width: 2px; background: var(--accent); }
@media (max-width: 640px) {
  /* Phones: the menu is the same fixed top row as the site nav, scrolling sideways; the cover runs edge to edge */
  .case-nav { top: 0; left: 0; right: 0; z-index: 2; width: auto; max-height: none; margin: 0; display: flex; align-items: center; gap: 1.25rem; padding: 1.5rem 1.5rem 0.875rem; background: var(--paper); overflow-x: auto; white-space: nowrap; }
  .case-nav-back { flex: none; margin: 0; }
  .case-nav-list { flex-direction: row; gap: 1.25rem; }
  .case-nav-list a { padding: 0; line-height: 1.6875rem; white-space: nowrap; }
  .case-nav-list a[aria-current]::before { left: 0; right: 0; top: auto; bottom: -0.1875rem; width: auto; height: 2px; }
  main.page-case { margin: 0 1rem; padding-top: 3.875rem; }
  .case-cover { margin: 0 -1rem 2rem; }
  .page-case .case-body section { scroll-margin-top: 5rem; } /* clear the fixed menu row */
}
@media (prefers-reduced-motion: reduce) { .case-nav-arrow { transition: none; } }
