/* fredhopkins.uk: monochrome, glass, hairlines */

:root {
  --bg: #050505;
  --fg: #f4f4f2;
  --fg-2: rgba(244, 244, 242, 0.68);
  --fg-3: rgba(244, 244, 242, 0.42);
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.2);
  --line-3: rgba(255, 255, 255, 0.36);

  --gutter: clamp(16px, 3.4vw, 44px);   /* outer frame lines sit here */
  --inset: clamp(14px, 2.6vw, 40px);    /* content starts this far inside the frame */
  --hud-h: 56px;
  --radius: 3px;

  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  color-scheme: dark;
}

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

html {
  background: var(--bg);
  color: var(--fg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
html.snap { scroll-snap-type: y mandatory; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; }
img { display: block; max-width: 100%; }
::selection { background: var(--fg); color: var(--bg); }

:focus-visible { outline: 1px solid var(--fg); outline-offset: 3px; }

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

/* ───────────────────────── Background layers */

.field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100lvh;
  display: block;
  z-index: 0;
  opacity: 0;
  transition: opacity 1.6s ease;
}
.field.is-on { opacity: 1; }

.no-gl .field { display: none; }
.no-gl body {
  background:
    radial-gradient(90% 70% at 72% 18%, #3a3a3a 0%, rgba(20, 20, 20, 0) 60%),
    radial-gradient(70% 60% at 12% 88%, #262626 0%, rgba(10, 10, 10, 0) 60%),
    var(--bg);
  background-attachment: fixed;
}

/* the drawing frame: gutter lines, HUD lines and registration marks */
.frame {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(var(--line), var(--line)) left var(--gutter) top 0 / 1px 100% no-repeat,
    linear-gradient(var(--line), var(--line)) right var(--gutter) top 0 / 1px 100% no-repeat,
    linear-gradient(var(--line), var(--line)) left 0 top var(--hud-h) / 100% 1px no-repeat,
    linear-gradient(var(--line), var(--line)) left 0 bottom var(--hud-h) / 100% 1px no-repeat;
}
.frame i {
  position: absolute;
  width: 11px;
  height: 11px;
  transform: translate(-50%, -50%);
}
.frame i::before,
.frame i::after {
  content: "";
  position: absolute;
  background: var(--line-3);
}
.frame i::before { left: 0; right: 0; top: 50%; height: 1px; }
.frame i::after  { top: 0; bottom: 0; left: 50%; width: 1px; }
.frame i:nth-child(1) { left: var(--gutter); top: var(--hud-h); }
.frame i:nth-child(2) { left: calc(100% - var(--gutter)); top: var(--hud-h); }
.frame i:nth-child(3) { left: var(--gutter); top: calc(100% - var(--hud-h)); }
.frame i:nth-child(4) { left: calc(100% - var(--gutter)); top: calc(100% - var(--hud-h)); }

/* ───────────────────────── Type */

.mono {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-2);
  font-variant-numeric: tabular-nums;
}

.display {
  margin: 0;
  font-weight: 500;
  line-height: 0.9;
  letter-spacing: -0.05em;
  text-wrap: balance;
  background: linear-gradient(180deg, #ffffff 35%, rgba(255, 255, 255, 0.62) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ───────────────────────── HUD */

.hud {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 10;
  height: var(--hud-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 0 calc(var(--gutter) + var(--inset));
  pointer-events: none;
}
.hud > * { pointer-events: auto; }
.hud > :last-child { justify-self: end; }
.hud-top { top: 0; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  justify-self: start;
  text-decoration: none;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg);
}
.brand b {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.04em;
  border: 1px solid var(--line-3);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.05);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.counter b { color: var(--fg); font-weight: 500; }


/* ───────────────────────── Glass */

.glass {
  position: relative;
  border-radius: var(--radius);
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.035) 38%, rgba(255, 255, 255, 0.015) 100%),
    rgba(12, 12, 12, 0.3);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  backdrop-filter: blur(22px) saturate(150%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 -1px 0 rgba(255, 255, 255, 0.04),
    0 30px 70px -30px rgba(0, 0, 0, 0.8);
}
/* specular edge: bright at the top-left and bottom-right, gone in between */
.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  background: linear-gradient(135deg,
    rgba(255, 255, 255, 0.55) 0%,
    rgba(255, 255, 255, 0.12) 22%,
    rgba(255, 255, 255, 0.05) 50%,
    rgba(255, 255, 255, 0.12) 78%,
    rgba(255, 255, 255, 0.4) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  pointer-events: none;
}
/* registration brackets just outside each corner */
.ticks::after {
  --c: rgba(255, 255, 255, 0.75);
  --l: 9px;
  content: "";
  position: absolute;
  inset: -7px;
  pointer-events: none;
  background:
    linear-gradient(var(--c), var(--c)) top left / var(--l) 1px,
    linear-gradient(var(--c), var(--c)) top left / 1px var(--l),
    linear-gradient(var(--c), var(--c)) top right / var(--l) 1px,
    linear-gradient(var(--c), var(--c)) top right / 1px var(--l),
    linear-gradient(var(--c), var(--c)) bottom left / var(--l) 1px,
    linear-gradient(var(--c), var(--c)) bottom left / 1px var(--l),
    linear-gradient(var(--c), var(--c)) bottom right / var(--l) 1px,
    linear-gradient(var(--c), var(--c)) bottom right / 1px var(--l);
  background-repeat: no-repeat;
}

/* ───────────────────────── Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 40px;
  padding: 0 14px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.03em;
  text-decoration: none;
  color: var(--fg);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.25s, color 0.25s, border-color 0.25s;
}
.btn:hover { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.btn-ghost { background: transparent; text-transform: uppercase; letter-spacing: 0.08em; font-size: 11px; }
.btn .arr { transition: transform 0.3s var(--ease); }
.btn:hover .arr { transform: translate(2px, -2px); }
.btn:hover .arr-go { transform: translateX(3px); }

.actions { display: flex; flex-wrap: wrap; gap: 8px; }

.socials {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin: 18px 0 0;
  padding: 14px 0 0;
  list-style: none;
  border-top: 1px solid var(--line);
}
.socials a {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--fg-2);
  transition: color 0.2s;
}
.socials a:hover { color: var(--fg); }

/* ───────────────────────── Panels (home + projects) */

main { position: relative; z-index: 2; }

.panel {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.panel-inner {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: auto 1fr auto;
  column-gap: clamp(12px, 2vw, 28px);
  padding:
    calc(var(--hud-h) + clamp(22px, 5vh, 56px))
    calc(var(--gutter) + var(--inset))
    calc(var(--hud-h) + clamp(22px, 5vh, 52px));
}

.panel-head {
  grid-column: 1 / -1;
  grid-row: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.panel-head .idx { color: var(--fg); }
.rule {
  flex: 1;
  height: 1px;
  background: var(--line-2);
  transform-origin: left center;
}

/* ───────────────────────── Home */

.home .panel-head { justify-content: flex-start; }

.home-title {
  grid-column: 1 / span 7;
  grid-row: 2 / span 2;
  align-self: end;
  font-size: clamp(64px, min(13.5vw, 22vh), 240px);
  margin-bottom: -0.06em;
}

.home-card {
  grid-column: 8 / -1;
  grid-row: 2 / span 2;
  align-self: end;
  padding: clamp(20px, 2.2vw, 28px);
}
.home-card .lede {
  margin: 0 0 10px;
  font-size: clamp(20px, 1.7vw, 26px);
  line-height: 1.2;
  letter-spacing: -0.025em;
  font-weight: 500;
}
.home-card .sub {
  margin: 0;
  color: var(--fg-2);
  font-size: 15px;
  line-height: 1.55;
  max-width: 46ch;
}

.btn-primary {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  height: 54px;
  margin-top: 24px;
  padding: 0 18px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--bg);
  background: var(--fg);
  border: 1px solid var(--fg);
  border-radius: var(--radius);
  transition: background 0.25s, color 0.25s;
}
.btn-primary .count { margin-left: auto; opacity: 0.5; }
.btn-primary .arr { font-size: 15px; transition: transform 0.35s var(--ease); }
.btn-primary:hover { background: transparent; color: var(--fg); }
.btn-primary:hover .arr { transform: translateX(4px); }

/* contact: a quiet line in the frame's bottom band */
.hud-bottom { bottom: 0; }
.home-contact a { color: var(--fg-3); text-decoration: none; transition: color 0.2s; }
.home-contact a:hover { color: var(--fg); }
.home-social { display: inline-flex; gap: 22px; }

/* ───────────────────────── Projects: intro */

.hero-title {
  grid-column: 1 / span 7;
  grid-row: 2;
  align-self: end;
  font-size: clamp(60px, min(10vw, 19vh), 184px);
}
.hero-intro {
  grid-column: 8 / -1;
  grid-row: 2;
  align-self: end;
  margin: 0 0 0.6em;
  max-width: 40ch;
  color: var(--fg-2);
  font-size: clamp(15px, 1.15vw, 17px);
  line-height: 1.55;
}

.hero-index {
  grid-column: 1 / -1;
  grid-row: 3;
  margin-top: clamp(24px, 4.5vh, 48px);
  padding: clamp(14px, 1.6vw, 22px) clamp(18px, 2vw, 26px);
}
.index-list {
  margin: 0;
  padding: 0;
  list-style: none;
  columns: 2;
  column-gap: clamp(24px, 4vw, 56px);
}
.index-list li { break-inside: avoid; }
.index-list a {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition: padding 0.35s var(--ease), color 0.25s;
}
.index-list a:hover { padding-left: 6px; }
.index-list .t { font-size: 15px; letter-spacing: -0.01em; white-space: nowrap; }
.index-list .r { margin-left: auto; text-align: right; color: var(--fg-3); white-space: nowrap; }
.index-list a:hover .r { color: var(--fg); }

/* ───────────────────────── Projects: one per page */

.project-title-wrap {
  grid-column: 1 / span 11;
  grid-row: 2;
  align-self: center;
  padding: clamp(24px, 5vh, 56px) 0;
}
.project-title {
  font-size: clamp(46px, min(8.4vw, 15vh), 156px);
}
.project-role {
  margin: clamp(14px, 2vh, 22px) 0 0;
  font-size: clamp(20px, 2.3vw, 34px);
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--fg-2);
}

.spec {
  grid-column: 7 / -1;
  grid-row: 3;
  align-self: end;
  padding: clamp(18px, 2vw, 26px);
}
.spec-summary {
  margin: 0;
  font-size: clamp(16px, 1.22vw, 18.5px);
  line-height: 1.5;
  letter-spacing: -0.01em;
  max-width: 50ch;
}
.spec-rows {
  display: grid;
  grid-template-columns: max-content 1fr;
  margin: 20px 0 0;
  border-top: 1px solid var(--line-2);
}
.spec-rows dt,
.spec-rows dd {
  margin: 0;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.spec-rows dt { padding-right: 28px; }
.spec-rows dd { font-size: 14px; }
.spec-rows a { text-decoration: none; border-bottom: 1px solid var(--line-3); }
.spec-rows a:hover { border-color: var(--fg); }
.spec-rows .sep { margin: 0 10px; color: var(--fg-3); }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}
.tags li {
  padding: 5px 8px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-2);
  border: 1px solid var(--line-2);
  border-radius: 2px;
}

.media {
  grid-column: 1 / span 4;
  grid-row: 3;
  align-self: end;
  margin: 0;
  padding: 7px;
}
.media img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 2px;
  filter: grayscale(1) contrast(1.06) brightness(0.92);
  transition: filter 0.6s var(--ease);
}
.media:hover img { filter: none; }
.media-btn {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}
.media-count {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 4px 7px;
  color: var(--fg);
  background: rgba(8, 8, 8, 0.6);
  border: 1px solid var(--line-2);
  border-radius: 2px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.more { margin-top: 18px; height: 36px; }
.more .arr { transition: transform 0.3s var(--ease); }
.more:hover .arr { transform: translateX(3px); }

/* ───────────────────────── "Read more" panel */

html.locked { overflow: hidden; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--fg);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.25s, color 0.25s;
}
.icon-btn:hover { background: var(--fg); color: var(--bg); }

.sheet { position: fixed; inset: 0; z-index: 30; }
.sheet[hidden] { display: none; }
.sheet-scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  transition: opacity 0.45s ease;
}
.sheet.is-open .sheet-scrim { opacity: 1; }
.sheet-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(620px, 100%);
  display: flex;
  flex-direction: column;
  background: rgba(10, 10, 10, 0.8);
  -webkit-backdrop-filter: blur(28px) saturate(140%);
  backdrop-filter: blur(28px) saturate(140%);
  border-left: 1px solid var(--line-2);
  box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.06), -40px 0 80px -40px rgba(0, 0, 0, 0.8);
  transform: translateX(100%);
  transition: transform 0.6s var(--ease);
  outline: none;
}
.sheet.is-open .sheet-panel { transform: none; }
.sheet-head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: calc(var(--hud-h) + 8px);
  padding: 0 clamp(20px, 3vw, 32px);
  border-bottom: 1px solid var(--line);
}
.sheet-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: clamp(24px, 4vh, 36px) clamp(20px, 3vw, 32px) 56px;
}
.sheet-title { font-size: clamp(38px, 4.6vw, 60px); line-height: 0.95; }
.sheet-role {
  margin: 12px 0 0;
  font-size: 20px;
  font-weight: 300;
  letter-spacing: -0.02em;
  color: var(--fg-2);
}
.sheet-body .spec-rows { margin-top: 24px; }
.sheet-h { margin: 30px 0 10px; color: var(--fg-3); }
.sheet-body p:not(.sheet-role) {
  margin: 0 0 12px;
  font-size: 15.5px;
  line-height: 1.65;
  color: rgba(244, 244, 242, 0.84);
}
.sheet-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.sheet-gallery button {
  display: block;
  padding: 0;
  border: 0;
  background: none;
  overflow: hidden;
  border-radius: 2px;
  aspect-ratio: 4 / 3;
  cursor: zoom-in;
}
.sheet-gallery button:first-child { grid-column: 1 / -1; aspect-ratio: 16 / 9; }
.sheet-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.05);
  transition: filter 0.5s var(--ease), transform 0.8s var(--ease);
}
.sheet-gallery button:hover img { filter: none; transform: scale(1.03); }

/* ───────────────────────── Photo viewer */

.viewer {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: rgba(3, 3, 3, 0.94);
}
.viewer[hidden] { display: none; }
.viewer img {
  max-width: calc(100vw - 160px);
  max-height: calc(100vh - 140px);
  max-height: calc(100svh - 140px);
  object-fit: contain;
  border-radius: 2px;
}
.viewer-prev, .viewer-next { position: absolute; top: 50%; transform: translateY(-50%); }
.viewer-prev { left: var(--gutter); }
.viewer-next { right: var(--gutter); }
.viewer-close { position: absolute; top: 16px; right: var(--gutter); }
.viewer-count { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); }
.viewer.single .viewer-prev, .viewer.single .viewer-next, .viewer.single .viewer-count { display: none; }


/* ───────────────────────── Projects: outro */

.outro-title {
  grid-column: 1 / span 8;
  grid-row: 2;
  align-self: center;
  font-size: clamp(60px, 11vw, 190px);
}
.outro-card {
  grid-column: 7 / -1;
  grid-row: 3;
  align-self: end;
  padding: clamp(20px, 2.2vw, 28px);
}
.outro-card p {
  margin: 0 0 20px;
  color: var(--fg-2);
  font-size: 15px;
  line-height: 1.55;
}

/* ───────────────────────── Rail (sits on the right frame line) */

.rail {
  position: fixed;
  z-index: 11;
  top: 50%;
  right: var(--gutter);
  transform: translate(50%, -50%);
}
.rail ol { margin: 0; padding: 0; list-style: none; }
.rail button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 18px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}
.rail .tick {
  width: 9px;
  height: 1px;
  background: var(--fg-3);
  transition: width 0.45s var(--ease), background 0.3s;
}
.rail button:hover .tick,
.rail button[aria-current="true"] .tick { width: 23px; background: var(--fg); }
.rail .rail-label {
  position: absolute;
  right: calc(100% + 4px);
  top: 50%;
  padding: 4px 7px;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg);
  background: rgba(10, 10, 10, 0.55);
  border: 1px solid var(--line-2);
  border-radius: 2px;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  opacity: 0;
  transform: translate(6px, -50%);
  transition: opacity 0.25s, transform 0.35s var(--ease);
  pointer-events: none;
}
.rail button:hover .rail-label,
.rail button:focus-visible .rail-label { opacity: 1; transform: translate(0, -50%); }

/* ───────────────────────── Reveal (only once JS is running) */

.js [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 26px, 0);
  transition:
    opacity 0.9s var(--ease),
    transform 1.1s var(--ease),
    clip-path 1.2s var(--ease),
    filter 0.9s var(--ease);
  transition-delay: var(--d, 0ms);
}
.js [data-reveal]:not(.glass) { filter: blur(6px); }
.js [data-reveal="title"] { clip-path: inset(0 0 100% 0); transform: translate3d(0, 44px, 0); }

.js .is-active [data-reveal] { opacity: 1; transform: none; }
.js .is-active [data-reveal]:not(.glass) { filter: none; }
.js .is-active [data-reveal="title"] { clip-path: inset(-10% -5% -20% -5%); }

.js .rule { transform: scaleX(0); transition: transform 1.3s var(--ease) 0.15s; }
.js .is-active .rule { transform: scaleX(1); }

/* ───────────────────────── Small screens */

@media (max-width: 900px) {
  .home-title  { grid-column: 1 / -1; grid-row: 2; margin-bottom: 32px; font-size: clamp(64px, min(15vw, 22vh), 200px); }
  .home-card   { grid-column: 3 / -1; grid-row: 3; }
  .hero-title  { grid-column: 1 / -1; }
  .hero-intro  { grid-column: 1 / -1; grid-row: 3; margin: 20px 0 0; }
  .hero-index  { grid-row: 4; }
  .index-list  { columns: 1; }
  .hero .panel-inner { grid-template-rows: auto 1fr auto auto; }
  .spec        { grid-column: 4 / -1; }
  .has-media .media { grid-column: 1 / span 5; }
  .has-media .spec  { grid-column: 6 / -1; }
  .outro-card  { grid-column: 4 / -1; }
}

@media (max-width: 680px) {
  :root { --hud-h: 52px; }

  .hud { grid-template-columns: 1fr auto; }
  .hud-mid { display: none; }

  .panel-inner { grid-template-columns: minmax(0, 1fr); column-gap: 0; }
  .panel-inner > * { grid-column: 1 / -1 !important; }

  .home-title  { font-size: clamp(64px, 21vw, 120px); align-self: center; margin-bottom: 32px; }
  .home-card   { grid-row: 3; }
  .home-contact {
    position: relative;
    z-index: 10;
    height: auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px 20px;
    padding-top: 0;
    padding-bottom: calc(var(--hud-h) + 16px);  /* clear of the frame's bottom line */
    margin-top: calc(-1 * var(--hud-h) + 8px);
  }

  .hero-title    { font-size: clamp(56px, 18vw, 96px); align-self: center; }
  .project-title { font-size: clamp(46px, 15vw, 88px); }
  .outro-title   { font-size: clamp(56px, 17vw, 96px); }

  .media { grid-row: 3; margin-bottom: 26px; }
  .media img { aspect-ratio: 16 / 9; }
  .media + .spec { grid-row: 4; }
  .project .panel-inner.has-media { grid-template-rows: auto 1fr auto auto; }

  .rail { display: none; }
  .index-list { columns: 1; }
  .index-list .t { white-space: normal; }
  .viewer img { max-width: calc(100vw - 32px); max-height: calc(100svh - 160px); }
  .viewer-prev, .viewer-next { top: auto; bottom: 14px; transform: none; }
  .viewer-count { bottom: 26px; }
  .index-list .r { max-width: 17.5ch; white-space: normal; font-size: 10px; letter-spacing: 0.04em; text-wrap: balance; }
}

/* short laptop screens: tighten everything so each page still fits */
@media (min-width: 681px) and (max-height: 800px) {
  .panel-inner {
    padding-top: calc(var(--hud-h) + 18px);
    padding-bottom: calc(var(--hud-h) + 18px);
  }
  .project-title-wrap { padding: 12px 0; }
  .project-title { font-size: clamp(42px, min(8vw, 12.5vh), 130px); }
  .project-role { margin-top: 10px; font-size: clamp(18px, 2vw, 26px); }
  .media img { aspect-ratio: 16 / 10; }
  .spec { padding: 16px 20px; }
  .spec-summary { font-size: 15.5px; }
  .spec-rows dt, .spec-rows dd { padding-top: 7px; padding-bottom: 7px; }
  .more { margin-top: 14px; }
  .hero-title { font-size: clamp(56px, min(9vw, 16vh), 150px); }
  .hero-index { margin-top: 18px; }
  .index-list a { padding: 6px 0; }
}

@media (max-height: 560px) {
  html.snap { scroll-snap-type: y proximity; }
}

/* ───────────────────────── Reduced motion */

@media (prefers-reduced-motion: reduce) {
  .field { transition: none; }
  .js [data-reveal],
  .js [data-reveal]:not(.glass),
  .js [data-reveal="title"] { opacity: 1; transform: none; filter: none; clip-path: none; transition: none; }
  .js .rule { transform: none; transition: none; }
  .sheet-panel, .sheet-scrim { transition: none; }
}
