:root {
  --bg: #000;
  --bg-alt: #101012;
  --card: #161618;
  --card-hover: #1d1d20;
  --line: rgba(255, 255, 255, 0.09);
  --text: #f5f5f7;
  --muted: #a1a1a6;
  --dim: #6e6e73;
  --accent: #ff6a3d;
  --accent-hover: #ff8259;
  --radius: 18px;
  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --nav-h: 56px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", Inter, "Segoe UI", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--accent); color: #000; padding: 8px 14px; border-radius: 999px; font-weight: 600;
}
.skip:focus { top: 12px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.muted { color: var(--muted); }

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: calc(var(--nav-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left));
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
  transition: background 0.3s, border-color 0.3s;
}
.nav.over { background: transparent; border-color: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }

.brand { display: flex; align-items: center; gap: 9px; }
.brand .mark { width: 28px; height: 28px; color: var(--text); }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-text b { font-size: 15px; font-weight: 800; letter-spacing: 0.06em; }
.brand-text small { font-size: 8.5px; font-weight: 600; letter-spacing: 0.22em; color: var(--muted); margin-top: 3px; }

.nav-links { display: flex; align-items: center; gap: clamp(14px, 3vw, 28px); font-size: 14px; }
.nav-links a { color: var(--text); opacity: 0.86; transition: opacity 0.2s; }
.nav-links a:hover { opacity: 1; }
.nav-links .pill {
  opacity: 1; background: var(--accent); color: #0b0b0c; font-weight: 600;
  padding: 7px 15px; border-radius: 999px; transition: background 0.2s;
}
.nav-links .pill:hover { background: var(--accent-hover); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 0 26px; border-radius: 999px;
  background: var(--accent); color: #0b0b0c; font-weight: 600; font-size: 16px;
  transition: background 0.2s, transform 0.2s var(--ease);
}
.btn:hover { background: var(--accent-hover); }
.btn:active { transform: scale(0.97); }
.btn.ghost { background: rgba(255, 255, 255, 0.08); color: var(--text); border: 1px solid var(--line); }
.btn.ghost:hover { background: rgba(255, 255, 255, 0.14); }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: grid; place-items: center; text-align: center;
  overflow: hidden; isolation: isolate;
  padding: calc(var(--nav-h) + 24px) var(--gutter) 72px;
}
.hero-media { position: absolute; inset: 0; z-index: -2; background: #0b0b0c; }
.hero-media img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transform: scale(1.08);
  transition: opacity 1.6s ease, transform 0s linear 1.6s;
}
.hero-media img.on { opacity: 1; transform: scale(1); transition: opacity 1.6s ease, transform 9s linear; }
.hero-shade {
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse 75% 55% at 50% 52%, rgba(0, 0, 0, 0.62), rgba(0, 0, 0, 0.18) 72%),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0) 22%, rgba(0, 0, 0, 0) 60%, #000);
}

.hero-content { display: flex; flex-direction: column; align-items: center; max-width: 760px; }
.lockup { display: flex; align-items: center; gap: clamp(12px, 2vw, 18px); margin-bottom: 18px; animation: rise 1s var(--ease) both; }
.lockup .mark { width: clamp(64px, 12vw, 104px); height: auto; color: var(--text); filter: drop-shadow(0 4px 18px rgba(0,0,0,.5)); }
.lockup-text { display: flex; flex-direction: column; text-align: left; line-height: 0.9; }
.lockup-text span { font-size: clamp(48px, 10vw, 92px); font-weight: 800; letter-spacing: 0.02em; text-shadow: 0 4px 30px rgba(0,0,0,.45); }
.lockup-text small { font-size: clamp(10px, 1.6vw, 14px); font-weight: 600; letter-spacing: 0.24em; color: rgba(245, 245, 247, 0.82); margin-top: 8px; }

.hero h1 {
  font-size: clamp(22px, 3.4vw, 30px); font-weight: 600; letter-spacing: -0.01em;
  text-shadow: 0 2px 20px rgba(0,0,0,.5);
  animation: rise 1s 0.12s var(--ease) both;
}
.hero-sub { color: rgba(245, 245, 247, 0.78); margin: 6px 0 26px; animation: rise 1s 0.2s var(--ease) both; }
.hero .btn { animation: rise 1s 0.28s var(--ease) both; }

.hero-pause {
  position: absolute; right: max(var(--gutter), env(safe-area-inset-right)); bottom: 24px;
  width: 36px; height: 36px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255, 255, 255, 0.14); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  display: grid; place-items: center; transition: background 0.2s;
}
.hero-pause:hover { background: rgba(255, 255, 255, 0.24); }
.hero-pause svg { width: 16px; height: 16px; fill: var(--text); }
.hero-pause .i-play, .hero-pause[aria-pressed="true"] .i-pause { display: none; }
.hero-pause[aria-pressed="true"] .i-play { display: block; }

@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* ---------- Sections ---------- */
.block { padding: clamp(64px, 10vw, 112px) 0; }
.block.alt { background: var(--bg-alt); }
.block + .block:not(.alt) { padding-top: clamp(32px, 6vw, 64px); }
.block.alt + .block { padding-top: clamp(64px, 10vw, 112px); }

h2 { font-size: clamp(32px, 4.4vw, 45px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; margin-bottom: 28px; }
h2.big { font-size: clamp(40px, 6.6vw, 72px); margin-bottom: 18px; }
.lead { color: var(--muted); font-size: clamp(17px, 2vw, 21px); max-width: 640px; margin-bottom: 40px; }

/* ---------- Highlights rail ---------- */
.rail { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.feat { display: block; text-align: left; background: none; border: 0; padding: 0; cursor: pointer; }
.feat .thumb { aspect-ratio: 16 / 10; border-radius: 14px; overflow: hidden; background: var(--card); }
.feat .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
.feat:hover .thumb img { transform: scale(1.05); }
.feat-meta { display: flex; gap: 12px; margin-top: 14px; align-items: flex-start; }
.feat-icon {
  flex: none; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  background: var(--card); border: 1px solid var(--line);
}
.feat-icon svg { width: 18px; height: 18px; stroke: var(--accent); fill: none; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.feat h3 { font-size: 15px; font-weight: 600; line-height: 1.3; }
.feat p { font-size: 13.5px; color: var(--muted); line-height: 1.4; margin-top: 3px; }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; text-align: center; }
.stat b { display: block; font-size: clamp(36px, 5.6vw, 60px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 15px; }

/* ---------- Work grid ---------- */
.work-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 24px; margin-bottom: 28px; }
.work-head h2 { margin-bottom: 0; }
.filters { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(var(--gutter) * -1); padding: 4px var(--gutter); }
.filters::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 1px solid var(--line); background: var(--card); color: var(--muted);
  border-radius: 999px; padding: 7px 14px; font-size: 14px; cursor: pointer; transition: all 0.2s;
}
.chip:hover { color: var(--text); }
.chip[aria-pressed="true"] { background: var(--text); color: #000; border-color: var(--text); }
.chip small { opacity: 0.6; margin-left: 4px; font-size: 12px; }

.grid { columns: 3; column-gap: 16px; }
.tile {
  position: relative; display: block; width: 100%; break-inside: avoid; margin: 0 0 16px;
  padding: 0; border: 0; border-radius: 14px; overflow: hidden; cursor: pointer;
  background: var(--card); text-align: left;
  animation: fade 0.5s var(--ease) both;
}
.tile img { width: 100%; height: auto; transition: transform 0.6s var(--ease); }
.tile:hover img { transform: scale(1.04); }
.tile-info {
  position: absolute; inset: auto 0 0 0; padding: 40px 16px 14px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.82), transparent);
  display: flex; align-items: flex-end; justify-content: space-between; gap: 10px;
  opacity: 0; transform: translateY(8px); transition: opacity 0.3s, transform 0.3s var(--ease);
}
.tile:hover .tile-info, .tile:focus-visible .tile-info { opacity: 1; transform: none; }
.tile-info b { font-size: 15px; font-weight: 600; }
.tile-info span { display: block; color: rgba(245,245,247,.7); font-size: 12.5px; text-transform: capitalize; }
.tile-count {
  flex: none; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  background: rgba(255,255,255,.16); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
@keyframes fade { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- Service cards ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; transition: background 0.3s; }
.card:hover { background: var(--card-hover); }
.card h3 { font-size: 19px; font-weight: 700; margin-bottom: 8px; }
.card p { color: var(--muted); font-size: 15px; padding-bottom: 18px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; font-size: 14.5px; font-weight: 500; }
.card li { display: flex; gap: 10px; align-items: baseline; }
.card li::before { content: "✓"; color: var(--accent); font-weight: 700; }

/* ---------- Contact ---------- */
.closing { text-align: center; }
.closing .lead { margin-left: auto; margin-right: auto; }
.contact { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--line); background: var(--bg-alt); }
.foot { display: flex; justify-content: space-between; gap: 16px; padding-top: 22px; padding-bottom: calc(22px + env(safe-area-inset-bottom)); color: var(--dim); font-size: 13px; }

/* ---------- Lightbox ---------- */
.lightbox {
  width: 100%; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0;
  border: 0; background: rgba(0, 0, 0, 0.94); color: var(--text);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.lightbox[open] { display: grid; grid-template-rows: auto 1fr auto; animation: fade 0.3s var(--ease); }
.lightbox::backdrop { background: rgba(0, 0, 0, 0.6); }
.lb-top {
  display: flex; align-items: center; gap: 16px;
  padding: calc(14px + env(safe-area-inset-top)) var(--gutter) 12px;
}
.lb-info { flex: 1; min-width: 0; }
.lb-info h3 { font-size: 17px; font-weight: 600; }
.lb-info p { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-count { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.lb-stage {
  position: relative; display: flex; align-items: center; justify-content: center;
  min-height: 0; overflow: hidden; padding: 0 calc(var(--gutter) + 52px); touch-action: pan-y;
}
.lb-stage img {
  max-width: 100%; max-height: 100%; width: auto; height: auto; min-width: 0; object-fit: contain;
  border-radius: 10px; transition: opacity 0.25s;
  user-select: none; -webkit-user-drag: none;
}
.lb-stage img.loading { opacity: 0.25; }
.lb-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer; flex: none;
  background: rgba(255, 255, 255, 0.1); display: grid; place-items: center; transition: background 0.2s;
}
.lb-btn:hover { background: rgba(255, 255, 255, 0.2); }
.lb-btn svg { width: 20px; height: 20px; fill: none; stroke: var(--text); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lb-prev, .lb-next { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; }
.lb-prev { left: calc(var(--gutter) / 2); }
.lb-next { right: calc(var(--gutter) / 2); }
.lb-btn[hidden] { display: none; }
.lb-dots { display: flex; justify-content: center; gap: 8px; padding: 14px 0 calc(18px + env(safe-area-inset-bottom)); min-height: 44px; }
.lb-dots button { width: 8px; height: 8px; padding: 0; border-radius: 50%; border: 0; background: rgba(255,255,255,.28); cursor: pointer; transition: all 0.2s; }
.lb-dots button[aria-current="true"] { background: var(--text); width: 22px; border-radius: 999px; }

/* ---------- Reveal on scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .rail {
    grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(240px, 42%);
    overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
    margin: 0 calc(var(--gutter) * -1); padding: 0 var(--gutter); scroll-padding: 0 var(--gutter);
  }
  .rail::-webkit-scrollbar { display: none; }
  .feat { scroll-snap-align: start; }
  .cards { grid-template-columns: 1fr; max-width: 560px; }
  .grid { columns: 2; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .rail { grid-auto-columns: 76%; gap: 14px; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 36px 16px; }
  .grid { column-gap: 10px; }
  .tile { margin-bottom: 10px; border-radius: 12px; }
  .tile-info { opacity: 1; transform: none; padding: 28px 10px 9px; }
  .tile-info b { font-size: 13px; }
  .tile-info span { display: none; }
  .tile-count { font-size: 11px; padding: 2px 7px; }
  .card { padding: 22px; }
  .contact .btn { flex: 1 1 100%; max-width: 340px; }
  .foot { flex-direction: column; gap: 4px; }
  .lb-prev, .lb-next { display: none; }
  .lb-stage { padding: 0 var(--gutter); }
  .nav-links { gap: 16px; }
}

@media (hover: none) {
  .tile-info { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0s !important; transition-duration: 0.01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
  .hero-media img { transform: none; }
}
