/* alotfi.com — site styles.
   Ported from the v21 publication-review shell (2026-10-13). Values are v21's
   unless marked "rebuild:". The v21 per-project and per-layout overrides are
   replaced by: presets  ([data-preset])  and  positions (.role-*).
   Designer-owned: add a preset = new [data-preset] block + shared/layout.json entry. */

:root {
  --paper: #f5f1e8;
  --cream: #f1eee6;
  --ink: #171916;
  --dark: #101310;
  --accent: #9caf7d;
  --accent2: #bed09c;
  --hair: rgba(23, 25, 22, 0.17);
  --nav-ink: #555a51;
  --active: #62704d;
  --hover: #61704c;
  /* rebuild: one muted text tone at 4.5:1 on cream (v21 used #797b74–#9a9c95, 2.4–4.0:1) */
  --muted: #6b6d66;
  --body-ink: #444940;
  --serif: "Iowan Old Style", "Baskerville", "Times New Roman", serif;
  --sans: "Helvetica Neue", Arial, sans-serif;
  --label: 500 8px/1.3 Arial, sans-serif;
}

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--sans); background: var(--cream); color: var(--ink); }
body.theme-dark { background: var(--dark); color: var(--paper); }
button, a { font: inherit; }
img { max-width: 100%; }
picture { display: contents; } /* the <img> is laid out exactly as in v21 */
picture > source { display: none; } /* keep <source> out of grid/flex layout */
h1, h2 { font-weight: 400; }
main:focus { outline: none; }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 200; padding: 10px 14px; background: var(--ink); color: var(--paper); text-decoration: none; font: var(--label); letter-spacing: .14em; text-transform: uppercase; }
.skip-link:focus { top: 12px; }

/* rebuild: visible keyboard focus everywhere (v21 had none) */
:focus-visible { outline: 1px solid var(--active); outline-offset: 4px; }
.theme-dark :focus-visible, .scene :focus-visible { outline-color: var(--accent2); }

/* rebuild: page crossfade between real pages (v21: .28s view crossfade) */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .28s; animation-timing-function: ease; }

/* ---------------------------------------------------------------- header */
.site-header { position: fixed; z-index: 80; top: 0; left: 0; width: 100%; padding: 20px 30px; display: flex; justify-content: space-between; align-items: flex-start; pointer-events: none; }
.site-header::before { content: ""; position: absolute; inset: 0 0 auto; height: 150px; background: linear-gradient(rgba(0,0,0,.68) 0%, rgba(0,0,0,.25) 50%, transparent 100%); z-index: -1; transition: opacity .3s; pointer-events: none; }
.theme-light .site-header::before { opacity: 0; }
.brand, .nav, .menu-toggle { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 10px; min-height: 44px; color: inherit; text-decoration: none; text-shadow: 0 1px 10px rgba(0,0,0,.45); }
.theme-light .brand { text-shadow: none; }
.eye { width: 31px; height: 32px; display: block; }
.eye svg { width: 100%; height: 100%; display: block; }
.eye .eye-frame { display: none; }
.eye .eye-frame.is-active { display: inline; }
.wordmark { display: flex; flex-direction: column; }
.name { font-size: 17px; letter-spacing: .23em; font-weight: 300; }
.sub { margin-top: 5px; font-size: 8px; letter-spacing: .34em; text-transform: uppercase; opacity: .72; }
.nav { display: flex; gap: 29px; }
.nav a { color: rgba(255,255,255,.95); text-decoration: none; text-transform: uppercase; font-size: 10px; letter-spacing: .14em; padding: 8px 0; position: relative; text-shadow: 0 1px 8px rgba(0,0,0,.7); }
.nav a:hover, .nav a.active { color: var(--accent2); }
.nav a::after { content: ""; position: absolute; left: 0; bottom: 1px; width: 0; height: 1px; background: var(--accent2); transition: .2s; }
.nav a:hover::after { width: 100%; }
.nav a.active::after { width: 36%; }
.theme-light .nav a { color: var(--nav-ink); text-shadow: none; }
.theme-light .nav a.active { color: var(--active); }
.menu-toggle { display: none; }

/* ---------------------------------------------------------------- home sequence */
html.page-home { scroll-snap-type: y mandatory; scrollbar-width: none; }
html.page-home::-webkit-scrollbar { display: none; }
.sequence { position: relative; }
.scene { height: 100vh; height: 100svh; position: relative; scroll-snap-align: start; overflow: hidden; }
.scene-media { position: absolute; inset: 0; }
.scene-media picture { display: block; width: 100%; height: 100%; }
.scene-media-mobile, .mobile-caption { display: none; }
.scene img { width: 100%; height: 100%; object-fit: cover; display: block; transform: scale(1.015); transition: transform .8s ease; }
.scene.active img { transform: scale(1); }
.shade { position: absolute; inset: 0; background: linear-gradient(transparent 51%, rgba(0,0,0,.08) 68%, rgba(0,0,0,.62) 100%); pointer-events: none; }
.caption { position: absolute; left: 30px; bottom: 28px; z-index: 3; display: flex; gap: 14px; }
.no { font-size: 9px; padding-top: 10px; opacity: .58; }
.scene-title { margin: 0; font: inherit; }
.link-title { position: relative; display: inline-block; color: var(--paper); text-decoration: none; padding: 4px 18px 8px 0; min-height: 44px; font: 400 clamp(30px,3vw,48px)/1.02 var(--serif); transition: .22s; }
.link-title .ca, .link-title .cb { position: absolute; width: 8px; height: 8px; opacity: 0; transition: .22s; }
.ca { left: -12px; top: -7px; border-left: 1px solid var(--accent2); border-top: 1px solid var(--accent2); }
.cb { right: -4px; bottom: -4px; border-right: 1px solid var(--accent2); border-bottom: 1px solid var(--accent2); }
.link-title:hover, .link-title:focus-visible { transform: translateX(7px); color: #eef3df; }
.link-title:hover .ca, .link-title:hover .cb, .link-title:focus-visible .ca, .link-title:focus-visible .cb { width: 15px; height: 15px; opacity: 1; }
.link-title .arrow { color: var(--accent2); font: 400 12px Arial; margin-left: 9px; vertical-align: super; }
.place { margin-top: 7px; font-size: 9px; letter-spacing: .18em; text-transform: uppercase; opacity: .72; }
.controls { position: fixed; right: 28px; bottom: 25px; z-index: 50; }
.bars { display: flex; gap: 0; align-items: flex-end; }
/* v21: 3px bars with 7px of air, 21/31/38/42px states. The 10px
   anchor cells preserve that exact visual rhythm while keeping the full
   44px height available for pointer and keyboard interaction. */
.bars a { display: block; width: 10px; height: 44px; position: relative; }
.bars a::after { content: ""; position: absolute; width: 3px; height: 21px; left: 50%; bottom: 0; background: rgba(255,255,255,.38); transform: translate(-50%,0); transition: height .2s ease, width .2s ease, background .2s ease, transform .2s ease; }
.bars a:hover::after, .bars a:focus-visible::after { height: 31px; background: var(--accent2); transform: translate(-50%,-2px); }
.bars a.active::after { height: 38px; width: 4px; background: var(--accent2); }
.bars a.active:hover::after, .bars a.active:focus-visible::after { height: 42px; }
.bars a:focus-visible { outline-offset: 3px; }

/* ---------------------------------------------------------------- shared labels */
.kicker { font-size: 9px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }

/* ---------------------------------------------------------------- section index: list + preview */
.arch-grid { height: 100vh; padding-top: 92px; display: grid; grid-template-columns: minmax(520px,.88fr) 1.35fr; }
.arch-list { overflow: auto; border-right: 1px solid var(--hair); padding: 3.5vw; }
.arch-list h1 { font: 400 clamp(44px,4.3vw,68px)/1 var(--serif); margin: 15px 0 30px; }
.arch-list .intro-copy { margin: -10px 0 30px; }
.arch-count { font-size: 8px; letter-spacing: .17em; text-transform: uppercase; color: var(--muted); margin: -18px 0 24px; }
.arch-row { width: 100%; display: grid; grid-template-columns: 35px 1fr 145px 40px 18px; gap: 12px; align-items: center; border-top: 1px solid var(--hair); padding: 14px 0; text-align: left; color: var(--ink); text-decoration: none; transition: .2s; }
.arch-row:last-child { border-bottom: 1px solid var(--hair); }
.arch-row:hover, .arch-row.active { color: var(--hover); padding-left: 8px; }
.arch-row .ttl { font: 400 clamp(16px,1.25vw,22px)/1.08 var(--serif); }
.arch-row .meta { font-size: 8px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.arch-row .arr { opacity: 0; transition: .2s; }
.arch-row:hover .arr, .arch-row.active .arr { opacity: 1; }
.arch-preview { padding: 3vw; height: 100%; }
.frame { position: relative; width: 100%; height: 100%; overflow: hidden; background: #d7d4cc; }
.preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .25s, transform .4s; transform: scale(1.01); }
.preview.active { opacity: 1; transform: none; }
.arch-sort { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px; margin: 16px 0 28px; padding-top: 2px; font: 500 8px/1.3 Arial, sans-serif; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.arch-sort-label { margin-right: 6px; color: var(--muted); }
.arch-sort button { appearance: none; -webkit-appearance: none; border: 0; border-bottom: 1px solid transparent; background: none; padding: 5px 0; color: var(--muted); cursor: pointer; font: inherit; letter-spacing: inherit; text-transform: inherit; transition: color .18s ease, border-color .18s ease; }
.arch-sort button:hover, .arch-sort button:focus-visible { color: #4f5945; }
.arch-sort button.active { color: #5e6c4a; border-bottom-color: #768361; }
html:not(.js) .arch-sort { display: none; } /* sorting needs JS; curated order without it */

/* ---------------------------------------------------------------- section index: cards; text pages */
.index-shell, .text-shell { padding: 150px 6vw 80px; max-width: 1500px; margin: 0 auto; }
.index-shell h1, .text-shell h1 { font: 400 clamp(46px,6vw,88px)/.95 var(--serif); margin: 12px 0 28px; }
.intro-copy, .text-shell p { max-width: 720px; font: 400 18px/1.65 Georgia, serif; color: var(--body-ink); }
.text-shell p { font-size: 20px; }
.text-shell .text-subheading { font: 400 28px/1.15 var(--serif); margin: 48px 0 12px; }
.study-grid { display: grid; grid-template-columns: repeat(12,1fr); gap: 46px 22px; margin-top: 60px; padding-bottom: 60px; align-items: start; }
.study-card { grid-column: span 4; display: block; color: inherit; text-decoration: none; }
.study-card img { width: 100%; aspect-ratio: 4/5; height: auto; object-fit: cover; display: block; margin-bottom: 16px; transition: transform .35s ease; }
.study-card:hover img { transform: scale(.992); }
.study-no, .study-meta { display: block; font: 500 9px/1.5 Arial, sans-serif; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.study-title { display: block; font: 400 28px/1.08 var(--serif); margin: 6px 0 9px; }
.study-meta { letter-spacing: .09em; }
.study-mosaic { width: 100%; aspect-ratio: 4/5; display: grid; grid-template-columns: repeat(3,1fr); gap: 3px; align-content: center; background: #e2ded4; margin-bottom: 16px; overflow: hidden; }
.study-mosaic img { width: 100% !important; height: auto !important; aspect-ratio: 1 !important; object-fit: cover !important; display: block !important; margin: 0 !important; transition: transform .35s ease; }
.study-card:hover .study-mosaic img { transform: scale(.985); }

/* About */
.about-shell { position: relative; }
.about-shell::before { content: ""; position: absolute; left: calc(6vw - 22px); top: 161px; width: 1px; height: 86px; background: linear-gradient(to bottom, rgba(98,112,77,.9), rgba(98,112,77,0)); }
.about-name { display: inline-block; position: relative; cursor: default; outline: none; transform-origin: left center; }
.about-name::after { content: ""; position: absolute; left: 2px; bottom: -15px; width: 44px; height: 1px; background: #71805d; opacity: .55; transform: scaleX(.42); transform-origin: left center; transition: transform .35s ease, opacity .35s ease; }
.about-name:hover::after, .about-name:focus-visible::after { transform: scaleX(1); opacity: .9; }
.about-name:focus-visible { outline: 1px solid var(--active); outline-offset: 6px; }
.about-name.is-resolving { animation: aboutSignal .58s cubic-bezier(.2,.75,.25,1); }
.about-lead { max-width: 850px !important; font-size: clamp(23px,2.15vw,31px) !important; line-height: 1.46 !important; color: #252a23 !important; margin-top: 38px !important; }
.about-shell p:not(.about-lead) { max-width: 760px; color: #4b5048; }
@keyframes aboutSignal { 0% { letter-spacing: .085em; opacity: .68; transform: translateY(2px); } 24% { opacity: 1; } 38% { letter-spacing: .035em; transform: translateY(-1px); } 55% { opacity: .82; } 72% { opacity: 1; transform: translateY(0); } 100% { letter-spacing: 0; opacity: 1; transform: translateY(0); } }

/* Contact */
.contact-shell h1::after { content: ""; display: block; width: 34px; height: 2px; background: #7d8967; margin-top: 20px; }
.contact-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; max-width: 720px; margin-top: 52px; padding-top: 20px; border-top: 1px solid var(--hair); font: 500 9px/1.5 Arial, sans-serif; letter-spacing: .13em; text-transform: uppercase; color: var(--muted); }
.contact-email { color: #64714f; text-decoration: none; text-transform: none; letter-spacing: .08em; display: inline-flex; align-items: center; justify-content: flex-end; gap: 10px; transition: color .22s ease, letter-spacing .22s ease; }
.contact-email::before { content: ""; width: 24px; height: 1px; background: #7d8967; display: block; transition: width .22s ease, background .22s ease; }
.contact-email:hover, .contact-email:focus-visible { color: #48553b; letter-spacing: .1em; }
.contact-email:hover::before, .contact-email:focus-visible::before { width: 38px; background: #596648; }
.contact-links { list-style: none; padding: 0; margin: 28px 0 0; display: flex; gap: 22px; flex-wrap: wrap; font: 500 9px/1.5 Arial, sans-serif; letter-spacing: .13em; text-transform: uppercase; }
.contact-links a { color: var(--active); text-decoration: none; }
.contact-links a:hover { text-decoration: underline; text-underline-offset: 4px; }
.copyright-note { margin-top: 42px; padding-top: 14px; border-top: 1px solid var(--hair); max-width: 720px; font-size: 7px; line-height: 1.5; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* ---------------------------------------------------------------- project page */
.project-shell { max-width: 1720px; margin: auto; padding: 120px 4vw 80px; }
.project-top { display: grid; grid-template-columns: minmax(0,1.58fr) minmax(260px,.42fr); gap: clamp(34px,5vw,92px); align-items: start; min-height: 76vh; }
.project-hero { width: 100%; height: 76vh; object-fit: contain; background: transparent; display: block; }
.position { font-size: 8px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin-bottom: 18px; }
.project-title { font: 400 clamp(40px,4vw,68px)/.98 var(--serif); margin: 14px 0 18px; }
.project-place { font-size: 9px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.project-image-count { margin-top: 14px; font-size: 8px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.project-text { margin-top: 28px; max-width: 420px; }
.project-text p { font: 400 15px/1.6 Georgia, serif; color: var(--body-ink); margin: 0 0 12px; }
.project-credits { margin: 22px 0 0; font: 500 8px/1.6 Arial, sans-serif; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.project-credits div { display: flex; gap: 8px; }
.project-credits dd { margin: 0; color: var(--ink); }
.actions { margin-top: 35px; padding-top: 20px; border-top: 1px solid var(--hair); display: flex; gap: 20px; }
.actions a { text-transform: uppercase; font-size: 9px; letter-spacing: .14em; color: #62655e; text-decoration: none; padding: 0; }
.actions a:hover { color: var(--hover); }

/* Gallery: 12-column grid; positions place images, images are never cropped. */
.gallery { display: grid; grid-template-columns: repeat(12,minmax(0,1fr)); column-gap: clamp(18px,2.7vw,50px); row-gap: clamp(64px,8vw,148px); margin-top: 7vw; padding-top: 2vw; align-items: start; }
.shot { margin: 0; min-width: 0; }
.shot img { display: block; width: 100%; height: auto; max-height: 82vh; object-fit: contain; }
.shot-meta { display: block; margin-top: 10px; }
.shot-index { display: block; font: 500 8px/1 Arial, sans-serif; letter-spacing: .16em; color: var(--muted); text-transform: uppercase; }
.shot-meta.index-right { text-align: right; }
.shot-caption, .shot-credit { display: block; margin-top: 8px; font: 400 13px/1.45 Georgia, serif; color: var(--body-ink); }
.shot-credit { font: 500 8px/1.4 Arial, sans-serif; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* Positions (v21 shot-* classes) */
.role-feature, .role-full { grid-column: 1 / -1; }
.role-feature img { max-height: none; }
.role-wide { grid-column: 2 / span 10; }
.role-left { grid-column: 1 / span 7; }
.role-right { grid-column: 7 / span 6; }
.role-small-left { grid-column: 2 / span 5; }
.role-small-right { grid-column: 8 / span 4; }
.role-tall-right { grid-column: 7 / span 5; }
.role-centre { grid-column: 4 / span 6; }
.role-centre img { max-height: 74vh; }
.role-centre-large { grid-column: 3 / span 8; }
.role-offset-left { grid-column: 1 / span 8; }
.role-offset-right { grid-column: 5 / span 8; }

/* Single image (v21 .single-work) — automatic for one-image projects */
.project.single-work .project-top { grid-template-columns: minmax(0,1.62fr) minmax(250px,.36fr); }
.project.single-work .project-hero { height: min(78vh,860px); }

/* Opening size: large (v21 CAC) */
.project[data-opening="large"] .project-top { grid-template-columns: minmax(0,1.86fr) minmax(230px,.32fr); gap: clamp(30px,4vw,72px); }
.project[data-opening="large"] .project-hero { height: 84vh; max-height: 1000px; }

/* Preset: slow (v21 slow) */
.project[data-preset="slow"] .gallery { row-gap: 11vw; }

/* Preset: pair (v21 duo / duo-vertical / observation-pair) */
.project[data-preset="pair"] .gallery { margin-top: 4vw; padding-top: 3vw; border-top: 1px solid var(--hair); }

/* Preset: series (v21 repeated) */
.project[data-preset="series"] .project-top { grid-template-columns: minmax(0,1.9fr) minmax(220px,.28fr); gap: clamp(28px,3.4vw,66px); min-height: 82vh; }
.project[data-preset="series"] .project-hero { height: 82vh; max-height: 980px; }
.project[data-preset="series"] .gallery { column-gap: clamp(18px,2.2vw,40px); row-gap: clamp(62px,6vw,110px); margin-top: 6vw; padding-top: 0; }

/* Preset: grid (v21 grid9) — no opening image; square cells; whole image unless crop allowed */
.project[data-preset="grid"] .project-shell { max-width: 1540px; }
.project[data-preset="grid"] .project-top { display: block; min-height: 0; max-width: 760px; margin-bottom: clamp(42px,5vw,72px); }
.project[data-preset="grid"] .gallery { grid-template-columns: repeat(3,minmax(0,1fr)); gap: clamp(5px,.7vw,12px); margin-top: 0; padding-top: 0; align-items: stretch; }
.project[data-preset="grid"] .shot { grid-column: auto; margin: 0; aspect-ratio: 1; background: #e2ded4; display: flex; align-items: center; justify-content: center; }
.project[data-preset="grid"] .shot img { width: 100%; height: 100%; max-height: none; object-fit: contain; }
.project[data-preset="grid"] .shot.crop img { object-fit: cover; }
.project[data-preset="grid"] .shot-meta { display: none; }

/* Secondary set (v18 CAC monochrome rail) */
.related-rail { grid-column: 1 / -1; margin-top: 7vw; padding-top: 28px; border-top: 1px solid var(--hair); min-width: 0; }
.related-rail-header { display: flex; justify-content: space-between; align-items: baseline; gap: 18px; margin-bottom: 20px; }
.related-rail-header .kicker { font: 500 8px/1.2 Arial, sans-serif; letter-spacing: .18em; }
.related-rail-header .title { margin: 0; font: 400 19px/1.1 var(--serif); color: var(--ink); }
.rail-track { display: flex; align-items: flex-end; gap: 18px; overflow-x: auto; overflow-y: hidden; padding: 2px 0 14px; scroll-snap-type: x proximity; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.rail-item { flex: 0 0 auto; margin: 0; scroll-snap-align: start; }
.rail-item img { display: block; height: min(52vh,610px); width: auto; max-width: 72vw; object-fit: contain; background: transparent; }
.rail-item .shot-meta { margin-top: 9px; }

/* Next project */
.next-project { margin-top: 10vw; padding-top: 25px; border-top: 1px solid var(--hair); display: flex; justify-content: space-between; align-items: baseline; gap: 20px; }
.next-label { font-size: 8px; letter-spacing: .17em; text-transform: uppercase; color: var(--muted); }
.next-link { color: var(--ink); text-decoration: none; font: 400 clamp(24px,2.4vw,38px)/1 var(--serif); text-align: right; transition: color .2s ease, transform .2s ease; display: inline-block; }
.next-link:hover { color: var(--hover); transform: translateX(5px); }

/* ---------------------------------------------------------------- mobile (v21 breakpoint 820px) */
@media (max-width: 820px) {
  .theme-light .site-header { background: rgba(242,239,231,.94); -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px); }
  .site-header { padding: 15px 18px; align-items: center; }
  /* rebuild: About and Contact stay in the menu (v21 hid them below 820px) */
  .nav { gap: 16px; }
  .nav a { font-size: 9px; padding: 14px 0; }
  .arch-grid { display: block; height: auto; overflow: visible; }
  .arch-preview { height: 42vh; padding: 18px; }
  .arch-list { padding: 24px 18px; border: 0; overflow: visible; }
  .arch-row { grid-template-columns: 30px 1fr 38px 15px; padding: 16px 0; }
  .arch-row .loc { display: none; }
  .project-shell { padding: 95px 18px 55px; }
  .project-top, .project[data-opening="large"] .project-top, .project[data-preset="series"] .project-top, .project.single-work .project-top { grid-template-columns: 1fr; min-height: 0; gap: 34px; }
  .project-hero, .project[data-opening="large"] .project-hero, .project[data-preset="series"] .project-hero, .project.single-work .project-hero { height: auto; max-height: 72vh; }
  .gallery { display: block; margin-top: 72px; padding-top: 0; }
  .shot { display: block; margin: 0 0 74px; }
  .shot img { width: 100%; max-height: none; height: auto; object-fit: contain; }
  .project[data-preset="series"] .gallery { margin-top: 62px; }
  .project[data-preset="series"] .shot { margin: 0 0 58px; }
  .project[data-preset="grid"] .gallery { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 3px; }
  .project[data-preset="grid"] .shot { margin: 0; }
  .project[data-preset="grid"] .project-top { margin-bottom: 34px; }
  .related-rail { display: block; margin-top: 58px; padding-top: 20px; }
  .related-rail-header { display: block; margin-bottom: 14px; }
  .related-rail-header .title { display: block; margin-top: 6px; font-size: 16px; }
  .rail-track { gap: 12px; }
  .rail-item img { height: min(44vh,460px); max-width: 84vw; }
  .next-project { margin-top: 70px; }
  .caption { left: 18px; right: 18px; }
  .controls { right: 12px; bottom: 120px; }
  .scene.has-mobile > .scene-media-desktop,
  .scene.has-mobile > .caption { display: none; }
  .scene-media-mobile, .mobile-caption { display: block; }
  .mobile-caption .caption { bottom: max(25px, env(safe-area-inset-bottom)); }
  .mobile-caption .link-title { font-size: clamp(28px, 8vw, 40px); }
  .scene .shade { background: linear-gradient(transparent 62%, rgba(0,0,0,.16) 77%, rgba(0,0,0,.75)); }
  .contact-meta { grid-template-columns: 1fr; gap: 10px; }
  .contact-email { justify-content: flex-start; }
  .arch-sort { gap: 8px 14px; margin: 14px 0 22px; }
  .arch-sort button { padding: 10px 0; }
  .actions a { padding: 12px 0; }
}
@media (max-width: 800px) {
  .study-card { grid-column: span 12; }
  .index-shell, .text-shell { padding: 120px 22px 60px; }
  .study-grid { margin-top: 40px; }
  .study-mosaic { gap: 2px; }
  .about-shell::before { display: none; }
  .about-lead { font-size: 22px !important; margin-top: 30px !important; }
  .about-name::after { bottom: -11px; }
}
/* rebuild: narrow phones — menu button replaces the inline row (with JS);
   without JS the links wrap and stay visible. */
@media (max-width: 600px) {
  .js .menu-toggle { display: block; appearance: none; border: 0; background: none; min-width: 44px; min-height: 44px; padding: 12px 0 12px 12px; color: inherit; text-transform: uppercase; font-size: 9px; letter-spacing: .14em; cursor: pointer; text-shadow: inherit; }
  .js .theme-dark .menu-toggle { color: rgba(255,255,255,.95); text-shadow: 0 1px 8px rgba(0,0,0,.7); }
  .js .theme-light .menu-toggle { color: var(--nav-ink); }
  .js .nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 0; padding: 6px 18px 14px; background: rgba(242,239,231,.97); border-bottom: 1px solid var(--hair); }
  .js .nav.open { display: flex; }
  .js .nav a { color: var(--nav-ink); text-shadow: none; padding: 14px 0; border-top: 1px solid var(--hair); }
  .js .nav a.active { color: var(--active); }
  html:not(.js) .site-header { flex-wrap: wrap; }
  html:not(.js) .nav { flex-wrap: wrap; gap: 4px 16px; width: 100%; }
}

/* ---------------------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  @view-transition { navigation: none; }
  html.page-home { scroll-behavior: auto; }
}
