:root {
  --acc: #46D5E8;
  --acc2: #E8843C;
  --page-gutter: max(48px, calc((100vw - 1400px) / 2 + 24px));
  --section-gap: clamp(32px, 4vw, 64px);
  --section-columns: minmax(0, 5fr) minmax(0, 6fr);
}

html, body {
  margin: 0;
  padding: 0;
  background: #0A0B0C;
}

html {
  scroll-behavior: auto;
  scrollbar-gutter: stable;
}

html.viewer-open,
html.viewer-open body {
  overflow: hidden;
}

.image-viewer {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 20px;
  border: 0;
  color: #EDEAE4;
  background: rgba(7,9,12,.95);
  overscroll-behavior: contain;
}

.image-viewer[open] {
  display: grid;
  grid-template-rows: auto minmax(0,1fr);
  gap: 16px;
}

.image-viewer::backdrop { background: rgba(0,0,0,.8); }

.image-viewer-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.image-viewer-toolbar p {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

.image-viewer button {
  flex-shrink: 0;
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid rgba(237,234,228,.3);
  border-radius: 4px;
  background: #151A20;
  color: inherit;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.image-viewer button:hover { background: #25313B; }
.image-viewer button:disabled { opacity: .5; cursor: default; }
.image-viewer .image-viewer-close { width: 44px; padding: 0; font-size: 28px; }
.image-viewer :focus-visible { outline: 2px solid var(--acc); outline-offset: 3px; }

.image-viewer-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 8px;
  cursor: zoom-out;
}

.image-viewer-image {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  cursor: zoom-in;
}

.image-viewer.is-zoomed .image-viewer-stage { display: block; }
.image-viewer.is-zoomed .image-viewer-image {
  max-width: none;
  max-height: none;
  margin: auto;
  cursor: zoom-out;
}

.image-viewer [hidden] { display: none; }

@media (max-width: 720px) {
  .image-viewer { padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom)); gap: 8px; }
  .image-viewer-toolbar { flex-wrap: wrap; gap: 8px; }
  .image-viewer-toolbar p { flex-basis: calc(100% - 60px); }
  .image-viewer-close { order: 1; }
  .image-viewer-zoom { order: 2; }
}

body {
  font-family: 'Onest', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  color: #EDEAE4;
}

body > div {
  overflow: visible !important;
}

* {
  box-sizing: border-box;
}

.site-header,
body > div > section,
body > div > footer {
  padding-left: var(--page-gutter) !important;
  padding-right: var(--page-gutter) !important;
}

.hero {
  display: grid !important;
  align-items: center !important;
  padding-top: clamp(68px, 7vh, 84px) !important;
  padding-bottom: clamp(68px, 7vh, 84px) !important;
}

.hero-copy {
  min-width: 0 !important;
  max-width: 590px !important;
}

.hero-title {
  font-size: clamp(50px, 3.4vw, 70px) !important;
  line-height: .96 !important;
  text-wrap: initial !important;
}

.hero-line {
  white-space: nowrap;
}

.hero-copy > p {
  margin-top: 30px !important;
}

.hero-copy > div:nth-of-type(2) {
  margin-top: 36px !important;
}

.hero-capabilities {
  margin-top: 54px !important;
}

.system-map {
  width: 100%;
  min-width: 0 !important;
  align-self: center !important;
  border-color: rgba(237,234,228,.14) !important;
  background: linear-gradient(180deg, rgba(237,234,228,.04), rgba(237,234,228,.012)) !important;
  transform: translate3d(0, var(--map-shift, 0), 0) scale(var(--map-scale, 1));
  transform-origin: 50% 50%;
}

.story-scene {
  isolation: isolate;
  overflow: clip;
}

#top {
  scroll-margin-top: 100px;
}

.hero {
  min-height: calc(100svh - 75px);
}

.hero-copy {
  transform: translate3d(0, var(--copy-shift, 0), 0);
}

.scene-rail {
  position: fixed;
  z-index: 60;
  top: 50%;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transform: translateY(-50%);
}

.scene-rail a {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: 32px;
  height: 28px;
  color: rgba(237,234,228,.32);
  font-size: 9px;
  letter-spacing: .12em;
  text-transform: uppercase;
  transition: color .25s;
}

.scene-rail a i {
  display: block;
  width: 6px;
  height: 6px;
  border: 1px solid rgba(237,234,228,.64);
  border-radius: 50%;
  background: #0A0B0C;
  transition: width .25s, height .25s, background .25s, border-color .25s;
}

.scene-rail a b {
  position: absolute;
  right: 18px;
  padding: 6px 8px;
  white-space: nowrap;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  background: rgba(10,11,12,.92);
  transform: translateX(5px);
  transition: opacity .2s, transform .2s;
}

.scene-rail a:hover,
.scene-rail a.is-active {
  color: #EDEAE4;
}

.scene-rail a:focus-visible {
  outline: 1px solid var(--acc);
  outline-offset: 2px;
}

.scene-rail a:hover i,
.scene-rail a.is-active i {
  width: 7px;
  height: 7px;
  border-color: var(--acc);
  background: var(--acc);
}

.scene-rail a:hover b,
.scene-rail a:focus-visible b {
  opacity: 1;
  transform: none;
}

.work-story {
  overflow: visible;
  padding-bottom: 88px !important;
}

.work-visual {
  position: relative;
}

.case-step {
  min-height: 0;
  transition: border-color .35s !important;
}

.case-step.is-active {
  border-color: rgba(70,213,232,.65) !important;
}

.case-shot {
  opacity: 1;
  filter: none;
  transform: scale(.992);
  transform-origin: 50% 50%;
  transition: opacity .65s, filter .65s, transform .65s cubic-bezier(.16,.84,.28,1);
}

.case-shot.is-active {
  opacity: 1;
  filter: saturate(1);
  transform: scale(1);
}

.portfolio-media {
  margin: 0;
  min-width: 0;
}

.site-footer {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px 48px;
  padding-block: 32px;
  border-top: 1px solid rgba(237,234,228,.09);
  color: rgba(237,234,228,.68);
  font-size: 13px;
  line-height: 1.6;
}

.footer-brand { color: #EDEAE4; font-size: 15px; font-weight: 500; }
.footer-brand span { margin-left: 12px; font-size: 12px; color: rgba(237,234,228,.5); }
.footer-identity p { margin: 10px 0 6px; }
.footer-details { display: flex; flex-wrap: wrap; gap: 4px 24px; margin: 0; font-size: 12px; }
.footer-details div { display: flex; gap: 8px; }
.footer-details dt { color: rgba(237,234,228,.5); }
.footer-details dd { margin: 0; font-variant-numeric: tabular-nums; }
.footer-contacts { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; }
.footer-contacts a { overflow-wrap: anywhere; text-underline-offset: 4px; }
.footer-contacts a:hover { text-decoration: underline; }
.footer-contacts a:focus-visible { outline: 2px solid var(--acc); outline-offset: 4px; }
.footer-registry { font-size: 12px; color: rgba(237,234,228,.68); }
.footer-source { font-size: 11px; color: rgba(237,234,228,.5); }

.media-frame {
  display: block;
  overflow: hidden;
  border: 1px solid rgba(237,234,228,.16);
  background: #0B1016;
  cursor: zoom-in;
}

.media-frame:focus-visible {
  outline: 2px solid var(--acc);
  outline-offset: 4px;
}

.media-wide { aspect-ratio: 16 / 10; }
.media-detail { aspect-ratio: 4 / 3; }
.media-phone { aspect-ratio: 1 / 2; }

.media-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.portfolio-media figcaption {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding-top: 9px;
  font-size: 11px;
  line-height: 1.5;
  color: rgba(237,234,228,.7);
}

.portfolio-media figcaption span {
  color: rgba(237,234,228,.45);
  font-size: 10px;
}

.portrait-frame {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border: 1px solid rgba(237,234,228,.14);
}

.portrait-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 70%;
}

.work-visual > div > .portfolio-media {
  flex: 1 1 0 !important;
}

@media (min-width: 1081px) and (min-height: 801px) {
  .work-visual .media-wide {
    height: min(38vh, 380px);
    aspect-ratio: auto;
  }

  .work-visual .media-detail {
    height: min(22vh, 220px);
    aspect-ratio: auto;
  }
}

@media (max-width: 720px) {
  .work-visual > div > .portfolio-media {
    flex-basis: 100% !important;
  }

  .media-phone {
    max-width: 320px;
    margin-inline: auto;
  }
}

.product-interlude {
  min-height: 0;
  display: block;
}

.process-story,
.about-story,
.contact-story {
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.product-interlude,
.process-story,
.about-story {
  padding-block: clamp(64px, 6vw, 96px) !important;
}

/* One page container and the same column start across every two-column section. */
.contact-story {
  padding-block: clamp(56px, 5vw, 80px) !important;
}

.section-columns,
.section-heading {
  display: grid !important;
  grid-template-columns: var(--section-columns);
  gap: var(--section-gap) !important;
  width: 100%;
  min-width: 0;
}

.section-columns > *,
.section-heading > * {
  min-width: 0 !important;
}

.work-layout > div,
.about-layout > div {
  max-width: none !important;
}

.about-layout,
.contact-layout {
  align-items: center !important;
}

.about-layout .portrait-frame {
  width: 100%;
  max-width: 400px;
}

.about-layout > div:last-child > p { max-width: 46ch !important; }
.contact-layout > div:last-child {
  width: 100%;
  max-width: 340px;
  justify-self: end;
}

.cooperation-block {
  position: relative;
  z-index: 10;
  padding: clamp(64px, 6vw, 96px) var(--page-gutter);
  border-top: 1px solid rgba(237,234,228,.09);
}

.cooperation-block h2 {
  margin: 0;
  font-size: clamp(30px, 3.4vw, 52px);
  font-weight: 500;
  line-height: 1.03;
  letter-spacing: -.03em;
}

.cooperation-intro {
  max-width: 38ch;
  margin: 24px 0 0;
  color: rgba(237,234,228,.66);
  font-size: 16px;
  font-weight: 300;
  line-height: 1.6;
}

.cooperation-terms { margin: 0; }
.cooperation-terms > div {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 24px;
  padding: 20px 0;
  border-bottom: 1px solid rgba(237,234,228,.11);
  font-size: 16px;
  line-height: 1.55;
}
.cooperation-terms > div:first-child { padding-top: 0; }
.cooperation-terms dt { font-weight: 500; }
.cooperation-terms dd { margin: 0; color: rgba(237,234,228,.72); font-weight: 300; }

.product-kicker {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-bottom: 40px;
  color: var(--acc2);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.product-status { padding: 7px 12px; border: 1px solid rgba(232,132,60,.4); }
.product-copy h2 {
  margin: 0;
  font-size: clamp(32px, 3.8vw, 56px);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -.03em;
}
.product-subtitle { margin: 16px 0 0; font-size: 17px; line-height: 1.5; color: rgba(237,234,228,.8); max-width: 38ch; }
.product-description { margin: 24px 0 0; font-size: 16px; line-height: 1.6; color: rgba(237,234,228,.66); max-width: 46ch; }
.product-benefits { margin-top: 32px; }
.product-benefits > div { border-top: 1px solid rgba(237,234,228,.11); padding: 16px 0; }
.product-benefits h3 { margin: 0; font-size: 11px; font-weight: 500; letter-spacing: .06em; color: rgba(237,234,228,.5); text-transform: uppercase; }
.product-benefits p { margin: 8px 0 0; font-size: 14px; line-height: 1.5; color: rgba(237,234,228,.7); }
.product-gallery {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  align-items: start;
  gap: 14px;
}

.site-header > div {
  flex-wrap: wrap;
  gap: 6px 14px !important;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.02em;
}
.site-brand:focus-visible { outline: 2px solid var(--acc); outline-offset: 5px; }

.site-header > div > span:last-child {
  font-size: 12px !important;
  letter-spacing: .02em !important;
}

.build-row h3 {
  text-wrap: balance;
}

.build-row {
  display: grid !important;
  grid-template-columns: var(--section-columns);
  gap: var(--section-gap) !important;
}
.build-row > div:first-child { grid-column: 1; grid-row: 1; width: auto !important; }
.build-row h3 { grid-column: 1; grid-row: 1; padding-left: 48px; }
.build-row > div:last-child { grid-column: 2; grid-row: 1; max-width: 50ch !important; }

.build-row > div:last-child > div {
  font-size: 12px !important;
  letter-spacing: 0 !important;
  line-height: 1.5;
}

.system-outputs > div {
  min-width: 0;
  overflow-wrap: anywhere;
}

.system-map > div:nth-last-of-type(2) {
  gap: 8px 18px !important;
  letter-spacing: .02em !important;
}

.process-story > *,
.about-story > *,
.contact-story > *,
.product-interlude > * {
  width: 100%;
}

.process-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.about-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

a {
  color: #EDEAE4;
  text-decoration: none;
}

a:hover {
  color: var(--acc, #46D5E8);
}

::selection {
  background: var(--acc, #46D5E8);
  color: #0A0B0C;
}

@keyframes flow {
  0% { transform: translateY(-100%); opacity: 0; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { transform: translateY(400%); opacity: 0; }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: .25; }
}

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(237,234,228,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(237,234,228,.035) 1px, transparent 1px);
  background-size: 96px 96px;
  mask-image: radial-gradient(120% 80% at 50% 0%, #000 20%, transparent 90%);
}

.nav-link:hover {
  color: #EDEAE4;
}

.nav-cta:hover {
  border-color: var(--acc, #46D5E8);
  color: var(--acc, #46D5E8);
}

.btn-primary:hover {
  background: var(--acc, #46D5E8);
  transform: translateY(-2px);
}

.btn-secondary:hover {
  border-color: rgba(237,234,228,.5);
  color: #EDEAE4;
}

.build-row:hover {
  border-color: rgba(70,213,232,.3) !important;
}

.process-cell:hover {
  background: #0E1012;
}

.contact-cta:hover {
  background: var(--acc, #46D5E8);
  transform: translateY(-2px);
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 1px;
  width: 0%;
  background: var(--acc, #46D5E8);
  z-index: 99;
  transition: width .12s linear;
  pointer-events: none;
}

.reveal {
  opacity: 0;
  transform: translate3d(0, 22px, 0);
  will-change: opacity, transform;
  transition: opacity .65s cubic-bezier(.16,.84,.28,1), transform .75s cubic-bezier(.16,.84,.28,1);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
  filter: none;
}

@media (min-width: 1081px) and (min-height: 801px) {
  .work-visual {
    position: sticky;
    top: clamp(92px, 14vh, 144px);
  }
}

@media (min-width: 1081px) and (max-height: 800px) {
  .build-story {
    padding-top: 72px !important;
    padding-bottom: 68px !important;
  }

  .build-story .scene-stage > .reveal:first-child {
    margin-bottom: 40px !important;
  }

  .build-story .build-row {
    padding-top: 26px !important;
    padding-bottom: 26px !important;
  }

  .work-story {
    padding-top: 76px !important;
    padding-bottom: 72px !important;
  }

  .work-story > .reveal:first-child {
    margin-bottom: 40px !important;
  }

}

@media (min-width: 1081px) and (max-width: 1280px) {
  .hero-title { font-size: clamp(40px, 3.5vw, 48px) !important; }
}

@media (max-width: 1080px) {
  .section-columns,
  .section-heading,
  .build-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .build-row > div:last-child { grid-column: 1; grid-row: 2; }

  .about-layout .portrait-frame { max-width: 360px; }

  .contact-layout > div:last-child { justify-self: start; }

  .scene-rail {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr !important;
    min-height: 0;
  }

  .hero-copy {
    max-width: 720px !important;
    --copy-shift: 0px;
  }

  .system-map {
    max-width: 760px;
    --map-shift: 0px;
    --map-scale: 1;
  }

  .work-visual {
    position: relative;
    top: auto;
  }

  .case-shot {
    opacity: 1;
    filter: none;
    transform: none;
  }

  .product-interlude,
  .process-story,
  .about-story,
  .contact-story {
    min-height: 0;
  }

  .process-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 720px) {
  :root {
    --page-gutter: 20px;
  }

  .site-header {
    padding-top: 20px !important;
    padding-bottom: 20px !important;
  }

  .site-header nav {
    gap: 18px !important;
  }

  .site-header .nav-link {
    display: none;
  }

  .hero {
    gap: 48px !important;
    padding-top: 56px !important;
    padding-bottom: 64px !important;
  }

  .hero-title {
    font-size: clamp(36px, 11vw, 50px) !important;
  }

  .hero-line {
    white-space: normal;
  }

  .hero-capabilities > div {
    flex-basis: 100% !important;
    padding-left: 0 !important;
    border-left: 0 !important;
  }

  .system-map {
    padding: 20px 18px 18px !important;
  }

  .system-map .system-outputs {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .about-story .portrait-frame {
    max-width: 340px;
  }

  .contact-story > div > div:last-child {
    width: 100%;
    max-width: 360px;
  }

  .build-row {
    gap: 20px !important;
  }

  .build-row h3,
  .build-row > div:last-child {
    min-width: 0;
    flex-basis: 100% !important;
  }

  .product-gallery { grid-template-columns: minmax(0, 1fr); gap: 28px; }

  .cooperation-terms > div { grid-template-columns: minmax(0, 1fr); gap: 8px; }

  .work-layout > div,
  .product-interlude > div > div {
    min-width: 0 !important;
    max-width: 100%;
  }

  .process-grid,
  .about-grid {
    grid-template-columns: 1fr !important;
  }
}

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

  .hero-copy,
  .system-map,
  .parallax {
    transform: none !important;
  }

  .work-visual {
    position: relative;
    top: auto;
  }

  .case-step.is-visible,
  .case-shot {
    opacity: 1;
    transform: none;
    filter: none;
  }
}
