:root {
  --paper: #f2f3f1;
  --ink: #1d2126;
  --steel: #5d6670;
  --alu: #cdd2d6;
  --yellow: #f2c12e;
  --blue: #1e4e9c;
  --surface: #ffffff;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #16191d;
    --ink: #e9ebed;
    --steel: #9ca5ae;
    --alu: #2f353c;
    --blue: #8fb3f2;
    --surface: #1e2227;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Archivo", "Helvetica Neue", Arial, sans-serif;
  font-variation-settings: "wdth" 100;
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--blue); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }

.skip { position: absolute; left: -999px; top: 0; background: var(--yellow); color: #1d2126; padding: 0.5rem 1rem; z-index: 20; }
.skip:focus { left: 0.5rem; }

/* Top bar */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 1.5rem;
  padding: 0.75rem clamp(1rem, 4vw, 3rem);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--alu);
}
.mark {
  font-variation-settings: "wdth" 125; font-weight: 800; color: var(--ink);
  text-decoration: none; white-space: nowrap; letter-spacing: -0.01em;
}
.top nav { overflow-x: auto; scrollbar-width: none; }
.top nav::-webkit-scrollbar { display: none; }
.top ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.1rem; white-space: nowrap; font-size: 0.9rem; }
.top nav a { color: var(--steel); text-decoration: none; }
.top nav a:hover { color: var(--ink); }

main { padding: 0 clamp(1rem, 4vw, 3rem); max-width: 1240px; margin: 0 auto; }

/* Hero */
.hero { padding: clamp(3rem, 9vw, 7rem) 0 3rem; border-bottom: 1px solid var(--alu); }
.hero h1 {
  margin: 0;
  font-size: clamp(3.4rem, 12vw, 9.5rem);
  line-height: 0.88;
  font-weight: 850;
  font-variation-settings: "wdth" 125;
  letter-spacing: -0.035em;
}
.hero h1::after {
  content: ""; display: block; width: 4.5rem; height: 0.55rem;
  background: var(--yellow); margin-top: 1.4rem;
}
.lede {
  max-width: 34ch; margin: 1.6rem 0 1.4rem;
  font-size: clamp(1.35rem, 2.6vw, 1.85rem); line-height: 1.3;
  font-variation-settings: "wdth" 92; font-weight: 500;
}
.facts { list-style: none; padding: 0; margin: 0 0 1.25rem; max-width: 62ch; }
.facts li { padding: 0.35rem 0; border-top: 1px solid var(--alu); }
.facts li:last-child { border-bottom: 1px solid var(--alu); }
.about { max-width: 62ch; color: var(--steel); margin: 0; }
.strip {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 1fr);
  gap: 6px; margin-top: 2.5rem; overflow-x: auto; scroll-snap-type: x mandatory;
}
.portrait { margin: 2rem 0 0; }
.portrait img { width: 100%; max-width: 420px; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 20%; }
@media (min-width: 900px) {
  .hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.62fr); column-gap: 3.5rem; }
  .hero h1 { grid-column: 1 / -1; }
  .hero-text { grid-column: 1; }
  .portrait { grid-column: 2; grid-row: 2; margin-top: 1.6rem; align-self: start; }
  .portrait img { max-width: none; }
  .strip { grid-column: 1 / -1; }
}
.contact-photo { margin-top: 1.25rem; width: 100%; max-width: 260px; aspect-ratio: 3 / 4; object-fit: cover; object-position: 50% 15%; }
.strip a { scroll-snap-align: start; }
.strip img { aspect-ratio: 3 / 4; object-fit: cover; width: 100%; height: 100%; }

/* Project sections */
.project {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem 3rem;
  padding: 3.5rem 0; border-bottom: 1px solid var(--alu);
}
@media (min-width: 960px) {
  .project { grid-template-columns: 260px minmax(0, 1fr); }
  .project-head { position: sticky; top: 4.5rem; align-self: start; }
}
.project-head h2 {
  margin: 0; font-size: clamp(1.9rem, 3.4vw, 2.6rem); line-height: 1;
  font-weight: 800; font-variation-settings: "wdth" 112; letter-spacing: -0.02em;
}
.role { color: var(--steel); margin: 0.75rem 0 0; font-size: 0.95rem; line-height: 1.45; }
.site-link { margin: 0.5rem 0 0; font-size: 0.95rem; }

.block { max-width: 66ch; }
.block + .block, .gallery + .block, .timeline + .block { margin-top: 2.5rem; }
.block h3 {
  margin: 0 0 0.6rem; font-size: 1.3rem; line-height: 1.2;
  font-weight: 700; font-variation-settings: "wdth" 108;
}
.block p { margin: 0 0 1rem; }
.stack { color: var(--steel); font-size: 0.95rem; }
.todo {
  border-left: 4px solid var(--yellow); padding: 0.4rem 0 0.4rem 0.9rem;
  color: var(--steel); font-size: 0.95rem;
}
.inline-links { padding: 0; margin: 0 0 1rem; list-style: none; }
.inline-links li { padding: 0.2rem 0; }

/* Galleries */
.gallery {
  display: grid; gap: 1rem 0.75rem; margin-top: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(min(200px, 40vw), 1fr));
}
.gallery.single { grid-template-columns: minmax(0, 520px); }
.gallery.phone:not(.single) { grid-template-columns: repeat(auto-fill, minmax(min(150px, 40vw), 1fr)); align-items: start; max-width: 820px; }
.gallery.phone .shot img { aspect-ratio: auto; object-fit: contain; }
.video { position: relative; aspect-ratio: 16 / 9; max-width: 720px; margin: 0 0 1rem; background: var(--alu); }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.shot { margin: 0; }
.shot a { display: block; background: var(--alu); }
.shot img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; transition: filter 0.2s; }
.shot a:hover img { filter: brightness(1.06); }
.shot figcaption { font-size: 0.85rem; line-height: 1.4; color: var(--steel); margin-top: 0.4rem; }

/* House timeline */
.timeline { margin-top: 1.75rem; }
.timeline-controls { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; }
.timeline-hint { margin: 0; color: var(--steel); font-size: 0.9rem; }
.timeline-controls button, .lb-controls button, .contact button {
  font: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer;
  background: var(--surface); color: var(--ink); border: 1px solid var(--alu);
  padding: 0.45rem 0.9rem; border-radius: 3px;
}
.timeline-controls button:hover, .lb-controls button:hover { border-color: var(--ink); }
.timeline-track {
  list-style: none; margin: 0; padding: 0 0 1rem;
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 300px); gap: 1rem;
  overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  border-top: 6px solid var(--yellow);
}
.frame { scroll-snap-align: start; padding-top: 0.75rem; position: relative; }
.frame::before {
  content: ""; position: absolute; top: -10px; left: 0; width: 14px; height: 14px;
  background: var(--ink); border: 3px solid var(--paper); border-radius: 50%;
}
.frame-n { font-variation-settings: "wdth" 125; font-weight: 800; font-size: 1.1rem; display: block; margin-bottom: 0.4rem; }
.frame img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.frame p { font-size: 0.88rem; line-height: 1.4; color: var(--steel); margin: 0.45rem 0 0; }

/* People */
.people { margin: 0; max-width: 66ch; }
.people div { padding: 1rem 0; border-top: 1px solid var(--alu); }
.people div:first-child { border-top: 0; padding-top: 0; }
.people dt { font-weight: 700; font-variation-settings: "wdth" 108; font-size: 1.1rem; }
.people dd { margin: 0.3rem 0 0; }

/* Links and contact */
.links { list-style: none; padding: 0; margin: 0 0 2.5rem; max-width: 66ch; }
.links li { padding: 0.55rem 0; border-top: 1px solid var(--alu); display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; }
.links li:last-child { border-bottom: 1px solid var(--alu); }
.links a { font-weight: 600; min-width: 9rem; }
.links span { color: var(--steel); font-size: 0.92rem; flex: 1 1 20rem; }

.contact { display: grid; gap: 1rem; max-width: 34rem; }
.contact label { display: grid; gap: 0.3rem; font-weight: 600; font-size: 0.95rem; }
.contact input, .contact textarea {
  font: inherit; font-weight: 400; color: var(--ink); background: var(--surface);
  border: 1px solid var(--alu); border-radius: 3px; padding: 0.6rem 0.7rem;
}
.contact input:focus, .contact textarea:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px var(--yellow); }
.contact button { justify-self: start; background: var(--ink); color: var(--paper); border-color: var(--ink); padding: 0.6rem 1.2rem; }
.contact button:disabled { opacity: 0.6; cursor: wait; }
.hp { position: absolute; left: -9999px; }
.form-status { margin: 0; min-height: 1.6em; font-size: 0.95rem; }

.foot { padding: 2rem clamp(1rem, 4vw, 3rem); color: var(--steel); font-size: 0.9rem; max-width: 1240px; margin: 0 auto; }

/* Lightbox */
.lightbox {
  border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 96vh;
  color: #eee;
}
.lightbox::backdrop { background: rgba(10, 12, 14, 0.92); }
.lightbox figure { margin: 0; display: grid; justify-items: center; gap: 0.6rem; }
.lightbox img { max-width: 94vw; max-height: 80vh; object-fit: contain; }
.lightbox figcaption { color: #d8dce0; font-size: 0.95rem; text-align: center; max-width: 60ch; }
.lb-controls { display: flex; justify-content: center; gap: 0.5rem; margin-top: 0.75rem; }
.lb-controls button { background: #262b31; color: #eee; border-color: #3a4048; }
.about + .about { margin-top: 0.75rem; }
