:root {
  color-scheme: dark;
  --ground: #14161b;
  --paper: #1a1d23;
  --ink: #ece8e0;
  --ink-soft: #b9b3a7;
  --muted: #837d72;
  --line: rgba(236, 232, 224, 0.1);
  --line-strong: rgba(236, 232, 224, 0.18);
  --accent: #c9964a;
  --accent-soft: rgba(201, 150, 74, 0.18);
  --accent-ink: #14161b;
  --radius: 10px;
  --maxw: 1040px;
  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-family: var(--sans);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--ground);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.15; margin: 0 0 .5rem; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.4rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.7rem, 3vw, 2.2rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1rem; }
a { color: inherit; }
img { max-width: 100%; display: block; }
section { padding: 4.5rem 1.25rem; }
section > h2, section > p, section > div, section > ol, section > ul { max-width: var(--maxw); margin-left: auto; margin-right: auto; }
.section-intro { color: var(--ink-soft); padding-right: 30%; margin-bottom: 2.5rem; }
.contact .section-intro { padding-right: 0; max-width: 620px; }
[hidden] { display: none !important; }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 1.5rem;
  padding: .85rem 1.25rem;
  background: rgba(20, 22, 27, 0.82); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { font-family: var(--serif); font-size: 1.1rem; text-decoration: none; }
.topnav { display: flex; gap: 1.5rem; margin-left: auto; }
.topnav a { text-decoration: none; color: var(--ink-soft); font-size: .92rem; }
.topnav a:hover { color: var(--ink); }
.lang-toggle { display: flex; border: 1px solid var(--line-strong); border-radius: 999px; overflow: hidden; }
.lang-toggle button {
  border: 0; background: transparent; padding: .35rem .8rem; cursor: pointer;
  font: inherit; font-size: .8rem; font-weight: 600; letter-spacing: .04em; color: var(--muted);
}
.lang-toggle button[aria-pressed="true"] { background: var(--ink); color: var(--ground); }

/* Hero */
.hero {
  position: relative;
  display: grid; grid-template-columns: 1.3fr 1fr; gap: 3rem; align-items: center;
  max-width: var(--maxw); margin: 0 auto; padding-top: 4.5rem; padding-bottom: 5rem;
}
.hero::before {
  content: ""; position: absolute; inset: -20% -30% auto auto; width: 60%; height: 120%;
  background: radial-gradient(closest-side, var(--accent-soft), transparent 70%);
  pointer-events: none; z-index: -1;
}
.eyebrow { text-transform: uppercase; letter-spacing: .16em; font-size: .72rem; font-weight: 600; color: var(--accent); margin-bottom: 1rem; }
.tagline { font-family: var(--serif); font-size: 1.35rem; font-weight: 400; color: var(--ink); line-height: 1.4; }
.lede { color: var(--ink-soft); max-width: 560px; }
.hero-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin: 1.75rem 0; }
.facts { list-style: none; padding: 0; margin: 1.5rem 0 0; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; color: var(--ink-soft); font-size: .92rem; }
.facts li::before { content: "\2014"; color: var(--accent); margin-right: .5rem; }
.portrait { margin: 0; }
.portrait img {
  width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 4px;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 22%);
  mask-image: linear-gradient(to right, transparent, #000 22%);
  filter: saturate(.9);
}
.portrait figcaption { display: none; }
.portrait.missing img { display: none; }
.portrait.missing { aspect-ratio: 4 / 5; border: 1px dashed var(--line-strong); border-radius: var(--radius); display: grid; place-items: center; color: var(--muted); font-size: .9rem; text-align: center; padding: 1rem; }
.portrait.missing figcaption { display: block; }

/* Buttons */
.btn {
  display: inline-block; padding: .75rem 1.3rem; border-radius: 999px;
  text-decoration: none; font-weight: 600; font-size: .92rem; border: 1px solid transparent;
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #d6a45a; }
.btn-ghost { border-color: var(--line-strong); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--ink); }

/* Case studies */
.work { background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.case {
  position: relative;
  display: grid; grid-template-columns: 1fr 1fr; gap: 3rem;
  padding: 3.5rem 0; border-top: 1px solid var(--line);
}
.case:first-child { border-top: 0; }
.case-num { font-family: var(--serif); font-size: 3.5rem; line-height: 1; color: var(--accent); opacity: .35; margin-bottom: .75rem; }
.case-meta { display: flex; flex-wrap: wrap; gap: .5rem 1rem; font-size: .82rem; color: var(--muted); margin-bottom: .6rem; }
.case h3 { font-size: 1.7rem; margin-bottom: 1rem; }
.case dl { margin: 0; }
.case dt { font-size: .7rem; text-transform: uppercase; letter-spacing: .14em; color: var(--accent); font-weight: 600; margin-top: 1.25rem; }
.case dd { margin: .3rem 0 0; color: var(--ink-soft); }
.case .stack { margin-top: 1.5rem; font-size: .78rem; color: var(--muted); }
.case .stack strong { color: var(--ink-soft); font-weight: 600; }

.shots { position: relative; align-self: start; }
.carousel-track {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-track figure { flex: 0 0 100%; scroll-snap-align: start; min-width: 0; }
.shots figure { margin: 0; }
.shots img {
  width: 100%; max-height: 460px; object-fit: contain;
  background: #0f1014; border-radius: 6px; border: 1px solid var(--line-strong);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  filter: brightness(.92);
}
.shots figcaption { font-size: .8rem; color: var(--muted); margin-top: .6rem; }
.shots figure.missing img { display: none; }
.shots figure.missing { aspect-ratio: 16 / 10; border: 1px dashed var(--line-strong); border-radius: 6px; display: grid; place-items: center; color: var(--muted); font-size: .85rem; text-align: center; padding: 1rem; }
.shots figure.missing figcaption::before { content: "Screenshot: "; }
.carousel-btn {
  position: absolute; top: 40%; transform: translateY(-50%);
  width: 2.25rem; height: 2.25rem; border-radius: 50%; border: 1px solid var(--line-strong);
  background: rgba(26, 29, 35, 0.9); color: var(--ink); font-size: 1.4rem; line-height: 1;
  cursor: pointer; display: grid; place-items: center;
}
.carousel-btn.prev { left: .6rem; }
.carousel-btn.next { right: .6rem; }
.carousel-btn:disabled { opacity: .3; cursor: default; }
.carousel-dots { display: flex; justify-content: center; gap: .45rem; margin-top: .6rem; }
.carousel-dot { width: .45rem; height: .45rem; border-radius: 50%; border: 0; padding: 0; background: var(--line-strong); cursor: pointer; }
.carousel-dot[aria-current="true"] { background: var(--accent); }

/* Other projects */
.other-list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.other-list li { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; }
.other-list h3 { font-size: 1.1rem; margin-bottom: .4rem; }
.other-list p { margin: 0; font-size: .9rem; color: var(--ink-soft); }

/* Process */
.process { background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.steps { counter-reset: step; list-style: none; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; }
.steps li { counter-increment: step; padding: 1.5rem 1.25rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--ground); }
.steps li::before { content: counter(step, decimal-leading-zero); display: block; font-family: var(--serif); font-size: 1.4rem; color: var(--accent); margin-bottom: .6rem; }
.steps h3 { font-size: 1.05rem; margin-bottom: .4rem; }
.steps p { margin: 0; font-size: .9rem; color: var(--ink-soft); }

/* Testimonials */
.testimonials blockquote { margin: 0 0 1.5rem; padding: 1.5rem 1.75rem; background: var(--paper); border-left: 2px solid var(--accent); border-radius: 0 var(--radius) var(--radius) 0; font-family: var(--serif); font-size: 1.15rem; line-height: 1.5; }
.testimonials cite { display: block; margin-top: .75rem; font-family: var(--sans); font-style: normal; font-size: .88rem; color: var(--muted); }

/* Contact */
.contact { text-align: center; padding-bottom: 5.5rem; }
.contact .section-intro { margin-left: auto; margin-right: auto; }
.contact-actions { display: flex; justify-content: center; gap: .75rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.contact-line { color: var(--muted); font-size: .92rem; }

.footer { text-align: center; padding: 2rem; color: var(--muted); font-size: .82rem; border-top: 1px solid var(--line); }

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; padding-top: 2.5rem; padding-bottom: 3rem; }
  .portrait { max-width: 320px; }
  .portrait img { -webkit-mask-image: linear-gradient(to bottom, #000 78%, transparent); mask-image: linear-gradient(to bottom, #000 78%, transparent); }
  .case { grid-template-columns: 1fr; gap: 1.75rem; padding: 2.5rem 0; }
  .case-num { font-size: 2.5rem; }
  .other-list, .steps { grid-template-columns: 1fr; }
  .topnav { display: none; }
  .lang-toggle { margin-left: auto; }
  .section-intro { padding-right: 0; }
}
