:root {
  --bg: #f7f6f2;
  --surface: #ffffff;
  --ink: #14181f;
  --muted: #5d6470;
  --line: #e4e2db;
  --accent: #d24330;
  --accent-dark: #a82f1e;
  --accent-soft: #fdeae5;
  --accent-light: #ff9a85;
  --accent-light-glow: rgba(255, 154, 133, 0.25);
  --dark: #12151c;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --radius: 14px;
  --max: 1080px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  font-size: 1.05rem;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }
a:hover { color: var(--accent-dark); }

.wrap { width: min(100% - 2.5rem, var(--max)); margin-inline: auto; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(247, 246, 242, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
}
.brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.brand:hover { color: var(--ink); }
.nav { display: flex; gap: 1.4rem; flex-wrap: wrap; }
.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

/* Hero */
.hero { padding: clamp(3.5rem, 10vw, 7rem) 0 clamp(3rem, 7vw, 5rem); }
.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  margin-bottom: 1.4rem;
}
.hero h1, .page-head h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.6rem, 8vw, 5rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  max-width: 14ch;
}
.hero .lead {
  margin-top: 1.4rem;
  max-width: 38rem;
  font-size: clamp(1.1rem, 2.4vw, 1.3rem);
  color: var(--muted);
}
.actions { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-top: 2rem; }
.btn {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  font-size: 0.98rem;
  text-decoration: none;
  padding: 0.8rem 1.4rem;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.15s;
}
.btn:hover { transform: translateY(-1px); color: var(--ink); background: var(--surface); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 2rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  list-style: none;
  color: var(--muted);
  font-size: 0.95rem;
}
.facts strong { color: var(--ink); font-weight: 600; }

/* Sections */
.section { padding: clamp(3rem, 7vw, 5rem) 0; }
.section-label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.6rem;
}
.section h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.9rem, 4.5vw, 2.7rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}
.about-grid { display: grid; gap: 1.2rem 3rem; max-width: 46rem; }
.about-grid p { color: #2c323c; }

.services { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); list-style: none; }
.service {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.6rem;
  transition: box-shadow 0.2s, transform 0.2s;
}
.service:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(20, 24, 31, 0.08); }
.service .num {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--accent);
  font-weight: 600;
}
.service h3 { font-size: 1.1rem; margin: 0.5rem 0 0.6rem; line-height: 1.3; }
.service p { font-size: 0.98rem; color: var(--muted); }

/* Contact */
.contact { background: var(--dark); color: #eceef3; border-radius: 28px; padding: clamp(1.8rem, 5vw, 3.5rem); }
.contact .section-label { color: var(--accent-light); }
.contact h2 { color: #fff; margin-bottom: 0.6rem; }
.contact .intro { color: #aab0bd; max-width: 34rem; margin-bottom: 2rem; }
.contact-form { display: grid; gap: 1.1rem; max-width: 40rem; }
.field { display: grid; gap: 0.4rem; }
.field label { font-size: 0.9rem; font-weight: 500; color: #cfd3dc; }
.field input, .field textarea {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
}
.field input::placeholder, .field textarea::placeholder { color: #7d8494; }
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent-light);
  box-shadow: 0 0 0 3px var(--accent-light-glow);
}
.contact-form .btn-primary { justify-self: start; margin-top: 0.4rem; }

/* Footer */
.site-footer { padding: 2.5rem 0 3rem; color: var(--muted); font-size: 0.9rem; }
.site-footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.site-footer a { color: var(--muted); }
.site-footer .footer-note { flex-basis: 100%; font-size: 0.82rem; }

/* Portfolio */
.page-head { padding: clamp(3rem, 8vw, 5.5rem) 0 2rem; }
.page-head h1 { font-size: clamp(2.3rem, 6vw, 3.8rem); max-width: 18ch; }
.page-head p { margin-top: 1rem; color: var(--muted); max-width: 36rem; }

.portfolio-group { padding: 2rem 0 1.5rem; }
.portfolio-group > .wrap > h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.7rem, 4vw, 2.2rem);
  letter-spacing: -0.02em;
  margin-bottom: 1.4rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--line);
}
.section-intro { color: var(--muted); margin: -0.4rem 0 1.6rem; max-width: 36rem; }
.subhead {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1rem;
}
.grid + .subhead { margin-top: 2.5rem; }
.jump { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.6rem; }
.page-head .jump a {
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink);
  border: 1.5px solid var(--line);
  background: var(--surface);
  padding: 0.45rem 1rem;
  border-radius: 999px;
  transition: border-color 0.15s, color 0.15s;
}
.page-head .jump a:hover { border-color: var(--accent); color: var(--accent); }
.stats {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 1.4rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.4rem;
}
.stat {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  padding: 0.2rem 1.1rem;
}
.stat + .stat { border-left: 1px solid var(--line); }
.stat dd {
  order: -1;
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.stat dt {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.project.placeholder { background: transparent; border: 1.5px dashed #c9c6bb; }
.project.placeholder:hover { transform: none; box-shadow: none; }
.project.placeholder h3, .project.placeholder .studio, .project.placeholder .role { color: var(--muted); }
.grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.project {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.25s, transform 0.25s, border-color 0.25s;
}
.project:hover { transform: translateY(-3px); border-color: #d3d0c6; box-shadow: 0 16px 36px rgba(20, 24, 31, 0.09); }
.project img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  background: var(--dark);
  transition: transform 0.4s;
}

.project-body { padding: 1.2rem 1.4rem 1.4rem; display: grid; gap: 0.3rem; align-content: start; }
.project h3 { font-size: 1.05rem; font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; }
.project .studio {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
  order: -1;
}
.project .studio .year { color: var(--muted); font-weight: 500; letter-spacing: 0.04em; }
.project .studio .year::before { content: "\00b7"; margin: 0 0.55em; color: #b9b5a8; }
.project .role { font-size: 0.92rem; color: var(--muted); line-height: 1.5; }

/* Cards with a poster: poster on the left, credit screenshot under the text.
   Add class "has-poster" to the card and <img class="poster" ...> inside it. */
.project.has-poster {
  display: grid;
  grid-template-columns: 112px 1fr;
  grid-template-areas: "poster body" "shot shot";
  grid-template-rows: auto 1fr;
}
.project.has-poster .poster {
  grid-area: poster;
  align-self: start;
  width: calc(100% - 1.2rem);
  height: auto;
  margin: 1.2rem 0 1.2rem 1.2rem;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 6px 16px rgba(20, 24, 31, 0.14);
}
.project.has-poster .project-body { grid-area: body; padding-left: 1.1rem; }
.project.has-poster .shot {
  grid-area: shot;
  align-self: end;
  width: 100%;
  border-top: 1px solid var(--line);
}
/* Empty frames, shown until a real poster or screenshot is added */
.ph {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: #efede6;
  border: 1.5px dashed #c9c6bb;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
/* Cards with no screenshot row: no empty space under the text */
.project.has-poster.no-shot {
  grid-template-areas: "poster body";
  grid-template-rows: auto;
}
/* Text-only card (no poster, no screenshot): don't stretch to the height of its neighbor in the row */
.project.text-only { align-self: start; }
.project.has-poster .poster.ph { box-shadow: none; padding: 0.4rem; }
.project.has-poster .shot.ph {
  aspect-ratio: 16 / 10;
  border-width: 1px 0 0 0;
  border-style: solid;
  border-color: var(--line);
  border-radius: 0;
  background: #000;
  color: #8a909c;
  font-size: 0.75rem;
}
@media (max-width: 420px) {
  .project.has-poster { grid-template-columns: 92px 1fr; }
}

/* Collection card (many titles under one client): full-width, with a fan of posters.
   Used on one card only. Replace the .fan-item spans with <img class="fan-item"> posters. */
.project.collection {
  grid-column: 1 / -1;
  grid-template-columns: 340px 1fr;
  grid-template-areas: "poster body";
  grid-template-rows: auto;
  align-items: center;
}
.poster-fan {
  grid-area: poster;
  position: relative;
  --step: 38px;
  width: 270px;
  height: 200px;
  margin: 1.4rem 0 1.4rem 2.2rem;
}
.project .fan-item {
  position: absolute;
  bottom: 20px;
  left: calc(var(--i) * var(--step) + 14px);
  width: 90px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 6px;
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 18px rgba(20, 24, 31, 0.22);
  transform: translateY(var(--y)) rotate(var(--r));
  transform-origin: 50% 100%;
  background: linear-gradient(160deg, var(--c1), var(--c2));
  transition: transform 0.25s;
}
.fan-item:nth-child(1) { --i: 0; --y: 8px;  --r: -14deg; --c1: #ffd2c7; --c2: #ff9a85; z-index: 1; }
.fan-item:nth-child(2) { --i: 1; --y: 2px;  --r: -7deg;  --c1: #d24330; --c2: #12151c; z-index: 2; }
.fan-item:nth-child(3) { --i: 2; --y: 0;    --r: 0deg;   --c1: #efede6; --c2: #c9c6bb; z-index: 3; }
.fan-item:nth-child(4) { --i: 3; --y: 2px;  --r: 7deg;   --c1: #5d6470; --c2: #14181f; z-index: 2; }
.fan-item:nth-child(5) { --i: 4; --y: 8px;  --r: 14deg;  --c1: #fdeae5; --c2: #d24330; z-index: 1; }
.project.collection:hover .fan-item:nth-child(1) { transform: translateY(8px) rotate(-18deg); }
.project.collection:hover .fan-item:nth-child(5) { transform: translateY(8px) rotate(18deg); }
.fan-note {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  text-align: center;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.project.collection .project-body { padding: 1.4rem 1.6rem 1.4rem 1.2rem; position: relative; z-index: 5; }
.project.collection .project-body .tag { margin-top: 0.7rem; }
@media (max-width: 760px) {
  .project.collection { grid-template-columns: 1fr; grid-template-areas: "poster" "body"; }
  .project.collection .project-body { padding: 0.4rem 1.4rem 1.4rem; }
}
@media (max-width: 560px) {
  .project.collection { grid-template-columns: 1fr; grid-template-areas: "poster" "body"; }
  .poster-fan { --step: 32px; width: 250px; max-width: calc(100% - 2.8rem); margin-left: 1.4rem; }
  .project.collection .project-body { padding: 0.4rem 1.4rem 1.4rem; }
}

/* Click-to-enlarge viewer for screenshots and posters (see lightbox.js) */
.project img.shot, .project img.poster, .project img.fan-item { cursor: zoom-in; }
.project img.shot:focus-visible, .project img.poster:focus-visible, .project img.fan-item:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.lightbox {
  border: 0;
  padding: 1.5rem;
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  background: rgba(10, 12, 16, 0.92);
  color: #eceef3;
  cursor: zoom-out;
}
.lightbox[open] {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
}
.lightbox-img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 6rem);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.lightbox-caption { font-size: 0.85rem; color: #aab0bd; text-align: center; }
.lightbox-close {
  position: absolute;
  top: 0.8rem;
  right: 1rem;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.2); }
.tag {
  justify-self: start;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent-dark);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}
.tag.quiet { background: #efede6; color: var(--muted); }
.note {
  margin-top: 1.6rem;
  padding: 1rem 1.3rem;
  border: 1px dashed #c9c6bb;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.95rem;
}

@media (max-width: 560px) {
  .nav { gap: 1rem; }
  .brand { font-size: 1.05rem; }
}

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