:root {
  color-scheme: light;
  --ink: #161616;
  --muted: #666a70;
  --line: #dedede;
  --paper: #ffffff;
  --soft: #f6f5f2;
  --soft-2: #edf4f1;
  --accent: #0d6b52;
  --accent-2: #9f4b30;
  --focus: #2d5bff;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  letter-spacing: 0;
}

body.route-hterm {
  background: #f8f8f5;
}

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

button,
input {
  font: inherit;
}

.site-shell {
  min-height: 100vh;
}

.site-topline {
  width: min(1120px, calc(100vw - 40px));
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 auto;
  border-bottom: 1px solid rgba(22, 22, 22, 0.08);
}

.topline-links {
  display: flex;
  gap: 20px;
  color: var(--muted);
  font-size: 13px;
}

.topline-links a:hover {
  color: var(--ink);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(22, 22, 22, 0.08);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px);
}

.nav {
  width: min(1120px, calc(100vw - 40px));
  height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border: 1px solid var(--ink);
  display: grid;
  place-items: center;
  font-size: 13px;
  line-height: 1;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  color: var(--muted);
  font-size: 14px;
}

.nav-link:hover,
.nav-link[aria-current="page"] {
  color: var(--ink);
}

.main {
  width: min(1120px, calc(100vw - 40px));
  margin: 0 auto;
}

.hero {
  min-height: calc(100vh - 68px);
  display: grid;
  grid-template-columns: minmax(0, 0.96fr) minmax(360px, 1.04fr);
  gap: 58px;
  align-items: center;
  padding: 72px 0 64px;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.hero h1 {
  max-width: 720px;
  margin-bottom: 22px;
  font-size: clamp(48px, 8vw, 92px);
  line-height: 0.96;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 600px;
  margin-bottom: 34px;
  color: #4e5358;
  font-size: 19px;
  line-height: 1.65;
}

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

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid var(--ink);
  border-radius: 6px;
  padding: 0 16px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
}

.button.secondary {
  background: transparent;
  color: var(--ink);
}

.button:hover {
  transform: translateY(-1px);
}

.button:focus-visible,
.nav-link:focus-visible,
.project-link:focus-visible,
.term-input:focus-visible {
  outline: 3px solid rgba(45, 91, 255, 0.24);
  outline-offset: 3px;
}

.hero-panel {
  border: 1px solid var(--line);
  background: linear-gradient(135deg, #fcfcfb 0%, #eef5f1 100%);
  aspect-ratio: 1 / 0.88;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  padding: 18px;
}

.terminal-window {
  width: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  border: 1px solid #202020;
  background: #fbfbf8;
  color: #1f2421;
  box-shadow: 12px 12px 0 rgba(13, 107, 82, 0.12);
}

.terminal-titlebar {
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #202020;
  padding: 0 14px;
  color: #555b57;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
}

.window-dots {
  display: flex;
  gap: 6px;
}

.window-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1px solid #202020;
}

.dot-red {
  background: #d9735f;
}

.dot-yellow {
  background: #d6b157;
}

.dot-green {
  background: #6ab67a;
}

.terminal-body {
  flex: 1;
  padding: 18px;
  overflow: hidden;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: clamp(12px, 1.5vw, 15px);
  line-height: 1.7;
}

.term-line {
  display: block;
  white-space: pre-wrap;
}

.term-muted {
  color: #6b706c;
}

.term-command {
  color: var(--accent);
}

.section {
  padding: 92px 0;
  border-top: 1px solid rgba(22, 22, 22, 0.1);
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin-bottom: 34px;
}

.section-heading h2 {
  margin-bottom: 0;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.05;
}

.section-heading p {
  max-width: 420px;
  margin-bottom: 3px;
  color: var(--muted);
  line-height: 1.6;
}

.project-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.project-card {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 30px;
  background: #fff;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid rgba(22, 22, 22, 0.12);
  border-radius: 999px;
  padding: 0 10px;
  color: #4f5551;
  background: #f8f8f5;
  font-size: 12px;
  font-weight: 650;
}

.project-card h3 {
  margin-bottom: 12px;
  font-size: 28px;
  line-height: 1.15;
}

.project-card p {
  margin-bottom: 22px;
  color: var(--muted);
  line-height: 1.65;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-weight: 700;
}

.project-link:hover {
  color: #084b3a;
}

.project-visual {
  min-height: 230px;
  border: 1px solid #202020;
  background: #f7f7f3;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  overflow: hidden;
}

.render-grid {
  height: 160px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  grid-template-rows: 0.8fr 1.2fr;
  gap: 10px;
}

.render-grid span {
  border: 1px solid #202020;
  background: #fff;
}

.render-grid span:nth-child(1) {
  background: linear-gradient(135deg, #ffffff 0%, #d8eee5 100%);
}

.render-grid span:nth-child(2) {
  background: #1f2421;
}

.render-grid span:nth-child(3) {
  background: #d9735f;
}

.render-grid span:nth-child(4) {
  background: linear-gradient(135deg, #d6b157 0%, #ffffff 100%);
}

.chess-board {
  width: min(170px, 100%);
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid #202020;
}

.chess-board span {
  min-width: 0;
}

.chess-board .light {
  background: #fff;
}

.chess-board .dark {
  background: #1f2421;
}

.visual-caption {
  max-width: 220px;
  color: #4f5551;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project-visual-chess {
  align-items: flex-start;
  background: #f4f7f6;
}

.about-grid {
  display: grid;
  grid-template-columns: 0.78fr 1.22fr;
  gap: 48px;
}

.about-kicker {
  color: var(--accent-2);
  font-weight: 750;
}

.about-copy {
  color: #3f4448;
  font-size: 18px;
  line-height: 1.75;
}

.legacy-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid rgba(22, 22, 22, 0.1);
  padding: 44px 0;
}

.legacy-section h2 {
  margin-bottom: 8px;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.1;
}

.legacy-section p {
  max-width: 560px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

.legacy-section .legacy-kicker {
  margin-bottom: 8px;
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 34px 0 48px;
  color: var(--muted);
  font-size: 14px;
}

.footer-links {
  display: flex;
  gap: 18px;
}

.footer-links a:hover {
  color: var(--ink);
}

@media (max-width: 560px) {
  .footer {
    display: block;
  }

  .footer-links {
    margin-top: 12px;
  }
}

.detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr);
  gap: 44px;
  align-items: center;
  padding: 78px 0 66px;
}

.detail-hero h1 {
  margin-bottom: 20px;
  font-size: clamp(46px, 7vw, 84px);
  line-height: 0.96;
}

.detail-copy {
  max-width: 600px;
  margin-bottom: 28px;
  color: #4e5358;
  font-size: 18px;
  line-height: 1.7;
}

.route-terminal {
  min-height: 430px;
}

.interactive-terminal .terminal-body {
  overflow: auto;
}

.term-output {
  min-height: 280px;
}

.term-form {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.term-prompt {
  color: var(--accent);
  white-space: nowrap;
}

.term-input {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  outline: none;
  font-family: inherit;
  font-size: inherit;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 86px;
}

.detail-block {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.detail-block h2 {
  margin-bottom: 12px;
  font-size: 18px;
}

.detail-block p,
.detail-block li {
  color: var(--muted);
  line-height: 1.65;
}

.detail-block ul {
  margin: 0;
  padding-left: 18px;
}

@media (max-width: 820px) {
  .site-topline {
    width: min(100% - 28px, 1120px);
  }

  .nav {
    width: min(100% - 28px, 1120px);
  }

  .main {
    width: min(100% - 28px, 1120px);
  }

  .nav-links {
    gap: 0;
  }

  .nav-link {
    padding: 0 8px;
  }

  .hero,
  .detail-hero,
  .project-card,
  .about-grid,
  .detail-grid,
  .legacy-section {
    grid-template-columns: 1fr;
  }

  .legacy-section {
    display: grid;
    justify-items: start;
  }

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

  .hero-panel {
    aspect-ratio: auto;
    min-height: 420px;
  }

  .section {
    padding: 70px 0;
  }

  .section-heading {
    display: block;
  }

  .section-heading p {
    margin-top: 14px;
  }

  .detail-hero {
    padding-top: 52px;
  }
}

@media (max-width: 560px) {
  .topline-links {
    gap: 10px;
    font-size: 12px;
  }

  .brand span:last-child {
    display: none;
  }

  .nav-link {
    font-size: 13px;
  }

  .hero h1,
  .detail-hero h1 {
    font-size: 46px;
  }

  .hero-copy,
  .detail-copy,
  .about-copy {
    font-size: 16px;
  }

  .project-card {
    padding: 22px;
  }

  .terminal-body {
    font-size: 12px;
  }
}

/* Home index refresh */
.home-intro {
  padding: 54px 0 84px;
}

.intro-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}

.intro-bar .eyebrow {
  margin: 0;
}

.intro-status {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.62fr);
  gap: 72px;
  align-items: center;
  padding: 22px 0 0;
}

.intro-copy {
  text-align: left;
}

.intro-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.social-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  border: 1px solid var(--ink);
  padding: 0 20px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.03em;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.social-button:hover {
  background: var(--ink);
  color: #fff;
  transform: translate(3px, -3px);
}

.intro-index {
  margin-bottom: 20px;
  color: var(--accent-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
}

.intro-copy h1 {
  margin-bottom: 20px;
  font-size: clamp(48px, 7vw, 76px);
  font-weight: 600;
  letter-spacing: -0.055em;
  line-height: 0.95;
}

.intro-lede {
  max-width: 390px;
  margin-bottom: 30px;
  color: #4e5358;
  font-size: 19px;
  line-height: 1.55;
}

.intro-arrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.intro-arrow span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 50%;
  transition: transform 160ms ease;
}

.intro-arrow:hover span {
  transform: translateY(3px);
}

.intro-art {
  position: relative;
  padding-bottom: 30px;
}

.intro-art .terminal-window {
  min-height: 340px;
  box-shadow: 14px 14px 0 rgba(13, 107, 82, 0.11);
}

.index-card {
  min-height: 340px;
  border: 1px solid #202020;
  padding: 16px;
  background: #f7f7f3;
  box-shadow: 14px 14px 0 rgba(13, 107, 82, 0.11);
}

.index-card-top,
.index-card-bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: #59605b;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

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

.project-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) minmax(150px, 220px);
  gap: 18px;
  align-items: center;
  min-height: 124px;
  border-bottom: 1px solid var(--line);
  padding: 20px 0;
}

.project-number {
  align-self: start;
  padding-top: 4px;
  color: var(--accent-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
}

.project-row-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
}

.project-row h3 {
  margin: 0 0 8px;
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 550;
  letter-spacing: -0.04em;
}

.project-title-link {
  color: inherit;
}

.project-title-link:hover {
  color: var(--accent);
}

.project-status {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  white-space: nowrap;
}

.project-row p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.project-row .project-link {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 50%;
  color: var(--ink);
  font-size: 18px;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.project-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 8px;
  padding-top: 4px;
}

.project-row .project-link-text {
  display: inline-flex;
  width: auto;
  height: auto;
  align-items: center;
  gap: 6px;
  border: 0;
  border-radius: 0;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.project-row .project-link-text:hover {
  background: transparent;
  color: #084b3a;
  transform: none;
}

@media (max-width: 700px) {
  .nav-external {
    display: none;
  }

  .project-row {
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: start;
  }

  .project-links {
    display: flex;
    grid-column: 2;
    padding-top: 4px;
  }

  .project-row .project-link-text {
    display: inline-flex;
  }
}

.project-row .project-link:not(.project-link-text):hover {
  background: var(--ink);
  color: #fff;
  transform: translate(2px, -2px);
}

@media (max-width: 560px) {
  .project-row {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
  }

  .project-row-heading {
    display: block;
  }

  .project-status {
    display: block;
    margin-bottom: 8px;
  }
}

.index-card-top {
  border-bottom: 1px solid #202020;
  padding: 0 0 13px;
}

.index-card-bottom {
  border-top: 1px solid #202020;
  padding: 13px 0 0;
  color: var(--accent-2);
}

.index-map {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  grid-template-rows: 1fr 1fr;
  gap: 10px;
  min-height: 246px;
  padding: 14px 0;
}

.map-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 110px;
  overflow: hidden;
  border: 1px solid #202020;
  padding: 12px;
}

.map-cell span {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
}

.map-cell strong {
  position: relative;
  z-index: 1;
  font-size: clamp(17px, 2.2vw, 24px);
  font-weight: 600;
  letter-spacing: -0.04em;
}

.map-cell i {
  position: absolute;
  right: -24px;
  bottom: -32px;
  width: 110px;
  height: 110px;
  border: 1px solid currentColor;
  border-radius: 50%;
  opacity: 0.55;
}

.map-cell-wide {
  background: linear-gradient(135deg, #e4f2ec, #c5e4d7);
  color: #185440;
}

.map-cell-dark {
  background: #202522;
  color: #f5f4ef;
}

.map-cell-chess {
  background: repeating-conic-gradient(#fff 0 25%, #202522 0 50%) 50% / 28px 28px;
  color: #202522;
}

.map-cell-light {
  background: #e7b36b;
  color: #5b341c;
}

.art-caption {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 28px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
}

.art-caption span:first-child {
  color: var(--accent-2);
}

@media (max-width: 820px) {
  .home-intro {
    padding-top: 38px;
  }

  .intro-grid {
    grid-template-columns: 1fr;
    gap: 48px;
    padding-top: 58px;
  }

  .intro-links {
    max-width: 420px;
  }
}

@media (max-width: 560px) {
  .intro-bar {
    display: block;
  }

  .intro-status {
    display: block;
    margin-top: 14px;
  }

  .intro-copy h1 {
    font-size: 56px;
  }

  .intro-lede {
    font-size: 17px;
  }

  .intro-art .terminal-window {
    min-height: 300px;
  }

  .art-caption {
    left: 0;
    font-size: 10px;
  }
}
