:root {
  --paper: #f2ede4;
  --paper-2: #e9e2d6;
  --ink: #171512;
  --muted: #776f63;
  --rec: #e0452b;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --ease: cubic-bezier(.7, 0, .2, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button { font: inherit; color: inherit; }

/* ── top bar ── */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 40;
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px clamp(16px, 3vw, 36px);
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.brand {
  font-family: var(--serif); font-size: 28px; text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px;
}
.rec { width: 8px; height: 8px; border-radius: 50%; background: var(--rec); animation: rec 1.6s steps(2) infinite; }
@keyframes rec { 50% { opacity: .15; } }
nav { display: flex; gap: clamp(12px, 2.2vw, 28px); align-items: center; font-size: 14px; }
nav a { text-decoration: none; }
nav a:hover,
body[data-view="work"] nav [data-go="work"],
body[data-view="about"] nav [data-go="about"],
body[data-view="contact"] nav [data-go="contact"] { text-decoration: underline; text-underline-offset: 4px; }
/* off the home page content scrolls under the bar, so give it paper to sit on */
body:not([data-view="home"]) .topbar {
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.sound {
  background: none; border: 1px solid currentColor; border-radius: 99px;
  padding: 3px 10px; font-family: var(--mono); font-size: 11px; cursor: pointer; color: var(--muted);
}
.sound[aria-pressed="false"] { text-decoration: line-through; }

.view { display: none; }
body[data-view="home"] .home { display: block; }
body[data-view="work"] .work { display: block; }
body[data-view="about"] .about { display: block; }
body[data-view="contact"] .contact { display: block; }

/* ── home ── */
.home {
  position: relative; height: 100vh; height: 100svh; overflow: hidden;
  touch-action: none; cursor: crosshair;
}
.drift {
  position: absolute; inset: -10% -5%;
  display: grid; grid-template-columns: repeat(var(--cols, 6), 1fr); gap: 14px;
  opacity: .13; filter: grayscale(1) contrast(1.1);
  pointer-events: none;
}
.drift .col { display: flex; flex-direction: column; gap: 14px; animation: drift var(--d, 80s) linear infinite; }
.drift .col:nth-child(even) { animation-direction: reverse; }
.drift img { width: 100%; height: auto; display: block; border-radius: 2px; }
@keyframes drift { to { transform: translateY(-50%); } }
.home::after { /* keep the centre calm so the avatar reads */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 55% 60% at 50% 55%, var(--paper) 30%, transparent 75%);
}

.trail { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.trail img, .fly-layer img {
  position: absolute; display: block; object-fit: cover;
  border-radius: 3px; box-shadow: 0 10px 30px rgba(23, 21, 18, .22);
  will-change: transform, opacity;
}
.trail .print { border: 6px solid #fff; border-bottom-width: 22px; border-radius: 2px; }

.home { --av: min(430px, 78vw); }
.giant { /* sits just above his head: the hair only nips the bottom of the letters */
  position: absolute; left: 0; right: 0; bottom: calc(var(--av) * 1.225 * .84);
  margin: 0; z-index: 1; text-align: center; pointer-events: none;
  font-weight: 400; line-height: .8;
}
.giant-word {
  display: block; font-family: var(--serif); font-style: italic;
  font-size: clamp(140px, min(30vw, 42vh), 440px); letter-spacing: -.04em; color: var(--ink);
}
.giant-eyebrow {
  display: block; font-family: var(--mono); font-size: 12px; letter-spacing: .3em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 1.2em;
}

.avatar-wrap {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: var(--av); z-index: 3; pointer-events: none;
}
#avatar { display: block; width: 100%; height: auto; overflow: visible; }
#avatar .lid { transform-box: fill-box; transform-origin: 50% 0; transform: scaleY(0); }
#avatar .eye.closed .lid { transform: scaleY(1); }

.home-foot {
  position: absolute; left: clamp(16px, 3vw, 36px); bottom: clamp(18px, 4vh, 40px); z-index: 4;
  max-width: 300px;
}
.tagline { font-family: var(--serif); font-size: 22px; line-height: 1.15; margin: 0 0 18px; }
.cta {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--ink); color: var(--paper); text-decoration: none;
  padding: 13px 20px; border-radius: 99px; font-weight: 500; font-size: 15px; white-space: nowrap;
  cursor: pointer; transition: transform .25s var(--ease), background .25s;
}
.cta span { transition: transform .25s var(--ease); }
.cta:hover { background: var(--rec); }
.cta:hover span { transform: translateX(4px); }

.readout {
  position: absolute; right: clamp(16px, 3vw, 36px); bottom: clamp(22px, 4vh, 44px); z-index: 4;
  font-family: var(--mono); font-size: 12px; color: var(--muted);
  display: flex; align-items: center; gap: 8px;
}
.readout .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--rec); }
.hint {
  position: absolute; left: 50%; top: 76px; transform: translateX(-50%); margin: 0; z-index: 4;
  font-family: var(--mono); font-size: 11px; letter-spacing: .12em; color: var(--muted);
  transition: opacity .6s; white-space: nowrap;
}
.flashscreen { position: fixed; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 60; }

/* ── work ── */
.work { padding: 110px clamp(16px, 3vw, 36px) 40px; min-height: 100vh; }
.work-head { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: 16px 30px; margin-bottom: 28px; }
.work-head h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(56px, 9vw, 120px); margin: 0; line-height: .85; letter-spacing: -.02em; }
.work-head h2 em { font-family: var(--mono); font-style: normal; font-size: 14px; vertical-align: top; color: var(--muted); letter-spacing: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters button {
  border: 1px solid var(--ink); background: none; border-radius: 99px; padding: 7px 14px;
  font-size: 13px; cursor: pointer; transition: background .2s, color .2s;
}
.filters button[aria-selected="true"], .filters button:hover { background: var(--ink); color: var(--paper); }

.grid { columns: 4 260px; column-gap: 14px; }
.grid figure {
  margin: 0 0 14px; break-inside: avoid; position: relative; cursor: zoom-in;
  transition: opacity .35s, filter .35s, transform .35s var(--ease);
}
.grid img { width: 100%; height: auto; display: block; border-radius: 3px; background: var(--paper-2); }
.grid figcaption {
  position: absolute; left: 10px; bottom: 10px; right: 10px;
  font-family: var(--mono); font-size: 11px; color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,.6);
  opacity: 0; transform: translateY(4px); transition: .3s var(--ease);
}
@media (hover: hover) {
  .grid:has(figure:hover) figure:not(:hover) { opacity: .35; filter: grayscale(.7); }
  .grid figure:hover figcaption { opacity: 1; transform: none; }
}
.grid figure.hidden-for-fly { opacity: 0 !important; }
.grid figure.filtered { display: none; }
.work-foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 40px; font-size: 13px; color: var(--muted); }

.fly-layer { position: fixed; inset: 0; z-index: 30; pointer-events: none; }

/* ── about + contact ── */
.about, .contact { padding: 120px clamp(16px, 3vw, 36px) 40px; min-height: 100vh; }
.about-grid, .contact-grid, .places, .about .work-foot {
  max-width: 1180px; margin-left: auto; margin-right: auto;
}
.about-grid, .contact-grid {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(28px, 6vw, 96px); align-items: start;
}
.eyebrow {
  font-family: var(--mono); font-size: 12px; letter-spacing: .3em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 18px; display: flex; align-items: center; gap: 10px;
}
.about h2, .contact h2 {
  font-family: var(--serif); font-weight: 400; font-size: clamp(56px, 8vw, 112px);
  line-height: .9; letter-spacing: -.02em; margin: 0;
}
.about-portrait { margin: 0; position: sticky; top: 100px; }
.about-portrait img { /* tall photo: never taller than the screen, so it stays whole while sticky */
  display: block; width: auto; max-width: 100%; height: auto; max-height: calc(100vh - 130px); max-height: calc(100svh - 130px);
  border-radius: 3px; background: var(--paper-2);
}
.about-copy p { font-size: 17px; line-height: 1.65; max-width: 34em; margin: 0 0 1em; }
.about-copy .eyebrow { font-size: 12px; margin-bottom: 18px; }
.about-copy .role { font-family: var(--serif); font-style: italic; font-size: clamp(24px, 2.4vw, 32px); color: var(--muted); margin: 8px 0 40px; }
.about-copy .lede { font-family: var(--serif); font-size: clamp(26px, 2.6vw, 34px); line-height: 1.2; margin-bottom: .9em; }
.about-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 26px; margin-top: 36px; }
.ig, .contact-meta a, .text-btn {
  font-family: var(--mono); font-size: 13px; text-decoration: none;
  border-bottom: 1px solid currentColor; padding-bottom: 2px; transition: color .2s;
}
.ig:hover, .contact-meta a:hover, .text-btn:hover { color: var(--rec); }

.places {
  list-style: none; padding: 0; margin-top: clamp(64px, 10vw, 130px); margin-bottom: 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; counter-reset: place;
}
.places li { counter-increment: place; }
.places img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; display: block; border-radius: 3px; background: var(--paper-2); }
.places span { display: block; margin-top: 10px; font-family: var(--mono); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; }
.places span::before { content: counter(place, decimal-leading-zero) "  "; white-space: pre; color: var(--rec); }

.contact-intro p:not(.eyebrow) { font-size: 17px; line-height: 1.6; max-width: 26em; margin: 26px 0 0; }
.contact-meta { display: grid; grid-template-columns: auto 1fr; gap: 12px 22px; margin: 40px 0 0; font-size: 14px; }
.contact-meta dt { font-family: var(--mono); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); padding-top: 2px; }
.contact-meta dd { margin: 0; }

.contact-form { display: grid; gap: 26px; }
.contact-form[hidden] { display: none; }
.topics { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.topics legend, .field > span {
  font-family: var(--mono); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted);
}
.topics legend { padding: 0; margin-bottom: 12px; }
.topics label { position: relative; }
.topics input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.topics label span {
  display: inline-block; border: 1px solid var(--ink); border-radius: 99px; padding: 9px 16px;
  font-size: 14px; cursor: pointer; transition: background .2s, color .2s;
}
.topics input:checked + span, .topics label:hover span { background: var(--ink); color: var(--paper); }
.topics input:focus-visible + span { outline: 2px solid var(--rec); outline-offset: 2px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.field { display: grid; gap: 6px; }
.field em { font-style: normal; letter-spacing: .05em; text-transform: none; opacity: .75; }
.field input, .field textarea {
  font: inherit; font-size: 17px; color: var(--ink); background: transparent;
  border: 0; border-bottom: 1px solid color-mix(in srgb, var(--ink) 30%, transparent); border-radius: 0;
  padding: 8px 0 10px; outline: none; transition: border-color .2s, box-shadow .2s;
}
.field textarea { min-height: 150px; line-height: 1.5; resize: vertical; }
.field input:focus, .field textarea:focus { border-bottom-color: var(--ink); box-shadow: 0 1px 0 var(--ink); }
.field ::placeholder { color: var(--muted); opacity: .6; }
.field.invalid > span, .topics.invalid legend { color: var(--rec); }
.field.invalid input, .field.invalid textarea { border-bottom-color: var(--rec); box-shadow: 0 1px 0 var(--rec); }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }
.form-foot .cta { border: 0; }
.form-foot .cta[disabled] { opacity: .55; cursor: progress; }
.form-status { margin: 0; font-size: 14px; line-height: 1.4; color: var(--muted); }
.form-status.error { color: var(--rec); }
.form-sent { outline: none; padding-top: 4px; }
.form-sent .rec { display: inline-block; }
.sent-line { font-family: var(--serif); font-size: clamp(30px, 3.4vw, 44px); line-height: 1.15; margin: 0 0 28px; max-width: 18em; }
.text-btn { background: none; border: 0; border-bottom: 1px solid currentColor; padding: 0 0 2px; cursor: pointer; }

/* ── lightbox ── */
.lightbox {
  position: fixed; inset: 0; z-index: 50; color: #f4efe6;
  background: color-mix(in srgb, var(--accent, #222) 45%, #0b0a09);
  display: grid; grid-template-rows: auto 1fr auto;
  transition: background .6s ease;
}
.lightbox[hidden] { display: none; }
.lb-top, .lb-bottom {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 16px clamp(16px, 3vw, 32px); font-family: var(--mono); font-size: 12px;
}
.lb-top #lbIndex { margin-left: auto; opacity: .7; }
.lb-close, .lb-nav {
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.2); border-radius: 99px;
  width: 40px; height: 40px; cursor: pointer; font-size: 16px; flex: none;
}
.lb-close:hover, .lb-nav:hover { background: rgba(255,255,255,.2); }
.lb-stage { display: grid; place-items: center; min-height: 0; padding: 0 clamp(8px, 4vw, 60px); }
.lb-frame { position: relative; max-height: 100%; display: grid; }
.lb-frame img {
  max-width: 100%; max-height: calc(100vh - 160px); max-height: calc(100svh - 160px);
  display: block; border-radius: 2px; box-shadow: 0 30px 80px rgba(0,0,0,.45);
  transition: opacity .3s;
}
.vf { position: absolute; width: 22px; height: 22px; border: 2px solid rgba(255,255,255,.85); opacity: 0; transition: opacity .3s, inset .3s var(--ease); }
.vf.tl { top: 12px; left: 12px; border-right: 0; border-bottom: 0; }
.vf.tr { top: 12px; right: 12px; border-left: 0; border-bottom: 0; }
.vf.bl { bottom: 12px; left: 12px; border-right: 0; border-top: 0; }
.vf.br { bottom: 12px; right: 12px; border-left: 0; border-top: 0; }
.vf-focus {
  position: absolute; left: 50%; top: 50%; width: 38px; height: 26px; transform: translate(-50%, -50%);
  border: 1.5px solid rgba(255,255,255,.8); opacity: 0; transition: opacity .3s;
}
.lb-frame:hover .vf, .lb-frame:hover .vf-focus { opacity: 1; }
.lb-frame:hover .vf.tl { top: 20px; left: 20px; } .lb-frame:hover .vf.tr { top: 20px; right: 20px; }
.lb-frame:hover .vf.bl { bottom: 20px; left: 20px; } .lb-frame:hover .vf.br { bottom: 20px; right: 20px; }
.lb-exif { text-align: center; opacity: .85; }

/* ── small screens ── */
.hint-touch { display: none; }
@media (hover: none) { .hint-desk { display: none; } .hint-touch { display: inline; } }


/* mid-width screens: the avatar's shoulders reach the corners, so keep the tagline clear of him */
@media (min-width: 641px) and (max-width: 1100px) {
  .home-foot { max-width: calc(50vw - min(215px, 39vw) - 24px); }
  .tagline { font-size: 18px; }
}
@media (min-width: 641px) and (max-width: 860px) {
  .tagline { display: none; }
}

@media (max-width: 640px) {
  .home { --av: 80vw; }
  .home-foot { left: 0; right: 0; bottom: 18px; max-width: none; display: flex; justify-content: center; z-index: 5; }
  .tagline { display: none; }
  .cta { padding: 13px 22px; box-shadow: 0 8px 24px rgba(23,21,18,.25); }
  .readout { display: none; }
  .hint { top: 64px; }
  .about, .contact { padding-top: 96px; }
  .grid { columns: 2 140px; column-gap: 8px; }
  .grid figure { margin-bottom: 8px; }
  .lb-exif { font-size: 10px; }
}

@media (max-width: 800px) {
  .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .about-portrait { position: static; max-width: min(340px, 62vw); }
  .places { grid-template-columns: repeat(2, 1fr); }
  .field-row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .drift .col, .rec { animation: none; }
}
