:root {
  --bg: #f6f4f0;
  --ink: #171717;
  --muted: #6b6a66;
  --line: #d9d5cd;
  --accent: #a58a63;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Inter", system-ui, sans-serif;
  --gutter: clamp(20px, 5vw, 64px);
  --logo-h: 100px;                       /* logo size — text scales with it */
  --header-h: calc(var(--logo-h) + 24px);
  --brand: #2c3b54;                      /* slate blue used for "Studio Chronicles" */
  --garamond: "EB Garamond", "Cormorant Garamond", Georgia, serif;
}
body.dark {
  --bg: #121212;
  --ink: #f1eee8;
  --muted: #bdb9b0;
  --line: #2f2f2d;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-weight: 300; line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  animation: page-in .6s ease both;
}
@keyframes page-in { from { opacity: 0; } to { opacity: 1; } }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
.wrap { padding-inline: var(--gutter); max-width: 1440px; margin-inline: auto; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  padding-inline: var(--gutter); color: #fff;
}
.site-header.solid { background: var(--bg); color: var(--ink); box-shadow: 0 1px 0 var(--line); }
.logo { display: flex; align-items: center; gap: calc(var(--logo-h) * .2); position: relative; z-index: 60; }
.lm { height: var(--logo-h); width: auto; }
.lm-dark { display: none; }
.solid .lm-dark { display: block; }
.solid .lm-light { display: none; }
body.dark .solid .lm-dark, body.menu-open .lm-dark { display: none; }
body.dark .solid .lm-light, body.menu-open .lm-light { display: block; }
.logo-text { display: flex; flex-direction: column; align-items: flex-start; text-align: left; font-family: var(--garamond); line-height: 1.1; color: #fff; }
.logo-text strong { font-weight: 400; font-size: calc(var(--logo-h) * .4); letter-spacing: 0; white-space: nowrap; line-height: 1.05; }
.solid .logo-text strong { color: var(--brand); }
body.dark .solid .logo-text strong { color: #e6ebf3; }
body.menu-open .logo-text strong { color: #fff; }
.nav { display: flex; gap: clamp(24px, 4vw, 56px); }
.nav a {
  font-size: .78rem; letter-spacing: .24em; text-transform: uppercase; font-weight: 400;
  position: relative; padding-block: 6px;
}
.nav a::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 100%;
  background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .35s;
}
.nav a:hover::after, .nav a.active::after { transform: scaleX(1); }

.menu-toggle { display: none; background: none; border: 0; width: 40px; height: 40px; cursor: pointer; position: relative; color: inherit; }
.menu-toggle span { position: absolute; left: 8px; right: 8px; height: 1px; background: currentColor; transition: transform .3s, top .3s; }
.menu-toggle span:first-child { top: 16px; }
.menu-toggle span:last-child { top: 24px; }
.menu-toggle[aria-expanded="true"] span:first-child { top: 20px; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:last-child { top: 20px; transform: rotate(-45deg); }

/* ---------- Home (hero only, no scrolling) ---------- */
body.home { overflow: hidden; height: 100vh; height: 100dvh; }
.hero {
  position: relative; height: 100%; overflow: hidden;
  background: #2a2a28; color: #fff; display: flex; align-items: flex-end;
}
.hero-img {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  transform: scale(1.06); animation: settle 2.4s ease-out forwards;
}
@keyframes settle { to { transform: scale(1); } }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0,0,0,.4) 0%, rgba(0,0,0,0) 30%, rgba(0,0,0,.55) 100%); }
.hero-copy { position: relative; padding: 0 var(--gutter) clamp(48px, 9vh, 100px); }
.eyebrow { font-size: .75rem; letter-spacing: .3em; text-transform: uppercase; margin: 0 0 20px; opacity: .85; }
.hero h1 { margin: 0; font-family: var(--serif); font-weight: 300; font-size: clamp(2.8rem, 8vw, 7rem); line-height: 1.02; letter-spacing: -.01em; }

/* ---------- Inner pages ---------- */
.inner main { min-height: calc(100vh - 90px); padding-top: var(--header-h); }
.page-head { padding-top: clamp(24px, 4vw, 64px); padding-bottom: clamp(24px, 4vw, 56px); }
.page-title { margin: 0 0 24px; font-family: var(--serif); font-weight: 300; font-size: clamp(3.2rem, 9vw, 8rem); line-height: .95; letter-spacing: -.02em; }
.lead { font-family: var(--serif); font-size: clamp(1.5rem, 2.6vw, 2.3rem); line-height: 1.3; font-weight: 400; margin: 0; max-width: 34ch; }
.page-head .lead { max-width: 40ch; }
.page-head .lead.wide { max-width: none; }
.block { padding-block: clamp(40px, 7vw, 96px); border-top: 1px solid var(--line); }
.block-title { margin: 0; font-family: var(--serif); font-weight: 300; font-size: clamp(1.8rem, 3vw, 2.6rem); line-height: 1.1; }
.grid-2 { display: grid; grid-template-columns: 1fr 2fr; gap: clamp(28px, 6vw, 96px); align-items: start; }
.prose p { margin: 0 0 1.4em; color: var(--muted); max-width: 62ch; font-size: 1.02rem; }
.prose p:last-child { margin-bottom: 0; }

.photo { aspect-ratio: 4 / 3; overflow: hidden; background: linear-gradient(135deg, #b9b3a6, #8f897c); }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.about-photo { padding-bottom: clamp(40px, 6vw, 80px); }
.about-photo .photo { aspect-ratio: 21 / 9; }

.stats { list-style: none; display: flex; flex-wrap: wrap; gap: 32px clamp(40px, 8vw, 120px); padding: 0; margin: 0; }
.stats strong { display: block; font-family: var(--serif); font-weight: 300; font-size: clamp(3rem, 6vw, 5rem); line-height: 1; }
.stats span { font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }

.services { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.services li {
  padding: 14px 0; border-bottom: 1px solid var(--line);
  font-family: var(--serif); font-size: clamp(1.15rem, 1.8vw, 1.7rem); font-weight: 300;
  transition: padding-left .35s, color .35s;
}
.services li:hover { padding-left: 20px; color: var(--accent); }

.team { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 260px)); gap: 24px; }
.team .photo { aspect-ratio: 3 / 4; }
.team figure { margin: 0; }
.team figcaption { padding-top: 14px; display: flex; flex-direction: column; }
.team strong { font-family: var(--serif); font-size: 1.5rem; font-weight: 400; }
.team figcaption span { font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }

.cta { padding-block: clamp(60px, 9vw, 130px); border-top: 1px solid var(--line); }
.cta-link { font-family: var(--serif); font-size: clamp(2.4rem, 6vw, 5rem); font-weight: 300; display: inline-block; transition: color .3s, transform .4s; }
.cta-link:hover { color: var(--accent); transform: translateX(12px); }

/* ---------- Work grid ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.filters button {
  background: none; border: 0; padding: 4px 0; cursor: pointer;
  font: 400 .75rem var(--sans); letter-spacing: .22em; text-transform: uppercase; color: var(--muted);
  border-bottom: 1px solid transparent; transition: color .25s, border-color .25s;
}
.filters button:hover, .filters button.active { color: var(--ink); border-color: var(--ink); }

.projects { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(32px, 4vw, 56px) clamp(20px, 3vw, 40px); padding-bottom: clamp(60px, 9vw, 130px); }
.project { display: block; }
.project.hide { display: none; }
.thumb { aspect-ratio: 4 / 3; overflow: hidden; background: linear-gradient(135deg, #b9b3a6, #8f897c); position: relative; }
.project:nth-child(3n+1) .thumb { background: linear-gradient(135deg, #9aa2a3, #6f787a); }
.project:nth-child(3n+2) .thumb { background: linear-gradient(135deg, #c5b9a3, #9c8f77); }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s cubic-bezier(.2,.7,.2,1); }
.project:hover .thumb img { transform: scale(1.05); }
.thumb .view {
  position: absolute; inset: 0; display: grid; place-items: center; color: #fff;
  font-size: .75rem; letter-spacing: .28em; text-transform: uppercase;
  background: rgba(0,0,0,.35); opacity: 0; transition: opacity .35s;
}
.project:hover .thumb .view { opacity: 1; }
.meta { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding-top: 16px; }
.meta h3 { margin: 0; font-family: var(--serif); font-size: 1.7rem; font-weight: 400; }
.meta span { font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }

/* ---------- Project detail ---------- */
.p-hero { width: 100%; height: 88vh; min-height: 420px; max-height: 900px; overflow: hidden; position: relative; background: linear-gradient(135deg, #b9b3a6, #8f897c); }
.p-hero img { width: 100%; height: 100%; object-fit: cover; }
.p-hero.missing::after { content: "Cover photo"; position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255,255,255,.75); font-size: .75rem; letter-spacing: .26em; text-transform: uppercase; }

.p-back-bar { padding-block: 20px; }
.back { display: inline-block; font-size: .75rem; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); margin-bottom: 28px; transition: color .25s; }
.back:hover { color: var(--ink); }
.p-cat { font-size: .75rem; letter-spacing: .26em; text-transform: uppercase; color: var(--accent); margin: 0 0 12px; }
.p-title { margin: 0; font-family: var(--serif); font-weight: 300; font-size: clamp(2.8rem, 8vw, 7rem); line-height: .98; letter-spacing: -.02em; }

.p-info { padding-block: clamp(32px, 5vw, 64px); }
.p-facts { margin: 0; display: grid; grid-template-columns: 1fr; gap: 16px; }
.p-facts div { border-top: 1px solid var(--line); padding-top: 10px; }
.p-facts dt { font-size: .68rem; letter-spacing: .22em; text-transform: uppercase; color: var(--accent); }
.p-facts dd { margin: 4px 0 0; }
.p-text .summary { font-family: var(--serif); font-size: clamp(1.4rem, 2.4vw, 2rem); line-height: 1.3; font-weight: 400; margin: 0 0 1.2em; color: var(--ink); max-width: none; }

.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(12px, 2vw, 28px); padding-bottom: clamp(48px, 7vw, 100px); }
.shot { margin: 0; cursor: zoom-in; overflow: hidden; position: relative; aspect-ratio: 4 / 3; background: linear-gradient(135deg, #b9b3a6, #8f897c); }
.shot:nth-child(3n+2) { background: linear-gradient(135deg, #9aa2a3, #6f787a); }
.shot:nth-child(3n) { background: linear-gradient(135deg, #c5b9a3, #9c8f77); }
.shot.wide { grid-column: 1 / -1; aspect-ratio: 16 / 9; }
.shot img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s cubic-bezier(.2,.7,.2,1); }
.shot:hover img { transform: scale(1.03); }
.shot.missing { cursor: default; }
.shot.missing::after { content: attr(data-label); position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255,255,255,.75); font-size: .75rem; letter-spacing: .26em; text-transform: uppercase; }

.next { display: block; border-top: 1px solid var(--line); padding-block: clamp(48px, 7vw, 100px); }
.next small { display: block; font-size: .72rem; letter-spacing: .24em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.next span { font-family: var(--serif); font-size: clamp(2.2rem, 6vw, 5rem); font-weight: 300; display: inline-block; transition: color .3s, transform .4s; }
.next:hover span { color: var(--accent); transform: translateX(12px); }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(10,10,10,.95); display: flex; align-items: center; justify-content: center; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 92vw; max-height: 86vh; object-fit: contain; }
.lightbox button { position: absolute; background: none; border: 0; color: #fff; cursor: pointer; font-size: 3rem; line-height: 1; width: 64px; height: 64px; opacity: .75; transition: opacity .2s; }
.lightbox button:hover { opacity: 1; }
.lb-close { top: 12px; right: 12px; }
.lb-prev { left: 8px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 8px; top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); color: #bbb; font-size: .75rem; letter-spacing: .2em; }

/* ---------- Connect ---------- */
.contact-details { display: grid; gap: 32px; }
.contact-details h5 { margin: 0 0 8px; font-size: .72rem; letter-spacing: .25em; text-transform: uppercase; font-weight: 400; color: var(--accent); }
.contact-details p { margin: 0; color: var(--muted); }
.contact-details a:hover { color: var(--ink); }
.contact-details .social { display: inline-flex; align-items: center; gap: 12px; transition: color .25s; }
.contact-details .social svg { flex: none; transition: transform .3s; }
.contact-details .social:hover svg { transform: scale(1.1); }

.contact-form { display: grid; gap: 28px; }
.field { position: relative; }
.field input, .field textarea {
  width: 100%; background: none; border: 0; border-bottom: 1px solid #4a4946; color: inherit;
  font: 300 1.05rem var(--sans); padding: 22px 0 10px; outline: none; resize: vertical; border-radius: 0; transition: border-color .25s;
}
.field input:focus, .field textarea:focus { border-color: var(--accent); }
.field label { position: absolute; left: 0; top: 22px; font-size: 1rem; color: #8a867d; pointer-events: none; transition: all .25s; }
.field input:focus + label, .field input:not(:placeholder-shown) + label,
.field textarea:focus + label, .field textarea:not(:placeholder-shown) + label { top: 0; font-size: .68rem; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); }
.field.invalid input, .field.invalid textarea { border-color: #c96a5a; }
.btn {
  justify-self: start; background: none; color: var(--ink); cursor: pointer;
  border: 1px solid var(--ink); padding: 16px 34px;
  font: 400 .78rem var(--sans); letter-spacing: .24em; text-transform: uppercase; transition: background .3s, color .3s;
}
.btn:hover { background: var(--ink); color: var(--bg); }
.form-note { margin: 0; min-height: 1.5em; font-size: .9rem; color: var(--accent); }

/* ---------- Footer & motion ---------- */
.site-footer { color: var(--muted); border-top: 1px solid var(--line); font-size: .78rem; letter-spacing: .1em; }
.site-footer .wrap { display: flex; justify-content: space-between; padding-block: 28px; }
.site-footer a:hover { color: var(--ink); }

.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-img { animation: none; transform: none; }
}

/* ---------- Responsive ---------- */
@media (min-width: 861px) {
  .p-info { display: grid; grid-template-columns: 1fr 2fr; gap: clamp(28px, 6vw, 96px); align-items: start; }
  .contact-details { gap: 40px; }
}
@media (max-width: 860px) {
  :root { --logo-h: 56px; }
  .grid-2 { grid-template-columns: 1fr; }
  .projects { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr; }
  .shot.wide { aspect-ratio: 4 / 3; }
  .p-facts { margin-bottom: 32px; }
  .lb-prev, .lb-next { width: 48px; }

  .menu-toggle { display: block; z-index: 60; }
  .logo { position: relative; z-index: 60; }
  .nav {
    position: fixed; inset: 0; background: #121212; color: #fff;
    flex-direction: column; align-items: center; justify-content: center; gap: 32px;
    opacity: 0; visibility: hidden; transition: opacity .35s, visibility .35s;
  }
  .nav a { font-family: var(--serif); font-size: 2.4rem; letter-spacing: .05em; text-transform: none; }
  .nav.open { opacity: 1; visibility: visible; }
  body.menu-open .site-header { color: #fff; background: transparent; box-shadow: none; }
}

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.load-error { grid-column: 1 / -1; color: var(--muted); padding: 40px 0; }
