:root {
  --bg: #050505;
  --bg-elev: #0b0b0b;
  --surface: #111111;
  --surface-2: #161616;
  --text: #f3f4f6;
  --muted: #b4b4b8;
  --line: #2a2a2a;
  --accent: #9b111e;
  --accent-2: #d32f2f;
  --accent-soft: rgba(155, 17, 30, 0.28);
  --accent-text: #fecaca;
  --nav: rgba(5, 5, 5, 0.88);
  --max: 1200px;
  --nav-h: 72px;
  --display: "Space Grotesk", system-ui, sans-serif;
  --body: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, textarea, select { font: inherit; }

.wrap {
  width: min(var(--max), calc(100% - 80px));
  margin: 0 auto;
}

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  background: var(--nav);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.12em;
  text-decoration: none;
  color: var(--text);
}
.brand-mark {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex: 0 0 auto;
}
.nav-end {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-left: auto;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.lang-switch {
  display: inline-flex;
  border: 1px solid var(--line);
  flex: 0 0 auto;
}
.lang-switch button {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  background: transparent;
  color: #a1a1aa;
  border: 0;
  padding: 8px 10px;
  cursor: pointer;
}
.lang-switch button.is-active {
  background: var(--accent);
  color: #fff;
}
.nav-links a {
  text-decoration: none;
  font-size: 14px;
  color: #d4d4d8;
  transition: color 0.15s ease;
}
.nav-links a:hover,
.nav-links a.is-active { color: var(--accent-text); }
.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  display: block;
  width: 16px;
  height: 1.5px;
  background: currentColor;
  position: relative;
  margin: 0 auto;
}
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
}
.nav-toggle span::before { top: -5px; }
.nav-toggle span::after { top: 5px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 22px;
  text-decoration: none;
  font-family: var(--body);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-solid {
  background: #f3f4f6;
  color: #050505;
}
.btn-solid:hover { background: #fff; }
.btn-ghost {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.45);
}
.btn-ghost:hover { border-color: #fff; }
.btn-accent {
  background: linear-gradient(135deg, #6f0f18, #b91c1c);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 8px 22px rgba(185, 28, 28, 0.32);
}
.link-more {
  display: inline-flex;
  margin-top: 12px;
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
}
.link-more:hover { color: var(--accent-text); }

.kicker {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin: 0 0 14px;
}
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.12; margin: 0; }
p { margin: 0; color: var(--muted); }
.section { padding: 96px 0; }
.section-head { margin-bottom: 40px; max-width: 720px; }
.section-head h2 { font-size: clamp(32px, 4vw, 44px); margin-bottom: 12px; }
.section-muted { color: var(--muted); font-size: 16px; }

/* Hero / showreel */
.hero {
  position: relative;
  min-height: calc(100vh - var(--nav-h));
  display: flex;
  align-items: center;
  background:
    radial-gradient(circle at 12% -20%, rgba(155, 17, 30, 0.55), transparent 42%),
    radial-gradient(circle at 88% 0%, rgba(211, 47, 47, 0.28), transparent 36%),
    #050505;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 120px;
  background: linear-gradient(to bottom, transparent, var(--bg));
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; padding: 80px 0 100px; }
.hero-page { min-height: auto; }
.hero-page::after { display: none; }
.hero h1 {
  font-size: clamp(40px, 6vw, 72px);
  max-width: 16ch;
  margin: 0 0 16px;
}
.hero-sub {
  font-family: var(--mono);
  font-size: 14px;
  color: #a1a1aa;
  margin-bottom: 32px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Featured */
.band-light { background: var(--bg-elev); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.projects {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px 24px;
}
.project {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--line);
}
.project-media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #0a0a0a;
  overflow: hidden;
}
.project-media img,
.project-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}
.project:hover .project-media img,
.project:hover .project-media video { transform: scale(1.04); }
.project-media .collage {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  height: 100%;
  gap: 2px;
}
.project-media .collage.cols-2 { grid-template-columns: 1fr 1fr; }
.project-media .collage img,
.project-media .collage video { height: 100%; }
.project-body { padding: 18px 18px 20px; }
.project-cat {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: 8px;
}
.project-body h3 { font-size: 20px; margin-bottom: 8px; }
.project-body p { font-size: 14px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tag {
  font-family: var(--mono);
  font-size: 11px;
  color: #d4d4d8;
  border: 1px solid #343434;
  padding: 4px 8px;
  background: #0d0d0d;
}

/* Services */
.services {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.service {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 22px 18px 24px;
  min-height: 180px;
}
.service .num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent-text);
  margin-bottom: 18px;
}
.service h3 { font-size: 18px; margin-bottom: 8px; }
.service p { font-size: 14px; }

/* Why me */
.why { display: grid; }
.why-row {
  display: grid;
  grid-template-columns: 72px 220px 1fr;
  gap: 24px;
  align-items: start;
  padding: 22px 0;
  border-top: 1px solid var(--line);
}
.why-row:last-child { border-bottom: 1px solid var(--line); }
.why-row .num {
  font-family: var(--mono);
  color: var(--accent-text);
  font-size: 13px;
}
.why-row h3 { font-size: 20px; }
.why-row p { font-size: 15px; }

/* Engineering band */
.eng-band {
  background:
    radial-gradient(circle at 80% 20%, rgba(155, 17, 30, 0.35), transparent 40%),
    #080808;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.eng-band h2 { font-size: clamp(32px, 4vw, 48px); margin-bottom: 16px; max-width: 16ch; }
.eng-band .lead { max-width: 560px; color: #d4d4d8; margin-bottom: 24px; }
.eng-note { color: #a1a1aa; font-size: 14px; margin: 8px 0 28px; }

.home-cta { margin-top: 36px; }
.about-teaser {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  flex-wrap: wrap;
}
.about-teaser h2 { margin-bottom: 12px; font-size: clamp(32px, 4vw, 44px); }
.crumb-link {
  display: inline-block;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 18px;
  font-size: 14px;
}
.crumb-link:hover { color: var(--accent-text); }
.about-page {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 48px;
  align-items: start;
}
.about-photo {
  border: 1px solid var(--line);
  background: #0a0a0a;
  overflow: hidden;
}
.about-photo img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}
.about-page .about-copy h2 {
  font-size: clamp(26px, 3vw, 36px);
  margin-bottom: 18px;
  max-width: 22ch;
}
.about-page .about-copy p {
  font-size: 16px;
  line-height: 1.7;
  white-space: pre-wrap;
}
.about-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}
.about-link {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: var(--surface);
  text-decoration: none;
}
.about-link img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}
.about-link span {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent-text);
}
.wm-wrap { position: relative; display: block; height: 100%; }
.wm-wrap video,
.wm-wrap img:not(.wm-overlay) { width: 100%; height: 100%; object-fit: cover; }
.wm-overlay {
  position: absolute;
  inset: 18% 18%;
  width: auto;
  height: auto;
  max-width: 64%;
  max-height: 64%;
  margin: auto;
  object-fit: contain;
  opacity: 0.28;
  pointer-events: none;
  user-select: none;
}
.about-copy h3 {
  font-size: clamp(26px, 3vw, 34px);
  margin-bottom: 16px;
  max-width: 22ch;
}
.roles { display: grid; gap: 10px; }
.role {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 16px 18px;
  font-family: var(--display);
  font-weight: 600;
}

/* Contact */
.contacts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.contact-card {
  display: block;
  text-decoration: none;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 22px 18px;
  min-height: 110px;
}
.contact-card small {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: 10px;
}
.contact-card strong { font-family: var(--display); font-size: 16px; }

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 28px 0 48px;
  color: #71717a;
  font-size: 13px;
  border-top: 1px solid var(--line);
}

/* Engineering page */
.page-hero { padding: 72px 0 56px; }
.page-hero h1 { font-size: clamp(36px, 5vw, 56px); max-width: 18ch; margin: 12px 0 16px; }
.dirs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.approach {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}
.approach-step {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 16px 14px;
  min-height: 110px;
}
.approach-step .num { font-family: var(--mono); color: var(--accent-text); font-size: 12px; margin-bottom: 10px; }
.approach-step h3 { font-size: 15px; }
.eng-cases { display: grid; gap: 14px; }
.eng-case {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 24px;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 24px;
}
.eng-case .meta small {
  font-family: var(--mono);
  color: var(--accent-text);
  letter-spacing: 0.1em;
}
.eng-case h3 { font-size: 22px; margin: 10px 0 12px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.split b {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--accent-text);
  margin-bottom: 6px;
}
.stack {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
.stack-card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 18px;
}
.stack-card small {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--accent-text);
}
.stack-card ul { margin: 12px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 14px; }
.stack-card li + li { margin-top: 6px; }

.cta-band {
  background:
    radial-gradient(circle at 20% 0%, rgba(155, 17, 30, 0.4), transparent 40%),
    #080808;
  text-align: left;
}
.cta-band h2 { font-size: clamp(28px, 4vw, 40px); margin-bottom: 12px; }

/* Case page */
.case-hero { padding: 48px 0 24px; }
.crumb {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: 16px;
}
.case-hero h1 { font-size: clamp(32px, 5vw, 52px); margin-bottom: 12px; }
.case-visual {
  margin: 28px 0 0;
  background: #0a0a0a;
  border: 1px solid var(--line);
  min-height: 320px;
}
.case-visual img { width: 100%; max-height: 70vh; object-fit: contain; background: #000; }
.story { padding: 40px 0; border-top: 1px solid var(--line); max-width: 760px; }
.story h2 { font-size: 28px; margin-bottom: 12px; }
.cat-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 28px;
}
.cat-filters button {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: transparent;
  color: #d4d4d8;
  border: 1px solid var(--line);
  padding: 8px 12px;
  cursor: pointer;
}
.cat-filters button.is-active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.media-item { display: grid; gap: 8px; }
.media-caption { color: var(--muted); font-size: 14px; }
.media-grid img,
.media-grid video,
.archive img,
.archive video {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #0a0a0a;
  cursor: zoom-in;
  border: 1px solid var(--line);
}
.results {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.result-card {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 22px 18px;
}
.result-card strong {
  display: block;
  font-family: var(--display);
  font-size: 28px;
  color: var(--accent-text);
  margin-bottom: 8px;
}

.archive {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.archive a { text-decoration: none; color: inherit; }
.archive figcaption { padding: 10px 2px 4px; font-size: 13px; color: #ddd; }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  padding: 20px;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: min(1200px, 95vw);
  max-height: 90vh;
  border: 1px solid #343434;
  background: #111;
}
.lightbox-close {
  position: absolute;
  top: 14px;
  right: 18px;
  width: 38px;
  height: 38px;
  border: 1px solid #3f3f46;
  background: rgba(17, 17, 17, 0.9);
  color: #f3f4f6;
  font-size: 20px;
  cursor: pointer;
}

/* Admin */
.admin-toggle {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 1200;
  border: 1px solid #3a3a3a;
  background: #141414;
  color: #f3f4f6;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 600;
}
.admin-panel {
  position: fixed;
  right: 16px;
  bottom: 68px;
  width: min(520px, 94vw);
  max-height: 82vh;
  overflow: auto;
  z-index: 1200;
  background: #0f0f0f;
  border: 1px solid #2e2e2e;
  padding: 14px;
  display: none;
}
.admin-panel.open { display: block; }
.admin-panel h3 { margin-bottom: 8px; }
.admin-muted { color: #b4b4b8; font-size: 13px; margin-bottom: 12px; }
.admin-grid { display: grid; gap: 8px; }
.admin-grid input,
.admin-grid textarea,
.admin-grid select {
  width: 100%;
  background: #161616;
  color: #f3f4f6;
  border: 1px solid #313131;
  padding: 9px 10px;
}
.admin-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.admin-btn {
  border: 1px solid #3a3a3a;
  background: #1a1a1a;
  color: #f3f4f6;
  padding: 8px 10px;
  cursor: pointer;
  font-weight: 600;
}
.admin-btn.danger { border-color: #5b1e22; color: #fecaca; }
.admin-list { margin-top: 12px; display: grid; gap: 8px; }
.admin-item {
  border: 1px solid #2f2f2f;
  padding: 8px 10px;
  background: #141414;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.admin-item small { color: #a1a1aa; }

@media (max-width: 980px) {
  .wrap { width: min(var(--max), calc(100% - 40px)); }
  .nav { height: 56px; }
  :root { --nav-h: 56px; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .nav-links {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: #0b0b0b;
    border-bottom: 1px solid var(--line);
    padding: 8px 0 16px;
  }
  .nav.is-open .nav-links { display: flex; }
  .nav-links a { padding: 12px 20px; }
  .section { padding: 64px 0; }
  .hero-inner { padding: 48px 0 72px; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; }
  .projects,
  .services,
  .about-page,
  .about-grid,
  .contacts,
  .dirs,
  .approach,
  .eng-case,
  .stack,
  .media-grid,
  .results,
  .archive,
  .split { grid-template-columns: 1fr; }
  .services { grid-template-columns: 1fr 1fr; }
  .why-row { grid-template-columns: 48px 1fr; }
  .why-row p { grid-column: 1 / -1; }
  .archive { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .wrap { width: calc(100% - 32px); }
  .services,
  .archive { grid-template-columns: 1fr; }
}
