/* ==========================================================================
   JC Frames
   Brand colors live in the tokens below: swap those values and the whole site follows.
   ========================================================================== */

:root {
  /* Brand palette, taken from the logo */
  --backdrop: #12132A;      /* dark ground the sheet sits on */
  --sheet: #1D1E3E;         /* the page itself */
  --sheet-hi: #2A2B57;      /* soft light at the top of the sheet */
  --well: #2A2B55;          /* recessed areas: image placeholders, preview stage */
  --ink: #FFE18F;           /* main text and headings (12.6:1 on sheet) */
  --ink-soft: #C4B07C;      /* captions, secondary text (7.5:1 on sheet) */
  --line: #3A3B6B;          /* hairlines */
  --accent: #F9BE4A;        /* progress, selection, focus, runway dashes (9.5:1 on sheet) */
  --accent-ink: #F9BE4A;    /* accent used as text */
  --on-dark: #FFE18F;       /* text on the home photo and the photo viewer */
  --on-dark-soft: #C4B07C;
  --focus-dark: #F9BE4A;    /* focus ring and current page on dark surfaces */
  --hero-font: var(--display);   /* the home headline. Swap for the NULL font once its file is added (see README) */
  --device: #0F1027;        /* phone and monitor frames in the wallpaper preview */
  --field: #FFF5D9;         /* contact form fields: warm cream with navy text (the sheet colour) */
  --field-hi: #FFFAEA;      /* a field with focus */
  --field-ink: var(--sheet);
  --field-hint: #6A6A86;    /* placeholder text (4.8:1 on the field) */
  --field-line: rgb(29 30 62 / 0.18);
  --field-line-hi: rgb(29 30 62 / 0.5);
  --error: #FF9B8A;         /* form errors (8.4:1 on sheet) */

  --display: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;  /* wordmark and headings */
  --sans: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;           /* everything else */
  --reading: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;        /* the About page paragraphs */
  --ink-body: rgb(255 225 143 / 0.88);   /* long paragraphs, a touch softer than headings (10:1 on sheet) */

  --gutter: clamp(20px, 5vw, 72px);
  --radius: 14px;
  --bar-h: 80px;

  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--bar-h) + 16px);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--backdrop);
  color: var(--ink);
  font: 400 1rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }
[tabindex="-1"]:focus { outline: none; }

img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }

:focus-visible { outline: 2px solid var(--accent); 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;
}

.skip {
  position: fixed; top: 12px; left: 12px; z-index: 100;
  padding: 12px 16px; background: var(--ink); color: var(--sheet);
  font-size: 0.875rem; text-decoration: none;
  transform: translateY(-200%);
}
.skip:focus { transform: none; outline-color: var(--focus-dark); }

/* ---------- sheet ---------- */

.sheet {
  position: relative;
  max-width: 1560px;
  margin: 16px auto;
  min-height: calc(100svh - 32px);
  display: flex; flex-direction: column;
  background: radial-gradient(120% 60% at 50% 0%, var(--sheet-hi), var(--sheet) 72%);
  background-color: var(--sheet);
  border-radius: var(--radius);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.6);
  overflow-x: clip;
}

/* ---------- header ---------- */

/* logo left, nav centred on the bar, player right (phones switch to a flex row in the responsive block) */
.bar {
  position: sticky; top: 0; z-index: 30;
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center;
  min-height: var(--bar-h);
  padding: 0 var(--gutter);
  border-radius: var(--radius) var(--radius) 0 0;
  border-bottom: 1px solid transparent;
  transition: background-color 0.2s, border-color 0.2s;
}
.bar.is-stuck { background: var(--sheet); border-bottom-color: var(--line); }

.mark { grid-column: 1; justify-self: start; display: inline-flex; align-items: center; padding: 6px 0; text-decoration: none; }
.mark img { display: block; height: 56px; width: auto; }

.nav { grid-column: 2; display: flex; gap: 8px; }
.nav a {
  display: inline-flex; align-items: center;
  min-height: 44px; padding: 0 16px;
  font: 700 0.9375rem/1 var(--display);
  letter-spacing: 0.01em;
  color: var(--ink-soft); text-decoration: none;
}
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] {
  color: var(--ink);
  text-decoration: underline; text-decoration-color: var(--accent);
  text-decoration-thickness: 2px; text-underline-offset: 8px;
}

/* On a computer the gold line under a link is drawn in from the left on hover or focus and stays under the current page.
   The menu panel on phones keeps the plain underline above. */
@media (min-width: 761px) {
  .nav a {
    background: linear-gradient(var(--accent), var(--accent)) no-repeat left calc(100% - 5px) / 0 2px;
    background-origin: content-box;   /* the line is as wide as the word, not the padding */
    transition: color 0.2s, background-size 0.35s var(--ease-out);
  }
  .nav a[aria-current="page"] { text-decoration: none; background-size: 100% 2px; }
  .nav a:focus-visible { background-size: 100% 2px; }
}
@media (min-width: 761px) and (hover: hover) {
  .nav a:hover { background-size: 100% 2px; }
}

.menu-btn {
  display: none;
  min-height: 44px; padding: 0 16px;
  background: none; border: 1px solid var(--line); border-radius: 999px;
  font: 700 0.9375rem/1 var(--display); cursor: pointer;
}

/* ---------- Spotify player ----------
   A button in the header opens Spotify's own embedded player (it is Spotify's iframe, so its controls and colours are
   Spotify's). initPlayer in js/main.js builds the embed on the first click and keeps it on the page when the panel closes,
   so the music carries on. The equaliser follows play and pause. */

.player { position: relative; grid-column: 3; justify-self: end; }
.player__btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 40px; padding: 0 16px 0 13px;
  background: none; border: 1px solid rgba(249, 190, 74, 0.55); border-radius: 999px;
  font: 700 0.875rem/1 var(--display); letter-spacing: 0.01em;
  color: var(--ink); cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
}
.player__btn:hover, .player[data-open="true"] .player__btn { background: rgb(249 190 74 / 0.12); border-color: var(--accent); }
.player__icon { display: block; flex: none; color: var(--accent); }

.eq { display: inline-flex; align-items: flex-end; gap: 2px; width: 13px; height: 13px; }
.eq i { flex: 1; height: 100%; background: var(--accent); border-radius: 1px; transform: scaleY(0.3); transform-origin: bottom; }
.player[data-playing="true"] .eq i { animation: eq 0.9s ease-in-out infinite alternate; }
.player[data-playing="true"] .eq i:nth-child(2) { animation-duration: 1.15s; animation-delay: -0.4s; }
.player[data-playing="true"] .eq i:nth-child(3) { animation-duration: 0.8s; animation-delay: -0.7s; }
@keyframes eq { from { transform: scaleY(0.25); } to { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) {   /* playing shows still bars of different heights */
  .player[data-playing="true"] .eq i { animation: none !important; transform: scaleY(0.6); }
  .player[data-playing="true"] .eq i:nth-child(2) { transform: scaleY(1); }
  .player[data-playing="true"] .eq i:nth-child(3) { transform: scaleY(0.4); }
}

.player__panel {
  position: absolute; top: calc(100% + 12px); right: 0; z-index: 5;
  width: min(400px, calc(100vw - 2 * var(--gutter)));
  background: var(--well);
  border: 1px solid rgb(249 190 74 / 0.4); border-radius: 12px; overflow: hidden;
  box-shadow: 0 24px 48px -20px rgba(0, 0, 0, 0.65);
  /* closed: invisible and out of the tab order, but still on the page so the music keeps playing */
  visibility: hidden; opacity: 0; transform: translateY(-6px);
  transition: opacity 0.2s, transform 0.25s var(--ease-out), visibility 0s 0.25s;
}
.player[data-open="true"] .player__panel { visibility: visible; opacity: 1; transform: none; transition-delay: 0s; }

.player__frame { position: relative; height: 152px; }
.player__note {
  position: absolute; inset: 0; display: grid; place-content: center; gap: 6px;
  padding: 16px; text-align: center; font-size: 0.875rem; color: var(--ink-soft);
}
.player__note a { color: var(--accent-ink); }
.player__frame:has(iframe) .player__note { display: none; }   /* the note is only for the moment before the embed exists */
.player__frame iframe { position: relative; display: block; width: 100%; height: 152px; border: 0; }

/* ---------- sections ---------- */

main { flex: 1; display: flex; flex-direction: column; }

.section { padding: clamp(32px, 5vw, 72px) var(--gutter) clamp(56px, 8vw, 104px); }

.head { display: grid; gap: 12px; margin-bottom: clamp(28px, 4vw, 48px); }
h2 {
  font: 700 clamp(2rem, 4.4vw, 3.25rem)/1.05 var(--display);
  letter-spacing: -0.02em;
}
.lede { max-width: 54ch; color: var(--ink-soft); font-size: 0.9375rem; }

/* ---------- home: headline on the left, the photo on the right, header on top ---------- */

.home { position: absolute; inset: 0; z-index: 0; }

.hero {
  --photo-w: min(76vw, 166svh);   /* never wider than the photo's own shape (1.66:1), so a 21:9 screen shows it whole */
  position: absolute; inset: 0; overflow: hidden;
}

/* The photo sits on the right and dissolves into the navy on its left edge. The fade is a mask,
   so what shows through is the page itself and there is no seam. It ends before the aircraft's nose. */
.hero__photo {
  position: absolute; top: 0; right: 0; bottom: 0; width: var(--photo-w);
  margin: 0; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, rgb(0 0 0 / .16) 6%, rgb(0 0 0 / .46) 13%, rgb(0 0 0 / .8) 21%, #000 29%);
          mask-image: linear-gradient(90deg, transparent 0, rgb(0 0 0 / .16) 6%, rgb(0 0 0 / .46) 13%, rgb(0 0 0 / .8) 21%, #000 29%);
  animation: hero-fade 1.8s var(--ease-out) both;
}
/* a soft shade behind the header keeps the nav readable over bright sky */
.hero__photo::after {
  content: ""; position: absolute; inset: 0 0 auto 0; z-index: 2; pointer-events: none;
  height: clamp(140px, 26vh, 260px);
  background: linear-gradient(rgb(3 7 10 / .72), rgb(3 7 10 / .3) 55%, rgb(3 7 10 / 0));
}
.hero__layer { position: absolute; inset: 0; will-change: transform; }   /* moved a few pixels by the pointer, see initHero */
.hero__photo img {
  width: 100%; height: 100%; max-width: none;
  object-fit: cover; object-position: 15% 50%;
  transform-origin: 36% 58%;
  animation: hero-push 24s cubic-bezier(.2, .6, .2, 1) .2s both;   /* a very slow push-in, once */
}
@keyframes hero-fade { from { opacity: 0; } }
@keyframes hero-push { from { transform: scale(1.04); } to { transform: scale(1.085); } }

.hero__words {
  position: absolute; left: 0; top: 0; bottom: 0; z-index: 3;
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
  padding: calc(var(--bar-h) + 2svh) 0 6svh var(--gutter);
}
.hero__title {
  font: 700 clamp(2.2rem, min(3.9vw, 7svh), 5.6rem)/1.05 var(--hero-font);
  letter-spacing: -0.02em;
}
.hero__title .line { display: block; overflow: hidden; padding-bottom: .14em; margin-bottom: -.14em; }
.hero__title .line > span {
  display: inline-block;
  color: #e3ebf0;   /* fallback where text gradients are not supported */
  background: linear-gradient(100deg, #c7d7e0 0%, #ffffff 100%);   /* pale blue to white */
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: hero-rise .95s var(--ease-out) both; animation-delay: calc(.5s + var(--i) * .13s);
}
@keyframes hero-rise { from { transform: translateY(105%); } }
@media (forced-colors: active) {   /* high-contrast modes would hide gradient text */
  .hero__title .line > span { background: none; -webkit-text-fill-color: currentColor; color: CanvasText; }
}

.hero__sub {
  margin-top: clamp(14px, 2.4svh, 26px);
  font: 400 clamp(1.05rem, 1.45vw, 1.55rem)/1.4 var(--reading);
  color: var(--ink-soft);
  animation: hero-up .9s var(--ease-out) 1s both;
}
@keyframes hero-up { from { opacity: 0; transform: translateY(14px); } }

/* the link, with the runway line directly under it (stops before the nose) */
.hero__cta {
  display: grid;
  width: clamp(260px, calc(44vw - var(--gutter)), 1000px);
  margin-top: clamp(32px, 6.4svh, 72px);
  animation: hero-up .9s var(--ease-out) 1.15s both;
}
.hero__link {
  display: inline-flex; align-items: center; justify-self: start; min-height: 44px;
  font: 700 clamp(1.05rem, 1.5vw, 1.45rem)/1 var(--display);
  color: var(--ink); text-decoration: none;
}
.hero__link .arrow { display: inline-block; margin-left: .35em; transition: transform .3s var(--ease-out); }
.hero__link:hover .arrow, .hero__link:focus-visible .arrow { transform: translateX(6px); }

/* runway: the same nine dashes as the logo, growing toward the aircraft */
.runway { display: block; width: 100%; height: auto; margin-top: -4px; fill: var(--accent); overflow: visible; }
.runway rect {
  transform-box: fill-box; transform-origin: left center;
  animation: dash-on .6s var(--ease-out) both;
  animation-delay: calc(1.3s + var(--i) * .07s);
}
@keyframes dash-on { from { opacity: 0; transform: scaleX(.15); } }
@keyframes dash-sweep { 0%, 100% { fill: var(--accent); } 40% { fill: #fff3cf; } }
/* once the arrival is over (initHero adds .is-ready) the lights only sweep on hover or keyboard focus */
.hero.is-ready .runway rect { animation: none; }
.hero.is-ready .hero__cta:has(.hero__link:hover) .runway rect,
.hero.is-ready .hero__cta:has(.hero__link:focus-visible) .runway rect {
  animation: dash-sweep .9s ease-out both; animation-delay: calc(var(--i) * .075s);
}

/* phones and portrait tablets: the photo on top, fading into the words below */
@media (max-width: 760px), (max-aspect-ratio: 1/1) {
  .hero { display: grid; grid-template-rows: clamp(260px, 60svh, 640px) 1fr; }
  .hero__photo {
    position: relative; width: 100%; height: 100%;
    -webkit-mask-image: linear-gradient(180deg, #000 0, #000 58%, rgb(0 0 0 / .78) 70%, rgb(0 0 0 / .42) 83%, rgb(0 0 0 / .12) 93%, transparent 100%);
            mask-image: linear-gradient(180deg, #000 0, #000 58%, rgb(0 0 0 / .78) 70%, rgb(0 0 0 / .42) 83%, rgb(0 0 0 / .12) 93%, transparent 100%);
  }
  .hero__photo img { object-position: 22% 50%; transform-origin: 30% 55%; }
  .hero__words {
    position: relative; inset: auto; margin-top: -4svh; justify-content: flex-start;
    padding: 0 var(--gutter) calc(env(safe-area-inset-bottom, 0px) + 26px);
  }
  .hero__title { font-size: clamp(1.7rem, 8.4vw, 3.2rem); }
  .hero__sub { font-size: 1.05rem; }
  .hero__cta { width: 100%; margin-top: 22px; }
  .hero__link { font-size: 1.1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .hero, .hero * { animation: none !important; transition: none !important; }
  .hero__layer { transform: none !important; }
}

body[data-view="home"] { background: var(--sheet); }
body[data-view="home"] .sheet {
  max-width: none; margin: 0;
  min-height: 100vh; min-height: 100dvh;
  border-radius: 0; box-shadow: none;
  background: radial-gradient(110% 80% at 12% 0%, var(--sheet-hi), var(--sheet) 68%);
  background-color: var(--sheet);
}
body[data-view="home"] .bar {
  position: absolute; top: 0; left: 0; right: 0;
  border-radius: 0; background: none; border-bottom-color: transparent;
}
body[data-view="home"] .nav a { color: rgba(255, 225, 143, 0.9); }
body[data-view="home"] .nav a:hover { color: var(--ink); }
body[data-view="home"] .menu-btn { color: var(--ink); border-color: rgba(255, 225, 143, 0.5); }
body[data-view="home"] :focus-visible { outline-color: var(--focus-dark); }
body[data-view="home"] .foot { display: none; }

/* ---------- portfolio: the gallery ----------
   Rows of photos run edge to edge. initPortfolio (js/main.js) decides which photos share a row; here each tile's width
   follows its own shape (--ar), so the photos in a row come out the same height and none is cropped. */

.gallery { --gap: clamp(6px, 0.7vw, 12px); display: grid; gap: var(--gap); }
.row { display: flex; gap: var(--gap); }
.row--short { width: calc(var(--fill) * 100%); }   /* a last row with too few photos to fill it keeps the same height as the rows above */

.tile {
  flex: var(--ar) 1 0px; min-width: 0;
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}
.js-ready .tile:not(.is-in) { opacity: 0; transform: translateY(24px); }

.tile__btn {
  position: relative; display: block; width: 100%;
  aspect-ratio: var(--ar);
  padding: 0; border: 0;
  background: var(--well);
  overflow: hidden;
  cursor: zoom-in;
}
.tile__btn img {
  width: 100%; height: 100%; object-fit: cover;   /* the box has the photo's own shape, so nothing is cut off */
  user-select: none; -webkit-user-drag: none;
  transition: transform 1.1s var(--ease-out);
}

/* a soft navy shade and the caption rise in over the photo on hover or keyboard focus */
.tile__btn::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgb(18 19 42 / 0.82), rgb(18 19 42 / 0.28) 38%, rgb(18 19 42 / 0) 62%);
  opacity: 0; transition: opacity 0.5s var(--ease-out);
}
.tile__cap {
  position: absolute; inset: auto 0 0 0; z-index: 1;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  padding: clamp(14px, 1.8vw, 28px);
  text-align: left; font-size: 0.8125rem; line-height: 1.5; letter-spacing: 0.02em;
  color: var(--on-dark-soft); font-variant-numeric: tabular-nums;
  opacity: 0; transform: translateY(10px);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
}
.tile__text { display: grid; }
.tile__title { font: 500 clamp(1rem, 1.4vw, 1.25rem)/1.35 var(--display); letter-spacing: 0; color: var(--on-dark); }
.tile__cap .reg { color: var(--on-dark); }
.tile__no { flex: none; }

.tile__btn:focus-visible { outline-offset: -4px; }
.tile__btn:focus-visible img { transform: scale(1.03); }
.tile__btn:focus-visible::after { opacity: 1; }
.tile__btn:focus-visible .tile__cap { opacity: 1; transform: none; }
@media (hover: hover) {
  .tile__btn:hover img { transform: scale(1.03); }
  .tile__btn:hover::after { opacity: 1; }
  .tile__btn:hover .tile__cap { opacity: 1; transform: none; }
}

.reg { margin-left: 0.9em; letter-spacing: 0.04em; color: var(--ink); }

.round {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; padding: 0;
  background: none; border: 1px solid var(--line); border-radius: 50%;
  color: var(--ink); cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}
.round:hover:not(:disabled) { background: var(--ink); border-color: var(--ink); color: var(--sheet); }
.round:active:not(:disabled) { transform: scale(0.96); }
.round:disabled { opacity: 0.38; cursor: default; }

/* ---------- wallpaper ---------- */

.wp {
  display: grid; gap: clamp(28px, 4vw, 56px);
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr);
  align-items: start;
}

.wp__stage {
  container-type: size;
  height: clamp(280px, 36vw, 440px);
  display: grid; place-items: center;
  background: var(--well);
  border-radius: 4px;
}
.wp__screen {
  --ar: 1.7778;
  width: min(calc(100cqw - 56px), calc((100cqh - 56px) * var(--ar)));
  aspect-ratio: var(--ar);
  overflow: hidden;
  border-radius: 4px;
  background: var(--device);
  box-shadow: 0 0 0 5px var(--device), 0 24px 36px -16px rgba(0, 0, 0, 0.6);
  transition: width 0.35s var(--ease-out);
}
.wp__screen[data-group="mobile"] { border-radius: 18px; box-shadow: 0 0 0 6px var(--device), 0 24px 36px -16px rgba(0, 0, 0, 0.6); }
.wp__screen img { width: 100%; height: 100%; object-fit: cover; }
.wp__meta { margin-top: 14px; font-size: 0.8125rem; letter-spacing: 0.02em; color: var(--ink-soft); }
.wp__meta strong { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }
.wp__name { display: block; }

.wp__controls { display: grid; gap: 28px; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend {
  padding: 0; margin-bottom: 10px;
  font: 700 1.125rem/1.3 var(--display);
  letter-spacing: -0.01em;
}

.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)); gap: 8px; }
.thumb { position: relative; display: block; cursor: pointer; }
.thumb input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.thumb img {
  width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover;
  background: var(--well);
  outline: 2px solid transparent; outline-offset: 2px;
  opacity: 0.72;
  transition: opacity 0.15s;
}
.thumb:hover img { opacity: 1; }
.thumb input:checked + img { opacity: 1; outline-color: var(--accent); }
.thumb input:focus-visible + img { outline: 3px solid var(--ink); }

.preset { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 4px; cursor: pointer; border-bottom: 1px solid var(--line); }
.preset input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.preset__size { font-variant-numeric: tabular-nums; font-size: 0.9375rem; }
.preset__note { flex: 1; font-size: 0.8125rem; color: var(--ink-soft); }
.preset__bytes { font-size: 0.8125rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.preset--off { opacity: 0.45; cursor: default; }
.preset--off input { cursor: default; }

/* pill buttons: For PC / iPad, For Phone, and the aspect ratios */
.wp__modes, .wp__ratios { display: flex; flex-wrap: wrap; gap: 8px; }
.wp__modes { margin-bottom: 16px; }
.wp__ratios { margin-bottom: 8px; }
.seg { position: relative; display: inline-flex; cursor: pointer; }
.seg input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.seg span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px;
  border: 1px solid var(--line); border-radius: 999px;
  font: 700 0.9375rem/1 var(--display); color: var(--ink-soft);
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.seg:hover span { border-color: var(--ink-soft); color: var(--ink); }
.seg input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--sheet); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 3px; }

.wp__empty { padding: 12px 0 4px; font-size: 0.9375rem; color: var(--ink-soft); }
.wp__screen.is-empty { background: var(--device); }
.wp__presets-group + .wp__presets-group { margin-top: 20px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 28px;
  background: var(--ink); color: var(--sheet);
  font: 700 0.9375rem/1 var(--display); letter-spacing: 0.01em; text-decoration: none;
  border-radius: 2px;
  transition: background-color 0.15s;
}
.btn:hover { background: var(--accent-ink); }
.btn[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }
.btn:active { transform: translateY(1px); }

/* ---------- journal ---------- */

.log { width: 100%; border-collapse: collapse; font-size: 0.9375rem; font-variant-numeric: tabular-nums; }
.log th {
  padding: 0 12px 12px 0; text-align: left;
  font: 700 0.9375rem/1.3 var(--display); letter-spacing: 0.01em; color: var(--ink);
  border-bottom: 1px solid var(--ink);
}
.log td { padding: 14px 12px 14px 0; border-bottom: 1px solid var(--line); vertical-align: baseline; }
.log td:first-child { white-space: nowrap; color: var(--ink-soft); }
.log tbody tr:hover { background: rgba(255, 225, 143, 0.06); }
.log .t-airline { font: 500 1.0625rem/1.4 var(--display); }
.log .t-note { display: block; font-size: 0.8125rem; color: var(--ink-soft); }
.log .t-last { text-align: right; padding-right: 0; }
.log .view {
  min-width: 44px; min-height: 44px; padding: 0 10px;
  background: none; border: 0; cursor: pointer;
  color: var(--accent-ink); font-variant-numeric: tabular-nums; letter-spacing: 0.04em;
  text-decoration: underline; text-underline-offset: 4px;
}

/* ---------- about ---------- */

.about {
  display: grid; gap: clamp(32px, 6vw, 96px);
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr);
  align-items: start;
}
.about__text { max-width: 36rem; }
.about__text h2 { margin-bottom: clamp(28px, 3.2vw, 40px); font-weight: 600; font-size: clamp(2.375rem, 2.1rem + 0.7vw, 2.75rem); line-height: 1.05; }
.about__sig { font: 500 clamp(1.375rem, 1.2rem + 0.55vw, 1.5rem)/1.3 var(--display); letter-spacing: -0.005em; color: var(--ink); }
.about__sig span { display: block; }
.about__sig span:last-child { color: var(--accent-ink); }
.about__body { display: grid; gap: 1.25em; max-width: 34rem; margin-top: clamp(28px, 3.4vw, 44px); font: 400 clamp(1.0625rem, 1rem + 0.2vw, 1.125rem)/1.7 var(--reading); color: var(--ink-body); }
.about__close { padding-left: 18px; border-left: 2px solid var(--accent); color: var(--ink); }
.gear { display: grid; grid-template-columns: max-content 1fr; gap: 8px 24px; margin-top: clamp(32px, 4vw, 48px); padding-top: 22px; border-top: 1px solid var(--line); font: 400 0.9375rem/1.5 var(--reading); }
.gear dt { padding-top: 0.2em; font-size: 0.75rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-soft); }

/* the text eases in each time the page opens; skipped when the visitor asks for less motion */
@media (prefers-reduced-motion: no-preference) {
  #about:not([hidden]) .about__text > * { animation: rise-in 0.8s var(--ease-out) both; }
  #about:not([hidden]) .about__text > :nth-child(2) { animation-delay: 80ms; }
  #about:not([hidden]) .about__text > :nth-child(3) { animation-delay: 180ms; }
  #about:not([hidden]) .about__text > :nth-child(4) { animation-delay: 260ms; }
  #about:not([hidden]) .about__photo { animation: rise-in 1s var(--ease-out) 120ms both; }
  @keyframes rise-in { from { opacity: 0; transform: translateY(14px); } }
}
/* the photo keeps its own shape (--ar, set from its pixel size), never cropped, and as tall as the window allows */
.about__photo { justify-self: end; width: min(100%, calc((100svh - 240px) * var(--ar, 0.8))); }
.about__photo img { width: 100%; aspect-ratio: var(--ar, 0.8); object-fit: cover; background: var(--well); box-shadow: 0 26px 40px -22px rgba(0, 0, 0, 0.7); }
.about__photo figcaption { margin-top: 14px; font-size: 0.75rem; letter-spacing: 0.02em; color: var(--ink-soft); }

/* ---------- contact ---------- */

/* one narrow column in the middle of the page: title, fields, button, then the social icons */
#contact .head { justify-items: center; text-align: center; }
.contact { display: grid; gap: clamp(32px, 4vw, 44px); max-width: 26rem; margin-inline: auto; }
.contact .lede { margin-inline: auto; text-align: center; }   /* the no-JavaScript note */

.cform { display: grid; gap: 20px; }
.field { display: grid; gap: 8px; align-content: start; }
.field label { font-size: 0.9375rem; line-height: 1.4; }
.field .req { color: var(--accent); }
.field input, .field textarea {
  width: 100%; min-height: 52px; padding: 13px 16px;
  font: 400 1rem/1.5 var(--sans); color: var(--field-ink);
  background: var(--field); border: 1px solid var(--field-line); border-radius: 4px;
  transition: border-color 0.15s, background-color 0.15s;
}
.field ::placeholder { color: var(--field-hint); opacity: 1; }
.field textarea { min-height: 168px; resize: vertical; }
.field input:hover, .field textarea:hover { border-color: var(--field-line-hi); }
.field input:focus, .field textarea:focus { border-color: var(--accent); background: var(--field-hi); }
.field [aria-invalid="true"] { border-color: var(--error); box-shadow: 0 0 0 2px var(--error); }
.field__err { font-size: 0.8125rem; line-height: 1.5; color: var(--error); }

/* the spam trap stays in the page for bots but off-screen for people */
.cform__trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.cform__error { text-align: center; font-size: 0.9375rem; line-height: 1.5; color: var(--error); }

.cform__send { justify-self: start; gap: 10px; min-height: 48px; padding: 0 30px; border: 0; border-radius: 999px; cursor: pointer; }
.cform__send:disabled { cursor: progress; background: var(--accent-ink); }
.cform__spin { display: none; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; }
.cform[data-state="sending"] .cform__spin { display: block; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .cform[data-state="sending"] .cform__spin { animation: none; } }   /* a still ring; the label says "Sending…" */

.cform__done { text-align: center; }
.cform__done:focus { outline: none; }
.cform__done h3 { font: 700 1.5rem/1.2 var(--display); letter-spacing: -0.01em; }
.cform__done p { margin-top: 8px; color: var(--ink-body); }
.cform__again {
  min-height: 44px; margin-top: 8px; padding: 0;
  background: none; border: 0; cursor: pointer;
  font: 700 0.9375rem/1 var(--display); color: var(--ink);
  text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 5px;
}

.social { display: flex; justify-content: center; gap: 12px; }
.social .round { text-decoration: none; transition: background-color 0.15s, border-color 0.15s, color 0.15s, transform 0.2s var(--ease-out); }
.social .round:hover { transform: translateY(-2px); }

/* ---------- footer ---------- */

.foot {
  display: grid; justify-items: center; gap: 6px;
  padding: 28px var(--gutter) 36px;
  border-top: 1px solid var(--line);
  font-size: 0.75rem; letter-spacing: 0.04em; color: var(--ink-soft);
  text-align: center;
}
.foot p { text-wrap: balance; }

/* ---------- photo viewer ---------- */

.lb {
  width: 100%; max-width: none; height: 100%; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: transparent; color: var(--on-dark);
}
.lb[open] { display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.lb::backdrop { background: rgba(18, 19, 42, 0.96); }
.lb :focus-visible { outline-color: var(--focus-dark); }

.lb__stage {
  display: grid; place-items: center; min-height: 0;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);   /* a fixed-size cell, so the photo's max-height has something to measure against */
  padding: clamp(12px, 3vw, 40px) clamp(12px, 3vw, 40px) 0;
  touch-action: pan-y pinch-zoom;   /* a sideways swipe changes photo (see initViewer) */
}
.lb__stage img { max-width: 100%; max-height: 100%; object-fit: contain; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.6); }

.lb__bar {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
  padding: 18px clamp(12px, 3vw, 40px) 22px;
}
.lb__info { display: grid; justify-items: start; gap: 6px; min-width: 0; }
.lb__zoom {
  min-height: 44px; padding: 0;
  background: none; border: 0; cursor: pointer;
  font: 700 0.9375rem/1 var(--display); color: var(--on-dark);
  text-decoration: underline; text-underline-offset: 5px;
}
.lb__zoom[aria-disabled="true"] { cursor: progress; text-decoration: none; opacity: 0.75; }
.lb__stage.can-zoom img { cursor: zoom-in; }

/* actual size: the photo at one pixel per screen pixel, scrolled or dragged around inside the stage */
.lb__stage.is-zoomed { display: flex; overflow: auto; overscroll-behavior: contain; padding: 0; touch-action: auto; }
.lb__stage.is-zoomed:focus-visible { outline-offset: -4px; }
.lb__stage.is-zoomed img { flex: none; width: var(--zw); height: auto; max-width: none; max-height: none; margin: auto; cursor: grab; box-shadow: none; }
.lb__cap { display: grid; font-size: 0.8125rem; line-height: 1.6; letter-spacing: 0.02em; color: var(--on-dark-soft); font-variant-numeric: tabular-nums; }
.lb__cap strong { font: 500 1.25rem/1.4 var(--display); letter-spacing: 0; color: var(--on-dark); }
.lb__cap .reg { color: var(--on-dark); }
.lb__ctl { display: flex; align-items: center; gap: 8px; flex: none; }
.lb__wp { margin-right: 12px; font: 700 0.9375rem/1 var(--display); color: var(--on-dark); text-underline-offset: 5px; }
.round--dark { border-color: rgba(230, 234, 237, 0.35); color: var(--on-dark); }
.round--dark:hover:not(:disabled) { background: var(--on-dark); border-color: var(--on-dark); color: var(--backdrop); }

@media (prefers-reduced-motion: no-preference) {
  .lb[open] .lb__stage img { animation: fade-in 0.25s ease-out both; }
  @keyframes fade-in { from { opacity: 0; } }
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  /* not enough room beside the centred nav for the name: the player button becomes a round icon */
  .player__btn { width: 40px; padding: 0; }
  .player__name, .eq { display: none; }
  .player[data-playing="true"] .player__icon { display: none; }   /* while playing, the equaliser takes the icon's place */
  .player[data-playing="true"] .eq { display: inline-flex; }

  .wp { grid-template-columns: 1fr; }
  .about { grid-template-columns: 1fr; }
  .about__photo { width: 100%; max-width: 460px; justify-self: start; }
}

@media (max-width: 760px) {
  :root { --bar-h: 72px; }
  .mark img { height: 40px; }

  .sheet { margin: 0; border-radius: 0; min-height: 100svh; }
  .bar { border-radius: 0; display: flex; gap: 8px; }
  .mark { margin-right: auto; }

  .menu-btn { display: inline-flex; align-items: center; order: 2; }

  /* the player button sits just left of Menu; its panel drops full width under the header, like the menu panel */
  .player { position: static; order: 1; }
  .player__btn { width: 44px; min-height: 44px; }
  .player__panel {
    top: 100%; left: 0; right: 0; width: auto;
    border-width: 0 0 1px; border-radius: 0;
    box-shadow: 0 24px 40px -24px rgba(0, 0, 0, 0.5);
  }

  .nav {
    position: absolute; top: 100%; left: 0; right: 0;
    display: none; flex-direction: column; gap: 0;
    padding: 8px var(--gutter) 16px;
    background: var(--sheet); border-bottom: 1px solid var(--line);
    box-shadow: 0 24px 40px -24px rgba(0, 0, 0, 0.5);
  }
  .nav[data-open="true"] { display: flex; }
  .nav a { min-height: 52px; padding: 0; font-size: 1.0625rem; border-bottom: 1px solid var(--line); }
  .nav a:last-child { border-bottom: 0; }

  /* on the home image the menu panel is dark */
  body[data-view="home"] .nav { background: rgba(4, 8, 11, 0.94); border-bottom-color: rgba(255, 255, 255, 0.18); box-shadow: none; }
  body[data-view="home"] .nav a { border-bottom-color: rgba(255, 255, 255, 0.18); }

  .log thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .log, .log tbody, .log tr, .log td { display: block; }
  .log tr { position: relative; padding: 16px 52px 16px 0; border-bottom: 1px solid var(--line); }
  .log td { padding: 0; border: 0; }
  .log td:first-child { margin-bottom: 2px; font-size: 0.8125rem; }
  .log td.t-airline { font-size: 1.125rem; }
  .log td[data-label]::before { content: attr(data-label) " "; color: var(--ink-soft); }
  .log td.t-last { position: absolute; top: 50%; right: 0; transform: translateY(-50%); }
  .log td.t-last::before { content: none; }
  .log td.is-empty { display: none; }

  .lb__bar { flex-direction: column; align-items: stretch; gap: 14px; }
  .lb__ctl { justify-content: space-between; }
  .lb__wp { margin-right: auto; }
}

/* ---------- ultrawide: 21:9 and wider ----------
   Everywhere else the sheet is a centered 1560px column. On a very wide screen that leaves wide dark
   margins and small photos, so here the sheet fills the screen, the portfolio puts about three photos in a row
   (see LAYOUTS in js/main.js) and the sizes that matter follow the height of the window (the wallpaper stage,
   the About photo) to keep each page in view. */

@media (min-aspect-ratio: 2/1) and (min-width: 1800px) {
  :root {
    --gutter: clamp(72px, 4.5vw, 200px);
    --bar-h: 96px;
  }

  .sheet { max-width: none; margin: 16px 24px; }
  .mark img { height: 64px; }
  .nav a { padding: 0 18px; font-size: 1.0625rem; }
  .player__btn { min-height: 44px; font-size: 0.9375rem; }

  .section { padding: 56px var(--gutter) 64px; }
  .head {
    grid-template-columns: auto minmax(0, 1fr); align-items: end;
    column-gap: clamp(40px, 4vw, 112px); margin-bottom: 40px;
  }
  h2 { font-size: 3.5rem; }
  .lede { max-width: 64ch; padding-bottom: 6px; font-size: 1.0625rem; }

  .gallery { --gap: clamp(10px, 0.5vw, 20px); }
  .tile__cap { font-size: 0.875rem; }

  .about { grid-template-columns: minmax(0, 44rem) auto; justify-content: center; gap: clamp(64px, 8vw, 280px); align-items: center; }
  .about__text { max-width: 44rem; }
  .about__sig { font-size: clamp(1.5rem, 0.75rem + 1.2vh, 1.75rem); }
  .about__text h2 { margin-bottom: clamp(24px, 3vh, 40px); }
  .about__body { max-width: 40rem; margin-top: clamp(24px, 3vh, 44px); font-size: clamp(1.0625rem, 0.5rem + 1vh, 1.1875rem); }
  .gear { font-size: 1rem; }
  /* the photo keeps its own shape (--ar, set from its size) and is as tall as the page allows */
  .about__photo { width: calc((100svh - 380px) * var(--ar, 1.5)); }
  .about__photo img { aspect-ratio: var(--ar, 1.5); }

  /* the three size groups sit side by side, so the controls are no taller than the preview */
  .wp { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: clamp(40px, 4vw, 120px); }
  .wp__stage { height: clamp(360px, calc(100svh - 500px), 900px); }
  .thumbs { grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); }
  #wp-presets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(24px, 2vw, 56px); align-items: start; }  .wp__presets-group + .wp__presets-group { margin-top: 0; }
  .wp__controls .btn { justify-self: start; min-width: 360px; }

  .log { max-width: 2200px; }
  #contact .head { grid-template-columns: 1fr; }   /* the title stands alone, centred over the form */
  .contact { max-width: 30rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0ms !important; transition-duration: 0.01ms !important; }
}
