:root {
  --bg: #05070a;
  --panel: rgba(10, 17, 22, 0.78);
  --panel-solid: #0c1217;
  --ink: #f4f8fb;
  --muted: #8b98a2;
  --line: rgba(150, 232, 255, 0.16);
  --cyan: #78e6ff;
  --green: #a8ffd6;
  --paper: #f2f4f2;
  --dark-text: #101214;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family:
    "Inter", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", Arial,
    sans-serif;
}

body.is-gated {
  overflow: hidden;
}

body.lightbox-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
  user-select: none;
  -webkit-user-drag: none;
}

.intro-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 26px;
  min-height: 100svh;
  padding: 32px;
  background:
    radial-gradient(circle at 50% 44%, rgba(120, 230, 255, 0.2), transparent 28%),
    radial-gradient(circle at 72% 16%, rgba(168, 255, 214, 0.12), transparent 24%),
    linear-gradient(145deg, #020304 0%, #081017 58%, #020304 100%);
  cursor: pointer;
}

.intro-gate::before,
.scan-grid {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(120, 230, 255, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 230, 255, 0.09) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(circle at center, black, transparent 76%);
  pointer-events: none;
}

.intro-gate::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent, rgba(120, 230, 255, 0.08), transparent);
  animation: scan 4s linear infinite;
}

.intro-gate.is-hidden,
body:not(.is-gated) .intro-gate {
  display: none;
}

.gate-core {
  position: relative;
  display: grid;
  width: min(420px, 72vw);
  place-items: center;
  animation: float-logo 4.2s ease-in-out infinite;
}

.gate-core img {
  position: relative;
  z-index: 1;
  width: min(360px, 68vw);
  filter: invert(1) drop-shadow(0 0 30px rgba(120, 230, 255, 0.34));
}

.gate-prompt {
  position: relative;
  z-index: 1;
  color: rgba(244, 248, 251, 0.58);
  font-size: 12px;
}

@keyframes float-logo {
  0%,
  100% {
    transform: translate3d(0, -10px, 0);
  }

  50% {
    transform: translate3d(0, 10px, 0);
  }
}

@keyframes scan {
  from {
    transform: translateY(-100%);
  }

  to {
    transform: translateY(100%);
  }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  align-items: center;
  min-height: 68px;
  padding: 0 clamp(18px, 3vw, 44px);
  background: rgba(5, 7, 10, 0.76);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(20px);
}

.brand {
  display: inline-flex;
  width: fit-content;
}

.brand img {
  width: auto;
  height: clamp(38px, 3.2vw, 48px);
  filter: invert(1);
}

.nav-cluster {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2vw, 28px);
}

nav {
  display: flex;
  gap: clamp(16px, 3vw, 38px);
  color: rgba(244, 248, 251, 0.72);
  font-size: 12px;
}

nav a:hover {
  color: var(--cyan);
}

.language-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: rgba(244, 248, 251, 0.08);
  border: 1px solid rgba(244, 248, 251, 0.12);
}

.language-switch button {
  min-width: 44px;
  min-height: 28px;
  padding: 0 10px;
  color: rgba(244, 248, 251, 0.62);
  background: transparent;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
}

.language-switch button:hover,
.language-switch button:focus-visible {
  color: var(--ink);
  outline: none;
}

.language-switch button.is-active {
  color: #071014;
  background: var(--cyan);
}

.protocol-hero {
  position: relative;
  min-height: calc(100svh - 68px);
  overflow: hidden;
  padding: clamp(58px, 7vw, 96px) clamp(18px, 4vw, 62px) clamp(44px, 6vw, 72px);
  background: var(--bg);
}

.hero-bg,
.hero-shade {
  position: absolute;
  inset: 0;
}

.hero-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: none;
}

.hero-shade {
  background:
    linear-gradient(90deg, rgba(5, 7, 10, 0.36), rgba(5, 7, 10, 0.08) 34%, rgba(5, 7, 10, 0) 58%),
    linear-gradient(0deg, rgba(5, 7, 10, 0.2), rgba(5, 7, 10, 0) 42%);
}

.scan-grid {
  opacity: 0.52;
}

.hero-statement {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: center;
  min-height: calc(100svh - 220px);
  max-width: min(560px, 42vw);
  padding-left: clamp(8px, 2vw, 28px);
}

.hero-statement .label {
  color: rgba(244, 248, 251, 0.7);
}

.label {
  margin: 0 0 18px;
  color: var(--cyan);
  font-family: Consolas, "SFMono-Regular", "Roboto Mono", monospace;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  color: #f7fbfd;
  font-size: clamp(34px, 4.7vw, 76px);
  font-weight: 480;
  line-height: 1.05;
  letter-spacing: 0;
  text-shadow: 0 18px 42px rgba(0, 0, 0, 0.48);
}

.system-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #070b0f;
}

.system-strip div {
  min-height: 132px;
  padding: 26px clamp(18px, 3vw, 44px);
  border-right: 1px solid var(--line);
}

.system-strip div:last-child {
  border-right: 0;
}

.system-strip span {
  display: block;
  color: var(--muted);
  font-family: Consolas, "SFMono-Regular", "Roboto Mono", monospace;
  font-size: 12px;
}

.system-strip strong {
  display: block;
  margin-top: 20px;
  color: var(--ink);
  font-size: clamp(28px, 4vw, 54px);
  font-weight: 520;
  line-height: 1;
}

.works {
  padding: clamp(72px, 9vw, 128px) clamp(18px, 4vw, 62px);
  background: var(--paper);
  color: var(--dark-text);
}

.section-head {
  display: grid;
  grid-template-columns: minmax(160px, 0.32fr) minmax(0, 1fr);
  gap: 26px;
  align-items: end;
  margin-bottom: 34px;
}

.works .label,
.contact .label {
  color: #4b5960;
}

.section-head h2,
.office h2,
.contact h2 {
  margin: 0;
  font-size: clamp(36px, 5.4vw, 78px);
  font-weight: 520;
  line-height: 1.04;
  letter-spacing: 0;
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 28px);
}

.work-card {
  min-width: 0;
  border-top: 1px solid rgba(16, 18, 20, 0.18);
}

.work-card.primary {
  grid-column: span 2;
}

.work-card figure {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  margin: 18px 0 16px;
  overflow: hidden;
  background: #d5d9d8;
}

.work-card figure::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.work-card.primary figure {
  aspect-ratio: 16 / 10;
}

.project-open {
  display: block;
  width: 100%;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  cursor: zoom-in;
  font: inherit;
  text-align: left;
}

.work-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 520ms ease;
  pointer-events: none;
}

.project-open:hover img,
.project-open:focus-visible img {
  transform: scale(1.2);
}

.project-open:focus-visible {
  outline: 1px solid #0f7f9a;
  outline-offset: 4px;
}

.tone-a,
.tone-b,
.tone-c {
  background-size: cover;
}

.tone-a {
  background-image:
    linear-gradient(112deg, rgba(120, 230, 255, 0.16), transparent),
    repeating-linear-gradient(90deg, rgba(16, 18, 20, 0.12) 0 1px, transparent 1px 34px),
    linear-gradient(140deg, #dce1df 0 34%, #aeb8b6 35% 56%, #40484a 57% 100%);
}

.tone-b {
  background-image:
    radial-gradient(circle at 24% 24%, rgba(120, 230, 255, 0.22), transparent 18%),
    linear-gradient(138deg, #c2cbc8, #eef0ed 48%, #697171);
}

.tone-c {
  background-image:
    linear-gradient(90deg, rgba(120, 230, 255, 0.18), transparent),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.28) 0 1px, transparent 1px 28px),
    linear-gradient(145deg, #12181b, #5c6a6c 54%, #dce0dc);
}

.work-card span {
  color: #607079;
  font-family: Consolas, "SFMono-Regular", "Roboto Mono", monospace;
  font-size: 12px;
}

.work-card h3 {
  margin: 10px 0 8px;
  font-size: clamp(20px, 2vw, 30px);
  font-weight: 520;
  line-height: 1.15;
}

.work-card p {
  margin: 0;
  color: #697178;
  font-size: 14px;
}

.office {
  padding: clamp(76px, 10vw, 142px) clamp(18px, 4vw, 62px);
  background:
    linear-gradient(90deg, rgba(120, 230, 255, 0.08), transparent 42%),
    #0b1116;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.office h2 {
  max-width: 960px;
}

.office p:last-child {
  max-width: 760px;
  margin: 30px 0 0;
  color: rgba(244, 248, 251, 0.64);
  font-size: clamp(16px, 1.8vw, 21px);
  line-height: 1.85;
}

.contact {
  min-height: 56svh;
  display: grid;
  align-content: center;
  padding: clamp(72px, 9vw, 128px) clamp(18px, 4vw, 62px);
  background: var(--paper);
  color: var(--dark-text);
}

.contact h2 {
  max-width: 900px;
}

.contact a {
  width: fit-content;
  margin-top: 34px;
  padding-bottom: 7px;
  border-bottom: 1px solid currentColor;
  font-size: clamp(18px, 2vw, 26px);
}

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px clamp(18px, 4vw, 62px);
  border-top: 1px solid var(--line);
  color: rgba(244, 248, 251, 0.56);
  background: #05070a;
  font-size: 13px;
}

footer img {
  width: 148px;
  filter: invert(1);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 72px 82px 54px;
  background:
    radial-gradient(circle at 50% 18%, rgba(120, 230, 255, 0.12), transparent 34%),
    rgba(1, 3, 5, 0.95);
}

.lightbox.is-open {
  display: flex;
}

.lightbox-stage {
  position: relative;
  display: grid;
  gap: 18px;
  width: 100%;
  height: 100%;
  margin: 0;
  place-items: center;
}

.lightbox-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.lightbox-stage img {
  max-width: 100%;
  max-height: calc(100svh - 150px);
  object-fit: contain;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
  pointer-events: none;
}

.lightbox-stage figcaption {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: 18px;
  width: min(980px, 100%);
  color: rgba(244, 248, 251, 0.76);
  font-size: 13px;
  text-align: center;
}

.lightbox-stage figcaption span {
  color: var(--cyan);
  font-family: Consolas, "SFMono-Regular", "Roboto Mono", monospace;
}

.lightbox-stage figcaption strong {
  font-weight: 500;
}

.lightbox button {
  position: absolute;
  z-index: 4;
  min-width: 48px;
  min-height: 42px;
  color: rgba(244, 248, 251, 0.82);
  background: rgba(8, 14, 18, 0.8);
  border: 1px solid rgba(120, 230, 255, 0.24);
  cursor: pointer;
  font-family: Consolas, "SFMono-Regular", "Roboto Mono", monospace;
  font-size: 12px;
}

.lightbox button:hover,
.lightbox button:focus-visible {
  color: var(--cyan);
  border-color: rgba(120, 230, 255, 0.6);
  outline: none;
}

.lightbox-close {
  top: 22px;
  right: 24px;
  padding: 0 16px;
}

.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
}

.lightbox-nav.prev {
  left: 24px;
}

.lightbox-nav.next {
  right: 24px;
}

@media (max-width: 980px) {
  .hero-statement {
    max-width: min(540px, 58vw);
  }

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

  .system-strip {
    grid-template-columns: 1fr;
  }

  .system-strip div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .system-strip div:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 680px) {
  .site-header {
    grid-template-columns: 1fr;
    gap: 12px;
    padding-block: 14px;
  }

  .nav-cluster {
    width: 100%;
    justify-content: space-between;
    gap: 12px;
  }

  nav {
    flex: 1;
    justify-content: flex-start;
    gap: 12px;
    overflow-x: auto;
  }

  .brand img {
    height: 40px;
  }

  .protocol-hero {
    min-height: calc(100svh - 116px);
    padding-top: 54px;
  }

  .hero-bg {
    object-position: 58% center;
  }

  .hero-shade {
    background:
      linear-gradient(90deg, rgba(5, 7, 10, 0.62), rgba(5, 7, 10, 0.16) 54%, rgba(5, 7, 10, 0) 82%),
      linear-gradient(0deg, rgba(5, 7, 10, 0.36), rgba(5, 7, 10, 0) 48%);
  }

  .hero-statement {
    min-height: calc(100svh - 250px);
    max-width: min(430px, 76vw);
    padding-left: 0;
  }

  h1 {
    font-size: clamp(31px, 10vw, 48px);
  }

  .section-head,
  .work-grid {
    grid-template-columns: 1fr;
  }

  .work-card.primary {
    grid-column: auto;
  }

  .agent-flow li {
    grid-template-columns: 34px 1fr;
  }

  footer {
    display: grid;
  }

  .lightbox {
    padding: 68px 18px 44px;
  }

  .lightbox-stage img {
    max-height: calc(100svh - 170px);
  }

  .lightbox-stage figcaption {
    display: grid;
    gap: 8px;
  }

  .lightbox-nav {
    top: auto;
    bottom: 14px;
    transform: none;
  }

  .lightbox-nav.prev {
    left: 18px;
  }

  .lightbox-nav.next {
    right: 18px;
  }
}
