:root {
  --bg: #ffffff;
  --ink: #111111;
  --muted: #6f6f6b;
  --line: #d9d8d4;
  --white-bg: #f1f0ec;
  --bright-bg: #d9d4c7;
  --black-bg: #111111;
  --font: "Inter Tight", system-ui, sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  --pad: max(16px, 3vw);
  --gap: 20px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
p { margin: 0; }

/* Section themes */
.theme-white { background: var(--white-bg); }
.theme-bright { background: var(--bright-bg); }
.theme-black { background: var(--black-bg); color: #f3f2ee; --line: #3a3a38; --muted: #a3a29d; --ink: #f3f2ee; }

/* Type */
.h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(48px, 7vw, 112px); line-height: .95; letter-spacing: -0.02em; margin: 0; }
.h2[data-num]::before {
  content: attr(data-num); display: block; margin-bottom: 18px;
  font: 400 13px/1 var(--font); letter-spacing: .12em; color: var(--muted);
}
.label { font-size: 14px; color: var(--muted); }

/* Buttons */
.btn {
  display: inline-block; background: var(--ink); color: var(--bg);
  padding: 14px 26px; border-radius: 6px; font-size: 15px; font-weight: 500;
  transition: opacity .2s;
}
.theme-black .btn { background: #f3f2ee; color: #111; }
.btn:hover { opacity: .75; }
.btn-small { padding: 9px 18px; font-size: 14px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 32px;
  padding: max(16px, 1.4vw) var(--pad);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
section[id] { scroll-margin-top: 72px; }
.brand { font-family: var(--serif); font-size: 26px; margin-right: auto; }
.nav { display: flex; gap: 28px; font-size: 15px; }
.nav a { opacity: .7; transition: opacity .2s; }
.nav a:hover, .nav a.active { opacity: 1; }
.nav a.active { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }
.burger { display: none; width: 34px; height: 34px; position: relative; }
.burger span { position: absolute; left: 5px; right: 5px; height: 2px; background: var(--ink); transition: transform .3s, top .3s; }
.burger span:first-child { top: 12px; }
.burger span:last-child { top: 20px; }
.burger[aria-expanded="true"] span:first-child { top: 16px; transform: rotate(45deg); }
.burger[aria-expanded="true"] span:last-child { top: 16px; transform: rotate(-45deg); }

.menu {
  position: fixed; inset: 0; z-index: 25; background: var(--bg);
  display: flex; flex-direction: column; justify-content: center; gap: 40px; padding: 0 var(--pad);
  opacity: 0; visibility: hidden; transition: opacity .35s, visibility .35s;
}
.menu.open { opacity: 1; visibility: visible; }
.menu nav { display: flex; flex-direction: column; gap: 4px; font-family: var(--serif); font-size: 48px; }
.menu .btn { align-self: flex-start; }

/* Hero */
.hero { padding: 0 var(--pad) clamp(64px, 10vw, 140px); }
.hero-media { position: relative; background: var(--white-bg); overflow: hidden; aspect-ratio: 2 / 1; max-height: 82vh; width: 100%; }
.hero-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1.4s ease; pointer-events: none; }
.hero-slide.active { opacity: 1; pointer-events: auto; }
.hero-slide img, .hero-slide svg { width: 100%; height: 100%; object-fit: cover; transform: scale(1.04); transition: transform 7s ease-out; }
.hero-slide.active img { transform: scale(1); }
.hero-caption {
  position: absolute; left: 20px; bottom: 18px; padding: 8px 14px; border-radius: 6px;
  background: rgba(17,17,17,.72); color: #f3f2ee; font-size: 14px; backdrop-filter: blur(6px);
}
.hero-caption span { display: inline-block; transition: transform .2s; }
.hero-slide:hover .hero-caption span { transform: translateX(4px); }
.hero-dots { position: absolute; right: 20px; bottom: 22px; display: flex; gap: 8px; }
.hero-dots button { width: 28px; height: 3px; background: rgba(255,255,255,.5); border-radius: 2px; }
.hero-dots button.active { background: #fff; }
.hero-tagline {
  font-family: var(--serif); font-weight: 400; font-size: clamp(34px, 4.6vw, 76px); line-height: 1.02; letter-spacing: -0.015em;
  margin: clamp(32px, 4vw, 64px) 0 clamp(24px, 3vw, 48px); max-width: 22ch;
}
.hero-intro { margin-left: 45.8%; max-width: 46ch; font-size: clamp(17px, 1.3vw, 20px); }

/* Sections */
.section { padding: clamp(64px, 9vw, 140px) var(--pad); }
.section > .h2 { margin-bottom: clamp(32px, 4vw, 64px); }

/* Carousel */
.carousel { margin: 0 calc(var(--pad) * -1); }
.carousel-track {
  list-style: none; margin: 0; padding: 0 var(--pad);
  display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - var(--pad) * 2 - var(--gap)) / 2.15);
  gap: var(--gap); overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 var(--pad);
  scrollbar-width: none;
}
.carousel-track::-webkit-scrollbar { display: none; }
.slide { scroll-snap-align: start; }
.slide > a { display: block; }
.slide-media { aspect-ratio: 3 / 2; overflow: hidden; background: var(--white-bg); margin-bottom: 22px; }
.slide-media img, .slide-media svg { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s cubic-bezier(.2,.7,.2,1); }
.slide:hover .slide-media img, .slide:hover .slide-media svg { transform: scale(1.03); }
.slide-title { font-family: var(--serif); font-weight: 400; font-size: clamp(28px, 2.8vw, 44px); letter-spacing: -0.01em; line-height: 1.1; margin: 0 0 10px; }
.slide .label { margin-bottom: 18px; }
.carousel-nav { display: flex; justify-content: center; gap: 28px; margin-top: 36px; }
.arrow { width: 56px; height: 24px; opacity: .8; transition: opacity .2s, transform .2s; }
.arrow:hover { opacity: 1; }
.arrow:disabled { opacity: .25; cursor: default; }
.arrow svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.4; }

/* Explore list */
.explore-row { border-top: 1px solid var(--line); padding: 28px 0 clamp(48px, 6vw, 96px); display: grid; grid-template-columns: 8fr 7fr 9fr; gap: var(--gap); cursor: pointer; }
.explore-title { font-family: var(--serif); font-size: clamp(26px, 2.4vw, 38px); line-height: 1.1; }
.explore-title .label { font-family: var(--font); }
.explore-title .label { display: block; margin-top: 6px; letter-spacing: 0; }
.explore-media { aspect-ratio: 1.58; overflow: hidden; background: var(--white-bg); }
.explore-media img, .explore-media svg { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s cubic-bezier(.2,.7,.2,1); }
.explore-row:hover .explore-media img, .explore-row:hover .explore-media svg { transform: scale(1.03); }
.explore-row:hover .explore-title { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }

/* Experience (Radian "Clients" layout) */
.exp-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 56px var(--gap); }
.exp-item .label { margin-bottom: 10px; }
.exp-item h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(22px, 2vw, 30px); line-height: 1.2; letter-spacing: -0.02em; margin: 0; }
.exp-item p { color: var(--muted); margin-top: 4px; }

/* About */
.about { display: grid; grid-template-columns: 9fr 1fr 14fr; gap: var(--gap); align-items: start; }
.about-portrait { grid-column: 1; aspect-ratio: 4 / 5.6; overflow: hidden; background: #222; }
.about-portrait img, .about-portrait svg { width: 100%; height: 100%; object-fit: cover; }
.about-body { grid-column: 3; }
.about .h2 { margin-bottom: 32px; }
.bio { font-size: clamp(17px, 1.35vw, 21px); max-width: 52ch; }
.bio p + p { margin-top: 1em; }
.about-lists { display: grid; grid-template-columns: 1fr 1fr; gap: 48px var(--gap); margin-top: clamp(48px, 6vw, 96px); }
.about-lists h4 { font-weight: 500; font-size: 20px; margin: 0 0 12px; letter-spacing: -0.01em; }
.about-lists ul { list-style: none; padding: 0; margin: 0; color: var(--muted); }
.about-lists li { padding: 2px 0; }
.about-cv { grid-column: 1 / -1; }

/* Contact */
.contact { display: grid; grid-template-columns: 10fr 1fr 13fr; gap: var(--gap); }
.contact .h2 { grid-column: 1; }
.contact-body { grid-column: 3; padding-top: clamp(24px, 6vw, 110px); }
.contact-text { font-size: clamp(17px, 1.35vw, 21px); max-width: 46ch; margin-bottom: 40px; }
.contact-form { display: grid; gap: 18px; max-width: 560px; }
.contact-form label { display: flex; flex-wrap: wrap; gap: 6px 4px; font-size: 14px; }
.contact-form input, .contact-form textarea { flex-basis: 100%; }
.contact-form label span { color: #57544d; }
.contact-form input, .contact-form textarea {
  font: inherit; font-size: 16px; color: var(--ink); background: transparent;
  border: 1px solid #8f8b80; border-radius: 6px; padding: 12px 14px; resize: vertical;
}
.contact-form input:focus, .contact-form textarea:focus { outline: 2px solid var(--ink); outline-offset: 1px; }
.contact-form .btn { justify-self: start; margin-top: 6px; }
.form-note { font-size: 13px; color: #57544d; }

/* Footer */
.site-footer { padding: clamp(48px, 6vw, 96px) var(--pad) 24px; }
.footer-row { display: grid; grid-template-columns: 10fr 6fr 8fr; gap: var(--gap); font-size: 15px; }
.footer-row a:hover { opacity: .7; }
.copyright { margin-top: clamp(40px, 6vw, 80px); font-size: 13px; color: var(--muted); }

body.locked { overflow: hidden; }

/* Project page */
.project-head { padding: clamp(32px, 5vw, 80px) var(--pad) clamp(28px, 3vw, 48px); }
.back-link { display: inline-block; margin-bottom: clamp(24px, 3vw, 48px); font-size: 15px; color: var(--muted); }
.back-link:hover { color: var(--ink); }
.project-meta { margin-top: 16px; color: var(--muted); font-size: 16px; }
.project-meta a { text-decoration: underline; }
.project-cover { padding: 0 var(--pad); }
.project-cover figure, .project-gallery figure { margin: 0; }
.project-cover img, .project-cover svg { width: 100%; height: auto; max-height: 88vh; object-fit: contain; background: var(--white-bg); }
.project-info { display: grid; grid-template-columns: 10fr 1fr 13fr; gap: var(--gap); padding: clamp(48px, 6vw, 96px) var(--pad); }
.facts { grid-column: 1; display: grid; grid-template-columns: auto 1fr; margin: 0; font-size: 15px; align-self: start; }
.facts dt, .facts dd { padding: 12px 0; border-top: 1px solid var(--line); margin: 0; }
.facts dt { color: var(--muted); padding-right: 28px; }
.project-text { grid-column: 3; font-size: clamp(17px, 1.35vw, 21px); }
.project-text p + p { margin-top: 1em; }
.project-gallery { display: grid; gap: clamp(24px, 3vw, 48px); padding: 0 var(--pad); }
.project-gallery img, .project-gallery svg { width: 100%; height: auto; background: var(--white-bg); }
.project-cover figcaption, .project-gallery figcaption { font-size: 14px; color: var(--muted); padding-top: 12px; }
.project-nav {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap);
  margin-top: clamp(64px, 8vw, 128px); padding: clamp(32px, 4vw, 56px) var(--pad) clamp(64px, 8vw, 128px);
  border-top: 1px solid var(--line); font-family: var(--serif); font-size: clamp(28px, 3.2vw, 52px); line-height: 1.05;
}
.project-nav .label { display: block; font-family: var(--font); font-size: 14px; margin-bottom: 10px; }
.project-nav .next { text-align: right; }
.project-nav a:hover { opacity: .6; }

/* Reveal (fade, like the template) */
.reveal { opacity: 0; transition: opacity .9s ease .15s; }
.reveal.in { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transition: none; }
}

/* Responsive */
@media (max-width: 900px) {
  .hero-media { aspect-ratio: 4 / 3; }
  .nav, .site-header > .btn { display: none; }
  .burger { display: block; }
  .hero-intro { margin-left: 0; }
  .carousel-track { grid-auto-columns: 82%; }
  .explore-row { grid-template-columns: 1fr; }
  .explore-row .explore-media { order: -1; }
  .exp-cols { grid-template-columns: 1fr 1fr; }
  .about, .contact, .project-info { grid-template-columns: 1fr; }
  .about-portrait, .about-body, .contact .h2, .contact-body, .facts, .project-text { grid-column: 1; }
  .project-text { grid-row: 1; }
  .about-portrait { max-width: 480px; }
  .contact-body { padding-top: 0; }
  .footer-row { grid-template-columns: 1fr; gap: 16px; }
}
@media (max-width: 560px) {
  .exp-cols { grid-template-columns: 1fr; gap: 36px; }
  .about-lists { grid-template-columns: 1fr; gap: 32px; }
  .menu nav { font-size: 34px; }
}
