/* ==========================================================================
   Katrine Olsen — portfolio
   Monochrome frame; each project brings its own colour (--accent).
   Source file: src/css/site.css — tools/build.py copies it to site/ with a
   content hash in the filename.
   ========================================================================== */

/* ---------- Fonts (self-hosted, OFL — see assets/fonts/OFL.txt) ---------- */
/* One variable file: weight 100–900, width 62–125% */
@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-v25-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}

/* Metric-matched fallbacks (measured against Archivo) keep layout still while the font loads */
@font-face {
  font-family: "Archivo Fallback";
  src: local("Arial"), local("ArialMT");
  size-adjust: 98.66%;
  ascent-override: 88.99%;
  descent-override: 21.28%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Archivo Display Fallback";
  src: local("Arial Narrow Bold"), local("ArialNarrow-Bold");
  font-weight: 100 900;
  size-adjust: 83.41%;
  ascent-override: 105.26%;
  descent-override: 25.18%;
  line-gap-override: 0%;
}

/* ---------- Tokens ---------- */
:root {
  --bg: #0f0f10;
  --bg-elev: #17171a;
  --line: #2a2a2f;
  --fg: #f3f2ee;
  --fg-muted: #a8a7a3;
  --fg-subtle: #8c8b88;

  --accent: #f3f2ee;
  --on-accent: #0f0f10;

  /* colours sampled from the project artwork, used by the logo mark */
  --tint-abel: #1992f7;
  --tint-zpace: #ffb000;
  --tint-zpace-deep: #f5871b;
  --tint-admin: #4da4ff;
  --tint-graphic: #7883c4;
  --tint-boksen: #f2cd30; /* poster light stripes */
  --tint-acme: #1f5da6;

  --font-body: "Archivo", "Archivo Fallback", "Helvetica Neue", Arial, sans-serif;
  --font-display: "Archivo", "Archivo Display Fallback", "Arial Narrow", sans-serif;

  --text-s: 0.9375rem;
  --step-0: 1.0625rem;
  --step-1: clamp(1.1875rem, 1.05rem + 0.6vw, 1.5rem);
  --step-2: clamp(1.5rem, 1.2rem + 1.2vw, 2.25rem);
  --step-3: clamp(2.5rem, 1.6rem + 4vw, 5rem);
  --step-4: clamp(3.75rem, 1.5rem + 11vw, 11rem);
  --step-5: clamp(4.5rem, 1rem + 15.5vw, 15.5rem);

  --space-s: 1rem;
  --space-m: 1.5rem;
  --space-l: clamp(2rem, 1.5rem + 2vw, 3rem);
  --space-xl: clamp(4rem, 3rem + 4vw, 7rem);
  --space-2xl: clamp(6rem, 4rem + 8vw, 11rem);

  --gutter: clamp(1rem, 0.5rem + 2.5vw, 3rem);
  --max: 90rem;
  --radius: 10px;
  --header-h: 4.5rem;

  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 180ms;
  --dur: 320ms;
  --dur-slow: 700ms;

  color-scheme: dark;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 1rem);
  scrollbar-gutter: stable; /* no layout jump when the lightbox locks scrolling */
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

html:has(dialog[open]) {
  overflow: hidden;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  /* grain is baked into a small tile on the page colour: print texture, no live filter */
  background: var(--bg) url("../img/grain.webp") repeat;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

img,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

ul[role="list"],
ol[role="list"] {
  list-style: none;
  padding: 0;
}

::selection {
  background: var(--accent);
  color: var(--on-accent);
}

:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Utilities ---------- */
.container {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: 0.75rem;
  z-index: 200;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  background: var(--fg);
  color: var(--bg);
  font-weight: 500;
  transform: translateY(-200%);
  transition: transform var(--dur) var(--ease-out);
}

.skip-link:focus-visible {
  transform: translateY(0);
}

.label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--fg-muted);
  line-height: 1.4;
}

.display {
  font-family: var(--font-display);
  font-stretch: 62%;
  font-weight: 800;
  text-transform: uppercase;
  line-height: 0.86;
  letter-spacing: -0.005em;
}

.arrow {
  width: 1em;
  height: 1em;
  flex: none;
  transition: transform var(--dur) var(--ease-out);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  border-bottom: 1px solid transparent;
  transition: background-color var(--dur) ease, border-color var(--dur) ease;
}

.site-header.is-scrolled {
  background-color: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom-color: var(--line);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
}

.site-header__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-m);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 44px;
  font-weight: 500;
}

.brand__mark {
  width: 2.5rem;
  fill: var(--fg);
  overflow: visible;
}

/* hover: the eight shapes ripple along their diagonals, left to right */
.brand__mark .shape:nth-child(odd) {
  --nx: -22px;
  --ny: -16px;
}

.brand__mark .shape:nth-child(even) {
  --nx: 22px;
  --ny: 16px;
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .brand:hover .brand__mark .shape,
  .brand:focus-visible .brand__mark .shape {
    animation: nudge 640ms var(--ease-out) both;
    animation-delay: calc(var(--i) * 45ms);
  }
}

@keyframes nudge {
  40% {
    transform: translate(var(--nx), var(--ny));
  }
}

.site-nav ul {
  display: flex;
  gap: clamp(0.25rem, 1.5vw, 1.5rem);
}

.site-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 0.5rem;
  color: var(--fg-muted);
  font-size: var(--text-s);
  transition: color var(--dur-fast) ease;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0.5rem;
  right: 0.5rem;
  bottom: 0.6rem;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--dur) var(--ease-out);
}

.site-nav a:hover,
.site-nav a[aria-current] {
  color: var(--fg);
}

.site-nav a:hover::after,
.site-nav a[aria-current]::after {
  transform: scaleX(1);
  transform-origin: left;
}

@media (width < 30rem) {
  .brand__name {
    display: none;
  }
}

/* ---------- Hero (home) ---------- */
.hero {
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100svh - var(--header-h));
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: var(--space-l);
  padding-block: var(--space-l);
}

.hero__top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-s) var(--space-m);
}

.hero__body {
  display: grid;
  grid-template-columns: 1fr;
  align-items: end;
  gap: var(--space-l);
}

/* capped by height too, so name + project index fit a laptop screen */
.hero__title {
  font-size: min(var(--step-5), 22vh);
  font-size: min(var(--step-5), 22svh);
}

.hero__title span {
  display: block;
}

.hero__title .outline {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--fg);
}

/* padding keeps glyph tops/bottoms inside the mask at line-height 0.86 */
.hero__title .line {
  overflow: hidden;
  padding-block: 0.08em;
  margin-block: -0.08em;
}

.hero__mark {
  width: clamp(8rem, 26vw, 26rem);
}

.hero__foot {
  display: grid;
  gap: var(--space-m);
  align-items: end;
  border-top: 1px solid var(--line);
  padding-top: var(--space-m);
}

.hero__lead {
  font-size: var(--step-1);
  line-height: 1.45;
  max-width: 36ch;
  text-wrap: balance;
}

.hero__lead span {
  color: var(--fg-muted);
}

/* Project index: the work itself, in the first screen */
.hero__index {
  display: grid;
  gap: 0.75rem;
}

.hero__index-all {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  justify-self: start;
  color: var(--fg-muted);
  font-size: var(--text-s);
  transition: color var(--dur-fast) ease;
}

.hero__index-all:hover {
  color: var(--fg);
}

.hero__thumbs {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.5rem;
}

.hero__thumbs a {
  position: relative;
  display: block;
  border-radius: 6px;
  outline: 2px solid transparent;
  outline-offset: 3px;
  transition: outline-color var(--dur-fast) ease, transform var(--dur) var(--ease-out);
}

.hero__thumbs img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: inherit;
  background: var(--bg-elev);
}

.hero__thumb-name {
  position: absolute;
  left: 50%;
  top: calc(100% + 0.5rem);
  translate: -50% 0;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-fast) ease;
}

.hero__thumbs a:hover,
.hero__thumbs a:focus-visible {
  outline-color: var(--accent);
}

.hero__thumbs a:hover .hero__thumb-name,
.hero__thumbs a:focus-visible .hero__thumb-name {
  opacity: 1;
}

@media (width >= 56rem) {
  .hero__body {
    grid-template-columns: 1fr auto;
  }

  .hero__mark {
    margin-bottom: 0.6em;
  }

  .hero__foot {
    grid-template-columns: 1fr auto;
  }

  .hero__index {
    justify-items: end;
  }

  .hero__index-all {
    justify-self: end;
  }

  .hero__thumbs {
    grid-template-columns: repeat(6, clamp(3.25rem, 1.5rem + 2.6vw, 4.5rem));
  }
}

@media (width < 56rem) {
  /* single column: let the name span the screen ("KATRINE" ≈ 3× font-size wide) */
  .hero__title {
    font-size: min(28vw, 15.5rem, 22vh);
    font-size: min(28vw, 15.5rem, 22svh);
  }

  .hero__mark {
    order: -1;
    width: clamp(7rem, 34vw, 12rem);
  }
}

/* short phones (e.g. 375×667): tighten so the project index still lands in the first screen */
@media (width < 56rem) and (height < 46rem) {
  .hero,
  .hero__body {
    gap: var(--space-s);
  }

  .hero {
    padding-block: var(--space-s) var(--space-m);
  }

  .hero__mark {
    width: 6rem;
  }

  .hero__foot {
    gap: var(--space-s);
    padding-top: var(--space-s);
  }

  .hero__index-all {
    display: none; /* the "Selected work" heading follows directly below */
  }
}

/* ---------- Logo mark as artwork (hero + contact) ---------- */
.mark-art {
  overflow: visible;
}

.mark-art path {
  fill: var(--fg);
  transition: fill 500ms var(--ease-out);
}

/* moved by site.js (pointer parallax, scroll dispersal, assembly) */
.mark-art .shape__move {
  transform-box: fill-box;
  transform-origin: center;
}

.mark-art .shape:nth-child(1) { --tint: var(--tint-abel); }
.mark-art .shape:nth-child(2) { --tint: var(--tint-zpace); }
.mark-art .shape:nth-child(3) { --tint: var(--tint-graphic); }
.mark-art .shape:nth-child(4) { --tint: var(--tint-zpace-deep); }
.mark-art .shape:nth-child(5) { --tint: var(--tint-admin); }
.mark-art .shape:nth-child(6) { --tint: var(--tint-boksen); }
.mark-art .shape:nth-child(7) { --tint: var(--tint-acme); }
.mark-art .shape:nth-child(8) { --tint: var(--fg); }

/* hovering the mark lets the work's colours flow back in */
.mark-art:hover .shape path {
  fill: var(--tint);
}

/* Entrance: shapes arrive in the projects' colours, then settle to monochrome.
   fill-mode "backwards" means no end state to clear, so hover works afterwards
   without depending on an animationend event. */
@media (prefers-reduced-motion: no-preference) {
  .js .hero__mark .shape {
    animation: shape-in var(--dur-slow) var(--ease-out) both;
    animation-delay: calc(var(--i) * 70ms + 150ms);
  }

  .js .hero__mark .shape:nth-child(odd) {
    --from: translate(-24px, -18px);
  }

  .js .hero__mark .shape:nth-child(even) {
    --from: translate(24px, 18px);
  }

  .js .hero__mark .shape path {
    animation: shape-tint 1600ms var(--ease-in-out) backwards;
    animation-delay: calc(var(--i) * 70ms + 150ms);
  }

  /* the name rises out of masked lines, in step with the mark */
  .js .hero__title .line > span {
    animation: line-up 1100ms var(--ease-out) both;
    animation-delay: calc(var(--l) * 110ms + 120ms);
  }

  .hero__thumbs a:hover,
  .hero__thumbs a:focus-visible {
    transform: translateY(-4px);
  }
}

@keyframes shape-in {
  from {
    opacity: 0;
    transform: var(--from);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes shape-tint {
  0%,
  55% {
    fill: var(--tint);
  }
  100% {
    fill: var(--fg);
  }
}

@keyframes line-up {
  from {
    transform: translateY(112%);
  }
}

/* ---------- Sections ---------- */
.section {
  padding-block: var(--space-2xl);
}

.section--flush-top {
  padding-top: var(--space-l);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: var(--space-s) var(--space-m);
  margin-bottom: var(--space-l);
  padding-bottom: var(--space-m);
  border-bottom: 1px solid var(--line);
}

.section-title {
  font-size: var(--step-3);
}

/* ---------- Work grid ---------- */
.work-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl) var(--space-l);
}

@media (width >= 48rem) {
  .work-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .work-item--wide {
    grid-column: 1 / -1;
  }
}

.work-card {
  display: grid;
  gap: var(--space-m);
}

.work-media {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg-elev);
  isolation: isolate;
}

.work-media img {
  width: 100%;
  transition: transform 900ms var(--ease-out);
}

.work-media::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.06);
  pointer-events: none;
}

.work-pill {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 0.875rem;
  font-weight: 500;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
}

.work-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem var(--space-m);
}

.work-title {
  font-size: var(--step-2);
  font-weight: 500;
  line-height: 1.1;
}

.work-title::after {
  content: "";
  display: inline-block;
  width: 0.3em;
  height: 0.3em;
  margin-left: 0.3em;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: 0.12em;
}

.work-tags {
  color: var(--fg-muted);
  font-size: var(--text-s);
}

.work-card:hover .work-media img,
.work-card:focus-visible .work-media img {
  transform: scale(1.035);
}

.work-card:hover .work-pill,
.work-card:focus-visible .work-pill {
  opacity: 1;
  transform: none;
}

@media (hover: none) {
  .work-pill {
    display: none;
  }
}

/* ---------- About ---------- */
.about {
  display: grid;
  gap: var(--space-l);
}

.about__lead {
  font-size: var(--step-2);
  line-height: 1.4;
  font-weight: 400;
  max-width: 32ch;
  text-wrap: pretty;
}

.about__lead span {
  color: var(--fg-muted);
}

.about__cols {
  display: grid;
  gap: var(--space-l);
  margin-top: var(--space-l);
}

.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: var(--space-s);
}

.skills li {
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: var(--text-s);
}

.about__facts {
  display: grid;
  gap: var(--space-m);
  align-content: start;
}

.about__facts dd {
  margin-top: 0.35rem;
}

@media (width >= 56rem) {
  .about {
    grid-template-columns: 4fr 8fr;
  }

  .about__cols {
    grid-template-columns: 3fr 2fr;
  }
}

/* ---------- Contact ---------- */
.contact__head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: var(--space-l);
  margin-bottom: var(--space-l);
}

.contact__title {
  font-size: var(--step-4);
}

.contact__mark {
  width: clamp(9rem, 22vw, 20rem);
  margin-bottom: 0.5rem;
}

/* scattered until the section is reached (state set by site.js, so no-JS shows it whole) */
.contact__mark.is-armed:not(.is-assembled) .shape__move {
  opacity: 0;
  transform: translate(var(--sx), var(--sy)) rotate(var(--sr));
}

.contact__mark.is-assembled .shape__move {
  transition: transform 1200ms var(--ease-out), opacity var(--dur-slow) ease;
  transition-delay: calc(var(--i) * 60ms);
}

@media (width < 48rem) {
  .contact__head {
    grid-template-columns: 1fr;
  }

  .contact__mark {
    order: -1;
    width: clamp(6rem, 30vw, 9rem);
  }
}

.contact-links li:first-child a {
  border-top: 1px solid var(--line);
}

.contact-links a {
  display: flex;
  align-items: center;
  gap: var(--space-m);
  padding-block: var(--space-m);
  border-bottom: 1px solid var(--line);
}

.contact-links__name {
  font-family: var(--font-display);
  font-stretch: 75%;
  font-weight: 700;
  font-size: var(--step-2);
  text-transform: uppercase;
  line-height: 1;
}

.contact-links__handle {
  margin-left: auto;
  color: var(--fg-muted);
}

.contact-links .icon {
  width: 1.5rem;
  height: 1.5rem;
  flex: none;
  fill: currentColor;
}

.contact-links .arrow {
  width: 1.5rem;
  height: 1.5rem;
}

/* hover slides the row content with a transform (no layout work) */
.contact-links .icon,
.contact-links__name {
  transition: transform var(--dur) var(--ease-out);
}

.contact-links a:hover .icon,
.contact-links a:hover .contact-links__name {
  transform: translateX(0.75rem);
}

.contact-links a:hover .arrow {
  transform: translate(3px, -3px);
}

@media (width < 30rem) {
  .contact-links__handle {
    display: none;
  }

  .contact-links .arrow {
    margin-left: auto;
  }
}

/* ---------- Footer ---------- */
.site-footer {
  padding-block: var(--space-m);
  border-top: 1px solid var(--line);
  color: var(--fg-muted);
  font-size: var(--text-s);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-s);
}

.site-footer a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  transition: color var(--dur-fast) ease;
}

.site-footer a:hover {
  color: var(--fg);
}

.site-footer a:hover .arrow {
  transform: translateY(-3px);
}

/* ---------- Case study ---------- */
.case-hero {
  display: grid;
  gap: var(--space-l);
  padding-block: var(--space-m) var(--space-xl);
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.6rem;
  color: var(--fg-muted);
  font-size: var(--text-s);
}

.breadcrumb a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  transition: color var(--dur-fast) ease;
}

.breadcrumb a:hover {
  color: var(--fg);
}

.breadcrumb a:hover .arrow {
  transform: translateX(-3px);
}

.breadcrumb li + li::before {
  content: "/";
  margin-right: 0.6rem;
  color: var(--fg-subtle);
}

.breadcrumb [aria-current] {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--fg);
}

.breadcrumb [aria-current]::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--accent);
}

.case-hero__grid {
  display: grid;
  gap: var(--space-l);
  align-items: end;
}

.case-hero__text {
  display: grid;
  gap: var(--space-m);
}

.case-title {
  font-size: var(--step-4);
}

.case-lead {
  font-size: var(--step-1);
  line-height: 1.45;
  max-width: 40ch;
  text-wrap: pretty;
}

.case-cover {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-elev);
}

.case-cover img {
  width: 100%;
}

.case-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: var(--space-m);
  padding-top: var(--space-m);
  border-top: 1px solid var(--line);
}

.case-meta dd {
  margin-top: 0.35rem;
  line-height: 1.45;
}

@media (width >= 56rem) {
  .case-hero__grid--with-cover {
    grid-template-columns: 7fr 5fr;
  }
}

.case-banner {
  margin-bottom: var(--space-xl);
}

.case-banner__frame {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-elev);
}

.case-banner img {
  width: 100%;
}

.case-body {
  display: grid;
  gap: var(--space-m);
  padding-bottom: var(--space-xl);
}

.prose {
  display: grid;
  gap: 1.1em;
  max-width: 64ch;
  font-size: var(--step-1);
  line-height: 1.6;
}

.prose p {
  text-wrap: pretty;
}

.note {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1rem;
  border: 1px dashed var(--fg-subtle);
  border-radius: 999px;
  color: var(--fg-muted);
  font-size: var(--text-s);
  justify-self: start;
}

@media (width >= 56rem) {
  .case-body {
    grid-template-columns: 4fr 8fr;
  }
}

/* Gallery */
.gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-m);
  padding-bottom: var(--space-2xl);
}

@media (width >= 48rem) {
  .gallery {
    grid-template-columns: repeat(2, 1fr);
    align-items: start;
  }

  .shot--full {
    grid-column: 1 / -1;
  }
}

.shot {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-elev);
}

.shot img {
  width: 100%;
}

.shot__zoom {
  display: block;
  cursor: zoom-in;
}

.shot__zoom::after {
  content: "";
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: color-mix(in srgb, var(--bg) 72%, transparent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f3f2ee' stroke-width='1.75' stroke-linecap='round'%3E%3Cpath d='M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7'/%3E%3C/svg%3E") center / 1.1rem no-repeat;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
}

.shot__zoom:hover::after,
.shot__zoom:focus-visible::after {
  opacity: 1;
  transform: none;
}

.shot__zoom:focus-visible {
  outline-offset: -4px;
}

@media (hover: none) {
  .shot__zoom::after {
    opacity: 1;
    transform: none;
  }
}

/* Pager */
.pager {
  display: grid;
  gap: var(--space-m);
  padding-bottom: var(--space-2xl);
}

.pager__link {
  position: relative;
  display: grid;
  align-content: space-between;
  gap: var(--space-l);
  min-height: 15rem;
  padding: var(--space-l);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  overflow: hidden;
  isolation: isolate;
  transition: border-color var(--dur) ease, color var(--dur) ease;
}

.pager__link::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--accent);
  transform: translateY(101%);
  transition: transform 550ms var(--ease-out), opacity var(--dur) ease;
}

.pager__link:hover,
.pager__link:focus-visible {
  border-color: var(--accent);
  color: var(--on-accent);
}

.pager__link:hover::before,
.pager__link:focus-visible::before {
  transform: none;
}

.pager__link:hover .label,
.pager__link:focus-visible .label {
  color: inherit;
}

.pager__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-s);
}

.pager__title {
  font-size: var(--step-3);
}

.pager__link .arrow {
  width: 1.75rem;
  height: 1.75rem;
}

.pager__link--next:hover .arrow {
  transform: translateX(4px);
}

.pager__link--prev:hover .arrow {
  transform: translateX(-4px);
}

@media (width >= 48rem) {
  .pager {
    grid-template-columns: 2fr 3fr;
  }

  .pager__link--next {
    text-align: right;
  }

  .pager__link--next .pager__top {
    flex-direction: row-reverse;
  }
}

/* ---------- 404 ---------- */
.notfound {
  min-height: calc(100svh - var(--header-h) - 6rem);
  display: grid;
  align-content: center;
  gap: var(--space-l);
  padding-block: var(--space-xl);
}

.notfound__title {
  font-size: var(--step-4);
}

.notfound p {
  font-size: var(--step-1);
  max-width: 40ch;
}

/* ---------- Lightbox ---------- */
.lightbox {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  background: rgb(8 8 9 / 0.96);
  color: var(--fg);
}

.lightbox::backdrop {
  background: rgb(8 8 9 / 0.6);
}

.lightbox__figure {
  height: 100%;
  display: grid;
  grid-template-rows: 1fr auto;
  place-items: center;
  gap: var(--space-s);
  padding: 4.5rem var(--gutter) var(--space-m);
}

.lightbox__img {
  max-width: 100%;
  max-height: calc(100dvh - 10rem);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
}

.lightbox__caption {
  color: var(--fg-muted);
  font-size: var(--text-s);
  text-align: center;
  max-width: 60ch;
}

.lightbox__btn {
  position: absolute;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.08);
  transition: background-color var(--dur-fast) ease;
}

.lightbox__btn:hover {
  background: rgb(255 255 255 / 0.16);
}

.lightbox__btn svg {
  width: 1.25rem;
  height: 1.25rem;
}

.lightbox__close {
  top: 1rem;
  right: var(--gutter);
}

.lightbox__prev,
.lightbox__next {
  top: 50%;
  transform: translateY(-50%);
}

.lightbox__prev {
  left: var(--gutter);
}

.lightbox__next {
  right: var(--gutter);
}

.lightbox__btn[hidden] {
  display: none;
}

@media (width < 48rem) {
  .lightbox__prev,
  .lightbox__next {
    top: 1rem;
    transform: none;
  }

  .lightbox__next {
    left: calc(var(--gutter) + 3.75rem);
    right: auto;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .lightbox[open] {
    animation: fade-in var(--dur) var(--ease-out);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

/* ---------- Reading progress (case studies; scroll-driven, no JS) ---------- */
.progress {
  display: none;
}

@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .progress {
      display: block;
      position: fixed;
      inset: 0 0 auto;
      z-index: 60;
      height: 2px;
      background: var(--accent);
      transform-origin: 0 50%;
      pointer-events: none;
      animation: progress linear both;
      animation-timeline: scroll(root);
    }
  }
}

@keyframes progress {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

/* ---------- Page transitions (same-site navigation) ---------- */
@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }

  /* the logo stays put while the page changes around it */
  .brand {
    view-transition-name: brand;
  }

  ::view-transition-group(*) {
    animation-duration: 600ms;
    animation-timing-function: var(--ease-out);
  }

  ::view-transition-old(root) {
    animation: vt-out 240ms var(--ease-in-out) both;
  }

  ::view-transition-new(root) {
    animation: vt-in 480ms var(--ease-out) 80ms both;
  }
}

@keyframes vt-out {
  to {
    opacity: 0;
  }
}

@keyframes vt-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

/* ---------- Reduced motion: same states, no travel ----------
   Movement is already opt-in (no-preference) above; here the hover and
   assembly states change in place instead of sliding or scaling. */
@media (prefers-reduced-motion: reduce) {
  .arrow,
  .contact-links .icon,
  .contact-links__name,
  .skip-link {
    transition: none;
  }

  .work-card:hover .work-media img,
  .work-card:focus-visible .work-media img,
  .work-pill {
    transform: none;
  }

  .contact-links a:hover .icon,
  .contact-links a:hover .contact-links__name {
    transform: none;
  }

  .contact__mark.is-assembled .shape__move {
    transition: none;
  }

  /* pager fill fades instead of sliding up */
  .pager__link::before {
    transform: none;
    opacity: 0;
  }

  .pager__link:hover::before,
  .pager__link:focus-visible::before {
    opacity: 1;
  }
}

/* ---------- Print: dark ink on white paper ---------- */
@media print {
  :root {
    --bg: #fff;
    --bg-elev: #fff;
    --fg: #111;
    --fg-muted: #444;
    --fg-subtle: #666;
    --line: #ccc;
    color-scheme: light;
  }

  body {
    background: #fff;
    color: #111;
    font-size: 11pt;
  }

  .site-header,
  .skip-link,
  .progress,
  .pager,
  .work-pill,
  .lightbox,
  .hero__index,
  .shot__zoom::after {
    display: none !important;
  }

  .hero {
    min-height: 0;
  }

  .hero__title .outline {
    color: #111;
    -webkit-text-stroke: 0;
  }

  .mark-art .shape__move {
    opacity: 1 !important;
    transform: none !important;
  }

  /* print the finished mark even mid-intro */
  .mark-art .shape,
  .mark-art path,
  .hero__title .line > span {
    animation: none !important;
  }

  .work-card,
  .shot,
  .case-banner,
  .case-cover {
    break-inside: avoid;
  }

  .contact-links__handle {
    margin-left: 0;
  }
}
