/* =========================================================
   DBU — Personal portfolio
   Tokens mirror the Figma variables (background/base, surface/raised, …)
   ========================================================= */
:root {
  --bg: #08090d;
  --surface-raised: #111318;
  --surface-graphite: #1a1d24;
  --surface-card: #101319;
  --surface-overlay: #0d1119;
  --border-subtle: #292f3a;
  --border-strong: #343b47;
  --text-primary: #f5f7fa;
  --text-secondary: #9ca3af;
  --text-detail: #b5bfcd;
  --accent-blue: #00b4ff;
  --accent-cyan: #00e5ff;
  --accent-violet: #a898dd;
  --grid-line: #141b25;

  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;

  --gutter: clamp(24px, 5vw, 72px);
  --wrap: min(1296px, 100% - 2 * var(--gutter));
  --nav-top: 24px;
  --nav-h: 72px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --slide-ms: 420ms;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + var(--nav-top)); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--accent-blue); outline-offset: 3px; }

.skip-link {
  position: fixed; left: 16px; top: -60px; z-index: 100;
  background: var(--accent-blue); color: var(--bg); padding: 10px 14px; font-size: 12px; font-weight: 700; border-radius: 4px;
}
.skip-link:focus { top: 16px; }

.wrap { width: var(--wrap); margin-inline: auto; position: relative; }

/* ---------- Type primitives ---------- */
.eyebrow {
  font: 500 10px/15px var(--font-body);
  color: var(--accent-blue);
  text-transform: uppercase;
  margin-bottom: 25px;
}
.eyebrow--flush { margin-bottom: 0; line-height: 12px; }
.eyebrow--tight { margin: 56px 0 28px; line-height: 12px; }
.eyebrow--work { margin-bottom: 24px; }
.eyebrow--lab { margin-bottom: 27px; }

.h-xl, .h-lg, .h-md, .h-work, .h-contact, .hero__title {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-primary);
  text-wrap: balance;
}
.h-xl { font-size: clamp(42px, 5.6vw, 80px); line-height: 0.98; }
.h-xl--ai { line-height: 1.01; }
.h-xl--process { line-height: 1; }
.h-xl--single { line-height: 1.05; }
.h-lg { font-size: clamp(40px, 5vw, 72px); line-height: 1; }
.h-md { font-size: clamp(36px, 4.45vw, 64px); line-height: 1.2; }
.h-md--tight { line-height: 1.03; }
.h-work { font-size: clamp(36px, 4.6vw, 66px); line-height: 1.02; }
.h-contact { font-size: clamp(48px, 6.95vw, 100px); line-height: 0.97; letter-spacing: -0.04em; }

.body-lg { font: 400 17px/1.5 var(--font-body); color: var(--text-secondary); }
.micro { font: 500 10px/14.5px var(--font-body); color: var(--text-secondary); }
.micro--10 { line-height: 15px; }
.micro a:hover { color: var(--text-primary); }

.section-intro { font: 400 16px/24px var(--font-body); color: var(--text-secondary); margin: 24px 0 40px; }
.section-intro--sm { font-size: 15px; line-height: 22.5px; margin: 30px 0 38px; }
.section-intro--lab { font-size: 17px; line-height: 25.5px; margin: 29px 0 50px; }

/* ---------- Buttons ---------- */
.btn-row { display: flex; flex-wrap: wrap; gap: 16px; }
.btn {
  display: inline-flex; align-items: center;
  height: 54px; padding: 0 19px; min-width: 154px;
  border-radius: 4px; border: 1px solid transparent;
  font: 700 12px/14.4px var(--font-body);
  white-space: pre;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
}
.btn--primary { background: var(--accent-blue); border-color: var(--accent-blue); color: var(--bg); min-width: 230px; }
.btn--primary:hover { background: #33c3ff; border-color: #33c3ff; }
.btn--secondary { background: var(--surface-raised); border-color: var(--border-strong); color: var(--text-primary); min-width: 230px; }
.btn--secondary:hover { border-color: var(--accent-blue); color: var(--accent-blue); }
.btn--wide { min-width: 260px; font-size: 11px; }
.btn--contact { min-width: 215px; font-size: 11px; }
.btn:active { transform: translateY(1px); }

.close-btn {
  height: 38px; padding: 0 9px; min-width: 68px;
  background: #192a3d; border: 1px solid #34495f;
  font: 400 9px/13.5px var(--font-body); color: var(--text-primary); text-align: left;
  transition: border-color 160ms ease;
}
.close-btn:hover { border-color: var(--accent-blue); }
.close-btn--lg { height: 40px; min-width: 72px; padding: 0 10px; font-weight: 500; }
.close-btn--project { min-width: 84px; padding: 0 11px; border-radius: 4px; background: #162334; border-color: #32465e; font: 500 10px/12px var(--font-body); white-space: pre; }

/* ---------- Navigation ---------- */
.site-nav {
  position: fixed; z-index: 40;
  top: var(--nav-top); left: 50%; transform: translateX(-50%);
  width: var(--wrap);
}
.site-nav__bar {
  position: relative; display: flex; align-items: center;
  height: var(--nav-h); padding: 0 23px;
  background: rgba(13, 16, 22, 0.94);
  border: 1px solid #252b35; border-radius: 8px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.logo { font: 700 27px/32.4px var(--font-display); display: inline-flex; align-items: baseline; }
.logo__slash { font: 400 23px/33.35px var(--font-display); color: var(--accent-blue); margin-left: 6px; }
.site-nav__links { position: absolute; left: 43.25%; top: 13px; display: flex; gap: 12px; }
.site-nav__links a {
  min-width: 80px; height: 44px; display: flex; align-items: center;
  font: 500 10px/12px var(--font-body); color: var(--text-secondary);
  transition: color 160ms ease;
}
.site-nav__links a:hover, .site-nav__links a.is-active { color: var(--text-primary); }
.site-nav__links a.is-active { color: var(--accent-blue); }
.site-nav__menu { display: none; margin-left: auto; height: 44px; font: 500 11px/13.2px var(--font-body); white-space: pre; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: clip; perspective: 1600px; }
.hero__wrap { min-height: 960px; padding: 164px 0 29px; display: flex; flex-direction: column; }
.hero__grid {
  position: absolute; z-index: 0; top: 120px; left: 0; height: 680px;
  width: calc(100% + 49px);
  animation: grid-float 8s ease-in-out infinite;
}
.hero__grid::before, .hero__grid::after { content: ""; position: absolute; inset: 0; pointer-events: none; }
.hero__grid::before { background: linear-gradient(to right, var(--grid-line) 1px, transparent 1px) 0 0 / 96px 100%; }
.hero__grid::after { right: 49px; background: linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px) 0 0 / 100% 80px; }

.hero__name, .hero__title, .hero__copy, .hero__foot { position: relative; z-index: 2; }
.hero__name { font: 500 13px/16.9px var(--font-body); color: var(--text-secondary); }
.hero__tag { position: absolute; z-index: 2; top: 142px; right: 0; width: 316px; font: 500 10px/14.5px var(--font-body); color: var(--accent-blue); }
.hero__title { margin-top: 39px; font-size: clamp(51px, 8.9vw, 128px); line-height: 0.98; letter-spacing: -0.05em; pointer-events: none; }
.hero__copy { margin-top: 87px; }
.hero__role { font: 500 14px/22.4px var(--font-body); max-width: 590px; }
.hero__lead { margin: 15px 0 25px; font: 400 16px/23.2px var(--font-body); color: var(--text-secondary); max-width: 560px; }
.hero__foot { margin-top: auto; padding-top: 46px; display: flex; justify-content: space-between; }
.hero__foot a:hover { color: var(--text-primary); }
.hero__foot-right { width: 278px; }

/* Digital core sculpture: authored at 680 px, scaled to the stage width by main.js */
.core-stage {
  position: absolute; z-index: 1;
  top: 166px; right: calc(-1 * var(--gutter));
  width: clamp(380px, 47.2vw, 680px); aspect-ratio: 1;
  min-height: 0; /* stop the unscaled 680px child from stretching the aspect-ratio box */
  --k: 1;
}
.core-stage > .core-scale { position: absolute; top: 0; left: 0; }
.core-scale { width: 680px; height: 680px; transform: scale(var(--k)); transform-origin: 0 0; perspective: 1600px; }
.core { width: 100%; height: 100%; transform: rotateY(-7deg); animation: core-float 8s ease-in-out infinite; will-change: transform; }
.core__frame { position: absolute; inset: 0; overflow: hidden; }
.core .v { position: absolute; }
.core .v__in { position: absolute; }
.core .v__in img, .core img.fill { width: 100%; height: 100%; max-width: none; }
.core img.fill { position: absolute; inset: 0; }
.core .v--mask { -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-mode: alpha; mask-mode: alpha; }

.status-card {
  position: absolute; z-index: 3; top: 648px; right: 0; width: 256px; height: 92px;
  padding: 15px 17px; border-radius: 6px;
  background: #101722; border: 1px solid #2b3c51;
  display: flex; flex-direction: column; gap: 12px;
  animation: status-float 8s ease-in-out infinite;
  transition: border-color 180ms ease;
}
.status-card:hover { border-color: var(--accent-blue); }
.status-card__label { font: 500 10px/14.5px var(--font-body); color: var(--accent-cyan); white-space: pre; }
.status-card__text { font: 400 16px/23.2px var(--font-display); }

@keyframes grid-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes core-float { 0%, 100% { transform: translateY(0) rotateY(-7deg); } 50% { transform: translateY(-14px) rotateY(-3deg); } }
@keyframes status-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(6px); } }

/* ---------- Sections ---------- */
.section { position: relative; padding: 48px 0 80px; }
.section--divided > .wrap::before {
  content: ""; position: absolute; top: -48px; left: 0; right: 0; height: 1px; background: var(--border-subtle);
}

/* Panels */
.panel {
  background: var(--surface-raised); border: 1px solid var(--border-subtle); border-radius: 8px;
  transition: border-color 180ms ease, transform 180ms ease;
}
a.panel:hover, .panel:hover { border-color: rgba(0, 180, 255, 0.55); }
.stack { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; padding: 24px; }
.panel__title { font: 500 24px/29px var(--font-display); }
.panel__title--lg { font-size: 26px; line-height: 31px; }
.panel__role { font: 400 14px/21px var(--font-body); }
.panel__body { font: 400 14px/21px var(--font-body); color: var(--text-secondary); }

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

.step-marker {
  flex: none; width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  background: #0c2535; border: 1px solid var(--accent-blue);
  font: 500 10px/10px var(--font-body); color: var(--accent-cyan);
}

/* ---------- About ---------- */
.about__grid { display: grid; grid-template-columns: 410px minmax(0, 690px); column-gap: clamp(32px, 9.6vw, 138px); margin-top: 61px; align-items: start; }
.about__portrait { display: block; aspect-ratio: 1; border: 1px solid #2c3542; border-radius: 6px; overflow: hidden; transition: border-color 180ms ease; }
.about__portrait:hover { border-color: var(--accent-blue); }
.about__portrait img { width: 100%; height: 100%; object-fit: cover; }
.about__text { padding-top: 9px; display: grid; gap: 20px; }
.about__lead { font: 500 26px/39px var(--font-display); margin-bottom: 0; }
.about__text .body-lg { font-size: 17px; line-height: 25.5px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 40px; }
.chip {
  display: inline-flex; align-items: center; height: 30px; padding: 0 11px;
  background: #0d121a; border: 1px solid #293341; border-radius: 3px;
  font: 500 9px/10.8px var(--font-body); color: var(--text-secondary);
  transition: border-color 160ms ease, color 160ms ease;
}
.chip:hover { border-color: var(--accent-blue); color: var(--text-primary); }

/* ---------- Journey ---------- */
.journey .eyebrow:first-child { margin-bottom: 26px; }
.journey__grid { display: grid; grid-template-columns: 42.3% minmax(0, 1fr); }
.journey__left { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; gap: 32px; padding-bottom: 0; }
.journey__left .h-lg { margin-top: 0; }
.journey__current { position: relative; padding: 7px 0 30px 26px; margin-top: -7px; }
.journey__spine { position: absolute; left: 0; top: 13px; bottom: 0; width: 1px; background: #314052; }
.journey__spine img { position: absolute; left: -4px; top: 0; }
.journey__date { font: 500 11px/16.5px var(--font-body); color: var(--accent-cyan); }
.journey__company { margin-top: 22px; font: 500 32px/38.4px var(--font-display); }
.journey__role { margin-top: 14px; font: 400 22px/30.8px var(--font-display); color: var(--text-secondary); }
.journey__list { margin-top: 32px; display: grid; grid-template-columns: repeat(2, minmax(0, 349px)); gap: 13.5px 12px; }
.journey__list li { font: 400 13px/19.5px var(--font-body); color: var(--text-secondary); }
.journey__list li::before { content: "↗"; margin-right: 0.85em; color: var(--text-secondary); }
.journey__also { margin-top: 98px; font: 400 12px/18px var(--font-body); color: var(--text-secondary); }
.journey .grid-3 .panel { min-height: 254px; }

/* ---------- Selected work ---------- */
.work { padding-top: 45px; padding-bottom: 84px; }
.work__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 32px; margin-bottom: 31px; }
.work__aside { width: 318px; flex: none; margin-top: 28px; font: 400 14px/21px var(--font-body); color: var(--text-secondary); }
.work__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 24px; }

.project {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface-card); border: 1px solid #2a3340; border-radius: 8px; overflow: hidden;
  cursor: pointer;
  transition: border-color 220ms ease, box-shadow 220ms ease, transform 320ms var(--ease-out);
}
.project--feature, .project--wide { grid-column: 1 / -1; }
.project--half { min-height: 776px; }
.project > .gallery { margin: -1px -1px 0; }
.project__body { flex: 1; display: flex; flex-direction: column; align-items: flex-start; padding: 25px 23px 26px; }
.project__kicker { font: 500 10px/15px var(--font-body); color: var(--accent-blue); margin-bottom: 14px; }
.project__title { font: 700 29px/1.1 var(--font-display); max-width: 588px; }
.project--feature .project__title { font-size: 40px; max-width: none; }
.project__summary { margin-top: 18px; font: 400 14px/21px var(--font-body); color: var(--text-secondary); max-width: 588px; }
.project--feature .project__summary { margin-top: 13px; font-size: 16px; line-height: 24px; max-width: 960px; }
.project__tags { margin-top: auto; padding-top: 40px; font: 500 8px/12px var(--font-body); color: var(--accent-blue); white-space: pre-wrap; }
.project--feature .project__tags { font-size: 10px; line-height: 15px; padding-top: 74px; }
.project__cta { margin-top: 35px; font: 700 10px/12px var(--font-body); color: var(--text-primary); white-space: pre; }
.project--feature .project__cta { margin-top: 17px; }
.project__cta:hover { color: var(--accent-blue); }

.project--wide { flex-direction: row-reverse; min-height: 447px; }
.project--wide > .gallery { margin: 19px 19px 19px 0; width: 548px; flex: none; }
.project--wide .project__body { padding: 57px 24px 26px 23px; }
.project--wide .project__title { font-size: 34px; max-width: 625px; }
.project--wide .project__summary { max-width: 625px; }
.project--wide .project__tags { margin-top: 0; padding-top: 0; flex: 1; display: flex; align-items: center; }
.project--wide .project__cta { margin-top: 0; }
.project--no-gallery { min-height: 0; }
.project--no-gallery .project__body { padding-top: 44px; padding-bottom: 36px; }
.project--no-gallery .project__summary { max-width: 860px; }
.project--no-gallery .project__tags { flex: none; padding: 40px 0 0; }
.project--no-gallery .project__cta { margin-top: 28px; }

@media (hover: hover) and (pointer: fine) {
  .project:hover {
    border-color: rgba(0, 180, 255, 0.6);
    box-shadow: 0 0 0 1px rgba(0, 180, 255, 0.12), 0 18px 48px -24px rgba(0, 180, 255, 0.35), inset 0 1px 0 rgba(0, 229, 255, 0.25);
    transform: perspective(1400px) rotateX(1.2deg) translateY(-3px);
  }
}

/* ---------- Screenshot gallery ---------- */
.gallery {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface-raised); border: 1px solid var(--border-subtle); border-radius: 8px;
  padding: 14px 15px 16px;
  cursor: default;
}
.gallery__head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; height: 12.1px; margin-bottom: 17px; }
.gallery__label { font: 500 11px/12.1px var(--font-body); color: var(--accent-blue); }
.gallery__count { font: 500 10px/11px var(--font-body); color: var(--text-secondary); min-width: 64px; }
.gallery__viewport {
  position: relative; overflow: hidden; border-radius: 4px;
  background: var(--surface-graphite); border: 1px solid var(--border-subtle);
  touch-action: pan-y; user-select: none; -webkit-user-select: none;
}
.gallery__viewport:focus-visible { outline-offset: 2px; }
.gallery__track { display: flex; gap: 16px; transition: transform var(--slide-ms) var(--ease-out); will-change: transform; }
.gallery__track.is-dragging { transition: none; }
.gallery__controls { position: relative; display: flex; justify-content: space-between; align-items: center; margin-top: 12px; height: 44px; }
.gallery__arrow, .gallery__dot {
  width: 44px; height: 44px; border-radius: 4px; display: grid; place-items: center;
  border: 1px solid var(--border-subtle); background: var(--surface-graphite);
  font: 400 19px/26.6px var(--font-body); color: var(--text-primary);
  transition: border-color 160ms ease, color 160ms ease;
}
.gallery__arrow:hover { border-color: var(--accent-blue); }
.gallery__dots { position: absolute; left: 50%; transform: translateX(-50%); display: flex; }
.gallery__dot { font-size: 11px; line-height: 16px; background: var(--surface-raised); border-color: #000; color: var(--text-secondary); }
.gallery__dot[aria-current="true"] { background: #000; border-color: var(--accent-blue); color: var(--accent-blue); }
.gallery__dot:hover { color: var(--text-primary); }

.slide {
  position: relative; flex: 0 0 100%; aspect-ratio: 16 / 9; overflow: hidden;
  container-type: inline-size;
  background: var(--surface-graphite); border: 0.1875cqw solid var(--border-subtle);
}
.slide img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
/* Real screenshots: show the whole image at its own proportions */
.gallery__viewport { transition: height var(--slide-ms) var(--ease-out); }
.gallery__track { align-items: flex-start; }
.slide--image { aspect-ratio: auto; border: 0; background: transparent; }
.slide--image img { display: block; height: auto; }
.slide__label, .slide__title, .slide__sub, .slide__slot { position: absolute; margin: 0; }
.slide__label { left: 4.81%; top: 6.78%; width: 90%; font: 500 2.5cqw/1.4 var(--font-body); color: var(--accent-blue); }
.slide__frame { position: absolute; left: 3.81%; top: 17.9%; width: 92%; height: 65.6%; border: max(1px, 0.0625cqw) solid var(--border-subtle); border-radius: 1.5cqw; }
.slide__title { left: 50%; transform: translateX(-50%); top: 34.1%; width: 85%; text-align: center; font: 500 5cqw/1.1 var(--font-display); color: var(--text-primary); }
.slide__sub { left: 50%; transform: translateX(-50%); top: 49.7%; width: 85%; text-align: center; font: 400 2.75cqw/1.4 var(--font-body); color: var(--text-secondary); }
.slide__slot { left: 4.81%; top: 89.4%; width: 90%; font: 500 2cqw/1.4 var(--font-body); color: var(--text-secondary); }

/* ---------- Additional projects ---------- */
.more .grid-2 .panel { min-height: 455px; }
.thumb { width: 306px; max-width: 100%; height: auto; aspect-ratio: 306 / 173; object-fit: contain; border-radius: 4px; }

/* ---------- Toolkit ---------- */
.grid-3--toolkit { gap: 20px; }
.capability {
  position: relative; min-height: 320px; padding: 19px; display: flex; flex-direction: column;
  background: #0e141d; border: 1px solid #273444; border-radius: 6px; cursor: pointer;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}
.capability:hover { border-color: rgba(0, 180, 255, 0.55); box-shadow: inset 0 1px 0 rgba(0, 229, 255, 0.15); }
.capability__kicker { font: 500 10px/15px var(--font-body); color: var(--accent-blue); white-space: pre; }
.capability__line { height: 1px; background: #26394e; margin: 21px 0 25px; }
.capability__nodes { display: flex; flex-wrap: wrap; gap: 10px; align-content: flex-start; }
.tech-node {
  height: 44px; padding: 0 12px; display: inline-flex; align-items: center;
  background: #172334; border: 1px solid #344a64; border-radius: 5px;
  font: 500 10px/12.5px var(--font-body); color: #dce7f5; white-space: nowrap;
  transition: border-color 160ms ease, background-color 160ms ease;
}
.tech-node:hover { border-color: var(--accent-blue); background: #1b2a3e; }
.capability__explore { margin-top: auto; padding-top: 24px; align-self: flex-start; font: 500 8px/9.6px var(--font-body); color: var(--text-secondary); white-space: pre; }
.capability__explore:hover { color: var(--accent-blue); }

/* ---------- AI development ---------- */
.split-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 32px; }
.split-head__aside { flex: none; width: 458px; margin-top: 29px; font: 500 23px/32.2px var(--font-display); }
.split-head__aside--muted { width: 368px; margin-top: 47px; font: 400 15px/22.5px var(--font-body); color: var(--text-secondary); }
.ai__intro { margin: 45px 0 66px; max-width: 1120px; font-size: 17px; line-height: 24.65px; }
.ai__tools { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 20px; }
.tool { position: relative; display: flex; flex-direction: column; min-height: 310px; padding: 20px; }
.tool__logo { width: 56px; height: 56px; border-radius: 8.4px; display: grid; place-items: center; }
.tool__logo img { width: 33.6px; height: 33.6px; object-fit: contain; }
.tool__logo--filled { background: var(--surface-graphite); }
.flip-y { transform: scaleY(-1) rotate(180deg) scaleX(-1); }
.tool__arrow { position: absolute; top: 24px; right: 14px; font: 400 16px/23.2px var(--font-body); color: var(--text-secondary); transition: color 160ms ease, transform 160ms ease; }
.tool:hover .tool__arrow { color: var(--accent-blue); transform: translate(2px, -2px); }
.tool__name { margin-top: 18px; font: 500 24px/28.8px var(--font-display); }
.tool__kicker { margin-top: 11px; font: 500 10px/14px var(--font-body); color: var(--accent-blue); }
.tool__body { margin-top: 36px; font: 400 14px/20.3px var(--font-body); color: var(--text-secondary); }

.ownership {
  margin-top: 50px; min-height: 210px; padding: 23px 23px 23px 23px;
  display: flex; justify-content: space-between; gap: 32px;
  background: var(--surface-graphite); border: 1px solid var(--border-subtle); border-radius: 8px;
}
.ownership__title { font: 700 36px/36.72px var(--font-display); }
.ownership__body { margin-top: 18px; font: 400 14px/20.3px var(--font-body); color: var(--text-secondary); }
.ownership__side { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; gap: 24px; }
.ownership__flow { align-self: flex-start; padding-top: 4px; width: 312px; font: 500 11px/18.7px var(--font-body); color: var(--accent-blue); }

/* ---------- Process ---------- */
.process { padding-bottom: 45px; }
.steps { position: relative; margin-top: 82px; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 22px; min-height: 290px; }
.steps::before { content: ""; position: absolute; left: 0; right: 0; top: 25px; height: 1px; background: #25465d; }
.step { position: relative; }
.step .step-marker { position: relative; transition: box-shadow 200ms ease; }
.step:hover .step-marker { box-shadow: 0 0 0 4px rgba(0, 180, 255, 0.15), 0 0 18px rgba(0, 229, 255, 0.35); }
.step h3 { margin-top: 32px; font: 700 18px/21.6px var(--font-display); }
.step p { margin-top: 16px; max-width: 190px; font: 400 14px/21px var(--font-body); color: var(--text-secondary); }
.process__flow { margin-top: 80px; line-height: 15px; }

/* ---------- Digital lab ---------- */
.lab { padding-top: 40px; padding-bottom: 70px; }
.lab .grid-3 { gap: 20px; }
.lab-card {
  min-height: 280px; padding: 19px; display: flex; flex-direction: column;
  background: #10151f; border: 1px solid #293546; border-radius: 6px;
  transition: border-color 180ms ease, transform 220ms var(--ease-out);
}
.lab-card:hover { border-color: rgba(0, 180, 255, 0.55); transform: translateY(-2px); }
.lab-card--violet { border-color: #3b365e; }
.lab-card--violet:hover { border-color: var(--accent-violet); }
.lab-card__kicker { font: 500 9px/13.5px var(--font-body); color: var(--accent-blue); }
.lab-card--violet .lab-card__kicker { color: var(--accent-violet); }
.lab-card__title { margin-top: 36px; font: 500 25px/27.5px var(--font-display); }
.lab-card__body { margin-top: 18.5px; font: 400 14px/21px var(--font-body); color: var(--text-secondary); }
.lab-card__foot { margin-top: auto; padding-top: 24px; }

/* ---------- Education ---------- */
.grid-2--edu { row-gap: 24px; }

/* ---------- Contact ---------- */
.contact { overflow: hidden; min-height: 760px; padding: 45px 0 26px; }
.contact__horizon { position: absolute; left: 0; right: 0; bottom: 0; height: 120px; pointer-events: none; z-index: 0; }
.contact__horizon img { position: absolute; max-width: none; }
.contact__horizon img:nth-child(1) { top: 0; }
.contact__horizon img:nth-child(2) { top: 6px; }
.contact__horizon img:nth-child(3) { top: 12px; }
.contact__horizon img:nth-child(4) { top: 18px; }
.contact__horizon img:nth-child(5) { top: 24px; }
.contact__wrap { z-index: 1; }
.contact .h-contact { margin-top: 30px; }
.contact__lead { margin-top: 39px; max-width: 730px; font-size: 17px; line-height: 25.5px; }
.btn-row--contact { margin-top: 32px; gap: 20px; }
.contact__email { margin-top: 28px; }
.contact__phone { margin-top: 12px; }
.footer { margin-top: 18px; display: grid; grid-template-columns: 1fr minmax(0, 478px); grid-template-rows: auto auto; row-gap: 36px; }
.footer__name { font: 500 15px/19.5px var(--font-display); }
.footer__name:hover { color: var(--accent-blue); }
.footer__tagline { font: 400 14px/21px var(--font-body); color: var(--text-secondary); }
.footer__top { font: 500 9px/13.5px var(--font-body); color: var(--accent-blue); white-space: pre; justify-self: start; }
.footer__top:hover { color: var(--accent-cyan); }
.footer__motto { font: 500 9px/13.5px var(--font-body); color: var(--text-secondary); padding-left: 130px; }
.footer__social {
  grid-column: 1 / -1; justify-self: start;
  display: inline-flex; align-items: center; gap: 10px;
  font: 500 9px/13.5px var(--font-body); color: var(--text-secondary); white-space: pre;
  transition: color 160ms ease;
}
.footer__social-icon { width: 18px; height: 18px; flex: none; color: var(--text-primary); transition: color 160ms ease; }
.footer__social:hover, .footer__social:hover .footer__social-icon { color: var(--accent-blue); }

/* ---------- Dialogs ---------- */
dialog { color: var(--text-primary); padding: 0; }
dialog::backdrop { background: rgba(3, 5, 9, 0.72); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
dialog[open] { animation: dialog-in 220ms var(--ease-out); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(12px) scale(0.985); } to { opacity: 1; transform: none; } }
html.has-modal { overflow: hidden; }

.panel-dialog {
  width: min(342px, 100vw - 32px); min-height: 520px; max-height: calc(100dvh - 32px); overflow-y: auto;
  background: var(--surface-overlay); border: 1px solid #2d4158; border-radius: 0;
  padding: 0 23px 32px;
}
.panel-dialog--tall { min-height: min(740px, 100dvh - 32px); border-color: #2c4158; padding-inline: 19px; }
#menu-dialog { min-height: 570px; }
.panel-dialog__head { display: flex; justify-content: space-between; align-items: center; padding-top: 13px; min-height: 51px; }
.panel-dialog__head--end { justify-content: flex-end; }
.panel-dialog--tall .panel-dialog__head { padding-top: 11px; }
.panel-dialog__title { margin-top: 38px; font: 700 31px/32.55px var(--font-display); }
.panel-dialog__title--cap { margin-top: 32px; font-size: 29px; line-height: 30.45px; }
.menu__title { font: 700 12px/18px var(--font-display); color: var(--accent-blue); }
.menu__links { margin-top: 43px; display: flex; flex-direction: column; gap: 34.8px; }
.menu__links a { font: 500 26px/31.2px var(--font-display); transition: color 160ms ease; }
.menu__links a:hover { color: var(--accent-blue); }
.contact-panel__lead { margin-top: 52px; font: 400 14px/21px var(--font-body); color: var(--text-secondary); }
.contact-panel__email { display: block; margin-top: 23px; font: 400 11px/16.5px var(--font-body); color: var(--text-secondary); word-break: break-all; }
.contact-panel__phone { display: block; margin-top: 43px; font: 400 12px/20px var(--font-body); color: var(--text-secondary); }
.contact-panel__email:hover, .contact-panel__phone:hover { color: var(--text-primary); }
.contact-panel__cta { margin-top: 40px; display: flex; align-items: center; height: 54px; padding: 0 16px; background: var(--accent-blue); color: var(--bg); font: 700 11px/13.2px var(--font-body); white-space: pre; }
.contact-panel__cta:hover { background: #33c3ff; }
.capability-list { margin-top: 28px; display: grid; gap: 23px; }
.capability-list dt { font: 500 15px/22.5px var(--font-display); }
.capability-list dd { margin-top: 2.5px; font: 400 12px/18px var(--font-body); color: var(--text-secondary); }

.project-dialog {
  width: min(1040px, 100vw - 32px); max-width: none; max-height: calc(100dvh - 48px);
  background: var(--surface-overlay); border: 1px solid #293747; border-radius: 0;
  overflow-y: auto; overscroll-behavior: contain;
}
.project-dialog__nav {
  position: sticky; top: 0; z-index: 2;
  height: 72px; padding: 0 48px; display: flex; justify-content: space-between; align-items: center;
  background: #111824; border-bottom: 1px solid #293747;
}
.project-dialog__crumb { font: 500 10px/12px var(--font-body); color: var(--accent-blue); }
.project-dialog__body { padding: 33px 48px 0; }
.detail__kicker { font: 500 10px/15px var(--font-body); color: var(--accent-blue); }
.detail__title { margin-top: 19px; font: 700 45px/1.05 var(--font-display); text-wrap: balance; }
.detail__summary { margin-top: 26px; font: 400 18px/27px var(--font-body); color: var(--text-secondary); }
.detail__gallery { margin-top: 32px; }
.detail__gallery .gallery { border-radius: 6px; }
.detail__sections { margin-top: 29px; }
.detail__label { font: 500 10px/15px var(--font-body); color: var(--accent-blue); }
.detail__text { margin-top: 13px; font: 400 16px/24px var(--font-body); color: var(--text-detail); }
.detail__block + .detail__block { margin-top: 31px; }
.architecture {
  margin-top: 16px; padding: 25px 9px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px;
  background: #101d2b; border: 1px solid #2d4058; border-radius: 5px;
}
.architecture span {
  min-height: 48px; padding: 17px 9px; display: flex; align-items: center;
  background: #182e43; border: 1px solid #365570; border-radius: 4px;
  font: 500 9px/10.8px var(--font-body); color: #bbd4ee; white-space: pre-wrap;
}
.detail__back {
  margin-top: 31px; width: 100%; height: 48px; padding: 0 15px; text-align: left;
  background: #142a3b; border: 1px solid #2d4962;
  font: 500 10px/12px var(--font-body); color: var(--accent-blue); white-space: pre;
  transition: border-color 160ms ease;
}
.detail__back:hover { border-color: var(--accent-blue); }
.detail__end { height: 1px; margin: 37px -48px 0; background: #293747; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1180px) {
  .site-nav__links { left: auto; right: 23px; gap: 4px; }
  .site-nav__links a { min-width: 0; padding: 0 8px; }
  .ai__tools { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 48px; }
  .steps::before { display: none; }
  .about__grid { grid-template-columns: minmax(0, 360px) minmax(0, 1fr); }
  .project--wide > .gallery { width: 46%; }
}

@media (max-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .journey__grid { grid-template-columns: 1fr; }
  .journey__left { display: contents; }
  .journey__left .btn { order: 3; margin-top: 8px; }
  .journey__current { order: 2; margin-top: 40px; }
  .journey__also { margin-top: 48px; }
  .split-head { flex-direction: column; gap: 0; }
  .split-head__aside, .split-head__aside--muted { width: auto; margin-top: 24px; }
  .work__head { flex-direction: column; gap: 0; }
  .work__aside { width: auto; margin-top: 20px; }
  .ownership { flex-direction: column; }
  .ownership__side { align-items: flex-start; }
}

@media (max-width: 900px) {
  :root { --nav-h: 72px; }
  .site-nav__links { display: none; }
  .site-nav__menu { display: inline-flex; align-items: center; }

  .hero__wrap { min-height: 0; padding-top: 136px; padding-bottom: 44px; }
  .hero__grid, .hero__tag, .hero__foot-right, .status-card { display: none; }
  .hero__title { margin-top: 33px; }
  .core-stage {
    position: relative; top: auto; right: auto;
    width: min(100% + 24px, 560px); margin: 31px auto 0; left: -1px;
  }
  .core-stage::before {
    content: ""; position: absolute; z-index: -1; top: 15%; left: 12px; right: 12px; height: 110%;
    background:
      linear-gradient(to right, var(--grid-line) 1px, transparent 1px) 0 0 / calc((100% - 1px) / 6) 100%,
      linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px) 0 0 / 100% 80px;
    -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent);
    mask-image: linear-gradient(to bottom, #000 70%, transparent);
  }
  .hero__copy { margin-top: 30px; }
  .hero__role { font-size: 12px; line-height: 19.2px; }
  .hero__lead { margin: 14px 0 42px; font-size: 13px; line-height: 18.85px; }
  .hero__foot { padding-top: 30px; }

  .about__grid { grid-template-columns: 1fr; row-gap: 40px; margin-top: 40px; }
  .about__portrait { max-width: 410px; }
  .about__lead { font-size: 22px; line-height: 32px; }

  .work__grid { grid-template-columns: 1fr; }
  .project--half { min-height: 0; }
  .project--wide { flex-direction: column; }
  .project--wide > .gallery { width: auto; margin: -1px -1px 0; }
  .project--wide .project__body { padding-top: 25px; }
  .project--wide .project__tags { padding: 40px 0 0; }
  .project--wide .project__cta { margin-top: 35px; }
  .project--feature .project__title { font-size: 29px; }
  .project--feature .project__summary { font-size: 14px; line-height: 21px; }
  .project--feature .project__tags { padding-top: 40px; font-size: 8px; line-height: 12px; }
  .project--feature .project__cta { margin-top: 35px; }

  .grid-2 { grid-template-columns: 1fr; }
  .more .grid-2 .panel { min-height: 0; }
  .contact .h-contact { margin-top: 24px; }
  .footer { grid-template-columns: 1fr; row-gap: 16px; padding-bottom: 120px; }
  .footer__motto { padding-left: 0; }
  .project-dialog__nav { padding: 0 20px; }
  .project-dialog__body { padding: 28px 20px 0; }
  .detail__end { margin-inline: -20px; }
  .detail__title { font-size: 32px; }
  .detail__summary { font-size: 16px; line-height: 24px; }
  .architecture { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .grid-3 { grid-template-columns: 1fr; }
  .ai__tools { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .tool { min-height: 0; }
  .tool__body { margin-top: 20px; }
  .steps { grid-template-columns: 1fr; row-gap: 32px; margin-top: 48px; padding-left: 0; }
  .steps::before { display: block; left: 19px; right: auto; top: 0; bottom: 0; width: 1px; height: auto; }
  .step { display: grid; grid-template-columns: 38px 1fr; column-gap: 20px; }
  .step .step-marker { grid-row: span 2; }
  .step h3 { margin-top: 9px; }
  .step p { margin-top: 8px; max-width: none; }
  .process__flow { margin-top: 56px; }
  .journey__list { grid-template-columns: 1fr; }
  .journey__company { font-size: 26px; line-height: 32px; }
  .journey__role { font-size: 18px; line-height: 26px; }
  .btn-row { gap: 10px; }
  .btn--primary, .btn--secondary { min-width: 0; }
  .hero .btn--primary { flex: 1 1 205px; }
  .btn--wide, .btn--contact { min-width: 0; }
  .gallery { padding: 12px 12px 12px; }
  .gallery__label { font-size: 10px; }
  .gallery__arrow, .gallery__dot { width: 40px; height: 40px; }
  .ownership__title { font-size: 28px; line-height: 30px; }
  .ownership__flow { width: auto; }
  .lab-card { min-height: 240px; }
  .capability { min-height: 280px; }
  .architecture { grid-template-columns: 1fr; }
}

@media (max-width: 400px) {
  .ai__tools { grid-template-columns: 1fr; }
}

/* Reduced motion: static sculpture, instant gallery changes */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero__grid, .core, .status-card { animation: none; }
  .gallery__track { transition: none; }
  dialog[open] { animation: none; }
  .project, .lab-card { transition: border-color 180ms ease; }
  .project:hover, .lab-card:hover { transform: none !important; }
}
