/*
  Matches the Figma frames "Desktop - Splash Page", "Desktop - About", "Desktop - Contact" and
  "Desktop - Project Spec Page", all 1440 × 1024.

  Every size is the design value × a scale that main.js sets from the window size:
    --s   home / pages        --gs  project gallery        --hs  header
  and --oy is the room left over above the design when the window is taller than it needs to be
  (the design is anchored to the bottom, so extra height shows up as space at the top).
*/

/* ───────── fonts (files live in /fonts) ───────── */
@font-face { font-family: "DK Display Patrol"; src: url("fonts/DKDisplayPatrol.otf") format("opentype"); font-display: swap; }
@font-face { font-family: "Elegant Typewriter"; font-weight: 300; font-style: normal; src: url("fonts/ElegantTypewriter-Light.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Elegant Typewriter"; font-weight: 400; font-style: normal; src: url("fonts/ElegantTypewriter-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Elegant Typewriter"; font-weight: 400; font-style: italic; src: url("fonts/ElegantTypewriter-Italic.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Elegant Typewriter"; font-weight: 700; font-style: normal; src: url("fonts/ElegantTypewriter-Bold.ttf") format("truetype"); font-display: swap; }
/* Public Sans Light (an open-source font) — the "Body - Public Sans" text style in Figma */
@font-face {
  font-family: "Public Sans"; font-weight: 300; font-style: normal; font-display: swap;
  src: url("fonts/PublicSans-Light-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Public Sans"; font-weight: 300; font-style: normal; font-display: swap;
  src: url("fonts/PublicSans-Light-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Public Sans Regular / Medium / SemiBold / Black — the "Tiny", "Tiny All Caps" and "Tiny B All Caps" text styles in Figma.
   One variable font file covers every weight from 400 to 900. */
@font-face { font-family: "Public Sans"; font-weight: 400 900; font-style: normal; font-display: swap; src: url("fonts/PublicSans-Variable-latin.woff2") format("woff2"); }

:root {
  --paper: #f7f2e5;
  --ink: #302f15;
  --soot: #161618;       /* phone body text ("soot grey" in Figma) */
  --hint: #7a7a7a;       /* form labels + the contact note */
  --tile: #d9d9d9;
  --ink-soft: #7d8a47;   /* the lighter olive green links fade to on hover */
  --display: "DK Display Patrol", Impact, sans-serif;
  --type: "Elegant Typewriter", "Courier New", monospace;
  --body: "Public Sans", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;   /* paragraphs: home bio, About, form labels */
  --ease: cubic-bezier(.19, 1, .22, 1);        /* strong ease-out: quick to start, long soft landing */
  --ease-io: cubic-bezier(.625, .05, 0, 1);   /* for things that travel from one place to another */
  --s: 1;        /* layout scale, set by script */
  --gs: 1;       /* project gallery scale, set by script */
  --hs: 1;       /* header scale, set by script */
  --oy: 0px;     /* spare height above the design, set by script */
  --fl: 728px;   /* left edge of the featured tile / gallery column, set by script */
  --ar: 148px;   /* distance from the right edge to the featured tile, set by script */
  --gl: 728px;   /* left edge of the project gallery, set by script */
  --gt: 160px;   /* top of the project gallery, set by script */
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--paper) url("assets/paper.png") center / cover fixed;
  color: var(--ink);
  font-family: var(--type);
  -webkit-font-smoothing: antialiased;
  touch-action: none;      /* on the home page the whole window scrolls the strip */
  user-select: none;
  -webkit-user-select: none;
}
body.dragging, body.dragging * { cursor: grabbing; }

/* opening: nothing is drawn until main.js has set the size, loaded the fonts and the first picture, then the page fades in once */
html.js:not(.ready) body { opacity: 0; }
html.js:not(.ready) .tile { animation-play-state: paused; }   /* the tiles' entrance waits for the reveal */
html.js body { transition: opacity .6s var(--ease); }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

/* ───────── header (same on every page) ───────── */

.logo {
  position: absolute;
  left: calc(30px * var(--hs)); top: calc(28px * var(--hs));
  width: calc(205px * var(--hs)); height: calc(51px * var(--hs));
  z-index: 6;
}
.logo img { width: 100%; height: 100%; object-fit: cover; display: block; }

.top nav {
  position: absolute;
  right: calc(30px * var(--hs)); top: calc(34px * var(--hs));
  display: flex; align-items: center;
  font: 600 calc(16px * var(--hs)) / calc(33px * var(--hs)) var(--body);   /* "C - Tiny All Caps" */
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink);
  z-index: 6;
}
/* two text boxes of the width they have in Figma (83 and 86), right-aligned: About ends at 1173, Contact at 1291, the Instagram icon starts at 1392 */
.nl { display: block; text-align: right; }
.nl-about   { width: calc(83px * var(--hs)); margin-right: calc(32px * var(--hs)); }
.nl-contact { width: calc(86px * var(--hs)); margin-right: calc(101.2px * var(--hs)); }
.nl { transition: color .55s var(--ease); }
.nl:hover, .nl:focus-visible, body[data-view="about"] .nl-about, body[data-view="contact"] .nl-contact { color: var(--ink-soft); }
/* the Instagram icon is the file from Figma (assets/icon-instagram.svg), painted in the text colour so it can fade on hover */
.ig {
  position: relative; display: block;
  width: calc(16.6px * var(--hs)); height: calc(16.6px * var(--hs));
  margin-right: calc(1.2px * var(--hs));
  background-color: var(--ink);
  -webkit-mask: url("assets/icon-instagram.svg") center / 100% 100% no-repeat;
  mask: url("assets/icon-instagram.svg") center / 100% 100% no-repeat;
  transition: transform .6s var(--ease), background-color .55s var(--ease);
}
.ig:hover, .ig:focus-visible { background-color: var(--ink-soft); }
.ig::before { content: ""; position: absolute; inset: -12px; }   /* a bigger target to click than the little icon */
.ig:hover { transform: rotate(-8deg) scale(1.08); }

/* ───────── home: strip ───────── */

.strip {
  position: absolute;
  left: 0; right: 0;
  top: calc(var(--oy) + 316px * var(--s));
  height: calc(676px * var(--s));
  overflow: hidden;
  transition: opacity .5s var(--ease);
}

.tile {
  position: absolute; left: 0; top: 0;
  pointer-events: none;
  will-change: transform;
  transition: opacity .55s var(--ease);
  animation: rise 1.1s var(--ease) var(--in, 0s) backwards;
}
.strip.settled .tile { animation: none; }
@keyframes rise { from { opacity: 0; translate: 0 24px; } to { opacity: 1; translate: 0 0; } }

.card {
  position: absolute; inset: 0;
  overflow: hidden;
  border-radius: calc(14px * var(--s));
  background: var(--tile);
  pointer-events: auto;
  cursor: pointer;
}
.media { position: absolute; inset: -6%; pointer-events: none; will-change: transform; }
.media img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* a cropped cover: a box in the big tile's shape, scaled to cover the frame it's in (so the crop is never stretched) */
.media.cropped { inset: 0; transform: none !important; }
.cc-box { position: absolute; inset: 0; container-type: size; }
.cc { position: absolute; left: 50%; top: 50%; width: max(100cqw, calc(100cqh * var(--cc))); aspect-ratio: var(--cc); translate: -50% -50%; }
.media .cc img { width: auto; height: auto; }

/* placeholder until a real cover is set in projects.js */
.ph {
  width: 100%; height: 100%;
  display: grid; place-content: center; text-align: center;
  background: var(--tile);
  color: rgba(48, 47, 21, .4);
  font: 400 calc(18px * var(--s)) / 1 var(--type);
  letter-spacing: .06em;
}
.ph small { display: block; margin-top: .6em; font-size: .62em; letter-spacing: .2em; text-transform: uppercase; }

/* ───────── home: text above the tiles ───────── */

.desc {
  position: absolute;
  left: calc(32px * var(--s)); top: calc(var(--oy) + 308px * var(--s));
  width: calc(461px * var(--s));
  margin: 0;
  font: 300 calc(24px * var(--s)) / normal var(--type);   /* Elegant Typewriter Light, 24 */
  z-index: 2;
  transition: opacity .4s var(--ease);
}
/* the little olive branch above the bio */
.h-olive {
  position: absolute;
  left: calc(32px * var(--s)); top: calc(var(--oy) + 213px * var(--s));
  width: calc(54px * var(--s)); height: calc(35.74px * var(--s));
  z-index: 2;
  transition: opacity .4s var(--ease);
}
.info {
  position: absolute;
  left: var(--fl); top: calc(var(--oy) + 202px * var(--s));
  width: calc(460px * var(--s));
  z-index: 2;
  transition: opacity .4s var(--ease);
}
.info b, .info span { display: block; }
.info b { font: 700 calc(48px * var(--s)) / calc(55px * var(--s)) var(--type); white-space: nowrap; }   /* "Poster" — "C - Heading"; a long title stays on one line, as in Figma */
.info span { margin-top: calc(10px * var(--s)); font: 600 calc(16px * var(--s)) / calc(18px * var(--s)) var(--body); letter-spacing: .05em; text-transform: uppercase; }   /* "C - Tiny All Caps" */
.info b, .info span { transition: opacity .3s var(--ease); }
.out { opacity: 0; }

/* coming back home: the text rises just like About and Contact do when they open */
body.home-enter .desc, body.home-enter .h-olive { animation: rise 1.1s var(--ease) .12s backwards; }
body.home-enter .info { animation: rise 1.1s var(--ease) .22s backwards; }

/* what happens to the home page while something else is open */
body.p-open .strip, body.on-page .strip { pointer-events: none; }
body.on-page .strip { opacity: 0; }
body.p-open .tile:not(.src) { opacity: 0; }
.tile.src { visibility: hidden; }
body.p-open .desc, body.p-open .info, body.p-open .h-olive, body.on-page .desc, body.on-page .info, body.on-page .h-olive { opacity: 0; pointer-events: none; }

/* ───────── project page ───────── */

.project {
  position: fixed; inset: 0;
  z-index: 4;
  visibility: hidden;
  pointer-events: none;
}
.project.show { visibility: visible; pointer-events: auto; }

.p-scroll {
  position: absolute; inset: 0;
  overflow-y: auto; overflow-x: hidden;
  overscroll-behavior: contain;
  touch-action: pan-y;
  outline: none;
  scrollbar-width: none;
}
.p-scroll::-webkit-scrollbar { display: none; }

/* the left column stays put while the gallery scrolls */
.p-fixed {
  position: fixed;
  pointer-events: none;      /* so the wheel reaches the scroller beneath */
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .35s var(--ease), transform .5s var(--ease);
}
body.p-open .p-fixed { opacity: 1; transform: none; transition: opacity .8s var(--ease) .45s, transform 1s var(--ease) .45s; }
.project.swapping .p-fixed, .project.swapping .p-gallery { opacity: 0 !important; transition: opacity .38s var(--ease) !important; }

/* Prev / Next Project: the new pictures start hidden and a little lower, then rise in one after another (the same entrance as a project opening) */
.p-gallery.entering .g-item { opacity: 0 !important; transform: translateY(calc(56px * var(--gs))) !important; transition: none !important; }
.p-gallery.swap-in .g-item {
  transition: opacity 1s var(--ease) calc(var(--d, .75s) - .62s), transform 1.3s var(--ease) calc(var(--d, .75s) - .62s) !important;
}

.p-text {
  left: calc(32px * var(--hs)); top: calc(var(--oy) + 532px * var(--hs));
  width: calc(555px * var(--hs));
  font: 400 calc(16px * var(--hs)) / calc(18px * var(--hs)) var(--body);
  letter-spacing: .05em;
}
.p-text b { display: block; height: calc(56px * var(--hs)); font: 700 calc(36px * var(--hs)) / normal var(--type); }
.p-text span { display: block; }
.p-text span:empty { display: none; }
.p-text #pSpecs { height: calc(22px * var(--hs)); margin-top: calc(-4px * var(--hs)); font: 600 calc(16px * var(--hs)) / calc(18px * var(--hs)) var(--body); text-transform: uppercase; }
.p-text #pDesc { width: calc(460px * var(--hs)); margin-top: calc(30px * var(--hs)); min-height: calc(44px * var(--hs)); }

/* Prev / Next Project: two arrows under the text, however long it is (assets/icon-arrow.svg, painted in the text colour) */
.p-nav {
  width: calc(341.33px * var(--hs));
  margin: calc(79.8px * var(--hs)) 0 0 calc(-1.5px * var(--hs));
  display: flex; justify-content: space-between;
  color: var(--ink);
}
.p-nav a {
  display: block; pointer-events: auto;
  width: calc(21.67px * var(--hs)); height: calc(21.67px * var(--hs));
  background-color: currentColor;
  -webkit-mask: url("assets/icon-arrow.svg") center / 100% 100% no-repeat;
  mask: url("assets/icon-arrow.svg") center / 100% 100% no-repeat;
  transition: color .55s var(--ease), transform .5s var(--ease);
}
.p-nav #pNext { transform: rotate(180deg); }
.p-nav a:hover, .p-nav a:focus-visible { color: var(--ink-soft); }
.p-nav[hidden] { display: none; }

.p-gallery {
  margin-left: var(--gl);
  width: calc(555px * var(--gs));
  padding: var(--gt) 0 calc(160px * var(--gs));
  display: flex; flex-direction: column; gap: calc(19px * var(--gs));
}
.g-item {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: calc(14px * var(--gs));
  background: var(--tile);
  opacity: 0;
  transform: translateY(calc(70px * var(--gs)));
  transition: opacity .35s var(--ease), transform .5s var(--ease);
}
.g-item .media { inset: 0; will-change: auto; }
.g-item { contain: layout paint; backface-visibility: hidden; }
.g-item.zoomable { cursor: zoom-in; }
.g-item .ph { font-size: calc(18px * var(--gs)); }
.g-tall  { height: calc(693px * var(--gs)); }
.g-short { height: calc(401px * var(--gs)); }

/* the cover is the shared element: script flies a copy in from the clicked tile, then reveals this */
.g-item.first { opacity: 1; transform: none; transition: none; }
.g-item.first.wait { visibility: hidden; }
body.p-open .g-item:not(.first) {
  opacity: 1; transform: none;
  transition: opacity .8s var(--ease) var(--d, .4s), transform 1.1s var(--ease) var(--d, .4s);
}

.ghost {
  position: fixed; left: 0; top: 0; z-index: 5;   /* it travels by transform (smooth); only its size is animated as layout */
  overflow: hidden;
  background: var(--tile);
  pointer-events: none;
  will-change: transform, width, height;
}
.ghost .media { inset: 0; will-change: auto; }

.project.instant, .project.instant * { transition: none !important; }
body.no-anim, body.no-anim * { transition: none !important; }

/* progress bar: a thumbnail per image, with a box showing where you are (top-right, level with the first picture) */
.p-map {
  --map-line: var(--ink);
  right: calc(32px * var(--hs)); top: calc(174px * var(--hs));
  width: calc(47px * var(--hs));
  padding: calc(6px * var(--hs)) calc(7px * var(--hs));
  pointer-events: auto;      /* clickable, unlike the text around it */
  cursor: pointer;
}
.p-thumb {
  position: relative;
  width: 100%; height: calc(var(--th, 41) * 1px * var(--hs)); margin-bottom: calc(2px * var(--hs));
  overflow: hidden;
  background: var(--tile);
  opacity: .85;
}
.p-thumb:last-of-type { margin-bottom: 0; }
.p-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.p-box {
  position: absolute; left: 0; top: 0;
  width: 100%; height: 40px;
  border: 1.5px solid var(--map-line);
  background: rgba(48, 47, 21, .07);
  pointer-events: none;
  will-change: transform, height;
}

/* round close button */
.p-close {
  position: fixed; z-index: 7;
  left: calc(32px * var(--hs)); bottom: calc(71px * var(--hs));
  width: max(36px, calc(43px * var(--hs))); aspect-ratio: 1;
  border-radius: 50%;
  background: var(--ink);
  opacity: 0; pointer-events: none;
  transform: scale(.6);
  transition: opacity .3s var(--ease), transform .6s var(--ease), background-color .3s var(--ease);
}
.p-close::before, .p-close::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 40%; height: 2px; margin: -1px 0 0 -20%;
  background: var(--paper);
  transform: rotate(45deg);
  transition: transform .5s var(--ease);
}
.p-close::after { transform: rotate(-45deg); }
.p-close:hover { background-color: var(--ink-soft); }
.p-close:hover::before { transform: rotate(135deg); }
.p-close:hover::after { transform: rotate(45deg); }
body.p-open .p-close { opacity: 1; pointer-events: auto; transform: none; transition-delay: .5s, .5s, 0s; }

/* ───────── picture viewer ───────── */

.lb { position: fixed; inset: 0; z-index: 9; visibility: hidden; pointer-events: none; touch-action: none; transition: visibility 0s linear .75s; }
.lb.show { visibility: visible; pointer-events: auto; transition-delay: 0s; }
.lb-bg { position: absolute; inset: 0; background: rgba(24, 23, 12, .9); opacity: 0; transition: opacity .7s var(--ease); }
.lb.show .lb-bg { opacity: 1; }
.lb-stage {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  padding: 4.5vh 6vw 9vh;     /* a little more room under the picture for the dots */
  cursor: zoom-out;
}
/* the viewer's frame: same shape as the tile that was clicked (--r = its width / height), as big as fits the window */
.lb-frame {
  position: relative; overflow: hidden;
  aspect-ratio: var(--r, .8);
  width: min(calc(100vw - 12vw), calc((100vh - 13.5vh) * var(--r, .8)));   /* the stage padding is 6vw each side, 4.5vh + 9vh */
  width: min(calc(100vw - 12vw), calc((100dvh - 13.5vh) * var(--r, .8)));
  background: var(--tile);
  border-radius: 14px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .3);
  will-change: transform, opacity;
  user-select: none; -webkit-user-drag: none;
}
.lb-frame .media { inset: 0; will-change: auto; }
.lb-nav, .lb-close {
  position: absolute;
  width: 43px; height: 43px;
  border-radius: 50%;
  background: rgba(247, 242, 229, .12);
  opacity: 0;
  transition: opacity .6s var(--ease) .25s, background-color .4s var(--ease);
}
.lb-nav:hover, .lb-close:hover { background: rgba(247, 242, 229, .26); }
.lb.show .lb-nav, .lb.show .lb-close, .lb.show .lb-dots { opacity: 1; }
.lb-nav { top: 50%; margin-top: -21.5px; }
.lb-prev { left: 24px; }
.lb-next { right: 24px; }
.lb-nav::before {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 21.67px; height: 21.67px;
  background-color: var(--paper);
  -webkit-mask: url("assets/icon-arrow.svg") center / 100% 100% no-repeat;
  mask: url("assets/icon-arrow.svg") center / 100% 100% no-repeat;
}
.lb-next::before { transform: rotate(180deg); }
.lb-close { top: 24px; right: 24px; }
.lb-close::before, .lb-close::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 17px; height: 2px; margin: -1px 0 0 -8.5px;
  background: var(--paper);
  transform: rotate(45deg);
  transition: transform .5s var(--ease);
}
.lb-close::after { transform: rotate(-45deg); }
.lb-close:hover::before { transform: rotate(135deg); }
.lb-close:hover::after { transform: rotate(45deg); }
.lb-dots {
  position: absolute; left: 50%; bottom: 22px;
  display: flex; gap: 10px;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity .6s var(--ease) .3s;
}
.lb-dot {
  width: 7px; height: 7px; padding: 0;
  border-radius: 50%;
  background: rgba(247, 242, 229, .35);
  transition: background-color .4s var(--ease), transform .5s var(--ease);
}
.lb-dot:hover { background: rgba(247, 242, 229, .7); }
.lb-dot.on { background: var(--paper); transform: scale(1.3); }
.lb.single .lb-nav, .lb.single .lb-dots { display: none; }

/* ───────── About + Contact ───────── */

.page {
  position: fixed; inset: 0;
  z-index: 4;
  overflow-y: auto; overflow-x: hidden;
  touch-action: pan-y;
  scrollbar-width: none;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .5s var(--ease), visibility 0s .5s;
}
.page::-webkit-scrollbar { display: none; }
.page.show { opacity: 1; visibility: visible; pointer-events: auto; transition-delay: 0s; }

.stage { position: absolute; left: 0; top: var(--oy); width: 100%; height: calc(1024px * var(--s)); }

/* things rise in one after another */
.pi {
  opacity: 0; translate: 0 16px;     /* `translate` (not `transform`) so the rotated olive rises straight up too */
  transition: opacity .3s var(--ease), translate .4s var(--ease);
}
.page.show .pi {
  opacity: 1; translate: 0 0;
  transition: opacity .9s var(--ease) calc(.15s + var(--i, 0) * .09s), translate 1.1s var(--ease) calc(.15s + var(--i, 0) * .09s);
}

.a-head {
  position: absolute; left: calc(28px * var(--s)); top: calc(493px * var(--s));
  width: calc(450px * var(--s));
  margin: 0;
  font-weight: 700; font-family: var(--type); line-height: normal;
}
.ah-big { display: block; font-size: calc(48px * var(--s)); line-height: calc(55px * var(--s)); }   /* "C - Heading" */
.ah-sub { display: block; margin: calc(-3px * var(--s)) 0 0 calc(4px * var(--s)); font: 400 calc(16px * var(--s)) / calc(18px * var(--s)) var(--body); letter-spacing: .05em; }   /* "Let me introduce myself" is Public Sans Regular */
.a-olive { position: absolute; left: calc(33px * var(--s)); top: calc(420px * var(--s)); width: calc(27px * var(--s)); height: calc(29px * var(--s)); rotate: 90deg; }
.c-olive { position: absolute; left: calc(430px * var(--s)); top: calc(505px * var(--s)); width: calc(39px * var(--s)); height: calc(30px * var(--s)); }

/* the paragraphs end level with the bottom of the photo (850), whatever their length */
.a-body {
  position: absolute; left: calc(32px * var(--s)); bottom: calc(174px * var(--s));
  width: calc(363px * var(--s));
  font: 400 calc(16px * var(--s)) / calc(18px * var(--s)) var(--body);   /* "C - Tiny" */
  letter-spacing: .05em;
}
.a-body p { margin: 0; }
.a-body p + p { margin-top: calc(18px * var(--s)); }

.a-photo {
  position: absolute; left: var(--fl); top: calc(174px * var(--s));
  width: calc(555px * var(--s)); height: calc(676px * var(--s));
  overflow: hidden;
  border-radius: calc(14px * var(--s));
  background: var(--tile);
}
.a-photo img { position: absolute; left: -29.22%; top: 0; width: 166.97%; height: 102.81%; max-width: none; display: block; }   /* the crop from Figma */

/* the photo caption: Elegant Typewriter Regular, ends level with the photo's right edge */
.a-cap {
  position: absolute; right: var(--ar); top: calc(880px * var(--s));
  width: calc(460px * var(--s)); height: calc(22px * var(--s));
  margin: 0;
  text-align: right;
  font: 400 calc(18px * var(--s)) / normal var(--type);
}
/* the contact note: grey, ends level with the photo's right edge on the About page, bottom-aligned */
.c-note {
  position: absolute; right: var(--ar); top: calc(721px * var(--s));
  width: calc(198px * var(--s)); height: calc(109px * var(--s));
  margin: 0;
  display: flex; align-items: flex-end; justify-content: flex-end;
  text-align: right;
  font: 400 calc(16px * var(--s)) / calc(18px * var(--s)) var(--body);   /* "C - Tiny" in grey */
  letter-spacing: .05em;
  color: var(--hint);
  white-space: pre-line;
  transition: opacity .3s var(--ease);
}

/* contact form: three lines to write on */
.c-form {
  position: absolute; left: calc(32px * var(--s)); top: calc(702px * var(--s));
  width: calc(437px * var(--s));
  display: flex; flex-direction: column; align-items: flex-start;
  gap: calc(22px * var(--s));    /* the three lines sit at 730, 780 and 830 */
}
.c-field {
  display: block;
  width: 100%;
  min-height: calc(28px * var(--s));
  margin: 0; padding: 0 calc(3px * var(--s));
  border: 0; border-radius: 0;
  border-bottom: 1px solid #000;
  background: transparent;
  color: var(--ink);
  font: 400 calc(16px * var(--s)) / calc(28px * var(--s)) var(--body);   /* what you type */
  letter-spacing: .05em;
  outline: none;
  user-select: text; -webkit-user-select: text;
}
.c-field::placeholder { color: var(--hint); opacity: 1; font-weight: 600; text-transform: uppercase; }   /* the labels: "C - Tiny All Caps" in grey */
.c-field:focus { box-shadow: 0 1px 0 #000; }
.c-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }   /* a trap for spam bots; people never see it */
.c-name, .c-email { height: calc(28px * var(--s)); }
.c-msg { height: calc(28px * var(--s)); resize: none; overflow: hidden; }   /* grows downward as you write */

/* SUBMIT: "C - Tiny B All Caps", its text sits at 904–926 */
.c-submit {
  margin-top: calc(52px * var(--s));
  font: 900 calc(14px * var(--s)) / calc(22px * var(--s)) var(--body);
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink);
}
.c-submit { transition: color .55s var(--ease); }
.c-submit:hover, .c-submit:focus-visible { color: var(--ink-soft); }

/* ───────── phones ───────── */
/* Same grid, fonts and colours as desktop, rearranged the way a phone is held: the header stays put, the bio sits under it,
   and the projects are one column of cards that scrolls up and down (the card in the middle is the active one). */

.view { display: none; }

@media (max-width: 759px) {
  /* header — "Phone" frames: logo 120 × 30, links 10px SemiBold caps, the icon at the right edge */
  .top::before { content: ""; position: fixed; left: 0; right: 0; top: 0; height: 84px; z-index: 5; pointer-events: none; background: linear-gradient(var(--paper) 55%, rgba(247, 242, 229, 0)); }
  .logo { left: 20px; top: 20px; width: 120px; height: 30px; }
  .top nav { right: 20px; top: 15px; height: 30px; font-size: 10px; line-height: 30px; }
  .nl-about, .nl-contact { width: auto; }
  .nl-about { margin-right: 25px; }
  .nl-contact { margin-right: 23px; }
  .ig { width: 16.6px; height: 16.6px; margin-right: 0; }

  /* home: bio (Elegant Typewriter Light 12), then the active project's name, then the column of cards running off the bottom */
  .h-olive { display: none; }
  .desc {
    left: 20px; top: 87px; width: 203px;
    font: 300 12px / normal var(--type);
    color: var(--soot);
  }
  .info { left: 20px; right: 20px; width: auto; top: 213px; bottom: auto; }
  .info b { font-size: 24px; line-height: 27px; }
  .info span { margin-top: 5px; font-size: 10px; line-height: 14px; color: var(--soot); }
  .strip {
    top: 283px; bottom: 0; height: auto;
    -webkit-mask-image: none; mask-image: none;
  }
  .view { display: none; }   /* the phone frames have no "View project" link: tap a card instead */

  /* project: the text sits above the gallery and the two scroll together */
  .p-fixed { position: static; pointer-events: auto; }
  .p-text { width: auto; padding: 105px 20px 0; font-size: 10px; line-height: 14px; font-weight: 500; color: var(--soot); }
  .p-text b { height: auto; font-size: 28px; line-height: 35px; color: var(--ink); }
  .p-text #pSpecs { height: auto; margin-top: 0; font-size: 10px; line-height: 14px; }
  .p-text #pDesc { width: auto; margin-top: 30px; min-height: 0; }
  .p-nav { width: auto; margin: 48px -1.5px 0; }
  .p-nav a { width: 21.67px; height: 21.67px; }
  .p-map { display: none; }
  .p-gallery { padding-top: 15px; gap: 15px; }
  .g-tall  { height: auto; aspect-ratio: 335 / 378; }
  .g-short { height: auto; aspect-ratio: 335 / 247; }
  .p-close { left: auto; right: 20px; bottom: 20px; width: 46px; }

  /* picture viewer: smaller buttons, tucked into the corners so the picture gets the room */
  .lb-stage { padding: 72px 14px 56px; }
  .lb-frame { width: min(calc(100vw - 28px), calc((100vh - 128px) * var(--r, .8))); width: min(calc(100vw - 28px), calc((100dvh - 128px) * var(--r, .8))); }
  .lb-nav { top: auto; bottom: 14px; margin-top: 0; width: 36px; height: 36px; }
  .lb-prev { left: 14px; }
  .lb-next { right: 14px; }
  .lb-close { top: 14px; right: 14px; width: 36px; height: 36px; }
  .lb-dots { bottom: 29px; }

  /* About + Contact: one column, in the order they read on desktop */
  .page { padding: 103px 20px 48px; }
  .stage { position: relative; height: auto; display: flex; flex-direction: column; }
  .stage > * { position: static; }
  .a-head { width: auto; height: auto; margin-top: 51.5px; margin-left: -2px; }
  .ah-big { font-size: 24px; line-height: 27px; }
  .ah-sub { margin: -5px 0 0 2px; font: 500 10px / 14px var(--body); letter-spacing: .05em; }
  .stage > .a-olive { position: absolute; left: auto; right: 1.5px; top: 50.5px; width: 20px; height: 21px; margin: 0; }
  .stage > .c-olive { position: absolute; left: auto; right: 1px; top: 55px; width: 25px; height: 19px; }
  .stage > .c-note, .stage > .a-cap { right: auto; top: auto; }   /* flow layout here: the desktop offsets don't apply */
  .stage > .a-photo { position: relative; }   /* the photo's own image is positioned inside it */
  .a-body { width: auto; margin-top: 26.5px; font: 500 10px / 14px var(--body); letter-spacing: .05em; }
  .a-body p + p { margin-top: 14px; }
  .a-photo { left: auto; top: auto; width: 100%; height: auto; aspect-ratio: 335 / 408; border-radius: 14px; margin-top: 43px; }
  .a-cap { width: auto; max-width: 184px; height: auto; align-self: flex-end; margin-top: 52px; font: 600 10px / 14px var(--body); letter-spacing: .05em; text-transform: uppercase; }
  .c-note {
    order: 1; width: 137px; height: auto; margin-top: 26.5px;
    justify-content: flex-start; text-align: left;
    font: 500 10px / 14px var(--body); letter-spacing: .05em; color: var(--soot);
  }
  .c-form { order: 2; width: auto; gap: 23px; margin-top: 131px; }
  .c-field { font-size: 16px; line-height: 28px; padding: 0 3px; }   /* typed text stays 16px so iPhones don't zoom in */
  .c-field::placeholder { font-size: 10px; }
  .c-name, .c-email, .c-msg { height: 28px; margin-top: 0; }
  .c-submit { margin-top: 45px; font-size: 12px; line-height: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .tile { animation: none; }
}
