:root {
  --font-display: "Noto Serif SC", serif;
  --font-body: "IBM Plex Sans", "Noto Sans SC", sans-serif;
  --color-surface: #f4f0e8;
  --color-panel: #fffaf0;
  --color-text: #151515;
  --color-muted: #68645c;
  --color-primary: #0e6f68;
  --color-accent: #d85b27;
  --color-line: #1b1b1b;
  --color-soft: #d8d0c2;
  --shadow-sm: 0 8px 24px rgba(18, 18, 18, 0.08);
  --shadow-md: 0 18px 56px rgba(18, 18, 18, 0.14);
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1.25rem;
  --space-lg: 2rem;
  --space-xl: 4rem;
  --space-xxl: 7rem;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(rgba(21, 21, 21, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 21, 21, 0.045) 1px, transparent 1px),
    var(--color-surface);
  background-size: 34px 34px;
  color: var(--color-text);
  font-family: var(--font-body);
  line-height: 1.6;
}

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

button {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 0 var(--space-lg);
  border-bottom: 1px solid var(--color-line);
  background: rgba(244, 240, 232, 0.9);
  backdrop-filter: blur(14px);
}

.brand,
.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-weight: 700;
}

.brand-mark {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--color-line);
  background: var(--color-text);
  color: var(--color-panel);
}

.site-nav a {
  color: var(--color-muted);
  font-size: 0.95rem;
}

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

.section-band {
  border-bottom: 1px solid var(--color-line);
  padding: var(--space-xxl) var(--space-lg);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(360px, 0.98fr);
  gap: var(--space-xl);
  align-items: center;
  min-height: calc(100vh - 72px);
  padding-top: var(--space-xl);
}

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

.eyebrow,
.section-kicker {
  margin: 0 0 var(--space-md);
  color: var(--color-primary);
  font-size: 0.86rem;
  font-weight: 700;
  text-transform: uppercase;
}

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

h1,
h2 {
  font-family: var(--font-display);
  line-height: 1.14;
}

h1 {
  max-width: 980px;
  margin-bottom: var(--space-lg);
  font-size: clamp(3rem, 6.6vw, 7.4rem);
}

h2 {
  margin-bottom: var(--space-lg);
  font-size: clamp(2rem, 4vw, 4.6rem);
}

h3 {
  margin-bottom: var(--space-sm);
  font-size: clamp(1.25rem, 2vw, 2rem);
  line-height: 1.2;
}

.hero-lede {
  max-width: 680px;
  color: var(--color-muted);
  font-size: clamp(1.05rem, 1.5vw, 1.35rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

.button,
.filter {
  min-height: 44px;
  border: 1px solid var(--color-line);
  padding: 0.68rem 1rem;
  transition:
    transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1),
    background 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.button:hover,
.filter:hover {
  transform: translateY(-2px);
}

.button.primary {
  background: var(--color-text);
  color: var(--color-panel);
}

.button.secondary,
.filter {
  background: transparent;
}

.agent-map {
  position: relative;
  min-height: 520px;
  border: 1px solid var(--color-line);
  background:
    radial-gradient(circle at 25% 20%, rgba(216, 91, 39, 0.18), transparent 30%),
    radial-gradient(circle at 76% 78%, rgba(14, 111, 104, 0.18), transparent 34%),
    var(--color-panel);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

#agentCanvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 520px;
}

.map-label {
  position: absolute;
  width: min(170px, 42%);
  border-left: 3px solid var(--color-accent);
  padding: var(--space-sm);
  background: rgba(255, 250, 240, 0.84);
  box-shadow: var(--shadow-sm);
}

.map-label span {
  display: block;
  color: var(--color-muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.map-label strong {
  display: block;
  margin-top: 0.1rem;
}

.label-one {
  top: 12%;
  left: 10%;
}

.label-two {
  top: 42%;
  right: 8%;
}

.label-three {
  bottom: 11%;
  left: 15%;
}

.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: var(--space-xl);
}

.intro-text {
  color: var(--color-muted);
  font-size: 1.08rem;
}

.intro-text strong {
  color: var(--color-text);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.filter {
  cursor: pointer;
  color: var(--color-muted);
}

.filter.active {
  background: var(--color-primary);
  color: white;
}

.project-list {
  display: grid;
  gap: 1px;
  background: var(--color-line);
  border: 1px solid var(--color-line);
}

.project-card {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: var(--space-lg);
  padding: var(--space-lg);
  background: var(--color-panel);
  transition:
    opacity 180ms ease,
    background 180ms ease;
}

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

.project-card:hover {
  background: #fff3df;
}

.project-index {
  color: var(--color-accent);
  font-weight: 700;
}

.project-card p {
  max-width: 860px;
  color: var(--color-muted);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.tags span,
.stack-grid div {
  border: 1px solid var(--color-soft);
  background: rgba(255, 250, 240, 0.7);
  padding: 0.5rem 0.7rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.stack-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-sm);
}

.contact {
  background: var(--color-text);
  color: var(--color-panel);
}

.contact .section-kicker {
  color: #74c7be;
}

.contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.contact-row a {
  border: 1px solid rgba(255, 250, 240, 0.45);
  padding: 0.7rem 1rem;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-lg);
  color: var(--color-muted);
}

@media (max-width: 920px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
  }

  .site-nav {
    width: 100%;
    justify-content: space-between;
    gap: var(--space-xs);
  }

  .hero,
  .intro-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .agent-map,
  #agentCanvas {
    min-height: 430px;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }

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

@media (max-width: 620px) {
  .section-band {
    padding: var(--space-xl) var(--space-md);
  }

  .brand {
    width: 100%;
    justify-content: space-between;
  }

  .site-nav a {
    font-size: 0.88rem;
  }

  h1 {
    font-size: clamp(2.45rem, 14vw, 4rem);
  }

  .agent-map,
  #agentCanvas {
    min-height: 360px;
  }

  .map-label {
    width: 148px;
    font-size: 0.88rem;
  }

  .project-card {
    grid-template-columns: 1fr;
    gap: var(--space-sm);
    padding: var(--space-md);
  }

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

  .site-footer {
    flex-direction: column;
  }
}
