/* ==========================================================================
   Yomi Lebi — Swiss Grid, hot pink with rough outlines
   ========================================================================== */

:root {
  --paper: #FFFFFF;
  --ink: #0A0A0A;
  --grey: #6A6A6A;       /* 5.4:1 on white */
  --body: #2A2A2A;
  --surface: #F2F2F2;
  --pink: #FF2D87;       /* fills and shapes only; text on pink is always ink */
  --ol-w: 3.5px;         /* rough outline weight */
  --ol-color: var(--ink);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --ease-wipe: cubic-bezier(.7, 0, .2, 1);
  --sans: 'Inter Tight', Helvetica, Arial, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overflow-x: clip; /* iOS Safari still side-scrolls with hidden alone */
}
img, video { display: block; max-width: 100%; }
a { color: inherit; }
/* touch: our pressed states replace the grey system tap flash */
a, button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
/* display type never runs off a narrow screen */
h1, h2, .p-title, .next-name { overflow-wrap: break-word; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

.mono { font-family: var(--mono); }
.muted { color: var(--grey); }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 48px); }
.g12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; }
.skip {
  position: absolute; left: 16px; top: -60px; z-index: 10;
  background: var(--ink); color: #fff; padding: 12px 16px; text-decoration: none;
}
.skip:focus { top: 16px; }

/* --------------------------------------------------------------------------
   Rough outline system (markup generated by js/rough.js)
   -------------------------------------------------------------------------- */
.rough { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.fill-pink { fill: var(--pink); }
.fill-ink { fill: var(--ink); }
.ol {
  fill: none;
  stroke: var(--ol-color);
  stroke-width: var(--ol-w);
  stroke-linejoin: miter;
  stroke-miterlimit: 8;
  d: var(--rough);
  transform: translate(1.4px, 1.6px); /* off-register at rest */
  transition: transform .35s var(--ease), d .35s var(--ease);
}
/* hover or keyboard focus: the outline snaps onto the shape */
:is(a, button, .fit-host):is(:hover, :focus-visible, :active) .ol { transform: none; d: var(--fit); }
.on-dark { --ol-color: #FFFFFF; }

/* generative art */
.art { position: absolute; inset: 0; }
.shape { position: absolute; inset: 0; transition: transform .5s var(--ease); }
.shape svg { display: block; width: 100%; height: 100%; overflow: visible; }

/* --------------------------------------------------------------------------
   Header + marker links
   -------------------------------------------------------------------------- */
.site-head { padding-top: 24px; }
.site-head .g12 { align-items: start; font-size: 12px; line-height: 1.5; border-bottom: 2px solid var(--ink); padding-bottom: 16px; }
.brand { grid-column: span 3; text-decoration: none; font-weight: 500; justify-self: start; }
.head-col { grid-column: span 3; color: var(--grey); }
.nav { grid-column: span 3; display: flex; gap: 20px; justify-content: flex-end; }

.nl { position: relative; isolation: isolate; text-decoration: none; padding: 4px 6px; margin: 0 -6px; }
.nl > .mk {
  position: absolute; left: 0; right: 0; bottom: 0; height: 72%; z-index: -1;
  clip-path: inset(0 100% 0 0); transition: clip-path .3s var(--ease-wipe);
}
.nl:is(:hover, :focus-visible, :active) > .mk { clip-path: inset(-8px); }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  position: relative; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: space-between; gap: 28px;
  min-height: 52px; padding: 0 20px;
  background: var(--ink); color: #FFFFFF;
  text-decoration: none; font-size: 15px; font-weight: 600;
  transition: background-color .2s ease, color .2s ease, box-shadow .2s ease;
}
.btn > .hl { position: absolute; inset: 0; z-index: -1; opacity: 0; transform: scale(.96); transition: opacity .2s ease, transform .25s var(--ease); }
.btn:is(:hover, :focus-visible, :active) { background: transparent; color: var(--ink); box-shadow: none; }
.btn:is(:hover, :focus-visible, :active) > .hl { opacity: 1; transform: none; }
.btn:active > .hl { transform: scale(.98); }
.btn .ar { flex-shrink: 0; transition: transform .25s ease; }
.btn:is(:hover, :focus-visible, :active) .ar { transform: translateX(4px); }
.btn--ghost { background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.btn--light { background: #FFFFFF; color: var(--ink); min-width: min(280px, 100%); }

/* --------------------------------------------------------------------------
   Home: hero
   -------------------------------------------------------------------------- */
.hero { padding-top: clamp(56px, 9vw, 120px); padding-bottom: clamp(72px, 10vw, 140px); }
.hero h1 { margin: 0; font-size: clamp(64px, 14vw, 196px); font-weight: 800; line-height: .86; letter-spacing: -.055em; }
.mask { display: block; overflow: hidden; padding-bottom: .05em; }
.mask > span { display: block; animation: rise .55s var(--ease) both; }
.mask + .mask > span { animation-delay: .07s; }
.dot {
  display: inline-block; position: relative;
  width: .17em; height: .17em; margin-left: .05em;
  --ol-w: 4.5px;
  animation: stamp .4s .45s var(--ease) both;
}
.hero-row { margin-top: 56px; row-gap: 32px; }
.hero-lede { grid-column: 1 / span 5; margin: 0; font-size: clamp(20px, 2vw, 26px); line-height: 1.3; font-weight: 500; letter-spacing: -.01em; }
.hero-cta { grid-column: 8 / span 5; display: flex; flex-direction: column; gap: 10px; }
.wipe-in { animation: wipe .5s var(--ease-wipe) both; }
.wipe-in.d1 { animation-delay: .2s; }
.wipe-in.d2 { animation-delay: .3s; }

/* section heads */
/* baseline, not end: the 12px index must sit on the heading's baseline, not under its descenders */
.sec-head { align-items: baseline; margin-bottom: 32px; }
.sec-head .idx { grid-column: span 3; font-size: 12px; color: var(--grey); }
.sec-head h2 { grid-column: span 9; margin: 0; font-size: clamp(36px, 5vw, 64px); font-weight: 700; letter-spacing: -.04em; line-height: 1; }

/* --------------------------------------------------------------------------
   Project cards
   -------------------------------------------------------------------------- */
.work { padding-bottom: 140px; }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.card { position: relative; display: block; text-decoration: none; color: var(--ink); border-top: 2px solid var(--ink); padding-top: 14px; }
.card .bar {
  position: absolute; left: 0; right: 0; top: -6px; height: 10px;
  clip-path: inset(-8px 100% -8px 0); transition: clip-path .4s var(--ease-wipe);
}
.card:is(:hover, :focus-visible, :active) .bar { clip-path: inset(-8px); }
/* The bar is only visible on touch, so its outline is always the fitted one.
   Morphing it during the wipe smeared the leading edge. */
.card .bar .ol { d: var(--fit); transform: none; transition: none; }
.card:focus-visible { outline-offset: 6px; }
.card-meta { display: flex; justify-content: space-between; font-size: 12px; }
.sq { position: relative; aspect-ratio: 1 / 1; background: var(--surface); overflow: hidden; margin-top: 14px; }
.sq > img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.card:is(:hover, :focus-visible, :active) .sq > img { transform: scale(1.04); }
/* diagram thumbnail (cards and the next-project thumb): type scales with the square */
.sq, .next-thumb { container-type: inline-size; }
.dg { position: absolute; inset: 0; font: 500 clamp(8px, 3.7cqw, 13px)/1 var(--mono); color: var(--ink); transition: transform .3s var(--ease); }
/* The diagram is drawn in the top 78% to clear the "View project" bar. With a cursor it rests
   centred and steps up as the bar slides in; on touch the bar is always there, so it stays up. */
@media (hover: hover) {
  .card .dg { transform: translateY(8%); }
  .card:is(:hover, :focus-visible, :active) .dg { transform: none; }
}
.dg > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.dg path { fill: none; stroke: var(--ink); stroke-width: 2px; vector-effect: non-scaling-stroke; }
.dg-n {
  position: absolute; display: flex; align-items: center; justify-content: center;
  background: var(--surface); border: 2px solid var(--ink); white-space: nowrap;
}
/* the next-project thumb has no "View project" bar, so the same labelled diagram sits centred */
.next-thumb .dg { transform: translateY(8%); }
.dg-ink { background: var(--ink); color: var(--paper); }
.dg-pink { background: none; border: 0; isolation: isolate; }
.dg-hl { position: absolute; inset: 0; z-index: -1; }
/* pink tag on a screenshot thumbnail (cards and the next-project thumb) */
.sq-tag { position: absolute; top: 8%; right: 8%; width: 16%; aspect-ratio: 1 / 1; transition: transform .5s var(--ease); }
.card:is(:hover, :focus-visible, :active) .sq-tag { transform: rotate(90deg); }
.card:is(:hover, :focus-visible, :active) .s1 { transform: translate(5%, -5%); }
.card:is(:hover, :focus-visible, :active) .s2 { transform: rotate(90deg); }
.view {
  position: absolute; left: 0; right: 0; bottom: 0; height: 44px;
  display: flex; align-items: center; justify-content: space-between; padding: 0 14px;
  background: var(--ink); color: #FFFFFF; font-size: 13px;
  transform: translateY(100%); transition: transform .3s var(--ease);
}
.card:is(:hover, :focus-visible, :active) .view { transform: none; }
.card h3 { margin: 16px 0 6px; font-size: 26px; font-weight: 700; letter-spacing: -.03em; }
.card p { margin: 0 0 14px; font-size: 15px; line-height: 1.45; color: #3A3A3A; }
/* one proof line per card (the `stat` field): the number a reviewer should leave with */
.card .card-stat { margin: 0 0 12px; padding-top: 10px; border-top: 1px solid var(--ink); font: 500 12px/1.5 var(--mono); color: var(--ink); }
/* The grid always starts at the left edge and fills rightwards as projects are added: each card
   is 3 of the 12 columns, so the second card's left edge sits under the section heading. */
/* Cards in a row share their row lines (meta, square, title, tagline, stat, tags), so a tagline
   or stat that wraps on one card can't push its neighbour's rows out of line. */
@supports (grid-template-rows: subgrid) {
  .cards > .card { display: grid; grid-template-rows: subgrid; grid-row: span 6; row-gap: 0; }
  .cards > .card > .card-stat { grid-row: 5; }
  .cards > .card > .tags { grid-row: 6; align-self: start; }
}
.tags { display: flex; flex-wrap: wrap; gap: 4px 12px; list-style: none; margin: 0; padding: 0; font-family: var(--mono); font-size: 11px; color: var(--grey); }

/* --------------------------------------------------------------------------
   About + footer
   -------------------------------------------------------------------------- */
.about { padding-bottom: 140px; }
.about .g12 { border-top: 2px solid var(--ink); padding-top: 24px; row-gap: 32px; }
.about .idx { grid-column: span 3; font-size: 12px; color: var(--grey); }
.about-body { grid-column: span 6; }
.about-lede { margin: 0 0 24px; font-size: clamp(24px, 2.6vw, 34px); font-weight: 500; line-height: 1.2; letter-spacing: -.02em; }
.about-body p:not(.about-lede) { margin: 0 0 16px; font-size: 16px; line-height: 1.65; color: #3A3A3A; }
.about-body p:last-child { margin: 0; }
.skills { grid-column: span 3; margin: 0; font-size: 13px; line-height: 1.8; }
.skills dt { color: var(--grey); }
.skills dd { margin: 0 0 14px; }

.site-foot { background: var(--ink); color: #FFFFFF; padding-top: 96px; padding-bottom: 32px; }
.site-foot .g12 { row-gap: 32px; }
.site-foot .idx { grid-column: span 3; font-size: 12px; color: #A0A0A0; }
.site-foot .cta { grid-column: span 9; }
.site-foot h2 { margin: 0 0 32px; font-size: clamp(44px, 8vw, 112px); font-weight: 800; line-height: .9; letter-spacing: -.05em; }
.fits-lede { margin: 0 0 16px; font-size: 18px; line-height: 1.5; color: #FFFFFF; max-width: 640px; }
.fits { list-style: none; margin: 0 0 40px; padding: 0; max-width: 640px; border-top: 1px solid #333; }
.fits li { display: grid; grid-template-columns: 40px 1fr; padding: 14px 0; border-bottom: 1px solid #333; font-size: 16px; line-height: 1.5; color: #D6D6D6; }
.fits li > span { font: 12px/2 var(--mono); color: #A0A0A0; }
.foot-bar { margin-top: 96px; padding-top: 16px; border-top: 1px solid #333; font-size: 12px; color: #A0A0A0; row-gap: 12px; }
.foot-bar > span { grid-column: span 6; }
.foot-links { grid-column: span 6; display: flex; gap: 20px; justify-content: flex-end; }
.site-foot .nl { color: #FFFFFF; }
.site-foot .nl:is(:hover, :focus-visible, :active) { color: var(--ink); }
.site-foot :focus-visible { outline-color: #FFFFFF; }

/* --------------------------------------------------------------------------
   Project page
   -------------------------------------------------------------------------- */
.p-head { padding-top: 56px; padding-bottom: 40px; }
.p-head .g12 { row-gap: 24px; align-items: end; }
.p-kicker { grid-column: span 3; font-size: 12px; line-height: 1.6; color: var(--grey); }
.p-titles { grid-column: span 9; }
.p-title { margin: 0; font-size: clamp(72px, 13vw, 180px); font-weight: 800; line-height: .84; letter-spacing: -.06em; }
.p-tagline { margin: 24px 0 0; font-size: clamp(20px, 2vw, 26px); line-height: 1.3; font-weight: 500; letter-spacing: -.01em; max-width: 30ch; }

.p-main { padding-bottom: 72px; }
.p-main .g12 { row-gap: 32px; }
.p-links { grid-column: span 3; display: flex; flex-direction: column; }
.lk {
  position: relative; isolation: isolate;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 52px; padding: 0 16px;
  border-top: 2px solid var(--ink);
  text-decoration: none; font-size: 15px; font-weight: 600;
  transition: background-color .2s ease, color .2s ease;
}
.lk:last-of-type { border-bottom: 2px solid var(--ink); }
.lk > .hl { position: absolute; inset: 0; z-index: -1; opacity: 0; transform: scale(.96); transition: opacity .2s ease, transform .25s var(--ease); }
.lk:is(:hover, :focus-visible, :active) { background: transparent; color: var(--ink); }
.lk:is(:hover, :focus-visible, :active) > .hl { opacity: 1; transform: none; }
.lk .ar { flex-shrink: 0; transition: transform .25s ease; }
.lk:is(:hover, :focus-visible, :active) .ar { transform: translate(3px, -3px); }
.lk--primary { background: var(--ink); color: #FFFFFF; }
.p-meta { margin: 28px 0 0; font-size: 12px; line-height: 1.7; }
.p-meta dt { color: var(--grey); }
.p-meta dd { margin: 0 0 12px; }

/* 1 · media showcase */
.media {
  grid-column: span 9;
  position: relative; aspect-ratio: 16 / 10;
  background: var(--surface); overflow: hidden;
  view-transition-name: media;
}
.media > video, .media > img { width: 100%; height: 100%; object-fit: cover; }
.media .art { inset: 10% auto 10% 50%; height: 80%; aspect-ratio: 1 / 1; transform: translateX(-50%); }
.media-label { position: absolute; top: 12px; left: 12px; font-size: 11px; color: var(--grey); }
.media-toggle {
  position: absolute; right: 12px; bottom: 12px; z-index: 1;
  min-width: 44px; min-height: 44px; padding: 0 14px;
  border: 2px solid var(--ink); background: transparent; color: var(--ink);
  font: 500 12px var(--mono); cursor: pointer;
}
.media-enlarge { right: auto; left: 12px; }
.media-toggle:is(:hover, :focus-visible, :active) { background: var(--ink); color: var(--paper); }
.can-enlarge > video, .can-enlarge > img { cursor: zoom-in; }
/* captions (`media.captions`): a strip under the video, inside the media box, so no part of the
   recording is covered. The video keeps 16:10; Enlarge, the caption and Pause share the strip
   (below 560px the caption drops to its own row under the buttons). */
.media.has-cap { aspect-ratio: auto; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; }
.has-cap > video { grid-area: 1 / 1 / 2 / 4; height: auto; aspect-ratio: 16 / 10; }
.has-cap > .media-toggle { position: static; grid-area: 2 / 3; margin: 12px 12px 12px 0; }
.has-cap > .media-enlarge { grid-area: 2 / 1; margin: 12px 0 12px 12px; }
/* 24px top padding puts the caption's first line level with the button labels */
.has-cap > .media-cap { grid-area: 2 / 2; padding-top: 24px; }
.media-cap {
  display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 16px;
  margin: 0; padding: 12px; font-size: 13px; line-height: 1.5; color: var(--ink);
}
.media-cap-n { color: var(--grey); }
/* every line shares one cell: the strip is as tall as the longest caption and never jumps */
.media-cap-t { display: grid; }
.media-cap-t > span { grid-area: 1 / 1; visibility: hidden; }
.media-cap-t > .on { visibility: visible; animation: wipe .3s var(--ease-wipe); }

/* full-screen media viewer (a modal <dialog>, built in js/project.js) */
.viewer {
  width: 100vw; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: 0 clamp(16px, 4vw, 48px) clamp(16px, 4vw, 48px); border: 0;
  background: var(--ink); color: var(--paper);
  flex-direction: column; align-items: center; justify-content: center; gap: 16px;
}
.viewer[open] { display: flex; }
.viewer::backdrop { background: var(--ink); }
.viewer-bar {
  align-self: stretch; display: flex; justify-content: space-between; align-items: center;
  min-height: 72px; border-bottom: 2px solid var(--paper); font-size: 12px;
}
.viewer-close {
  min-width: 44px; min-height: 44px; padding: 0 16px;
  border: 2px solid var(--paper); background: transparent; color: var(--paper);
  font: 500 12px var(--mono); cursor: pointer;
}
.viewer-close:is(:hover, :focus-visible, :active) { background: var(--paper); color: var(--ink); }
.viewer :focus-visible { outline-color: var(--paper); }
.viewer-media {
  flex: 1; min-height: 0; width: 100%;
  object-fit: contain; background: var(--ink);
  animation: wipe .45s var(--ease-wipe) both;
}
.viewer .media-cap { align-self: stretch; padding: 0; color: var(--paper); }
.viewer .media-cap-n { color: #A0A0A0; }
html:has(.viewer[open]) { overflow: hidden; }
.viewer-hint { display: none; color: #A0A0A0; }
/* phones only: a narrow desktop window can't be turned sideways */
@media (orientation: portrait) and (max-width: 760px) and (pointer: coarse) {
  .viewer-hint { display: block; margin-top: 4px; }
}

/* 4 · description */
.p-desc { padding-bottom: 80px; }
.sec { border-top: 2px solid var(--ink); padding: 20px 0 40px; row-gap: 16px; }
.sec:last-child { border-bottom: 2px solid var(--ink); }
.sec .n { grid-column: span 3; font-family: var(--mono); font-size: 12px; color: var(--grey); }
.sec h3 { grid-column: span 3; margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.sec .b { grid-column: span 6; font-size: 17px; line-height: 1.6; color: var(--body); }
.sec p { margin: 0; }
.sec ol, .sec .list { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.sec .list { list-style: square; gap: 12px; }
/* results table: scrolls inside its own box on narrow screens, never the page */
.res-scroll { overflow-x: auto; }
.res { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 1.4; font-variant-numeric: tabular-nums; }
.res th, .res td { padding: 10px 16px 10px 0; text-align: right; font-weight: 400; white-space: nowrap; border-bottom: 1px solid var(--ink); }
.res th:first-child { text-align: left; white-space: normal; } /* long row labels wrap; numbers never do */
.res th:last-child, .res td:last-child { padding-right: 0; }
.res thead th { color: var(--grey); border-bottom-width: 2px; padding-top: 0; }
.res-group th { color: var(--grey); padding-top: 22px; }
.res-note { margin-top: 16px; font-size: 14px; line-height: 1.5; color: var(--grey); }
.tech { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 16px; list-style: none; margin: 0; padding: 0; font-family: var(--mono); font-size: 14px; }

/* 2 · card, reused as next-project band */
.next {
  position: relative; isolation: isolate; display: block;
  padding: 40px 0; background: var(--ink); color: #FFFFFF; text-decoration: none;
  transition: background-color .25s ease, color .25s ease;
}
.next > .hl { position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .25s ease; }
.next:is(:hover, :focus-visible, :active) { background: transparent; color: var(--ink); }
.next:is(:hover, :focus-visible, :active) > .hl { opacity: 1; }
.next:focus-visible { outline-offset: -6px; }
.next .g12 { align-items: center; row-gap: 20px; }
.next .sub { color: #BDBDBD; transition: color .25s ease; }
.next:is(:hover, :focus-visible, :active) .sub { color: var(--ink); }
.next-kicker { grid-column: span 3; font-size: 12px; }
/* 3 columns: the same width as a home card's square, so the diagram labels stay readable */
.next-thumb { grid-column: span 3; position: relative; aspect-ratio: 1 / 1; background: var(--surface); overflow: hidden; }
.next-thumb > img { width: 100%; height: 100%; object-fit: cover; }
.next-body { grid-column: span 6; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.next-name { font-size: clamp(44px, 7vw, 96px); font-weight: 800; letter-spacing: -.05em; line-height: .9; }
.next-tags { margin-top: 12px; font-size: 12px; }
.next .ar { flex-shrink: 0; transition: transform .3s var(--ease); }
.next:is(:hover, :focus-visible, :active) .ar { transform: translateX(12px); }
.p-foot { display: flex; justify-content: space-between; align-items: center; padding-top: 16px; padding-bottom: 32px; font-size: 12px; color: var(--grey); }

/* --------------------------------------------------------------------------
   Motion
   -------------------------------------------------------------------------- */
@keyframes rise { from { transform: translateY(100%); } to { transform: none; } }
@keyframes wipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(-12px); } }
@keyframes wipe-l { from { clip-path: inset(0 0 0 100%); } to { clip-path: inset(-12px); } }
@keyframes stamp { from { opacity: 0; transform: scale(1.6) rotate(-12deg); } to { opacity: 1; transform: none; } }
@keyframes vt-out { to { opacity: 0; transform: translateX(-40px); } }
@keyframes vt-in { from { opacity: 0; transform: translateX(48px); } }
@keyframes vt-out-back { to { opacity: 0; transform: translateX(40px); } }
@keyframes vt-in-back { from { opacity: 0; transform: translateX(-48px); } }

.media.enter { animation: wipe-l .5s .12s var(--ease-wipe) both; }

/* scroll reveals: hidden only when JS is running and motion is allowed.
   Hidden with opacity (not clip-path) so IntersectionObserver can still see them. */
@media (prefers-reduced-motion: no-preference) {
  .js .rv { opacity: 0; }
  .js .rv.on { opacity: 1; animation: wipe .45s var(--ease-wipe) both; }
}

/* Page transitions (cross-document View Transitions: Chrome/Edge 126+, Safari 18.2+).
   The page slides; the clicked card's square morphs into the project media. */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .4s var(--ease-wipe) both; }
::view-transition-new(root) { animation: vt-in .5s var(--ease) both; }
html:active-view-transition-type(back)::view-transition-old(root) { animation-name: vt-out-back; }
html:active-view-transition-type(back)::view-transition-new(root) { animation-name: vt-in-back; }
::view-transition-group(media) { animation-duration: .5s; animation-timing-function: var(--ease); }
::view-transition-old(media), ::view-transition-new(media) { height: 100%; object-fit: cover; overflow: clip; }

/* browsers without view transitions still get a slide-in on the project page */
html:not(.vt) .page-enter { animation: vt-in .5s var(--ease) both; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 980px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-lede { grid-column: 1 / span 7; }
  .hero-cta { grid-column: 8 / span 5; }
  /* columns are narrow here: the kicker takes its own row so the thumb can stay label-sized */
  .next-kicker { grid-column: 1 / -1; }
  .next-thumb { grid-column: span 4; }
  .next-body { grid-column: span 8; }
}
@media (max-width: 760px) {
  .g12 > *, .sec .n, .sec h3, .sec .b { grid-column: 1 / -1 !important; }
  .head-col, .hide-m { display: none !important; }
  .brand { grid-column: span 6 !important; }
  .nav { grid-column: span 6 !important; }
  .site-head .g12 > .brand, .site-head .g12 > .nav { grid-column: auto !important; }
  .site-head .g12 { grid-template-columns: 1fr auto; }
  .p-links { order: 2; }
  .foot-links { justify-content: flex-start; }
  .tech { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .cards { grid-template-columns: 1fr; }
  .p-title { font-size: clamp(52px, 17vw, 72px); }
  .tags, .media-label { font-size: 12px; }
  .has-cap > .media-cap { grid-area: 3 / 1 / 4 / 4; padding-top: 0; }
}

/* Touch screens: no hover, fingers instead of a cursor.
   Hover-only content shows by default, and every link is at least a 44px target. */
@media (hover: none) {
  .card .view { transform: none; }
}
@media (pointer: coarse), (max-width: 760px) {
  .nl, .brand, a.nav { display: inline-flex; align-items: center; min-height: 44px; }
  .nav, .foot-links { flex-wrap: wrap; gap: 4px 24px; }
  .site-head .g12 { align-items: center; }
}

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
