:root {
  color-scheme: dark;
  --ink: #090d16;
  --surface: #0d1320;
  --surface-strong: #111a2a;
  --paper: #f4f7fb;
  --muted: #9aa7b9;
  --line: rgba(244, 247, 251, 0.16);
  --line-strong: rgba(244, 247, 251, 0.34);
  --accent: #2f70ff;
  --accent-soft: rgba(47, 112, 255, 0.16);
  --max-width: 1440px;
  --gutter: clamp(1.25rem, 4vw, 4.5rem);
  --section-space: clamp(6rem, 12vw, 11rem);
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

body {
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    var(--ink);
  background-size: 48px 48px;
  color: var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

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

button {
  color: inherit;
  font: inherit;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.7rem 1rem;
  background: var(--paper);
  color: var(--ink);
  transform: translateY(-150%);
  transition: transform 160ms ease;
}

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

.mono {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.site-header {
  position: fixed;
  z-index: 50;
  top: 0;
  left: 0;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  padding: 1rem var(--gutter);
  border-bottom: 1px solid transparent;
  background: linear-gradient(to bottom, rgba(9, 13, 22, 0.92), transparent);
  transition: background 180ms ease, border-color 180ms ease;
}

.site-header.is-scrolled,
.site-header.is-open {
  border-color: var(--line);
  background: rgba(9, 13, 22, 0.94);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.9rem;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.brand-mark {
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  border: 1px solid var(--line-strong);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: -0.08em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(1.1rem, 2.8vw, 2.75rem);
  font-size: 0.875rem;
}

.site-nav a {
  color: var(--muted);
  transition: color 160ms ease;
}

.site-nav a:hover {
  color: var(--paper);
}

.language-toggle {
  min-width: 2.7rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--line-strong);
  background: transparent;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.875rem;
}

.language-toggle:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.menu-toggle {
  display: none;
}

.hero,
.section,
.site-footer {
  width: min(100%, var(--max-width));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.hero {
  position: relative;
  display: flex;
  min-height: 100svh;
  flex-direction: column;
  justify-content: center;
  padding-top: 8rem;
  padding-bottom: 3rem;
}

.hero::after {
  position: absolute;
  top: 16%;
  right: -9%;
  width: clamp(16rem, 34vw, 36rem);
  aspect-ratio: 1;
  border: 1px solid rgba(47, 112, 255, 0.18);
  border-radius: 50%;
  box-shadow: inset 0 0 8rem rgba(47, 112, 255, 0.07);
  content: "";
  pointer-events: none;
}

.hero-kicker {
  display: flex;
  gap: 0.7rem;
  color: #b9c5d6;
}

.hero-kicker span:first-child {
  color: var(--accent);
}

.hero-title {
  position: relative;
  z-index: 1;
  max-width: 13ch;
  margin: clamp(2rem, 5vh, 4rem) 0;
  font-size: clamp(3.4rem, 8.7vw, 8.9rem);
  font-weight: 650;
  letter-spacing: -0.075em;
  line-height: 1.08;
  white-space: pre-line;
}

[lang="en"] .hero-title {
  max-width: 11ch;
  font-size: clamp(3.25rem, 8.5vw, 8.5rem);
}

.hero-lower {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 31rem);
  gap: 3rem;
  align-items: end;
}

.hero-copy {
  grid-column: 2;
  margin: 0;
  color: #c3ccda;
  font-size: clamp(1rem, 1.4vw, 1.25rem);
}

.hero-actions {
  display: flex;
  grid-column: 2;
  align-items: center;
  gap: 1.5rem;
  margin-top: 0.25rem;
}

.button {
  display: inline-flex;
  min-height: 3.25rem;
  align-items: center;
  justify-content: space-between;
  gap: 2.5rem;
  padding: 0.8rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.button-primary {
  background: var(--paper);
  color: var(--ink);
  transition: background 160ms ease, color 160ms ease;
}

.button-primary:hover {
  background: var(--accent);
  color: white;
}

.text-link {
  border-bottom: 1px solid var(--line-strong);
  font-size: 0.875rem;
}

.text-link:hover {
  border-color: var(--accent);
}

.hero-signal {
  display: flex;
  margin-top: auto;
  padding-top: clamp(3rem, 9vh, 6rem);
  align-items: center;
  color: #6f7c90;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
}

.hero-signal i {
  width: clamp(2rem, 8vw, 7rem);
  height: 1px;
  margin-inline: 0.7rem;
  background: linear-gradient(90deg, var(--line-strong), var(--accent));
}

.section {
  padding-top: var(--section-space);
  padding-bottom: var(--section-space);
  border-top: 1px solid var(--line);
}

.section-index {
  color: #6f7c90;
}

.statement {
  display: grid;
  grid-template-columns: minmax(10rem, 0.35fr) minmax(0, 1fr);
  gap: 3rem;
}

.statement-body h2,
.approach-intro h2,
.about-grid h2,
.collaborate h2 {
  margin: 0;
  font-size: clamp(2.6rem, 6vw, 6.25rem);
  font-weight: 560;
  letter-spacing: -0.065em;
  line-height: 1.08;
  white-space: pre-line;
}

.statement-body p {
  max-width: 38rem;
  margin: 4rem 0 0 auto;
  color: var(--muted);
  font-size: clamp(1rem, 1.5vw, 1.2rem);
}

.section-heading {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 3rem;
  align-items: end;
  margin-bottom: clamp(3rem, 7vw, 6rem);
}

.section-heading h2 {
  margin: 1.2rem 0 0;
  font-size: clamp(3.2rem, 7.5vw, 7.75rem);
  font-weight: 590;
  letter-spacing: -0.075em;
  line-height: 0.95;
}

.section-heading > p {
  max-width: 30rem;
  margin: 0;
  color: var(--muted);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 2rem;
}

.filter-button {
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.875rem;
}

.filter-button:hover,
.filter-button.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--paper);
}

.project-list {
  border-top: 1px solid var(--line-strong);
}

.project-item {
  display: grid;
  grid-template-columns: 6rem minmax(10rem, 0.45fr) minmax(0, 1fr) auto;
  gap: clamp(1rem, 3vw, 3rem);
  padding: 2.75rem 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}

.project-number,
.project-category {
  color: #758297;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project-title {
  margin: 0 0 0.55rem;
  font-size: clamp(1.6rem, 2.7vw, 2.65rem);
  font-weight: 570;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.project-summary {
  margin: 0;
  color: #c7d0de;
}

.project-description {
  max-width: 42rem;
  margin: 0 0 1.5rem;
  color: var(--muted);
}

.technology-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.technology-list li {
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--line);
  color: #aeb9c9;
  font-family: var(--mono);
  font-size: 0.875rem;
}

.project-link {
  display: inline-flex;
  min-width: 4.5rem;
  min-height: 3rem;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  color: var(--paper);
  padding-inline: 0.8rem;
  font-size: 0.875rem;
  transition: border-color 160ms ease, background 160ms ease;
}

.project-access {
  display: block;
  margin-top: 1rem;
  color: #8794a8;
  font-size: 0.875rem;
}

.project-link:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.empty-state,
.loading-state {
  display: grid;
  min-height: 18rem;
  place-items: center;
  padding: 3rem;
  text-align: center;
}

.empty-state h3 {
  margin: 0 0 0.7rem;
  font-size: clamp(1.6rem, 3vw, 2.6rem);
  font-weight: 520;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
}

.portfolio-note,
.noscript-note {
  margin: 1.25rem 0 0;
  color: #8794a8;
  font-size: 0.875rem;
}

.approach-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(16rem, 28rem);
  gap: 4rem;
  align-items: end;
  margin-top: 2rem;
}

.approach-intro p {
  margin: 0;
  color: var(--muted);
}

.process-list {
  margin: clamp(4rem, 8vw, 8rem) 0;
  padding: 0;
  list-style: none;
}

.process-list li {
  display: grid;
  grid-template-columns: 6rem 0.65fr 1fr;
  gap: 2rem;
  padding: 2.25rem 0;
  border-top: 1px solid var(--line);
  align-items: baseline;
}

.process-list li:last-child {
  border-bottom: 1px solid var(--line);
}

.process-list h3 {
  margin: 0;
  font-size: clamp(1.4rem, 2.6vw, 2.3rem);
  font-weight: 520;
}

.process-list p {
  max-width: 34rem;
  margin: 0;
  color: var(--muted);
}

.process-number {
  color: var(--accent);
}

.architecture {
  display: grid;
  grid-template-columns: 0.36fr minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 6rem);
  padding: clamp(2rem, 5vw, 4.5rem);
  background: var(--surface);
  align-items: center;
}

.architecture-copy > .mono {
  margin: 0 0 1.5rem;
  color: var(--accent);
}

.architecture-copy h3 {
  margin: 0 0 1.5rem;
  font-size: clamp(1.75rem, 3vw, 3rem);
  font-weight: 530;
  letter-spacing: -0.045em;
  line-height: 1.1;
}

.architecture-copy > p:last-child {
  margin: 0;
  color: var(--muted);
}

.architecture-flow {
  min-width: 0;
}

.architecture-flow ol {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.architecture-flow li {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 10rem;
  flex-direction: column;
  justify-content: center;
  padding: 1.1rem;
  border: 1px solid var(--line-strong);
  border-left: 0;
}

.architecture-flow li:first-child {
  border-left: 1px solid var(--line-strong);
}

.architecture-flow li:not(:last-child)::after {
  position: absolute;
  z-index: 2;
  top: 50%;
  right: -0.32rem;
  width: 0.62rem;
  height: 0.62rem;
  border-top: 1px solid var(--accent);
  border-right: 1px solid var(--accent);
  background: var(--surface);
  content: "";
  transform: translateY(-50%) rotate(45deg);
}

.architecture-flow .flow-accent {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.flow-id {
  margin-bottom: 1.4rem;
  color: #7e8ba0;
  font-family: var(--mono);
  font-size: 0.75rem;
}

.architecture-flow strong {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.25;
}

.architecture-flow small {
  margin-top: 0.45rem;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.35;
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 0.75fr);
  gap: clamp(3rem, 8vw, 8rem);
  margin-top: 2rem;
}

.about-copy {
  padding-top: 1rem;
}

.about-lead {
  margin: 0 0 1.5rem;
  color: var(--paper);
  font-size: clamp(1.25rem, 2vw, 1.65rem);
}

.about-copy > p:not(.about-lead) {
  color: var(--muted);
}

.company-facts {
  margin: 3.5rem 0 0;
}

.company-facts div {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  gap: 1rem;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
}

.company-facts div:last-child {
  border-bottom: 1px solid var(--line);
}

.company-facts dt {
  color: #758297;
  font-size: 0.875rem;
}

.company-facts dd {
  margin: 0;
}

.company-facts a {
  border-bottom: 1px solid var(--line-strong);
}

.collaborate {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 0.65fr);
  gap: clamp(3rem, 7vw, 7rem);
  align-items: end;
}

.collaborate h2 {
  max-width: 11ch;
  margin-top: 2rem;
}

.collaborate-copy > p {
  max-width: 34rem;
  margin: 2rem 0 0;
  color: var(--muted);
}

.collaborate-link {
  display: flex;
  min-height: 13rem;
  align-items: flex-end;
  justify-content: space-between;
  padding: 1.5rem;
  background: var(--accent);
  color: white;
  transition: background 160ms ease, transform 160ms ease;
}

.collaborate-link:hover {
  background: #1d5fea;
  transform: translateY(-4px);
}

.collaborate-arrow {
  font-size: 3rem;
  line-height: 1;
}

.site-footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 2rem;
  align-items: center;
  padding-top: 2.5rem;
  padding-bottom: 2.5rem;
  border-top: 1px solid var(--line);
  color: #7f8ba0;
  font-size: 0.75rem;
}

.site-footer .brand {
  color: var(--paper);
}

.site-footer > a:last-child {
  justify-self: end;
}

.reveal {
  animation: reveal 700ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

.hero-title.reveal {
  animation-delay: 80ms;
}

.hero-lower.reveal {
  animation-delay: 160ms;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    font-size: 0.875rem;
  }

  .menu-glyph,
  .menu-glyph::after {
    display: block;
    width: 1.2rem;
    height: 1px;
    background: currentColor;
    content: "";
    transition: transform 160ms ease;
  }

  .menu-glyph::after {
    transform: translateY(5px);
  }

  .menu-toggle[aria-expanded="true"] .menu-glyph {
    transform: rotate(45deg);
  }

  .menu-toggle[aria-expanded="true"] .menu-glyph::after {
    transform: rotate(-90deg);
  }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    display: none;
    width: 100%;
    align-items: stretch;
    flex-direction: column;
    gap: 0;
    padding: 1rem var(--gutter) 2rem;
    border-bottom: 1px solid var(--line);
    background: rgba(9, 13, 22, 0.98);
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a {
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--line);
  }

  .language-toggle {
    width: max-content;
    margin-top: 1rem;
  }

  .hero-lower,
  .section-heading,
  .approach-intro,
  .about-grid,
  .collaborate,
  .architecture {
    grid-template-columns: 1fr;
  }

  .hero-copy,
  .hero-actions {
    grid-column: 1;
  }

  .hero-lower {
    gap: 1.5rem;
  }

  .statement {
    grid-template-columns: 1fr;
  }

  .project-item {
    grid-template-columns: 4rem minmax(0, 0.5fr) minmax(0, 1fr) auto;
  }

  .process-list li {
    grid-template-columns: 4rem 0.6fr 1fr;
  }

}

@media (max-width: 640px) {
  :root {
    --section-space: 5.5rem;
  }

  .brand-name {
    display: none;
  }

  .site-header {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
  }

  .hero {
    min-height: 46rem;
    padding-top: 7rem;
  }

  .hero::after {
    top: 23%;
    right: -35%;
  }

  .hero-title {
    font-size: clamp(3.05rem, 15vw, 5.4rem);
  }

  [lang="en"] .hero-title {
    font-size: clamp(2.7rem, 13vw, 4.8rem);
  }

  .hero-actions {
    align-items: flex-start;
    flex-direction: column;
    gap: 1rem;
  }

  .statement-body h2,
  .approach-intro h2,
  .about-grid h2,
  .collaborate h2 {
    font-size: clamp(2.35rem, 11vw, 4rem);
  }

  .statement-body p {
    margin-top: 2rem;
  }

  .section-heading {
    gap: 1.5rem;
  }

  .project-item {
    grid-template-columns: 2.5rem minmax(0, 1fr) auto;
    gap: 1rem;
  }

  .project-category {
    grid-column: 2 / -1;
    grid-row: 1;
    margin-top: 0.15rem;
  }

  .project-heading {
    grid-column: 2 / -1;
  }

  .project-content {
    grid-column: 2 / -1;
  }

  .project-link {
    grid-column: 3;
    grid-row: 2;
  }

  .process-list li {
    grid-template-columns: 2.5rem minmax(0, 1fr);
    gap: 1rem;
  }

  .process-list p {
    grid-column: 2;
  }

  .architecture {
    margin-inline: calc(var(--gutter) * -1);
  }

  .architecture-flow ol {
    grid-template-columns: 1fr;
  }

  .architecture-flow li {
    min-height: 7.5rem;
    border-top: 0;
    border-left: 1px solid var(--line-strong);
  }

  .architecture-flow li:first-child {
    border-top: 1px solid var(--line-strong);
  }

  .architecture-flow li:not(:last-child)::after {
    top: auto;
    right: 50%;
    bottom: -0.32rem;
    transform: translateX(50%) rotate(135deg);
  }

  .company-facts div {
    grid-template-columns: 6rem minmax(0, 1fr);
  }

  .site-footer {
    grid-template-columns: 1fr auto;
  }

  .site-footer p {
    grid-column: 1 / -1;
    grid-row: 2;
    margin: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
