:root {
  color-scheme: dark;
  --bg: #07100e;
  --bg-raised: #0b1714;
  --panel: rgba(15, 31, 27, 0.84);
  --panel-solid: #0f1f1b;
  --line: rgba(164, 214, 194, 0.17);
  --line-strong: rgba(164, 214, 194, 0.32);
  --text: #f0f7f3;
  --muted: #a9bbb4;
  --faint: #74877f;
  --accent: #61e7ad;
  --accent-strong: #9af3ce;
  --accent-soft: rgba(97, 231, 173, 0.11);
  --warm: #ffc76b;
  --danger: #ff8c7f;
  --max: 1180px;
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background:
    radial-gradient(circle at 78% -10%, rgba(49, 148, 108, 0.18), transparent 34rem),
    radial-gradient(circle at 0% 32%, rgba(50, 111, 96, 0.11), transparent 28rem),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  opacity: 0.025;
  background-image: linear-gradient(rgba(255,255,255,.6) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.6) 1px, transparent 1px);
  background-size: 48px 48px;
}

a { color: inherit; }
img { display: block; max-width: 100%; }
button, a { -webkit-tap-highlight-color: transparent; }

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 14px;
  color: #06100d;
  background: var(--accent);
  border-radius: 8px;
  transform: translateY(-160%);
}

.skip-link:focus { transform: translateY(0); }

.shell {
  width: min(calc(100% - 40px), var(--max));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid transparent;
  background: rgba(7, 16, 14, 0.72);
  backdrop-filter: blur(18px);
}

.site-header.scrolled { border-color: var(--line); }

.nav {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 760;
  letter-spacing: .02em;
}

.brand-mark {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 22px rgba(97, 231, 173, .72);
}

.nav-links,
.locale-switcher,
.hero-actions,
.project-actions,
.contact-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.nav-links { gap: 24px; }
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 650;
}
.nav-links a:hover { color: var(--text); }

.nav-tools { display: flex; align-items: center; gap: 18px; }
.locale-switcher {
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.025);
}

.locale-button {
  min-width: 34px;
  height: 30px;
  padding: 0 8px;
  color: var(--faint);
  border: 0;
  border-radius: 999px;
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.locale-button[aria-pressed="true"] {
  color: #06100d;
  background: var(--accent);
}

.hero {
  padding: 34px 0 22px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: start;
  text-align: center;
}

.eyebrow,
.project-index,
.mini-label {
  margin: 0 0 18px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .14em;
  line-height: 1.3;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { text-wrap: balance; }

h1 {
  max-width: 900px;
  margin: 0 auto 14px;
  font-size: clamp(2.05rem, 3vw, 2.55rem);
  font-weight: 780;
  letter-spacing: -.05em;
  line-height: .98;
}

.hero-lead {
  max-width: 900px;
  margin: 0 auto 16px;
  color: var(--muted);
  font-size: clamp(.96rem, 1.15vw, 1.08rem);
  line-height: 1.5;
}

.hero .eyebrow { margin-bottom: 12px; }
.hero-actions { justify-content: center; }

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 17px;
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(255,255,255,.025);
  text-decoration: none;
  font-size: 14px;
  font-weight: 760;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.button:hover {
  border-color: rgba(97,231,173,.55);
  background: var(--accent-soft);
  transform: translateY(-2px);
}

.button.primary {
  color: #06110d;
  border-color: var(--accent);
  background: var(--accent);
}

.button.primary:hover { background: var(--accent-strong); }
.button.disabled {
  color: var(--faint);
  border-style: dashed;
  cursor: not-allowed;
  pointer-events: none;
}

.hero-note {
  width: min(100%, 900px);
  margin-inline: auto;
  padding: 18px 0 0;
  border-top: 1px solid var(--line-strong);
}

.hero-note strong {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 1.05rem;
}

.hero-note p { margin: 0; color: var(--muted); }

.proof-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,.018);
  overflow: hidden;
}

.proof {
  min-height: 104px;
  padding: 18px 22px;
  border-right: 1px solid var(--line);
}
.proof:last-child { border-right: 0; }
.proof b {
  display: block;
  margin-bottom: 8px;
  color: var(--accent-strong);
  font-size: 1.72rem;
  letter-spacing: -.05em;
  line-height: 1;
}
.proof span { color: var(--muted); font-size: 13px; line-height: 1.45; }

.section { padding: 66px 0; }
.section.compact { padding: 48px 0; }
#work.section { padding-top: 32px; }
.section-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  justify-items: center;
  margin-bottom: 18px;
  text-align: center;
}

.section h2 {
  max-width: 980px;
  margin-bottom: 0;
  font-size: clamp(1.65rem, 2.1vw, 1.85rem);
  font-weight: 760;
  letter-spacing: -.04em;
  line-height: 1.08;
}

.section-note { max-width: 820px; margin: 0; color: var(--muted); }

.portfolio-disclosure {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 20px;
  margin: 0 0 20px;
  padding: 18px 20px;
  border: 1px solid rgba(255, 199, 107, .34);
  border-left: 4px solid var(--warm);
  border-radius: var(--radius-md);
  background: linear-gradient(110deg, rgba(255, 199, 107, .11), rgba(97, 231, 173, .045));
  box-shadow: 0 18px 44px rgba(0, 0, 0, .2);
}

.portfolio-disclosure-label {
  align-self: start;
  padding: 5px 9px;
  color: #191006;
  border-radius: 999px;
  background: var(--warm);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .11em;
  line-height: 1.2;
  text-transform: uppercase;
  white-space: nowrap;
}

.portfolio-disclosure h3 {
  margin: 0 0 6px;
  font-size: clamp(1.05rem, 1.7vw, 1.3rem);
  letter-spacing: -.02em;
  line-height: 1.25;
}

.portfolio-disclosure p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }

.project {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(340px, .92fr);
  gap: 0;
  margin-bottom: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(140deg, rgba(17,37,32,.92), rgba(10,22,19,.94));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.project:last-child { margin-bottom: 0; }
.project.reverse { grid-template-columns: minmax(340px, .92fr) minmax(0, 1.08fr); }
.project.reverse .project-media { order: 2; }

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.project-grid .project,
.project-grid .project.reverse {
  grid-template-columns: 1fr;
  margin: 0;
}

.project-grid .project.reverse .project-media { order: 0; }
.project-grid .project-media,
.project-grid .media-gallery,
.project-grid .gallery-frame,
.project-grid .gallery-track,
.project-grid .gallery-slide {
  height: 260px;
  min-height: 260px;
}
.project-grid .project-content { display: flex; flex-direction: column; padding: 26px; }
.project-grid .project h3 { font-size: clamp(1.75rem, 2.25vw, 2.3rem); }
.project-grid .project-summary { font-size: .94rem; }
.project-grid .metric-row { margin: 18px 0; }
.project-grid .metric { padding: 11px; }
.project-grid .evidence-list { margin-bottom: 18px; }
.project-grid .evidence-list li { padding-block: 7px; font-size: 13px; }
.project-grid .evidence-list li::before { top: 15px; }
.project-grid .tag-list { margin-bottom: 20px; }
.project-grid .project-actions { margin-top: auto; }

.project-media {
  min-height: 480px;
  background: #020605;
}

.project-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-media.portrait {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  padding: 2px;
  background: rgba(97,231,173,.13);
}

.project-media.portrait img { min-height: 304px; }

.media-gallery {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: inherit;
  overflow: hidden;
}

.gallery-frame {
  width: 100%;
  height: 100%;
  min-height: inherit;
  overflow: hidden;
  cursor: zoom-in;
  touch-action: pan-y;
}

.gallery-track {
  display: flex;
  width: 100%;
  height: 100%;
  min-height: inherit;
  transition: transform .42s cubic-bezier(.22,.72,.2,1);
}

.gallery-slide {
  width: 100%;
  min-width: 100%;
  height: 100%;
  min-height: inherit;
  object-fit: contain;
  background: #020605;
  user-select: none;
}

.project-grid .mobile-gallery .gallery-slide,
.case-visual .mobile-gallery .gallery-slide {
  object-fit: contain;
  object-position: center;
}

.gallery-frame.landscape .gallery-slide { object-fit: cover; }

.gallery-controls {
  position: absolute;
  right: 18px;
  bottom: 18px;
  left: 18px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}

.gallery-button,
.viewer-nav,
.viewer-close,
.back-to-top {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(5, 13, 11, .82);
  backdrop-filter: blur(12px);
  cursor: pointer;
}

.gallery-button {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 25px;
  pointer-events: auto;
}

.gallery-counter {
  padding: 7px 11px;
  color: var(--text);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  background: rgba(5,13,11,.78);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.gallery-dots {
  position: absolute;
  bottom: 78px;
  left: 50%;
  z-index: 5;
  display: flex;
  gap: 6px;
  transform: translateX(-50%);
}

.gallery-dot {
  width: 7px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.36);
  cursor: pointer;
}

.gallery-dot.active { background: var(--accent); box-shadow: 0 0 12px rgba(97,231,173,.65); }

.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 26px;
  background: rgba(0, 5, 4, .94);
  backdrop-filter: blur(14px);
}

.image-viewer.open { display: flex; }
.viewer-open { overflow: hidden; }
.viewer-dialog { position: relative; width: min(1320px, 100%); height: min(88vh, 880px); }
.viewer-viewport { width: 100%; height: 100%; overflow: hidden; }
.viewer-track { display: flex; width: 100%; height: 100%; transition: transform .35s ease; }
.viewer-image { min-width: 100%; width: 100%; height: 100%; object-fit: contain; user-select: none; }
.viewer-close { position: absolute; top: -4px; right: -4px; z-index: 3; width: 48px; height: 48px; border-radius: 50%; font-size: 30px; }
.viewer-nav { position: absolute; top: 50%; z-index: 3; width: 52px; height: 72px; border-radius: 14px; font-size: 38px; transform: translateY(-50%); }
.viewer-prev { left: 12px; }
.viewer-next { right: 12px; }
.viewer-counter { position: absolute; right: 50%; bottom: 8px; padding: 7px 12px; border-radius: 999px; background: rgba(5,13,11,.8); font-size: 12px; font-weight: 800; transform: translateX(50%); }

.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 45;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 22px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px);
  transition: opacity .2s ease, transform .2s ease, border-color .2s ease;
}

.back-to-top.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.back-to-top:hover, .gallery-button:hover, .viewer-nav:hover, .viewer-close:hover { border-color: var(--accent); color: var(--accent); }

.project-content { padding: clamp(28px, 3.4vw, 44px); }
.project h3 {
  margin-bottom: 18px;
  font-size: clamp(1.85rem, 2.8vw, 2.75rem);
  letter-spacing: -.05em;
  line-height: 1;
}

.project-summary { margin-bottom: 24px; color: var(--muted); font-size: 1.02rem; }
.metric-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 28px 0;
}

.metric {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.018);
}

.metric b { display: block; color: var(--accent-strong); font-size: 1.35rem; }
.metric span { color: var(--muted); font-size: 12px; line-height: 1.35; }

.evidence-list,
.content-list {
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
}

.evidence-list li,
.content-list li {
  position: relative;
  margin: 0;
  padding: 10px 0 10px 22px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}
.evidence-list li::before,
.content-list li::before {
  position: absolute;
  top: 18px;
  left: 2px;
  width: 6px;
  height: 6px;
  content: "";
  border-radius: 50%;
  background: var(--accent);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 0 30px;
  padding: 0;
  list-style: none;
}
.tag-list li {
  padding: 6px 9px;
  color: #bad0c7;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255,255,255,.018);
  font-size: 11px;
  font-weight: 720;
}

.capability-grid,
.case-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.capability,
.case-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel);
}

.capability h3,
.case-card h3 {
  margin-bottom: 12px;
  font-size: 1.18rem;
  letter-spacing: -.025em;
}
.capability p,
.case-card p { margin-bottom: 0; color: var(--muted); }

.stack {
  display: grid;
  grid-template-columns: .72fr 1.28fr;
  gap: 54px;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(97,231,173,.07), rgba(255,255,255,.018));
}

.stack h3 { margin-bottom: 14px; font-size: 1.55rem; }
.stack p { color: var(--muted); }
.stack-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.stack-group h4 { margin: 0 0 10px; color: var(--accent-strong); font-size: 12px; letter-spacing: .11em; text-transform: uppercase; }
.stack-group p { margin: 0; }

.contact {
  padding: 38px;
  border: 1px solid rgba(97,231,173,.28);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 90% 10%, rgba(97,231,173,.15), transparent 20rem),
    var(--panel-solid);
}

.contact { text-align: center; }
.contact h2 { max-width: 980px; margin: 0 auto 16px; }
.contact p { max-width: none; margin-inline: auto; color: var(--muted); }
.contact-actions { justify-content: center; margin-top: 22px; }

.engineering-details {
  width: min(calc(100% - 40px), var(--max));
  margin: 34px auto 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,.018);
  overflow: hidden;
}

.engineering-details > summary {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 52px 16px 22px;
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .03em;
  text-align: center;
  cursor: pointer;
  list-style: none;
}

.engineering-details > summary::-webkit-details-marker { display: none; }
.engineering-details > summary::after { margin-left: 12px; content: "+"; font-size: 22px; line-height: 1; }
.engineering-details[open] > summary { border-bottom: 1px solid var(--line); }
.engineering-details[open] > summary::after { content: "−"; }
.engineering-details .section { padding-inline: 20px; }

.site-footer {
  padding: 34px 0 46px;
  color: var(--faint);
  font-size: 13px;
}
.footer-row { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }

/* Case-study pages */
.case-hero {
  padding: 58px 0 40px;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 56px;
  align-items: center;
}
.case-hero h1 { font-size: clamp(2.8rem, 4.8vw, 4.6rem); }
.case-visual {
  min-height: 510px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #020605;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.case-visual img { width: 100%; height: 100%; object-fit: cover; }
.case-visual.seed { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: 2px; }

.architecture-flow {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 32px;
}
.architecture-flow span {
  position: relative;
  min-height: 100px;
  padding: 20px;
  display: flex;
  align-items: center;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.018);
  font-size: 13px;
}
.architecture-flow span:not(:last-child)::after {
  position: absolute;
  right: -11px;
  z-index: 2;
  color: var(--accent);
  content: "→";
}

.decision-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.decision {
  padding: 28px;
  border-left: 2px solid var(--accent);
  background: rgba(255,255,255,.018);
}
.decision h3 { margin-bottom: 9px; }
.decision p { margin: 0; color: var(--muted); }

.wide-proof { margin-top: 28px; }
.back-link { color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 700; }
.back-link:hover { color: var(--accent); }

@media (max-width: 980px) {
  .hero, .case-hero, .project, .project.reverse, .stack { grid-template-columns: 1fr; }
  .project-grid { grid-template-columns: 1fr; }
  .hero { gap: 20px; padding-top: 32px; }
  .project.reverse .project-media { order: 0; }
  .project-media { min-height: 400px; }
  .case-visual { min-height: 420px; }
  .proof-grid { grid-template-columns: repeat(2, 1fr); }
  .proof:nth-child(2) { border-right: 0; }
  .proof:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .capability-grid, .case-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .shell { width: min(calc(100% - 28px), var(--max)); }
  .nav { min-height: 64px; }
  .nav-links { display: none; }
  .nav-tools { margin-left: auto; }
  .hero { padding: 28px 0 20px; }
  h1 { font-size: clamp(1.85rem, 8vw, 2.35rem); }
  .section { padding: 54px 0; }
  .section.compact { padding: 40px 0; }
  .section-head { grid-template-columns: 1fr; gap: 14px; margin-bottom: 24px; }
  .section h2 { font-size: clamp(1.55rem, 7vw, 1.85rem); }
  .portfolio-disclosure { grid-template-columns: 1fr; gap: 12px; padding: 20px; }
  .portfolio-disclosure-label { justify-self: start; }
  .proof { min-height: 110px; padding: 16px; }
  .project-media { min-height: 310px; }
  .project-media.portrait img { min-height: 260px; }
  .project-content { padding: 28px 22px 30px; }
  .capability-grid, .case-grid, .decision-grid, .stack-groups, .architecture-flow { grid-template-columns: 1fr; }
  .architecture-flow span:not(:last-child)::after { right: auto; bottom: -19px; left: 24px; transform: rotate(90deg); }
  .stack, .contact { padding: 28px 22px; }
  .case-hero { padding-top: 44px; }
  .case-visual { min-height: 350px; }
  .gallery-controls { right: 10px; bottom: 10px; left: 10px; }
  .gallery-button { width: 38px; height: 38px; }
  .gallery-dots { bottom: 64px; }
  .image-viewer { padding: 8px; }
  .viewer-dialog { height: 92vh; }
  .viewer-nav { width: 42px; height: 58px; }
  .viewer-prev { left: 4px; }
  .viewer-next { right: 4px; }
  .viewer-close { top: 4px; right: 4px; }
  .back-to-top { right: 14px; bottom: 14px; width: 44px; height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}

:focus-visible { outline: 3px solid rgba(97,231,173,.72); outline-offset: 3px; }
