:root { --fg: #000; --muted: #6b6b6b; --line: #e2e2e2; --bg: #fff; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; padding: 0 16px; font: 500 12px/1.5 "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: var(--fg); background: var(--bg); }
a { color: inherit; }
img { max-width: 100%; display: block; }
.wrap { max-width: 1440px; margin: 0 auto; }

/* Header */
.site-head { padding: 22px 0 10px; }
.wordmark { font-size: clamp(44px, 12.5vw, 190px); font-weight: 700; letter-spacing: -0.02em; line-height: .9; text-decoration: none; display: block; overflow: hidden; white-space: nowrap; }
.nav-row { display: flex; justify-content: space-between; gap: 12px; margin-top: 14px; text-transform: uppercase; }
.clock { white-space: nowrap; font-variant-numeric: tabular-nums; }
.nav { display: flex; flex-wrap: wrap; gap: 6px 16px; text-transform: uppercase; }
.nav a { text-decoration: none; }
.nav a[aria-current="page"] { text-decoration: underline; }

/* Shared */
.label { text-transform: uppercase; }
.muted { color: var(--muted); }
.section { margin: 36px 0 18px; display: flex; justify-content: space-between; align-items: center; gap: 12px; text-transform: uppercase; }
.btn-link { background: none; border: 0; padding: 0; font: inherit; text-transform: uppercase; color: var(--muted); cursor: pointer; }
.btn-link[aria-pressed="true"] { color: var(--fg); text-decoration: underline; }
.btn-link:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, button:focus-visible { outline: 1px solid var(--fg); outline-offset: 3px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }

/* Grid (catalogue + home) */
.grid { display: grid; gap: 28px 16px; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); }
.card { text-decoration: none; display: block; }
.thumb { aspect-ratio: 1 / 1; border: 1px solid var(--line); background: #f3f3f3; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .name { margin-top: 8px; text-transform: uppercase; }
.card .meta { color: var(--muted); }
@media (max-width: 720px) { .grid { gap: 20px 10px; grid-template-columns: repeat(min(var(--cols, 4), 2), minmax(0, 1fr)); } }

/* Project page */
/* Layout copied from the reference: specs left, tall image right (about 27% of the width), Inquire and Previous / Next under the specs. */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 27.4%; gap: 16px; margin-top: clamp(40px, 7vw, 100px); }
.detail-main { display: flex; flex-direction: column; min-height: 100%; }
.detail-img { aspect-ratio: 537 / 619; align-self: start; }
.specs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px 16px; margin: 0; }
.specs dt { text-transform: uppercase; color: var(--muted); font-size: 10px; margin-bottom: 6px; }
.specs dd { margin: 0; font-weight: 600; text-transform: uppercase; }
.specs .info dd, .specs .long dd { text-transform: none; max-width: 34ch; }
.specs .long dd p { margin: 0 0 .8em; }
.specs .break { grid-column-start: 1; }
.inquire { margin: auto 0 0; padding-top: clamp(48px, 7vw, 100px); text-decoration: underline; }
.prev-next { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: clamp(48px, 7vw, 96px) 0 40px; text-transform: uppercase; }
.prev-next a:last-child { grid-column: 3; }
.prev-next a { text-decoration: none; }
@media (max-width: 899px) {
  .detail { grid-template-columns: 1fr; }
  .detail-img { order: -1; width: 100%; }
}
@media (max-width: 720px) { .specs { grid-template-columns: repeat(2, minmax(0, 1fr)); } .prev-next { grid-template-columns: 1fr 1fr; } .prev-next a:last-child { grid-column: 2; } }

/* Tables (archive) */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 5px 10px 5px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { text-transform: uppercase; font-weight: 600; }
.tag { display: inline-block; margin: 0 4px 2px 0; padding: 0 8px; border: 1px solid var(--line); border-radius: 999px; font-size: 11px; text-transform: uppercase; }
.empty { padding: 24px 0; color: var(--muted); }
@media (max-width: 720px) { .hide-sm { display: none; } }

/* Archive hover reveal (desktop + mouse only; see initArchive) */
.reveal { position: fixed; top: 0; right: 16px; z-index: 20; width: clamp(220px, 29vw, 440px); aspect-ratio: 4 / 5; pointer-events: none; opacity: 0; transition: opacity .15s ease; background: #f3f3f3; }
.reveal.show { opacity: 1; }
.reveal img { width: 100%; height: 100%; object-fit: cover; display: block; }
tbody.dim tr { color: #b5b5b5; transition: color .15s ease; }
tbody.dim tr.on { color: var(--fg); }
tbody.dim tr .tag { color: inherit; border-color: currentColor; }
@media (prefers-reduced-motion: reduce) { .reveal, tbody.dim tr { transition: none; } }
@media (hover: none), (max-width: 899px) { .reveal { display: none; } }

/* Editorial */
#stories { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 32px 16px; align-items: start; }
.story h2 { margin: 2px 0 10px; font-size: 12px; font-weight: 600; }
.story .thumb { aspect-ratio: 4 / 5; }
.story .thumb.auto { aspect-ratio: auto; border: 0; background: none; }
.story .thumb.auto img { height: auto; }
.story p { margin: 8px 0 0; }
@media (max-width: 1100px) { #stories { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px) { #stories { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Home carousel + intro splash */
.carousel { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; cursor: grab; padding-bottom: 8px; }
.carousel::-webkit-scrollbar { display: none; }
.carousel.drag { cursor: grabbing; scroll-snap-type: none; }
.slide { flex: 0 0 clamp(200px, 23vw, 340px); scroll-snap-align: start; text-decoration: none; user-select: none; -webkit-user-drag: none; }
.slide .thumb { aspect-ratio: 4 / 5; }
.slide-meta { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; text-transform: uppercase; }
.splash { position: fixed; inset: 0; z-index: 50; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; text-transform: uppercase; font-weight: 700; font-size: 13px; line-height: 1.3; cursor: pointer; transition: opacity .4s ease; }
.splash img { width: clamp(200px, 24vw, 330px); aspect-ratio: 3 / 4; object-fit: cover; }
.splash p { margin: 0; }
.splash.out { opacity: 0; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .splash { transition: none; } }

/* About Us */
.prose p { margin: 0 0 1.2em; font-size: 14px; line-height: 1.6; max-width: 62ch; }
.two-col > div:first-child h2:not(:first-child) { margin-top: 44px; }
.chip-row a.tag { text-decoration: none; transition: background .15s ease, color .15s ease; }
.chip-row a.tag:hover { background: var(--fg); color: #fff; border-color: var(--fg); }
@media (prefers-reduced-motion: reduce) { .chip-row a.tag { transition: none; } }

/* Archive page: tighter spacing between the menu, filters, status line and table */
body[data-page="archive"] .section { margin: 20px 0 6px; }
body[data-page="archive"] .chip-row { gap: 4px 14px; }
body[data-page="archive"] th { padding-bottom: 6px; }

/* Archive: clickable rows + project page */
tbody tr[data-href] { cursor: pointer; }
td a { text-decoration: none; }
.specs dd .tag { margin: 0 6px 4px 0; text-transform: uppercase; }

/* 404 */
.notfound { text-align: center; margin: 120px 0; text-transform: uppercase; display: grid; gap: 14px; justify-items: center; }
.notfound p { margin: 0; max-width: 34ch; }

/* Info + contact form */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 32px; }
.two-col h2 { font-size: 12px; text-transform: uppercase; margin: 0 0 8px; }
.form { display: grid; gap: 14px; max-width: 520px; }
.form label { display: grid; gap: 6px; text-transform: uppercase; }
.form input, .form textarea { font: inherit; padding: 10px; border: 1px solid var(--line); background: #fff; border-radius: 0; }
.form textarea { min-height: 140px; resize: vertical; }
.form button { justify-self: start; font: inherit; text-transform: uppercase; padding: 10px 18px; border: 1px solid var(--fg); background: var(--fg); color: #fff; cursor: pointer; }
.form button[disabled] { opacity: .5; cursor: default; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.status { min-height: 1.4em; }
@media (max-width: 720px) { .two-col { grid-template-columns: 1fr; gap: 24px; } }

/* Footer */
.site-foot { margin: 60px 0 24px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 20px; text-transform: uppercase; }
.site-foot a { text-decoration: none; }

/* Archive table: fixed, compact columns that never run under the hover image */
body[data-page="archive"] table { table-layout: fixed; width: 100%; }
@media (min-width: 900px) { body[data-page="archive"] table { max-width: calc(100% - clamp(220px, 29vw, 440px) - 40px); } }

/* Image slider (a project with several images) */
.detail-img { position: relative; }
.detail-img .slides { display: flex; height: 100%; }
.detail-img .slides img { flex: 0 0 100%; width: 100%; height: 100%; object-fit: cover; }
.slider .slides { overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; cursor: grab; }
.slider .slides::-webkit-scrollbar { display: none; }
.slider .slides.drag { cursor: grabbing; scroll-snap-type: none; }
.slider .slides img { scroll-snap-align: start; user-select: none; -webkit-user-drag: none; }
.dots { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); display: flex; gap: 8px; }
.dots button { position: relative; width: 7px; height: 7px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .55); box-shadow: 0 0 0 1px rgba(0, 0, 0, .25); cursor: pointer; transition: background .25s ease, transform .25s ease; }
.dots button::after { content: ""; position: absolute; inset: -10px; }
.dots button[aria-current="true"] { background: #fff; transform: scale(1.3); }

/* Motion. Only opacity and transform move; reduced-motion users get none of it. */
.rv { opacity: 0; transform: translateY(18px); transition: opacity .7s cubic-bezier(.2, .7, .2, 1), transform .7s cubic-bezier(.2, .7, .2, 1); }
.rv.rv-fade { transform: none; }
.rv.in { opacity: 1; transform: none; }
.wordmark span { display: inline-block; animation: rise .9s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes rise { from { transform: translateY(105%); } to { transform: none; } }
.detail-img { animation: wipe 1s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes wipe { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
.nav a { padding-bottom: 1px; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .3s ease; }
.nav a:hover, .nav a[aria-current="page"] { background-size: 100% 1px; }
.nav a[aria-current="page"] { text-decoration: none; }
.card .thumb, .slide .thumb { overflow: hidden; }
.card .thumb img, .slide .thumb img { transition: transform .9s cubic-bezier(.2, .7, .2, 1); }
.card:hover .thumb img, .slide:hover .thumb img { transform: scale(1.05); }
.prev-next a, .inquire a { display: inline-block; transition: transform .3s ease; }
.prev-next a:hover, .inquire a:hover { transform: translateX(4px); }
.form button { transition: background .2s ease, color .2s ease; }
.form button:hover { background: #fff; color: var(--fg); }
.btn-link { transition: color .2s ease; }
.btn-link:hover { color: var(--fg); }
@media (prefers-reduced-motion: no-preference) { @view-transition { navigation: auto; } }
@media (prefers-reduced-motion: reduce) {
  .wordmark span, .detail-img { animation: none; }
  .card .thumb img, .slide .thumb img, .prev-next a, .inquire a, .nav a, .dots button { transition: none; }
}


/* Home marquee: the track is moved with transform by marquee() in app.js */
.carousel { display: block; overflow: hidden; scroll-snap-type: none; touch-action: pan-y; }
.carousel .track { display: flex; gap: 16px; width: max-content; will-change: transform; }
.carousel.drag { cursor: grabbing; }

/* Hover line: shown under an image only on hover or keyboard focus (always visible on touch screens) */
.card { display: block; }
.hover-line { margin-top: 8px; min-height: 1.5em; text-transform: uppercase; opacity: 0; transform: translateY(4px); transition: opacity .35s ease, transform .35s ease; }
.card:hover .hover-line, .card:focus-visible .hover-line, .slide:hover .hover-line, .slide:focus-visible .hover-line { opacity: 1; transform: none; }
.slide .hover-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Landing carousel: black and white, colour on hover */
.slide .thumb img { filter: grayscale(1); transition: filter .5s ease, transform .9s cubic-bezier(.2, .7, .2, 1); }
.slide:hover .thumb img, .slide:focus-visible .thumb img { filter: grayscale(0); }

@media (hover: none) { .hover-line { opacity: 1; transform: none; } .slide .thumb img { filter: none; } }
@media (prefers-reduced-motion: reduce) { .hover-line, .slide .thumb img { transition: none; } }

/* Selected Work: spacing above the grid follows the reference (76px from the menu to the label, 26px from the label to the first row at 1440px) */
body[data-page="selected-work"] .section { margin: 66px 0 26px; }
@media (max-width: 720px) { body[data-page="selected-work"] .section { margin: 40px 0 20px; } }

/* Selected Work: roomier gaps between cards (32px between columns; row gap + the hover line below each image = about 56px image to image) */
@media (min-width: 721px) { body[data-page="selected-work"] .grid { gap: 30px 32px; } }

/* Landing carousel: every slide keeps the same width. A long one-line caption used to stretch its slide (flex items default to min-width:auto),
   so the caption may now run past the slide's edge instead; only the hovered slide's caption is visible. */
.slide { min-width: 0; }
.slide .hover-line { overflow: visible; text-overflow: clip; }

/* Selected Work: portrait 4:5 cards in the 4 and 6 column views, like the reference (341x425 at 1440px); the 2 column view stays square */
#grid[data-cols="4"] .card .thumb, #grid[data-cols="6"] .card .thumb { aspect-ratio: 4 / 5; }

/* Selected Work: Show 2 is portrait too (4:5) */
#grid[data-cols="2"] .card .thumb { aspect-ratio: 4 / 5; }

/* Archive filter: outlined pills (All, Category, Year, Brand) with dropdown lists */
.fbtn { display: inline-flex; align-items: center; gap: 6px; padding: 5px 14px; font: inherit; text-transform: uppercase; background: #fff; color: var(--fg); cursor: pointer; transition: background .2s ease, color .2s ease; }
.fbtn[aria-pressed="true"] { background: var(--fg); color: #fff; }
.fbtn:focus-visible { outline: 1px solid var(--fg); outline-offset: 3px; }
.fwrap { position: relative; }
.fmenu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; min-width: 100%; max-height: 320px; overflow-y: auto; margin: 0; padding: 6px; list-style: none; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, .08); }
.fmenu[hidden] { display: none; }
.fopt { display: block; width: 100%; padding: 7px 12px; border: 0; border-radius: 999px; background: none; font: inherit; text-align: left; text-transform: uppercase; white-space: nowrap; cursor: pointer; }
.fopt:hover, .fopt:focus-visible { background: var(--fg); color: #fff; outline: none; }
.fopt[aria-pressed="true"] { text-decoration: underline; }

/* About Us disciplines: black tags, white with black text on hover */
.chip-row a.tag { background: #000; border-color: #000; color: #fff; padding: 4px 12px; font-size: 11px; }
.chip-row a.tag:hover, .chip-row a.tag:focus-visible { background: #fff; color: #000; border-color: #000; outline: none; }

/* Archive: more air between the filter / "Showing" line and the project table */
body[data-page="archive"] table { margin-top: 40px; }

/* About Us: single column; enquiry form in a popup */
body[data-page="about-us"] .two-col { grid-template-columns: minmax(0, 720px); }
.enquiry { width: min(520px, calc(100% - 32px)); border: 1px solid var(--fg); padding: 28px; background: #fff; color: var(--fg); font: inherit; }
.enquiry::backdrop { background: rgba(0, 0, 0, .35); }
.enquiry h2 { font-size: 12px; text-transform: uppercase; margin: 0 0 18px; }
.enq-close { position: absolute; top: 10px; right: 12px; margin: 0; }
.enq-close button { font: inherit; font-size: 22px; line-height: 1; background: none; border: 0; cursor: pointer; padding: 4px 8px; }
.enquiry form.form { max-width: none; }

/* Screen-reader-only text (used for each page's H1) */
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
