/* ---------- Tokens -------------------------------------------------------
   Fixed palette for every page: graphite, bone and brass.                    */

:root {
  --bg: #0e0f11;
  --surface: #16171a;
  --text: #ece9e2;
  --muted: #8f8d87;
  --line: #2a2b30;
  --accent: #c9a66b;
  --accent-ink: #0e0f11;

  --gutter: clamp(16px, 4vw, 56px);
  --header-h: 60px;
  --font-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-name: "Cal Sans", "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ---------- Base ---------------------------------------------------------- */

/* On the home page the hero starts at the very top, under the header. */
body.on-home { padding-top: 0; }

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  padding-top: var(--header-h);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }

a { color: inherit; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 100;
  background: var(--accent); color: var(--accent-ink); padding: 8px 12px;
}
.skip-link:focus { left: 8px; }

.label {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.display {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 0.95;
  margin: 0;
}

#app { outline: none; min-height: 70vh; }

.view { animation: fade-in 500ms ease both; }
@keyframes fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Header --------------------------------------------------------- */

.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--gutter);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  transition: background-color 400ms ease, border-color 400ms ease;
}
/* Over the home hero the header is transparent and light-coloured. */
.site-header.is-over {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom-color: transparent;
}
.site-header.is-over .wordmark,
.site-header.is-over .site-nav a { color: #f4f1ea; }
.site-header.is-over .site-nav a:not([aria-current="page"]) { color: rgba(244, 241, 234, .7); }

.wordmark {
  font-family: var(--font-name);
  font-weight: 400;
  font-size: 20px;
  letter-spacing: 0;
  text-decoration: none;
}

.site-nav { display: flex; gap: clamp(18px, 3vw, 36px); }
.site-nav a {
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  padding: 6px 0;
  border-bottom: 1px solid transparent;
  transition: color 200ms, border-color 200ms;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--accent); }

/* ---------- Buttons & links ------------------------------------------------- */

.text-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; letter-spacing: 0.04em;
  text-decoration: none;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--accent);
}
.text-link:hover { color: var(--accent); }

.chip {
  appearance: none;
  font: inherit; font-size: 13px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 200ms, border-color 200ms, background-color 200ms;
}
.chip:hover { color: var(--text); border-color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }

/* ---------- Palette bar (shared) ------------------------------------------- */

.palette-bar { display: flex; height: 4px; }
.palette-bar span { flex: 1; }

/* ---------- Home ----------------------------------------------------------- */

.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background: var(--surface);
}
/* Faint down-pointing chevron; clicking it scrolls to the next section. */
.scroll-cue {
  position: absolute; z-index: 2;
  left: 50%; bottom: 14px;
  transform: translateX(-50%);
  width: 56px; height: 56px;
  display: grid; place-items: center;
  background: none; border: 0; padding: 0;
  color: rgba(244, 241, 234, .55);
  cursor: pointer;
  transition: color 250ms ease;
  animation: cue-bob 2.6s ease-in-out infinite;
}
.scroll-cue:hover, .scroll-cue:focus-visible { color: rgba(244, 241, 234, .95); }
.scroll-cue svg { width: 28px; height: 28px; }
@keyframes cue-bob {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 6px); }
}
/* The photo is square; app.js sizes and places it for each hero shape (placeHero). */
.hero img {
  position: absolute;
  max-width: none;
  animation: hero-in 1.6s cubic-bezier(.2,.7,.2,1) both;
}
/* Once placed, resizes and rotations glide to the new framing instead of jumping. */
.hero img.placed {
  transition: left .6s cubic-bezier(.2,.7,.2,1), top .6s cubic-bezier(.2,.7,.2,1),
              width .6s cubic-bezier(.2,.7,.2,1), height .6s cubic-bezier(.2,.7,.2,1);
}
@keyframes hero-in { from { transform: scale(1.06); opacity: 0; } to { transform: none; opacity: 1; } }
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background:
    linear-gradient(to top, rgba(8,9,10,.82) 0%, rgba(8,9,10,.15) 55%, rgba(8,9,10,.25) 100%);
}
/* The name sits at the top, over the dark sky; the tagline and link sit at the bottom. */
.hero-copy {
  position: absolute; z-index: 1;
  left: var(--gutter); right: var(--gutter);
  top: calc(var(--header-h) + 5vh); bottom: clamp(28px, 7vh, 72px);
  color: #f4f1ea;
  display: flex; flex-direction: column; justify-content: space-between; gap: 20px;
}
.hero h1 {
  font-family: var(--font-name);
  font-weight: 400;
  font-size: clamp(64px, min(14vw, 22vh), 200px);
  line-height: 0.92;
  letter-spacing: -0.02em;
  margin: 0;
}
.hero-sub {
  display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: flex-end; justify-content: space-between;
  border-top: 1px solid rgba(244,241,234,.35); padding-top: 18px;
}
.hero-sub p { margin: 0; max-width: 42ch; font-size: clamp(15px, 1.5vw, 19px); }
.hero-sub .label { color: rgba(244,241,234,.7); }
.hero-caption {
  position: absolute; z-index: 1; right: var(--gutter); top: 96px;
  color: rgba(244,241,234,.85); text-align: right;
}
.hero-caption a { color: inherit; text-decoration: none; }

/* Tagline and link shown beneath the photo on phones only. */
.hero-intro { display: none; }

.section { padding: clamp(64px, 10vw, 128px) var(--gutter); }
.section-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
  margin-bottom: clamp(28px, 4vw, 48px);
}
.section-head h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 4vw, 48px);
  letter-spacing: -0.025em;
  margin: 0;
}

.about {
  display: grid; gap: 24px;
  grid-template-columns: 1fr;
  max-width: 1200px;
}
.about p.lede {
  font-family: var(--font-display);
  font-weight: 500;
  font-stretch: 92%;
  font-size: clamp(24px, 3.4vw, 42px);
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 0;
  max-width: 28ch;
}
.about .label { margin-bottom: 4px; }

@media (min-width: 900px) {
  .about { grid-template-columns: 200px 1fr; gap: 48px; }
}

/* ---------- Project cards / grid ------------------------------------------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: clamp(32px, 4vw, 56px) clamp(16px, 2vw, 28px);
}

.card { color: inherit; text-decoration: none; display: block; }
.card .thumb {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--surface);
}
.card img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 900ms cubic-bezier(.2,.7,.2,1), opacity 400ms;
}
.card:hover img { transform: scale(1.035); }
.card h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 16px 0 6px;
}
.card .meta {
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 13px; color: var(--muted);
}
.card .palette-bar { margin-top: 14px; opacity: .85; transition: opacity 300ms; }
.card:hover .palette-bar { opacity: 1; }

.index-head {
  padding: clamp(48px, 8vw, 96px) var(--gutter) clamp(24px, 3vw, 40px);
  display: grid; gap: 28px;
}
.index-head h1 { font-size: clamp(56px, 10vw, 150px); letter-spacing: -0.045em; }
.index-tools {
  display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center;
  border-top: 1px solid var(--line); padding-top: 18px;
}
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.count { font-size: 13px; color: var(--muted); }

.index-grid { padding: 0 var(--gutter) clamp(72px, 10vw, 128px); }

/* ---------- Project page --------------------------------------------------- */

.back-row { padding: 24px var(--gutter) 0; }
.back {
  display: inline-flex; gap: 8px; align-items: center;
  font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase;
  text-decoration: none; color: var(--muted);
  transition: color 200ms;
}
.back:hover { color: var(--accent); }

.project-head {
  padding: clamp(32px, 6vw, 72px) var(--gutter) clamp(32px, 5vw, 56px);
  display: grid; gap: clamp(28px, 4vw, 48px);
}
.project-title {
  font-size: clamp(44px, 8.4vw, 124px);
  letter-spacing: -0.045em;
  line-height: 0.9;
  max-width: 13ch;
}
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 24px 40px;
  margin: 0;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}
.fact dt { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.fact dd { margin: 0; font-size: 17px; }

.project-head { border-top: 3px solid var(--accent); }
.fact dt { color: var(--accent); }
.fact dd { color: var(--text); }

.gallery {
  padding: 0 var(--gutter);
  columns: 2;
  column-gap: clamp(12px, 2vw, 24px);
}
.gallery figure {
  margin: 0 0 clamp(12px, 2vw, 24px);
  break-inside: avoid;
  position: relative;
}
.gallery figure.wide { column-span: all; }
.gallery img {
  width: 100%;
  height: auto;
  background: var(--surface);
  cursor: zoom-in;
  transition: opacity 500ms;
}
.gallery figure img[loading] { opacity: 1; }
.gallery figcaption {
  position: absolute; left: 10px; bottom: 10px;
  font-size: 12px; letter-spacing: .08em;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 3px 8px;
  opacity: 0; transition: opacity 250ms;
}
.gallery figure:hover figcaption, .gallery figure:focus-within figcaption { opacity: 1; }

@media (max-width: 720px) {
  .gallery { columns: 1; }
}

.project-nav {
  margin-top: clamp(64px, 9vw, 120px);
  padding: 0 var(--gutter) clamp(72px, 10vw, 128px);
  display: grid; gap: 24px;
  grid-template-columns: 1fr;
}
.project-nav a {
  display: grid; grid-template-columns: 96px 1fr; gap: 18px; align-items: center;
  text-decoration: none;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
.project-nav a:hover h3 { color: var(--accent); }
.project-nav img { width: 96px; aspect-ratio: 4/5; object-fit: cover; }
.project-nav h3 {
  font-family: var(--font-display); font-weight: 600; font-size: clamp(20px, 2.6vw, 30px);
  letter-spacing: -0.02em; margin: 6px 0 0; transition: color 200ms;
}
.project-nav .dir { text-align: right; }
.project-nav .dir a { grid-template-columns: 1fr 96px; text-align: right; }
.project-nav .dir a > div { order: 1; }
.project-nav .dir a img { order: 2; }
@media (min-width: 800px) {
  .project-nav { grid-template-columns: 1fr 1fr; }
}

/* ---------- Contact --------------------------------------------------------- */

.contact {
  padding: clamp(72px, 12vw, 160px) var(--gutter) clamp(72px, 10vw, 128px);
  display: grid; gap: clamp(40px, 6vw, 72px);
}
.contact h1 { font-size: clamp(56px, 10vw, 150px); letter-spacing: -0.045em; }
.contact .mail {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(22px, 4.4vw, 56px);
  letter-spacing: -0.02em;
  text-decoration: none;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 6px;
  overflow-wrap: anywhere;
  transition: color 200ms;
}
.contact .mail:hover { color: var(--accent); }
.contact-cols {
  display: grid; gap: 28px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  border-top: 1px solid var(--line);
  padding-top: 20px;
}
.contact-cols p { margin: 0; font-size: 17px; }
.contact-cols a { text-decoration: none; }
.contact-cols a:hover { color: var(--accent); }

/* ---------- Footer ----------------------------------------------------------- */

.site-footer {
  display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; justify-content: space-between;
  padding: 28px var(--gutter) 36px;
  border-top: 1px solid var(--line);
  font-size: 13px; color: var(--muted);
}
.site-footer p { margin: 0; }
.site-footer .socials { display: flex; gap: 20px; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--text); }

/* ---------- Lightbox -------------------------------------------------------- */

.lightbox {
  position: fixed; inset: 0; z-index: 50;
  display: grid; grid-template-rows: auto 1fr auto;
  background: color-mix(in srgb, var(--bg) 96%, transparent);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none;
  transition: opacity 300ms ease;
}
.lightbox.open { opacity: 1; pointer-events: auto; }
.lb-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px var(--gutter);
  font-size: 13px; letter-spacing: .08em; color: var(--muted);
}
.lb-btn, .lb-nav {
  font: inherit; color: var(--text);
  background: transparent; border: 1px solid var(--line);
  cursor: pointer;
  transition: border-color 200ms, color 200ms, background-color 200ms;
}
.lb-btn { padding: 8px 14px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.lb-btn:hover, .lb-nav:hover { border-color: var(--accent); color: var(--accent); }
.lb-stage {
  position: relative; min-height: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 0 clamp(12px, 6vw, 96px);
}
.lb-stage img {
  max-width: 100%; max-height: 100%;
  width: auto; height: auto;
  object-fit: contain;
  box-shadow: 0 30px 80px rgba(0,0,0,.35);
}
.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 48px; height: 48px; font-size: 18px;
  display: grid; place-items: center;
}
.lb-prev { left: 8px; }
.lb-next { right: 8px; }
.lb-caption {
  margin: 0; padding: 14px var(--gutter) 20px;
  font-size: 13px; color: var(--muted); text-align: center;
}

/* ---------- Responsive ----------------------------------------------------- */

/* Phones: the photo is a shorter band so the whole car stays in frame. The
   name sits in the sky above the car, and the tagline moves below the photo. */
@media (max-width: 720px) {
  .hero { height: 58vh; height: 58svh; min-height: 0; }
  .hero-copy { top: calc(var(--header-h) + 22px); bottom: auto; gap: 0; justify-content: flex-start; }
  .hero h1 { font-size: clamp(44px, 13.5vw, 60px); }
  .hero-sub { display: none; }
  .hero-intro {
    display: grid; gap: 16px;
    padding: 24px var(--gutter) 8px;
  }
  .hero-intro p { margin: 0; font-size: 15px; color: var(--muted); max-width: 40ch; }
}

@media (max-width: 560px) {
  .wordmark { font-size: 16px; }
  .site-nav { gap: 18px; }
  .site-nav a { font-size: 12px; }
  .hero-caption { display: none; }
  .project-nav a { grid-template-columns: 72px 1fr; }
  .project-nav img { width: 72px; }
  .project-nav .dir a { grid-template-columns: 1fr 72px; }
  .lb-prev, .lb-next { width: 40px; height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .scroll-cue { animation: none; }
  *, *::before, *::after { animation: none !important; transition-duration: 1ms !important; }
}
