:root {
  color-scheme: dark;
  --ink: #f7f1e6;
  --muted: #b8b2a7;
  --dim: #827c72;
  --soil: #0d100e;
  --soil-2: #141813;
  --soil-3: #20251d;
  --clay: #c98d45;
  --gold: #d7b46a;
  --jade: #35d0bd;
  --line: rgba(247, 241, 230, 0.14);
  --line-strong: rgba(215, 180, 106, 0.42);
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 10% 0%, rgba(201, 141, 69, 0.18), transparent 28rem),
    radial-gradient(circle at 95% 8%, rgba(53, 208, 189, 0.12), transparent 30rem),
    linear-gradient(180deg, #090c0a 0%, var(--soil) 44%, #11150f 100%);
  color: var(--ink);
  font-family:
    "Inter",
    "Noto Sans SC",
    "PingFang SC",
    "Microsoft YaHei",
    system-ui,
    sans-serif;
  line-height: 1.65;
  letter-spacing: 0;
}

::selection {
  background: rgba(215, 180, 106, 0.35);
  color: var(--ink);
}

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

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

#terrain-canvas,
.ambient-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

#terrain-canvas {
  z-index: -3;
}

.ambient-grid {
  z-index: -2;
  opacity: 0.42;
  background-image:
    linear-gradient(rgba(247, 241, 230, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(247, 241, 230, 0.055) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.76) 64%, transparent 100%);
}

.site-header {
  position: fixed;
  z-index: 20;
  top: 18px;
  left: 50%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: min(1180px, calc(100% - 32px));
  min-height: 58px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(13, 16, 14, 0.78);
  box-shadow: 0 14px 46px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(18px);
  transform: translateX(-50%);
}

.brand-mark,
.top-nav,
.header-action {
  display: flex;
  align-items: center;
}

.brand-mark {
  gap: 10px;
  min-width: 0;
}

.brand-symbol {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(215, 180, 106, 0.5);
  border-radius: 6px;
  background: linear-gradient(135deg, rgba(201, 141, 69, 0.22), rgba(53, 208, 189, 0.1));
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 800;
}

.brand-text {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.92rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.top-nav {
  gap: 4px;
  justify-self: center;
}

.top-nav a,
.header-action {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.92rem;
  transition:
    color 180ms ease,
    background 180ms ease,
    border-color 180ms ease;
}

.top-nav a {
  display: grid;
  place-items: center;
}

.top-nav a:hover,
.top-nav a.is-active,
.header-action:hover {
  background: rgba(247, 241, 230, 0.08);
  color: var(--ink);
}

.header-action {
  justify-self: end;
  border: 1px solid rgba(215, 180, 106, 0.34);
}

main {
  position: relative;
  z-index: 1;
}

.hero-section {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 780px);
  align-items: center;
  width: min(1180px, calc(100% - 40px));
  min-height: 88svh;
  margin: 0 auto;
  padding: 104px 0 34px;
  gap: 64px;
}

.hero-section::before {
  position: absolute;
  z-index: 0;
  content: "";
  inset: 58px calc(50% - 50vw) -36px;
  background-image:
    linear-gradient(90deg, rgba(9, 12, 10, 0.9) 0%, rgba(9, 12, 10, 0.7) 44%, rgba(9, 12, 10, 0.3) 100%),
    linear-gradient(180deg, rgba(9, 12, 10, 0.12), rgba(9, 12, 10, 0.78)),
    url("./assets/hero-system-texture-v1.webp");
  background-position: center;
  background-size: cover;
  opacity: 0.72;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 74%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0%, #000 74%, transparent 100%);
}

.hero-section > * {
  position: relative;
  z-index: 1;
}

.hero-copy {
  max-width: 720px;
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--gold);
  font-family:
    "SFMono-Regular",
    Consolas,
    "Liberation Mono",
    monospace;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: 5.2rem;
  line-height: 1.02;
  font-weight: 900;
}

.hero-role {
  margin-bottom: 22px;
  color: var(--jade);
  font-size: 1.25rem;
  font-weight: 700;
}

.hero-lede {
  max-width: 660px;
  margin-bottom: 34px;
  color: var(--muted);
  font-size: 1.08rem;
}

.hero-actions,
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.primary-link,
.secondary-link,
.contact-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 6px;
  font-weight: 800;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.primary-link {
  border: 1px solid rgba(215, 180, 106, 0.68);
  background: linear-gradient(135deg, rgba(201, 141, 69, 0.94), rgba(215, 180, 106, 0.78));
  color: #14100a;
}

.secondary-link {
  border: 1px solid var(--line);
  background: rgba(247, 241, 230, 0.06);
  color: var(--ink);
}

.contact-chip {
  border: 1px solid rgba(53, 208, 189, 0.28);
  background: rgba(53, 208, 189, 0.08);
  color: var(--ink);
}

.primary-link:hover,
.secondary-link:hover {
  transform: translateY(-2px);
}

.signal-band {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.signal-item {
  min-height: 170px;
  padding: 28px;
  border-right: 1px solid var(--line);
  background: rgba(13, 16, 14, 0.5);
}

.signal-item:last-child {
  border-right: 0;
}

.signal-kicker,
.system-index,
.timeline-item time {
  color: var(--gold);
  font-family:
    "SFMono-Regular",
    Consolas,
    "Liberation Mono",
    monospace;
  font-size: 0.75rem;
  font-weight: 700;
}

.signal-item strong {
  display: block;
  margin: 8px 0 10px;
  font-size: 1.16rem;
}

.signal-item p,
.system-card p,
.impact-list,
.timeline-item p,
.stack-card p,
.contact-copy p {
  color: var(--muted);
}

.section {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 104px 0 0;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 34px;
}

.section-intro {
  max-width: 720px;
  margin: 18px 0 0;
  color: var(--muted);
}

h2 {
  margin-bottom: 0;
  font-size: 3rem;
  line-height: 1.15;
}

h3 {
  margin-bottom: 12px;
  font-size: 1.2rem;
  line-height: 1.35;
}

.principle-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 0.8fr);
  gap: 58px;
  align-items: center;
}

.principle-copy {
  padding-left: 20px;
  border-left: 2px solid var(--line-strong);
  font-size: 1.05rem;
}

.element-map {
  position: relative;
  display: grid;
  min-height: 380px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(201, 141, 69, 0.11), transparent 42%),
    rgba(247, 241, 230, 0.035);
  overflow: hidden;
}

.element-map::before,
.element-map::after {
  position: absolute;
  content: "";
  border: 1px solid rgba(215, 180, 106, 0.24);
  border-radius: 50%;
  animation: mapPulse 8s ease-in-out infinite;
}

.element-map::before {
  width: 230px;
  height: 230px;
}

.element-map::after {
  width: 310px;
  height: 310px;
  animation-delay: -3s;
}

.map-core {
  position: relative;
  z-index: 2;
  display: grid;
  width: 98px;
  height: 98px;
  place-items: center;
  border: 1px solid rgba(215, 180, 106, 0.52);
  border-radius: 50%;
  background: rgba(13, 16, 14, 0.86);
  color: var(--gold);
  font-size: 2.2rem;
  font-weight: 900;
  box-shadow: 0 0 56px rgba(201, 141, 69, 0.2);
}

.map-node {
  position: absolute;
  z-index: 2;
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  border: 1px solid rgba(247, 241, 230, 0.18);
  border-radius: 50%;
  background: rgba(20, 24, 19, 0.9);
  color: var(--ink);
  font-weight: 800;
}

.node-a {
  top: 44px;
  left: 50%;
  transform: translateX(-50%);
}

.node-b {
  top: 138px;
  right: 54px;
}

.node-c {
  right: 82px;
  bottom: 54px;
}

.node-d {
  bottom: 54px;
  left: 82px;
}

.node-e {
  top: 138px;
  left: 54px;
}

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

.system-card,
.stack-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(247, 241, 230, 0.06), transparent 44%),
    rgba(13, 16, 14, 0.74);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.18);
}

.system-card {
  min-height: 276px;
  padding: 28px;
}

.system-card::before,
.stack-card::before {
  position: absolute;
  content: "";
  top: 0;
  right: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--clay), var(--jade), transparent);
  opacity: 0.7;
}

.system-index {
  display: block;
  margin-bottom: 24px;
}

.impact-list {
  display: grid;
  gap: 8px;
  padding-left: 18px;
  margin: 22px 0;
}

.impact-list li::marker {
  color: var(--gold);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.tag-row span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(247, 241, 230, 0.12);
  border-radius: 6px;
  background: rgba(247, 241, 230, 0.055);
  color: var(--muted);
  font-size: 0.82rem;
}

.portfolio-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  max-width: none;
  gap: 28px;
}

.portfolio-heading > div {
  max-width: 760px;
}

.project-count {
  color: transparent;
  font-size: clamp(4rem, 9vw, 7rem);
  line-height: 0.8;
  -webkit-text-stroke: 1px rgba(215, 180, 106, 0.52);
}

.project-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.filter-button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(247, 241, 230, 0.035);
  color: var(--muted);
  font: inherit;
  font-size: 0.86rem;
  cursor: pointer;
  transition:
    color 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.filter-button:hover,
.filter-button.is-active {
  border-color: rgba(215, 180, 106, 0.5);
  background: rgba(215, 180, 106, 0.12);
  color: var(--ink);
}

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

.project-card {
  position: relative;
  min-height: 142px;
  padding: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(247, 241, 230, 0.052), transparent 54%),
    rgba(13, 16, 14, 0.7);
}

.project-card::after {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 54px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--jade));
  content: "";
}

.project-card h3 {
  margin: 30px 0 0;
  font-size: 1.05rem;
}

.project-number,
.project-type {
  font-family:
    "SFMono-Regular",
    Consolas,
    "Liberation Mono",
    monospace;
  font-size: 0.72rem;
  font-weight: 700;
}

.project-number {
  color: var(--gold);
}

.project-type {
  float: right;
  color: var(--dim);
}

.project-card[hidden] {
  display: none;
}

.timeline {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.timeline-item {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 28px;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}

.timeline-item h3 {
  margin-bottom: 6px;
}

.timeline-item p {
  margin-bottom: 0;
}

.stack-card {
  min-height: 178px;
  padding: 26px;
}

.contact-section {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) auto;
  align-items: end;
  width: min(1180px, calc(100% - 40px));
  margin: 104px auto 0;
  padding: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(201, 141, 69, 0.16), transparent 40%),
    rgba(13, 16, 14, 0.82);
}

.contact-copy {
  max-width: 780px;
}

.contact-copy h2 {
  margin-bottom: 16px;
  font-size: 2.35rem;
}

.contact-copy p {
  margin-bottom: 0;
}

.contact-actions {
  justify-content: flex-end;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  width: min(1180px, calc(100% - 40px));
  margin: 38px auto 0;
  padding: 28px 0 46px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 0.9rem;
}

.not-found {
  display: grid;
  align-content: center;
  justify-items: start;
  width: min(760px, calc(100% - 40px));
  min-height: 100svh;
  margin: 0 auto;
}

.not-found h1 {
  font-size: clamp(2.8rem, 10vw, 5.2rem);
}

.not-found p:not(.eyebrow) {
  color: var(--muted);
}

.js [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 680ms ease,
    transform 680ms ease;
}

.js [data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

.js .site-header[data-reveal] {
  transform: translateX(-50%) translateY(18px);
}

.js .site-header[data-reveal].is-visible {
  transform: translateX(-50%) translateY(0);
}

@keyframes mapPulse {
  0%,
  100% {
    transform: scale(0.96);
    opacity: 0.52;
  }
  50% {
    transform: scale(1.04);
    opacity: 0.9;
  }
}

@media (max-width: 980px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .top-nav {
    display: none;
  }

  .hero-section,
  .principle-layout,
  .contact-section {
    grid-template-columns: 1fr;
  }

  .hero-section {
    min-height: auto;
    padding-top: 110px;
    gap: 42px;
  }

  .hero-section::before {
    inset: 70px calc(50% - 50vw) -28px;
    background-position: 62% center;
    opacity: 0.58;
  }

  h1 {
    font-size: 3.8rem;
  }

  h2 {
    font-size: 2.35rem;
  }

  .signal-band,
  .systems-grid,
  .stack-grid,
  .project-grid {
    grid-template-columns: 1fr;
  }

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

  .signal-item {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .signal-item:last-child {
    border-bottom: 0;
  }

  .contact-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 680px) {
  .site-header {
    top: 10px;
    width: calc(100% - 20px);
  }

  .brand-text {
    display: none;
  }

  .header-action {
    padding: 0 12px;
    font-size: 0.86rem;
  }

  .hero-section,
  .section,
  .signal-band,
  .contact-section,
  .site-footer {
    width: calc(100% - 28px);
  }

  .hero-section {
    padding-top: 92px;
    padding-bottom: 22px;
    gap: 24px;
  }

  .hero-section::before {
    inset: 58px calc(50% - 50vw) -18px;
    background-position: 70% center;
    opacity: 0.5;
  }

  h1 {
    font-size: 2.75rem;
  }

  h2,
  .contact-copy h2 {
    font-size: 2rem;
  }

  .hero-role {
    font-size: 1.05rem;
  }

  .hero-lede,
  .principle-copy {
    font-size: 1rem;
  }

  .signal-item,
  .system-card,
  .stack-card,
  .contact-section {
    padding: 22px;
  }

  .section {
    padding-top: 76px;
  }

  .portfolio-heading {
    align-items: start;
  }

  .project-count {
    font-size: 3.8rem;
  }

  .project-filters {
    flex-wrap: nowrap;
    padding-bottom: 6px;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .filter-button {
    flex: 0 0 auto;
  }

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

  .element-map {
    min-height: 330px;
  }

  .map-node {
    width: 64px;
    height: 64px;
    font-size: 0.92rem;
  }

  .node-b {
    right: 26px;
  }

  .node-c {
    right: 44px;
  }

  .node-d {
    left: 44px;
  }

  .node-e {
    left: 26px;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .primary-link,
  .secondary-link,
  .contact-chip {
    width: 100%;
  }

  .site-footer {
    display: grid;
    gap: 8px;
  }
}

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

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

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