/* ---------- Fonts ---------- */
/* Plus Jakarta Sans is declared in css/fonts.css (linked before this file on every page). */

/* ---------- Tokens ---------- */
:root {
  --bg: #f2f2f2;
  --ink: #000;
  --accent: #0000ff;
  --placeholder: #d9d9d9;
  --footer-bg: #000;
  --footer-ink: #f2f2f2;
  --tile-shadow: 0 1px 8px rgba(0, 0, 0, 0.1);
  --float-shadow: 0 1px 8px rgba(0, 0, 0, 0.1), 0 12px 32px rgba(0, 0, 0, 0.08);

  --page-max: 1440px;
  --gutter: 36px;        /* text sections, footer */
  --gutter-header: 32px;
  --gutter-header-end: 40px;
  --gutter-grid: 16px;   /* works grid edges and gap */
  --intro-width: 873px;
  /* Spacing below follows the home design (Figma 6653:49949) at 1440 and scales down with the screen. */
  --motto-gap: clamp(160px, 41.1vw, 592px); /* motto → contact (pages without the robot) */
  --bot-space: clamp(64px, 7.1vw, 102px);   /* space above and below the robot on project and article pages */
  /* Home: motto → contact is 592 in the design; the robot sits a little below the middle-upper spot. */
  --home-bot-above: clamp(80px, 10.4vw, 150px);
  --home-bot-below: clamp(110px, 19.2vw, 276px);

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  /* Every hover change (colour, background, opacity, small shifts) uses these, so nothing snaps.
     A gentle standard curve over 0.4s: ease-out curves finish most of the change in the first
     ~80ms, which reads as an instant switch. */
  --hover-dur: 0.4s;
  --hover-ease: cubic-bezier(0.4, 0, 0.2, 1);

  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  line-height: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, p, ul, dl, dd { margin: 0; }
ul { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
/* Images can't be dragged out of the page (Chromium/Safari; js/main.js covers Firefox). */
img, svg, picture, video { -webkit-user-drag: none; user-drag: none; }
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center; /* logo, nav and clock share one centre line */
  height: 87px;
  padding: 0 var(--gutter-header-end) 0 var(--gutter-header);
}

/* Liquid glass: a frosted, slightly brightened layer (::before) plus a light sheen
   and glossy bottom edge (::after). Chromium also bends what's behind it through
   the #liquid-glass SVG filter; other browsers get the frosted version. */
.site-header::before,
.site-header::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.site-header::before {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.62) 0%, rgba(242, 242, 242, 0.48) 100%);
  -webkit-backdrop-filter: blur(18px) saturate(1.8) brightness(1.04);
  backdrop-filter: blur(18px) saturate(1.8) brightness(1.04);
}
.has-svg-backdrop .site-header::before {
  backdrop-filter: url(#liquid-glass) blur(16px) saturate(1.8) brightness(1.04);
}
.site-header::after {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.9) 30%, rgba(255, 255, 255, 0.9) 70%, rgba(255, 255, 255, 0) 100%) bottom / 100% 1px no-repeat,
    linear-gradient(180deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0) 40%);
}
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.site-header__logo { justify-self: start; }
.site-header__logo img { width: 60px; height: auto; }

.site-nav ul { display: flex; gap: 24px; }
.site-nav a {
  display: block;
  font-size: 15px;
  font-weight: 600;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color var(--hover-dur) var(--hover-ease);
}
.site-nav a[aria-current],
.site-nav a:hover { color: var(--accent); }

.site-header__meta {
  justify-self: end;
  display: flex;
  align-items: center;
}
.local-time {
  font-size: 12px;
  font-weight: 400;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ---------- Intro ---------- */
.intro {
  width: min(var(--intro-width), 100% - 2 * var(--gutter));
  margin-top: clamp(64px, 13.2vw, 190px);
  margin-left: max(var(--gutter), 50% - 428px);
}
.intro__name {
  font-size: 16px;
  font-weight: 600;
  text-transform: capitalize;
}
.intro__role {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 400;
}
.intro__headline,
.intro__statement {
  font-size: clamp(20px, 1rem + 1.4vw, 28px);
  font-weight: 800;
}
.intro__headline { margin-top: 43px; }
.intro__statement { margin-top: 12px; }
.intro__statement em { font-style: normal; color: var(--accent); }

.tools {
  display: flex;
  gap: 16px;
  margin-top: 31px;
}
.tools__item {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--tile-shadow);
}
.tools__item img { flex: none; }
/* This icon ships with its own tile and shadow, drawn 8px beyond the 40px box. */
.tools__item--bare { overflow: visible; background: none; box-shadow: none; }
.tools__item--bare img { position: absolute; left: -8px; top: -7px; width: 56px; height: 56px; max-width: none; }

/* ---------- My words ---------- */
/* A short quote from the article between two grey quote marks, lined up with the
   intro: the opening mark sits at the intro's edge, a little above the first line,
   the closing mark just after the text, level with its last line. */
.words {
  display: grid;
  grid-template-columns: 33px minmax(0, 796px) auto;
  align-items: start;
  width: min(852px, 100% - 2 * var(--gutter));
  margin-top: clamp(72px, 10.56vw, 152px);
  margin-left: max(var(--gutter), 50% - 428px);
}
.words__mark { width: 15px; height: auto; }
.words__mark--end { align-self: end; margin-left: 8px; }
.words__text {
  padding-top: 12px;
  font-size: 13px;
  font-weight: 400;
  line-height: 20px;
}
.words__link {
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
  transition: opacity var(--hover-dur) var(--hover-ease);
}
.words__link:hover { opacity: 0.6; }

/* ---------- Works grid ---------- */
.works {
  --stagger: clamp(24px, 5.14vw, 74px); /* how much lower the right column starts */
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(12px, 1.67vw, 24px) var(--gutter-grid);
  max-width: var(--page-max);
  margin: clamp(96px, 15.56vw, 224px) auto 0;
  padding: 0 var(--gutter-grid) var(--stagger);
}
.work-card {
  position: relative;
  display: block;
  aspect-ratio: 696 / 509;
  overflow: hidden;
  border-radius: 5.747% / 7.859%; /* 40px at 696 × 509, in step with the card */
}
/* Each cover is a full-card render of its Figma frame (logo, name, mockup),
   with its own rounded corners already transparent. Keep the card itself
   without a background: a colour behind the cover leaks through the
   anti-aliased corner edge as a thin coloured arc. */
.work-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* The mockup sits on its own layer (cut from the same render, with its soft
   shadow) over a cover that has the mockup area cleared to white. --x/--y/--w
   are its box in the 696 × 509 card, in Figma px. On hover it floats up a
   little; leaving the card eases it back. */
.work-card .work-card__shot {
  position: absolute;
  left: calc(var(--x) / 696 * 100%);
  top: calc(var(--y) / 509 * 100%);
  width: calc(var(--w) / 696 * 100%);
  height: auto;
  transition: transform var(--hover-dur) var(--hover-ease);
}
@media (hover: hover) {
  .work-card:hover .work-card__shot,
  .work-card:focus-visible .work-card__shot {
    transform: translateY(-3%) scale(1.02);
  }
}
@media (prefers-reduced-motion: reduce) {
  .work-card .work-card__shot { transition: none; }
}
.work-card:nth-child(even) {
  margin-top: var(--stagger);
  margin-bottom: calc(-1 * var(--stagger));
}

/* ---------- Previous / next project (end of works/*.html, above the outro) ----------
   Two halves between hairlines: a bracketed label in the nav's style over the
   project name at the contact title's size. Hover turns the half the site blue
   (#0000ff, on dark pages too) and nudges its arrow outward. */
.work-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: calc(100% - 2 * var(--gutter));
  max-width: calc(var(--page-max) - 2 * var(--gutter));
  margin: clamp(96px, 11.1vw, 160px) auto 0;
  border-block: 1px solid rgba(128, 128, 128, 0.3); /* fallback before color-mix (Safari < 16.2) */
  border-block: 1px solid color-mix(in srgb, var(--ink) 14%, transparent);
}
.work-pager + .motto { margin-top: clamp(96px, 13.9vw, 200px); }
.work-pager__link {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: clamp(28px, 3.3vw, 48px) 0;
  color: var(--ink);
  transition: color var(--hover-dur) var(--hover-ease);
}
.work-pager__link--next {
  align-items: flex-end;
  text-align: right;
  border-left: 1px solid rgba(128, 128, 128, 0.3);
  border-left: 1px solid color-mix(in srgb, var(--ink) 14%, transparent);
}
.work-pager__label {
  font-size: 15px;
  font-weight: 600;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0.5;
  transition: opacity var(--hover-dur) var(--hover-ease);
}
/* Room on the outer side so the hover nudge (4px) never reaches the bracket. */
.work-pager__arrow {
  display: inline-block;
  transition: transform var(--hover-dur) var(--hover-ease);
}
.work-pager__link--prev .work-pager__arrow { margin: 0 2px 0 6px; }
.work-pager__link--next .work-pager__arrow { margin: 0 6px 0 2px; }
.work-pager__name {
  font-size: clamp(32px, 1.5rem + 2.2vw, 48px);
  font-weight: 600;
  line-height: 1.1;
}
.work-pager__link:hover,
.work-pager__link:focus-visible { color: #0000ff; outline: none; } /* the site blue on every page, dark ones too */
.work-pager__link:hover .work-pager__label,
.work-pager__link:focus-visible .work-pager__label { opacity: 1; }
.work-pager__link--prev:hover .work-pager__arrow,
.work-pager__link--prev:focus-visible .work-pager__arrow { transform: translateX(-4px); }
.work-pager__link--next:hover .work-pager__arrow,
.work-pager__link--next:focus-visible .work-pager__arrow { transform: translateX(4px); }
@media (max-width: 767px) {
  .work-pager__link { gap: 10px; padding: 24px 0; }
  .work-pager__link--prev { padding-right: 12px; }
  .work-pager__link--next { padding-left: 12px; }
  .work-pager__label { font-size: 12px; }
  .work-pager__name { font-size: 24px; }
}

/* ---------- Motto ---------- */
.motto {
  max-width: var(--page-max);
  margin: clamp(96px, 17.43vw, 251px) auto 0;
  padding: 0 var(--gutter);
}
.motto__title {
  font-size: 24px;
  font-weight: 600;
}
.motto p {
  margin-top: 12px;
  font-size: 18px;
  font-weight: 400;
}

/* neo ⇄ 8-bit robot (js/neo-bot.js): centred on the page between the motto and the
   contact block, with the same space above and below it (--bot-space). The logo and the
   robot are both centred in its box, so the two gaps look equal in either state. */
.neo-bot {
  width: clamp(120px, 15vw, 216px);
  aspect-ratio: 60 / 46;
  margin: var(--bot-space) auto 0;
  color: var(--ink);
  pointer-events: none;
}
.neo-bot svg { display: block; width: 100%; height: 100%; overflow: visible; }
.motto:has(.neo-bot) + .contact { margin-top: var(--bot-space); }
.motto--home .neo-bot { margin-top: var(--home-bot-above); }
.motto--home:has(.neo-bot) + .contact { margin-top: var(--home-bot-below); }

/* ---------- Contact ---------- */
.contact {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 48px;
  max-width: var(--page-max);
  margin: var(--motto-gap) auto 0;
  padding: 0 var(--gutter) clamp(64px, 6.94vw, 100px); /* contact → footer */
}
.contact__mark { width: 44px; height: 44px; }
.contact__title {
  margin-top: 13px;
  font-size: clamp(32px, 1.5rem + 2.2vw, 48px);
  font-weight: 800;
  margin-bottom: -13px; /* trims half-leading so spacing matches the 0.94 line box in the design */
  line-height: 1.48;
  color: var(--accent);
  text-transform: capitalize;
}
.contact__details {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.contact__email {
  margin-top: 2px;
  font-size: 32px;
  font-weight: 800;
}
.contact__list {
  display: grid;
  gap: 28px;
  width: 207px;
  margin-top: 45px;
  font-size: 14px;
  font-weight: 500;
}
.contact__list div { display: flex; justify-content: space-between; gap: 16px; }

/* ---------- Copy on hover ---------- */
/* The button sits just outside the text's right edge so the text never shifts. */
.copyable {
  --copy-size: 16px;
  position: relative;
  display: inline-block;
}
.contact__email.copyable { --copy-size: 22px; }
.copy-btn {
  position: absolute;
  top: 50%;
  left: 100%;
  display: grid;
  place-items: center;
  padding: 4px 4px 4px 6px; /* inner edge touches the text, so hover carries over */
  border: 0;
  background: none;
  color: rgba(0, 0, 0, 0.4);
  cursor: pointer;
  opacity: 0;
  transform: translate(-4px, -50%);
  transition:
    opacity var(--hover-dur) var(--hover-ease),
    transform var(--hover-dur) var(--hover-ease),
    color var(--hover-dur) var(--hover-ease);
}
.copyable:hover .copy-btn,
.copy-btn:focus-visible,
.copy-btn.is-copied { opacity: 1; transform: translate(0, -50%); }
.copy-btn:hover { color: var(--ink); }
.copy-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; border-radius: 6px; }
.copy-btn svg {
  grid-area: 1 / 1;
  width: var(--copy-size);
  height: var(--copy-size);
  transition: opacity 0.2s ease, transform 0.3s var(--ease-out);
}
.copy-btn__done { color: var(--accent); opacity: 0; transform: scale(0.6); }
.copy-btn.is-copied .copy-btn__done { opacity: 1; transform: none; }
.copy-btn.is-copied .copy-btn__copy { opacity: 0; transform: scale(0.6); }
.copy-btn__tip {
  position: absolute;
  bottom: calc(100% + 2px);
  right: 0; /* anchored to the icon's right edge so it never pokes past the page edge */
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.25s ease, transform 0.3s var(--ease-out);
  pointer-events: none;
}
.copy-btn.is-copied .copy-btn__tip { opacity: 1; transform: none; }

/* Touch screens have no hover: keep the icon faintly visible. */
@media (hover: none) {
  .copy-btn { opacity: 1; }
}

/* ---------- Footer ---------- */
/* The faint "neolithic" wordmark centred in the black band, with the copyright
   line centred on top of it (Figma 6653:50000). */
.site-footer {
  display: grid;
  place-items: center;
  height: 199px;
  padding: 0 var(--gutter);
  border-radius: 48px 48px 0 0;
  background: var(--footer-bg);
  color: var(--footer-ink);
  font-size: 14px;
  font-weight: 500;
}
.site-footer > * { grid-area: 1 / 1; }
.site-footer__wordmark {
  width: 540px;
  pointer-events: none;
}
.site-footer__copy { position: relative; }

/* ---------- Custom cursor ---------- */
/* Only on mouse/trackpad devices, and only once JS adds .has-custom-cursor,
   so the native cursor stays if the script never runs.
   States (set by js/main.js as data-state on .cursor):
     default · hover (breathing) · external (breathing + ↗) · view (work cards)
     copy / copied (copy buttons) · drag ([data-cursor="drag"]) · disabled
   Modifiers: .is-pressed (mouse down), .is-dark (over [data-cursor-theme="dark"]), .is-loading */
.has-custom-cursor,
.has-custom-cursor * { cursor: none !important; }

/* Registered so they can be animated/transitioned smoothly:
   --breath loops 0→1→0; --hover, --press, --dim ease between 0 and 1 as states change. */
@property --breath { syntax: "<number>"; inherits: true; initial-value: 0; }
@property --hover { syntax: "<number>"; inherits: true; initial-value: 0; }
@property --press { syntax: "<number>"; inherits: true; initial-value: 0; }
@property --dim { syntax: "<number>"; inherits: true; initial-value: 0; }

.cursor {
  --cursor-color: var(--accent);
  --cursor-ink: #fff;
  --dot-size: 14px;
  --size-ease: cubic-bezier(0.34, 1.25, 0.64, 1); /* slight overshoot when growing */
  --hover: 0;
  --press: 0;
  --dim: 0;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  width: 0;
  height: 0;
  pointer-events: none;
  opacity: 0;
  animation: cursor-breath 2.8s var(--ease-in-out) infinite;
  transition:
    opacity 0.2s ease,
    --hover 0.45s var(--hover-ease),
    --dim var(--hover-dur) var(--hover-ease),
    --press 0.55s cubic-bezier(0.34, 1.56, 0.64, 1); /* springy release */
}
.cursor.is-visible { opacity: 1; }
.cursor.is-pressed {
  --press: 1;
  transition:
    opacity 0.2s ease,
    --hover 0.45s var(--hover-ease),
    --dim var(--hover-dur) var(--hover-ease),
    --press 0.12s ease-out;
}
.cursor.is-dark { --cursor-color: #fff; --cursor-ink: #000; }
.cursor[data-state="hover"],
.cursor[data-state="external"] { --hover: 1; }
.cursor[data-state="view"] { --dot-size: 84px; }
.cursor[data-state="copy"],
.cursor[data-state="copied"] { --dot-size: 30px; }
.cursor[data-state="copied"] { --cursor-color: #35db77; --cursor-ink: #fff; }
.cursor[data-state="disabled"] { --cursor-color: #9a9a9a; --dim: 1; }

.cursor__dot,
.cursor__halo,
.cursor__spinner {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 50%;
}
.cursor__dot {
  display: grid;
  place-items: center;
  width: var(--dot-size);
  height: var(--dot-size);
  background: var(--cursor-color);
  color: var(--cursor-ink);
  transform: translate(-50%, -50%)
    scale(calc((1 + var(--hover) * (0.05 + 0.2 * var(--breath))) * (1 - 0.3 * var(--press))));
  opacity: calc((1 - var(--hover) * 0.25 * (1 - var(--breath))) * (1 - 0.5 * var(--dim)));
  transition:
    width 0.5s var(--size-ease),
    height 0.5s var(--size-ease),
    background-color var(--hover-dur) var(--hover-ease),
    color var(--hover-dur) var(--hover-ease);
}
.cursor__halo {
  width: 14px;
  height: 14px;
  background: var(--cursor-color);
  filter: blur(1.5px);
  transform: translate(-50%, -50%) scale(calc(1 + var(--hover) * (0.2 + 0.9 * var(--breath))));
  opacity: calc(var(--hover) * (0.12 + 0.18 * var(--breath)));
  transition: background-color var(--hover-dur) var(--hover-ease);
}

/* Content inside the dot: "View" label, copy icon, check icon. */
.cursor__label,
.cursor__icon {
  grid-area: 1 / 1;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.25s ease, transform 0.4s var(--hover-ease);
}
.cursor__label {
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.cursor__icon { width: 14px; height: 14px; }
.cursor[data-state="view"] .cursor__label,
.cursor[data-state="copy"] .cursor__icon--copy,
.cursor[data-state="copied"] .cursor__icon--done {
  opacity: 1;
  transform: none;
  transition-delay: 0.1s; /* appear once the dot has mostly grown */
}

/* External link: a small ↗ to the upper right of the dot. */
.cursor__arrow {
  position: absolute;
  left: 9px;
  top: -23px;
  width: 14px;
  height: 14px;
  color: var(--cursor-color);
  opacity: 0;
  transform: translate(-4px, 4px);
  transition:
    opacity var(--hover-dur) var(--hover-ease),
    transform var(--hover-dur) var(--hover-ease),
    color var(--hover-dur) var(--hover-ease);
}
.cursor[data-state="external"] .cursor__arrow { opacity: 1; transform: none; }

/* Drag: arrows slide out to either side of the dot. */
.cursor__drag {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  gap: 22px;
  color: var(--cursor-color);
  transform: translate(-50%, -50%);
  transition: color var(--hover-dur) var(--hover-ease);
}
.cursor__drag svg {
  width: 12px;
  height: 12px;
  opacity: 0;
  transition: opacity var(--hover-dur) var(--hover-ease), transform var(--hover-dur) var(--hover-ease);
}
.cursor__drag svg:first-child { transform: translateX(4px); }
.cursor__drag svg:last-child { transform: translateX(-4px); }
.cursor[data-state="drag"] .cursor__drag svg { opacity: 1; transform: none; }

/* Loading: a ring spinning around the dot. */
.cursor__spinner {
  width: 30px;
  height: 30px;
  border: 2px solid transparent;
  border-top-color: var(--cursor-color);
  border-right-color: var(--cursor-color);
  opacity: 0;
  animation: cursor-spin 0.9s linear infinite;
  transition: opacity 0.3s ease;
}
.cursor.is-loading .cursor__spinner { opacity: 1; }

/* Click ripple: left behind at the click point, expands and fades. */
.cursor-ripple {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 999;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  pointer-events: none;
  animation: cursor-ripple 0.6s var(--hover-ease) forwards;
}
.cursor-ripple.is-dark { border-color: #fff; }

@keyframes cursor-breath {
  0%, 100% { --breath: 0; }
  50% { --breath: 1; }
}
@keyframes cursor-spin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}
@keyframes cursor-ripple {
  from { transform: var(--at) scale(1); opacity: 0.6; }
  to { transform: var(--at) scale(4); opacity: 0; }
}

/* ---------- Tablet ---------- */
@media (max-width: 1023px) {
  :root { --gutter: 28px; --gutter-header: 24px; --gutter-header-end: 24px; }

  /* Nav moves to its own row below the logo and clock. */
  .site-header {
    grid-template-columns: 1fr auto;
    row-gap: 20px;
    height: auto;
    padding-top: 24px;
    padding-bottom: 18px;
  }
  .site-nav {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .site-nav ul { flex-wrap: wrap; gap: 10px 20px; }

  .contact { flex-direction: column; gap: 56px; }
  .contact__details { align-items: flex-start; }
  .contact__email { font-size: 26px; }
  .contact__list { width: min(100%, 360px); margin-top: 28px; gap: 20px; }

  .site-footer__wordmark { width: 380px; }
}

/* ---------- Mobile ---------- */
@media (max-width: 767px) {
  :root { --gutter: 20px; --gutter-header: 20px; --gutter-header-end: 20px; --gutter-grid: 12px; }

  .site-header { row-gap: 16px; padding-top: 16px; padding-bottom: 14px; }
  .site-nav ul { gap: 10px 14px; }
  .site-nav a { font-size: 13px; }
  .local-time { font-size: 12px; }

  .intro__headline { margin-top: 32px; }

  .works { grid-template-columns: 1fr; padding-bottom: 0; }
  .work-card:nth-child(even) { margin: 0; }

  .motto__title { font-size: 20px; }
  .motto p { font-size: 16px; }

  .contact__details { align-items: stretch; width: 100%; }
  /* Hug the text and leave room for the copy icon on its right. */
  .contact__email { align-self: flex-start; max-width: calc(100% - 30px); font-size: 22px; overflow-wrap: anywhere; }
  .contact__email.copyable { --copy-size: 18px; }
  /* Right padding keeps the always-visible copy icons inside the screen. */
  .contact__list { width: 100%; padding-right: 26px; }

  .words { grid-template-columns: 24px minmax(0, 1fr) auto; }

  .site-footer {
    height: auto;
    padding: 40px var(--gutter);
    border-radius: 32px 32px 0 0;
  }
  .site-footer__wordmark { width: 100%; }
}

/* ---------- Dark page theme ----------
   For project pages drawn on a black canvas (works/xterio.html): add
   class="theme-dark" to <html> and data-cursor-theme="dark" to <body>
   (the footer then takes data-cursor-theme="light").
   Everything shared flips: the page turns #171717 with white text, the glass
   header goes dark, and the footer turns white with black text. The ShapeGrid
   lines pick up --shape-grid-line below (read by js/shape-grid.js).
   The contact rocket has its own dark version: point .contact__mark at
   assets/icons/contact-mark-dark.svg in the page markup. */
.theme-dark {
  --bg: #171717;
  --ink: #fff;
  --accent: #5b5bff; /* the site blue, lifted so it reads on black */
  --footer-bg: #fff;
  --footer-ink: #000;
  --tile-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
  --float-shadow: 0 1px 8px rgba(0, 0, 0, 0.4), 0 12px 32px rgba(0, 0, 0, 0.35);
  --shape-grid-line: #1f1f1f; /* +8 on the background, as #f7f7f7 is on #f2f2f2 */
  --shape-grid-hover: #2e2e2e;
  --shape-grid-hover-fill: #242424;
  color-scheme: dark;
}
.theme-dark .site-header::before {
  background: linear-gradient(180deg, rgba(23, 23, 23, 0.66) 0%, rgba(23, 23, 23, 0.5) 100%);
  -webkit-backdrop-filter: blur(18px) saturate(1.6) brightness(0.92);
  backdrop-filter: blur(18px) saturate(1.6) brightness(0.92);
}
.theme-dark.has-svg-backdrop .site-header::before {
  backdrop-filter: url(#liquid-glass) blur(16px) saturate(1.6) brightness(0.92);
}
.theme-dark .site-header::after {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.16) 30%, rgba(255, 255, 255, 0.16) 70%, rgba(255, 255, 255, 0) 100%) bottom / 100% 1px no-repeat,
    linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0) 40%);
}
.theme-dark .site-header__logo img { filter: invert(1); } /* assets/logo.svg is black */
.theme-dark .copy-btn { color: rgba(255, 255, 255, 0.45); }
.theme-dark .copy-btn__tip { color: var(--bg); }
.theme-dark .site-footer__wordmark { filter: invert(1); } /* white at 10% → black at 10% */

/* ---------- Dark header only ----------
   For a light page whose top is black (works/versa.html, the Versa hero): add
   site-header--dark and data-cursor-theme="dark" to the <header>. The header gets the
   dark-theme look (white text, black glass, inverted logo); the rest of the page stays
   light. The glass is near-opaque so it still reads black over white content. */
.site-header--dark {
  --bg: #171717;
  --ink: #fff;
  --accent: #5b5bff;
  --float-shadow: 0 1px 8px rgba(0, 0, 0, 0.4), 0 12px 32px rgba(0, 0, 0, 0.35);
  color: var(--ink);
  color-scheme: dark;
}
.site-header--dark::before {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.82) 100%);
  -webkit-backdrop-filter: blur(18px) saturate(1.6) brightness(0.92);
  backdrop-filter: blur(18px) saturate(1.6) brightness(0.92);
}
.has-svg-backdrop .site-header--dark::before {
  backdrop-filter: url(#liquid-glass) blur(16px) saturate(1.6) brightness(0.92);
}
.site-header--dark::after {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.16) 30%, rgba(255, 255, 255, 0.16) 70%, rgba(255, 255, 255, 0) 100%) bottom / 100% 1px no-repeat,
    linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0) 40%);
}
.site-header--dark .site-header__logo img { filter: invert(1); }

/* Reduced motion: keep the gentle fades, drop the looping cursor breathing. */
@media (prefers-reduced-motion: reduce) {
  .cursor { animation: none; }
}
