:root {
  color-scheme: dark;
  --bg: #0d0f0e;
  --surface: #151816;
  --surface-2: #1a1e1b;
  --text: #f3f4ef;
  --muted: #979f98;
  --border: #292e2a;
  --border-strong: #3a413b;
  --accent: #8bd59e;
  --accent-ink: #102016;
  --good: #78cf8d;
  --warn: #e8b45f;
  --bad: #df7373;
  --unknown: #303531;
  --shell: min(960px, calc(100% - 40px));
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f5f1;
  --surface: #ffffff;
  --surface-2: #f0f1ed;
  --text: #161916;
  --muted: #6d756e;
  --border: #dfe2dc;
  --border-strong: #c7ccc5;
  --accent: #2f8d4d;
  --accent-ink: #ffffff;
  --unknown: #d9ddd7;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button { font: inherit; }
.shell { width: var(--shell); margin-inline: auto; }

.header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 78%, transparent);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(14px);
}
.header-inner {
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand {
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: -.035em;
}
.brand span,
.intro h1 span { color: var(--accent); }
.nav { display: flex; align-items: center; gap: 5px; }
.nav > a,
.theme-toggle {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 7px;
  padding: 0 10px;
  background: transparent;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}
.nav > a:hover,
.theme-toggle:hover { color: var(--text); background: var(--surface); }
.status-link { gap: 7px; }
.status-link i,
.status-pill i {
  width: 7px;
  height: 7px;
  border-radius: 99px;
  background: var(--unknown);
}
.status-link.operational i,
.status-pill.operational i { background: var(--good); }
.status-link.degraded i,
.status-pill.degraded i { background: var(--warn); }
.status-link.offline i,
.status-pill.offline i { background: var(--bad); }
.theme-toggle { width: 34px; padding: 0; }
.theme-toggle svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
html[data-theme="dark"] .sun { display: none; }
html[data-theme="light"] .moon { display: none; }

.intro {
  padding: 78px 0 70px;
  border-bottom: 1px solid var(--border);
}
.intro h1 {
  margin: 0 0 25px;
  font-size: clamp(62px, 11vw, 102px);
  line-height: .9;
  letter-spacing: -.075em;
  font-weight: 790;
}
.intro-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 15px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 720;
}
.button:hover { border-color: var(--border-strong); background: var(--surface-2); }
.button.primary { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }

.section { padding: 46px 0 0; }
.section-title {
  margin-bottom: 13px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.project {
  min-height: 260px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: border-color 140ms ease, transform 140ms ease;
}
.project:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.project-copy {
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}
.project-meta { margin-bottom: 26px; color: var(--muted); font-size: 12px; font-weight: 650; }
.project h2 {
  margin: 0 0 8px;
  font-size: clamp(34px, 5vw, 46px);
  line-height: 1;
  letter-spacing: -.055em;
}
.project p { margin: 0 0 30px; color: var(--muted); font-size: 15px; }
.open-link { font-size: 13px; font-weight: 730; }
.open-link span { margin-left: 4px; color: var(--muted); }
.project-art {
  position: relative;
  min-height: 260px;
  overflow: hidden;
  border-left: 1px solid var(--border);
  background:
    radial-gradient(circle at 68% 45%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 30%),
    var(--surface-2);
}
.project-art::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .5;
  background-image:
    linear-gradient(color-mix(in srgb, var(--border) 55%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--border) 55%, transparent) 1px, transparent 1px);
  background-size: 24px 24px;
}
.project-art svg { position: absolute; width: 116%; height: 116%; left: -8%; top: -8%; }
.trail { stroke-linecap: round; stroke-linejoin: round; }
.trail-a { stroke: color-mix(in srgb, var(--text) 90%, transparent); stroke-width: 19; }
.trail-b { stroke: color-mix(in srgb, var(--accent) 78%, #6b8cff); stroke-width: 11; }
.pellet { fill: var(--muted); opacity: .55; }
.pellet-a { fill: var(--good); opacity: 1; }

.status-card {
  margin: 46px 0 74px;
  padding: 27px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}
.status-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
}
.status-top .section-title { margin-bottom: 8px; }
.status-top h2 {
  margin: 0;
  font-size: clamp(24px, 4vw, 34px);
  line-height: 1.1;
  letter-spacing: -.045em;
}
.status-pill {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
  white-space: nowrap;
}
.history {
  height: 45px;
  display: grid;
  grid-template-columns: repeat(30, 1fr);
  align-items: end;
  gap: 4px;
  margin-top: 34px;
}
.history-bar {
  height: 34px;
  border-radius: 3px;
  background: var(--unknown);
  transition: transform 120ms ease;
}
.history-bar:hover { transform: translateY(-2px); }
.history-bar.operational { background: var(--good); }
.history-bar.degraded { background: var(--warn); }
.history-bar.offline { background: var(--bad); }
.status-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 11px;
  color: var(--muted);
  font-size: 11px;
}

.footer { border-top: 1px solid var(--border); }
.footer-inner {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-size: 12px;
}
.footer a { text-decoration: none; }
.footer a:hover { color: var(--text); }

@media (max-width: 720px) {
  :root { --shell: min(100% - 28px, 960px); }
  .header-inner { height: auto; min-height: 60px; }
  .nav > a:not(.status-link) { display: none; }
  .intro { padding: 60px 0 52px; }
  .intro h1 { font-size: clamp(58px, 22vw, 82px); }
  .project { grid-template-columns: 1fr; }
  .project-copy { min-height: 245px; padding: 24px; }
  .project-art { min-height: 190px; border-left: 0; border-top: 1px solid var(--border); }
  .status-card { padding: 22px; }
  .status-top { align-items: center; }
  .status-pill span { display: none; }
  .history { gap: 3px; }
  .status-footer { align-items: flex-start; flex-direction: column; gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
