:root {
  color-scheme: dark;
  --bg: #121212;
  --surface: #1b1a18;
  --text: #ece8e1;
  --muted: #8f8a82;
  --line: #2e2c29;
  --accent: #ff6a4d;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Inter", system-ui, sans-serif;
  --gutter: clamp(16px, 4vw, 48px);

  /* Golden ratio type scale: each step is the one below × 1.618 */
  --ratio: 1.618;
  --step-0: 17px;                                 /* body text  */
  --step-1: calc(var(--step-0) * var(--ratio));   /* ≈ 27.5px   */
  --step-2: calc(var(--step-1) * var(--ratio));   /* ≈ 44.5px   */
  --step-3: calc(var(--step-2) * var(--ratio));   /* ≈ 72px     */
  --step-4: calc(var(--step-3) * var(--ratio));   /* ≈ 116.5px  */
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }

h1, h2, h3 { font-weight: 400; margin: 0; }

::selection { background: var(--accent); color: #fff; }

/* ── Header ───────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px var(--gutter);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
}

.logo {
  font-family: var(--serif);
  font-size: 28px;
  text-decoration: none;
  line-height: 1;
}
.logo span { color: var(--accent); }

nav { display: flex; gap: 28px; }
nav a {
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
}
nav a:hover { color: var(--accent); }

.header-right { display: flex; align-items: center; gap: 28px; }

.lang-switch { display: flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.lang-switch button {
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.lang-switch button:hover { color: var(--text); }
.lang-switch button[aria-pressed="true"] { background: var(--text); color: var(--bg); }

/* ── Hero ─────────────────────────────────────── */
.hero {
  padding: clamp(60px, 14vh, 160px) var(--gutter) clamp(60px, 12vh, 120px);
}

.eyebrow {
  margin: 0 0 20px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero h1 {
  font-family: var(--serif);
  /* Step 2 on phones, growing to step 4 on large screens */
  font-size: clamp(var(--step-2), 8vw, var(--step-4));
  line-height: 1;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.hero em { color: var(--accent); }

.hero-intro {
  margin: 32px 0 0;
  max-width: 46ch;
  font-size: clamp(18px, 1.6vw, 21px);
  color: var(--muted);
}

.contact-intro { margin: 16px 0 0; max-width: 50ch; color: var(--muted); }

.hero-link {
  display: inline-block;
  margin-top: 40px;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
.hero-link:hover { color: var(--accent); }

/* ── Sections ─────────────────────────────────── */
section { padding: 0 var(--gutter); }

section h2 {
  font-family: var(--serif);
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1.05;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  padding-top: 32px;
  margin-bottom: 32px;
  border-top: 1px solid var(--line);
}

/* ── Filters ──────────────────────────────────── */
.filters { display: flex; flex-wrap: wrap; gap: 8px; }

.filter {
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 7px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.filter:hover { border-color: var(--text); }
.filter.active { background: var(--text); border-color: var(--text); color: var(--bg); }

/* ── Grid ─────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr));
  gap: 40px 24px;
  align-items: start;
}

.card {
  all: unset;
  cursor: pointer;
  display: block;
}
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; }

.card-media {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 4px;
}
.card-media > * {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.card:hover .card-media > * { transform: scale(1.04); }

.placeholder {
  display: flex;
  align-items: flex-end;
  padding: 24px;
}
.placeholder span {
  font-family: var(--serif);
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1;
}

.card-info { margin-top: 14px; }
.card-info h3 { font-family: var(--sans); font-size: 17px; font-weight: 600; }
.card-info p { margin: 4px 0 0; font-size: 14px; color: var(--muted); }

/* ── About ────────────────────────────────────── */
.about {
  margin-top: clamp(100px, 16vh, 180px);
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

.about-body {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: clamp(32px, 6vw, 96px);
  margin-top: 32px;
}

.about-text p { margin: 0 0 18px; max-width: 60ch; }
.about-text .lead { font-family: var(--serif); font-size: clamp(26px, 3vw, 36px); line-height: 1.2; }
.about-text strong { font-weight: 400; color: var(--accent); }

.button {
  display: inline-block;
  margin-top: 12px;
  padding: 12px 24px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-weight: 500;
  font-size: 15px;
  text-decoration: none;
  transition: background 0.2s;
}
.button:hover { background: var(--accent); }

.facts { margin: 0; }
.facts div {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.facts div:first-child { border-top: 1px solid var(--line); }
.facts dt { font-size: 13px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
.facts dd { margin: 0; }

/* ── Contact ──────────────────────────────────── */
.contact {
  margin-top: clamp(100px, 16vh, 180px);
  padding-top: clamp(60px, 10vh, 120px);
  padding-bottom: clamp(60px, 10vh, 120px);
  background: var(--surface);
  color: var(--text);
}

.email {
  display: inline-block;
  margin-top: 24px;
  font-family: var(--serif);
  font-size: clamp(32px, 6vw, 88px);
  line-height: 1.1;
  text-decoration: none;
  overflow-wrap: anywhere;
  color: var(--accent);
}
.email:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 8px; }

.socials {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 32px;
  margin: 40px 0 0;
  padding: 0;
  list-style: none;
}
.socials a { text-decoration: none; font-weight: 500; }
.socials a:hover { color: var(--accent); }

/* ── Footer ───────────────────────────────────── */
.site-footer {
  display: flex;
  justify-content: space-between;
  padding: 24px var(--gutter);
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
  border-top: 1px solid var(--line);
}
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--text); }

/* ── Project dialog ───────────────────────────── */
dialog {
  width: min(1100px, 100vw - 32px);
  max-height: calc(100vh - 32px);
  padding: 0;
  border: none;
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
}
dialog::backdrop { background: rgb(0 0 0 / 0.8); backdrop-filter: blur(4px); }

dialog .close {
  position: sticky;
  top: 12px;
  float: right;
  margin: 12px 12px 0 0;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  z-index: 1;
}
dialog .close:hover { background: var(--accent); }

.dialog-head { padding: clamp(24px, 5vw, 56px); max-width: 760px; }
.dialog-head h2 { font-family: var(--serif); font-size: clamp(40px, 6vw, 72px); line-height: 1; margin-bottom: 20px; }
.dialog-desc { margin: 0 0 16px; }
.tools { margin: 0; font-size: 14px; color: var(--muted); }

.grade {
  display: inline-block;
  margin: -4px 0 20px;
  padding: 4px 12px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  font-size: 13px;
  color: var(--text);
}
.grade strong { color: var(--accent); font-weight: 600; }
.grade span { color: var(--muted); }

.process { margin: 28px 0 24px; }
.process h3 {
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.process ol { margin: 0; padding-left: 1.6em; }
.process li { margin-bottom: 10px; padding-left: 4px; }
.process li::marker { font-family: var(--serif); font-size: 1.15em; color: var(--accent); }
.process strong { font-weight: 600; }
.credits { margin: 12px 0 0; font-size: 13px; font-style: italic; color: var(--muted); }

.dialog-images {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: 16px;
  padding: 0 clamp(16px, 4vw, 40px) clamp(16px, 4vw, 40px);
}
.dialog-images > * { width: 100%; border-radius: 4px; }
.dialog-images .wide,
.dialog-images .placeholder { grid-column: 1 / -1; }
.dialog-images .solo { grid-column: 1 / -1; justify-self: center; width: calc(50% - 8px); }
.dialog-images video { background: #000; }
/* Phone-shaped, to sit next to 9:16 videos and images */
.dialog-images .figma {
  aspect-ratio: 9 / 16;
  height: auto;
  border: 1px solid var(--line);
  background: var(--bg);
}

.dialog-section { margin-top: clamp(32px, 6vw, 64px); }

/* ── Carousel ─────────────────────────────────── */
/* The current slide sits in the middle, with smaller, faded neighbours
   peeking in on each side. --fit is set by script.js from the slides' shape. */
.dialog-carousel { padding: 0 clamp(16px, 4vw, 40px); }
.carousel {
  --slide: min(520px, 62vw, var(--fit, 520px));
  --gap: 12px;
  position: relative;
  max-width: calc(var(--slide) * 1.8);
  margin: 0 auto;
}

.carousel-track {
  display: flex;
  gap: var(--gap);
  padding-inline: calc(50% - var(--slide) / 2);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-track:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.carousel-track img {
  flex: 0 0 var(--slide);
  width: var(--slide);
  border-radius: 4px;
  scroll-snap-align: center;
  opacity: 0.35;
  transform: scale(0.85);
  cursor: pointer;
  transition: opacity 0.4s, transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.carousel-track img.is-active { opacity: 1; transform: none; cursor: default; }

.carousel-btn {
  position: absolute;
  top: calc(50% - 18px);
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgb(18 18 18 / 0.7);
  color: #ece8e1;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  transition: opacity 0.2s, background 0.2s;
}
.carousel-btn:hover { background: var(--accent); }
.carousel-btn:disabled { opacity: 0; pointer-events: none; }
.carousel-btn.prev { left: calc(50% - var(--slide) / 2 - 22px); }
.carousel-btn.next { right: calc(50% - var(--slide) / 2 - 22px); }

.carousel-dots { display: flex; justify-content: center; gap: 4px; margin-top: 12px; }
.carousel-dots button {
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
}
.carousel-dots button::before {
  content: "";
  display: block;
  width: 8px;
  height: 8px;
  margin: auto;
  border-radius: 50%;
  background: var(--line);
  transition: background 0.2s, transform 0.2s;
}
.carousel-dots button[aria-current="true"]::before { background: var(--accent); transform: scale(1.25); }
.dialog-section-head { padding: 0 clamp(16px, 4vw, 40px); max-width: 760px; margin-bottom: 20px; }
.dialog-section-head h3 { font-family: var(--serif); font-size: var(--step-1); line-height: 1.1; }
.dialog-section-head p { margin: 8px 0 0; color: var(--muted); }
.dialog-images .placeholder { aspect-ratio: 16 / 9; }

/* ── Small screens ────────────────────────────── */
@media (max-width: 760px) {
  nav { gap: 18px; }
  .header-right { gap: 18px; }
  .about-body { grid-template-columns: 1fr; }
  .facts div { grid-template-columns: 90px 1fr; }
}

@media (max-width: 520px) {
  .dialog-images { gap: 8px; }
  .dialog-images .solo { width: calc(50% - 4px); }
  .logo { font-size: 24px; }
  nav { gap: 14px; }
  nav a { font-size: 14px; }
  .header-right { gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
