:root {
  --ink: #07100d;
  --ink-2: #101713;
  --paper: #eef3ec;
  --paper-strong: #fbfff7;
  --line: #c5d2c7;
  --muted: #66716a;
  --acid: #dfff3f;
  --ember: #ff3f2d;
  --mint: #b6f4c4;
  --forest: #123b2e;
  --charcoal: #222823;
  --shadow: rgba(7, 16, 13, 0.22);
  --font-display: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  --font-latin: "DIN Condensed", "Avenir Next Condensed", "Franklin Gothic Condensed", sans-serif;
  --font-body: "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-body);
  letter-spacing: 0;
}

body::selection {
  color: var(--ink);
  background: var(--acid);
}

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

img {
  display: block;
  max-width: 100%;
}

section {
  scroll-margin-top: 94px;
}

button {
  font: inherit;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 16px;
  z-index: 100;
  transform: translateY(-160%);
  border: 1px solid var(--acid);
  border-radius: 4px;
  color: var(--paper-strong);
  background: var(--ink);
  padding: 10px 14px;
}

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

.site-header {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 76px;
  padding: 18px 40px;
  color: var(--paper-strong);
  background: rgba(7, 16, 13, 0.82);
  border-bottom: 1px solid rgba(244, 240, 232, 0.16);
  backdrop-filter: blur(18px);
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-latin);
  font-size: 1.55rem;
  line-height: 1;
  text-transform: uppercase;
}

.brand-token {
  position: relative;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(223, 255, 63, 0.32);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0)),
    #07100d;
  box-shadow:
    inset 0 0 0 1px rgba(255, 253, 246, 0.08),
    0 10px 26px rgba(0, 0, 0, 0.26);
}

.brand-token::after {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(255, 253, 246, 0.1);
  border-radius: 8px;
  pointer-events: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  object-fit: cover;
  filter: invert(1) grayscale(1) contrast(1.38);
  transform: scale(1.12);
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.primary-nav a {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 13px;
  color: rgba(255, 253, 246, 0.78);
  font-size: 0.92rem;
}

.primary-nav a:hover,
.primary-nav a:focus-visible {
  color: var(--paper-strong);
  border-color: rgba(223, 255, 63, 0.46);
  outline: none;
}

.section-dark {
  color: var(--paper-strong);
  background:
    linear-gradient(90deg, rgba(223, 255, 63, 0.08) 1px, transparent 1px) 0 0 / 56px 56px,
    linear-gradient(0deg, rgba(223, 255, 63, 0.06) 1px, transparent 1px) 0 0 / 56px 56px,
    radial-gradient(circle at 88% 22%, rgba(255, 75, 47, 0.24), transparent 28%),
    linear-gradient(135deg, #07100d 0%, #0b1611 56%, #11251d 100%);
}

.section-light {
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(7, 16, 13, 0.055) 1px, transparent 1px) 0 0 / 42px 42px,
    var(--paper);
}

.section-ink {
  color: var(--paper-strong);
  background:
    linear-gradient(135deg, rgba(223, 255, 63, 0.18) 0 1px, transparent 1px 18px) 0 0 / 18px 18px,
    var(--forest);
}

.hero {
  position: relative;
  min-height: 96vh;
  padding: 128px 40px 28px;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 12px;
  background: repeating-linear-gradient(
    90deg,
    var(--acid) 0 38px,
    var(--ember) 38px 54px,
    transparent 54px 72px
  );
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.72fr);
  gap: 56px;
  align-items: center;
  max-width: 1220px;
  min-height: 68vh;
  margin: 0 auto;
}

.hero-copy {
  max-width: 760px;
  color: var(--paper-strong);
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--ember);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 780;
  line-height: 1.25;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  color: var(--paper-strong);
  font-family: var(--font-latin);
  font-size: 8.7rem;
  font-weight: 800;
  line-height: 0.82;
  text-transform: uppercase;
}

.hero-lede {
  max-width: 620px;
  margin: 28px 0 0;
  color: rgba(255, 253, 246, 0.84);
  font-size: 1.34rem;
  line-height: 1.55;
}

.hero-actions,
.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.hero-actions {
  margin-top: 34px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  border-radius: 6px;
  padding: 13px 18px;
  font-weight: 760;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    color 180ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-2px);
  outline: none;
}

.button-primary {
  color: var(--ink);
  background: var(--acid);
  border: 1px solid var(--acid);
  box-shadow: 0 14px 34px rgba(223, 255, 63, 0.16);
}

.button-primary:hover,
.button-primary:focus-visible {
  background: var(--mint);
  border-color: var(--mint);
}

.button-quiet {
  color: var(--paper-strong);
  border: 1px solid rgba(255, 253, 246, 0.22);
  background: rgba(255, 253, 246, 0.06);
}

.button-outline {
  color: var(--ink);
  border: 1px solid var(--ink);
  background: transparent;
}

.button-outline:hover,
.button-outline:focus-visible {
  color: var(--paper-strong);
  background: var(--ink);
}

.hero-emblem {
  position: relative;
  min-height: 520px;
  border-left: 1px solid rgba(255, 253, 246, 0.16);
  border-bottom: 1px solid rgba(255, 253, 246, 0.16);
  padding: 22px;
}

.hero-emblem::before {
  content: "";
  position: absolute;
  top: 34px;
  right: -14px;
  width: 72%;
  height: 72%;
  background:
    linear-gradient(135deg, transparent 0 24%, rgba(223, 255, 63, 0.88) 24% 27%, transparent 27% 100%),
    repeating-linear-gradient(0deg, rgba(255, 253, 246, 0.16) 0 2px, transparent 2px 18px);
  clip-path: polygon(10% 0, 100% 18%, 86% 100%, 0 80%);
}

.hero-emblem img {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  margin: 38px auto 0;
  filter: grayscale(1) contrast(1.12) drop-shadow(0 26px 48px rgba(0, 0, 0, 0.4));
  mix-blend-mode: screen;
}

.emblem-caption {
  position: absolute;
  z-index: 2;
  right: 0;
  bottom: 32px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  max-width: 310px;
  border: 1px solid rgba(223, 255, 63, 0.46);
  border-radius: 8px;
  padding: 16px;
  background: rgba(7, 16, 13, 0.88);
}

.emblem-caption span {
  color: var(--acid);
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1;
}

.emblem-caption strong {
  line-height: 1.25;
}

.signal-strip {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 12px;
  max-width: 1220px;
  margin: 0 auto 22px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 253, 246, 0.18);
  overflow-x: auto;
  scrollbar-width: none;
}

.signal-strip::-webkit-scrollbar {
  display: none;
}

.signal-strip span {
  flex: 0 0 auto;
  border: 1px solid rgba(255, 253, 246, 0.18);
  border-radius: 999px;
  padding: 9px 12px;
  color: rgba(255, 253, 246, 0.78);
  background: rgba(255, 253, 246, 0.05);
  white-space: nowrap;
}

.projects {
  padding: 96px 40px 110px;
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(280px, 0.54fr);
  gap: 44px;
  align-items: end;
  max-width: 1220px;
  margin: 0 auto;
}

.section-heading .eyebrow {
  grid-column: 1 / -1;
  margin-bottom: -26px;
}

.section-heading h2,
.capability-intro h2,
.open-panel h2,
.contact h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 3.85rem;
  line-height: 1.04;
  font-weight: 800;
}

.section-heading p:not(.eyebrow),
.open-panel p,
.contact-card p {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.65;
}

.project-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 1220px;
  margin: 36px auto 24px;
}

.tab-button {
  min-height: 42px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 9px 15px;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
}

.tab-button:hover,
.tab-button:focus-visible,
.tab-button.is-active {
  color: var(--paper-strong);
  background: var(--ink);
  outline: none;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  max-width: 1220px;
  margin: 0 auto;
}

.project-card {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(7, 16, 13, 0.18);
  border-radius: 8px;
  background: var(--paper-strong);
  box-shadow: 0 22px 60px rgba(7, 16, 13, 0.08);
  transition:
    transform 220ms ease,
    box-shadow 220ms ease,
    opacity 220ms ease;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 28px 70px rgba(7, 16, 13, 0.14);
}

.project-card.is-hidden {
  display: none;
}

.project-preview {
  position: relative;
  aspect-ratio: 16 / 10;
  min-height: 220px;
  border-bottom: 1px solid rgba(7, 16, 13, 0.12);
  background: var(--charcoal);
  overflow: hidden;
}

.project-preview::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(255, 253, 246, 0.22);
  border-radius: 6px;
  pointer-events: none;
}

.project-preview-image {
  background: var(--ink);
}

.project-preview-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.preview-lattice {
  background:
    linear-gradient(135deg, transparent 0 49%, var(--acid) 49% 52%, transparent 52% 100%),
    repeating-linear-gradient(90deg, rgba(255, 253, 246, 0.18) 0 1px, transparent 1px 34px),
    #202820;
}

.preview-lattice span {
  position: absolute;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  border: 18px solid var(--ember);
}

.preview-lattice span:nth-child(1) {
  top: 42px;
  left: 32px;
}

.preview-lattice span:nth-child(2) {
  right: -22px;
  top: 124px;
  border-color: var(--acid);
}

.preview-lattice span:nth-child(3) {
  left: 74px;
  bottom: 48px;
  border-color: var(--mint);
}

.preview-hex {
  background:
    linear-gradient(30deg, transparent 0 38%, rgba(223, 255, 63, 0.9) 38% 40%, transparent 40% 100%),
    linear-gradient(150deg, transparent 0 38%, rgba(255, 75, 47, 0.75) 38% 40%, transparent 40% 100%),
    radial-gradient(circle at 72% 22%, rgba(182, 244, 196, 0.3), transparent 28%),
    #15201a;
}

.preview-hex span {
  position: absolute;
  display: block;
  width: 86px;
  height: 74px;
  clip-path: polygon(24% 0, 76% 0, 100% 50%, 76% 100%, 24% 100%, 0 50%);
  border: 1px solid rgba(255, 253, 246, 0.2);
  background: var(--paper-strong);
  box-shadow: 10px 10px 0 rgba(223, 255, 63, 0.82);
}

.preview-hex span:nth-child(1) {
  top: 44px;
  left: 34px;
}

.preview-hex span:nth-child(2) {
  top: 104px;
  right: 36px;
  background: var(--acid);
  box-shadow: 10px 10px 0 rgba(255, 75, 47, 0.82);
}

.preview-hex span:nth-child(3) {
  left: 68px;
  bottom: 54px;
  background: var(--mint);
  box-shadow: 10px 10px 0 rgba(255, 253, 246, 0.82);
}

.preview-hex span:nth-child(4) {
  right: 66px;
  bottom: 36px;
  width: 42px;
  height: 36px;
  background: var(--ember);
  box-shadow: 0 0 0 11px rgba(255, 75, 47, 0.22);
}

.preview-radar {
  background:
    radial-gradient(circle, transparent 0 34px, rgba(223, 255, 63, 0.75) 35px 38px, transparent 39px 76px, rgba(255, 255, 255, 0.18) 77px 79px, transparent 80px),
    linear-gradient(160deg, #edf6df 0%, #c7ead0 42%, #17231d 43%);
}

.preview-radar span {
  position: absolute;
  display: block;
  height: 4px;
  border-radius: 999px;
  background: var(--ember);
  transform-origin: left center;
}

.preview-radar span:nth-child(1) {
  width: 150px;
  left: 56px;
  top: 66px;
  transform: rotate(18deg);
}

.preview-radar span:nth-child(2) {
  width: 96px;
  left: 86px;
  bottom: 98px;
  background: var(--acid);
  transform: rotate(-28deg);
}

.preview-radar span:nth-child(3) {
  width: 58px;
  right: 32px;
  top: 146px;
  background: var(--paper-strong);
  transform: rotate(90deg);
}

.preview-terminal {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  padding: 44px 24px;
  color: var(--mint);
  background:
    linear-gradient(0deg, rgba(223, 255, 63, 0.12) 1px, transparent 1px) 0 0 / 100% 24px,
    #111713;
  font-family: "SF Mono", "Menlo", monospace;
  font-size: 0.86rem;
}

.preview-terminal span {
  position: relative;
  z-index: 1;
  display: block;
  width: fit-content;
  max-width: 100%;
  border-radius: 4px;
  padding: 7px 9px;
  background: rgba(7, 16, 13, 0.82);
}

.preview-map {
  background:
    linear-gradient(90deg, rgba(255, 253, 246, 0.2) 1px, transparent 1px) 0 0 / 31px 31px,
    linear-gradient(0deg, rgba(255, 253, 246, 0.12) 1px, transparent 1px) 0 0 / 31px 31px,
    #202820;
}

.preview-map span {
  position: absolute;
  width: 88px;
  height: 58px;
  border: 1px solid rgba(255, 253, 246, 0.36);
  border-radius: 6px;
  background: var(--paper-strong);
  box-shadow: 9px 9px 0 var(--acid);
}

.preview-map span:nth-child(1) {
  top: 44px;
  left: 34px;
}

.preview-map span:nth-child(2) {
  top: 116px;
  right: 30px;
  box-shadow: 9px 9px 0 var(--ember);
}

.preview-map span:nth-child(3) {
  bottom: 62px;
  left: 76px;
  box-shadow: 9px 9px 0 var(--mint);
}

.preview-map span:nth-child(4) {
  right: 56px;
  bottom: 32px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--ember);
  box-shadow: 0 0 0 12px rgba(255, 75, 47, 0.24);
}

.project-content {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  min-height: 318px;
  padding: 24px;
}

.project-meta,
.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.project-meta span {
  border: 1px solid rgba(7, 16, 13, 0.18);
  border-radius: 999px;
  padding: 5px 8px;
  color: var(--forest);
  font-size: 0.78rem;
  font-weight: 760;
  background: rgba(182, 244, 196, 0.38);
}

.project-content h3 {
  margin: 0;
  font-family: var(--font-latin);
  font-size: 2.42rem;
  line-height: 0.95;
  text-transform: uppercase;
}

.project-content p {
  margin: 0;
  color: var(--muted);
  line-height: 1.56;
}

.tech-tags span {
  border-radius: 4px;
  padding: 6px 8px;
  color: var(--paper-strong);
  background: var(--ink);
  font-size: 0.78rem;
}

.project-links a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  border-bottom: 2px solid var(--ink);
  font-weight: 800;
}

.project-links a::after {
  content: "↗";
  margin-left: 6px;
  color: var(--ember);
}

.capabilities {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(320px, 1fr);
  gap: 48px;
  padding: 98px 40px;
}

.capability-intro,
.capability-list,
.open-panel,
.contact-grid,
.site-footer {
  max-width: 1220px;
}

.capability-intro {
  justify-self: end;
}

.capability-intro .eyebrow {
  color: var(--acid);
}

.capability-list {
  display: grid;
  gap: 12px;
}

.capability-list article {
  border-top: 1px solid rgba(255, 253, 246, 0.2);
  padding: 24px 0;
}

.capability-list span {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--acid);
  font-family: var(--font-latin);
  font-size: 1.4rem;
}

.capability-list h3 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1.04;
  font-weight: 800;
}

.capability-list p {
  max-width: 560px;
  margin: 0;
  color: rgba(255, 253, 246, 0.76);
  line-height: 1.62;
}

.opensource {
  padding: 100px 40px;
}

.open-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(280px, 0.74fr) auto;
  gap: 32px;
  align-items: center;
  margin: 0 auto;
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  padding: 34px 0;
}

.open-panel .eyebrow {
  margin-bottom: 12px;
}

.open-panel .button {
  white-space: nowrap;
}

.contact {
  padding: 100px 40px;
}

.contact .eyebrow {
  color: var(--acid);
}

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(320px, 0.52fr);
  gap: 42px;
  align-items: end;
  margin: 0 auto;
}

.contact-card {
  border: 1px solid rgba(255, 253, 246, 0.18);
  border-radius: 8px;
  padding: 24px;
  background: rgba(255, 253, 246, 0.06);
}

.contact-card p {
  margin-bottom: 22px;
  color: rgba(255, 253, 246, 0.76);
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0 auto;
  padding: 24px 40px 34px;
}

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

.site-footer p {
  margin: 0;
  color: var(--muted);
  text-align: right;
}

@media (prefers-reduced-motion: no-preference) {
  .hero-copy,
  .hero-emblem,
  .signal-strip,
  .section-heading,
  .project-card,
  .capability-list article,
  .open-panel,
  .contact-grid {
    animation: rise-in 680ms ease both;
  }

  .hero-emblem {
    animation-delay: 110ms;
  }

  .signal-strip,
  .project-card:nth-child(2),
  .capability-list article:nth-child(2) {
    animation-delay: 170ms;
  }

  .project-card:nth-child(3),
  .capability-list article:nth-child(3) {
    animation-delay: 230ms;
  }

  .project-card:nth-child(4) {
    animation-delay: 290ms;
  }

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

@media (max-width: 1180px) {
  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1040px) {
  .hero-grid,
  .section-heading,
  .capabilities,
  .open-panel,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: 7rem;
  }

  .hero-emblem {
    min-height: 430px;
  }

  .capability-intro {
    justify-self: auto;
    max-width: 760px;
  }
}

@media (max-width: 760px) {
  section {
    scroll-margin-top: 150px;
  }

  .site-header {
    position: sticky;
    flex-direction: column;
    align-items: flex-start;
    min-height: auto;
    padding: 14px 18px;
  }

  .primary-nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .hero,
  .projects,
  .capabilities,
  .opensource,
  .contact {
    padding-left: 18px;
    padding-right: 18px;
  }

  .hero {
    min-height: auto;
    padding-top: 54px;
  }

  .hero-grid {
    min-height: auto;
    gap: 32px;
  }

  .hero h1 {
    font-size: 4.7rem;
  }

  .hero-lede {
    font-size: 1.12rem;
  }

  .hero-emblem {
    min-height: 350px;
  }

  .emblem-caption {
    left: 18px;
    right: 18px;
    bottom: 18px;
    max-width: none;
  }

  .section-heading .eyebrow {
    margin-bottom: 0;
  }

  .section-heading h2,
  .capability-intro h2,
  .open-panel h2,
  .contact h2 {
    font-size: 3.05rem;
  }

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

  .project-preview {
    min-height: 220px;
  }

  .project-content {
    min-height: 0;
  }

  .open-panel {
    align-items: start;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
    padding-left: 18px;
    padding-right: 18px;
  }

  .site-footer p {
    text-align: left;
  }
}

@media (max-width: 430px) {
  .hero h1 {
    font-size: 3.85rem;
  }

  .hero-actions,
  .project-links {
    align-items: stretch;
    flex-direction: column;
  }

  .button,
  .hero-actions a {
    width: 100%;
  }

  .section-heading h2,
  .capability-intro h2,
  .open-panel h2,
  .contact h2 {
    font-size: 2.55rem;
  }

  .project-content h3 {
    font-size: 2.05rem;
  }
}
