:root {
  color-scheme: dark;
  --shell: #0a0d12;
  --black: #05070a;
  --stage-top: #0e1319;
  --stage-bottom: #05070a;
  --ink: #eef2f6;
  --muted: #97a1af;
  --quiet: #5a6270;
  --line: rgba(238, 242, 246, 0.1);

  --accent: #5ec8f0;
  --accent-ink: #04121a;
  --accent-soft: rgba(94, 200, 240, 0.13);
  --violet: #a78bfa;
  --violet-soft: rgba(167, 139, 250, 0.12);
  --gray-soft: rgba(151, 161, 175, 0.1);

  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-body: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--shell);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  min-height: 100vh;
  margin: 0;
  padding: clamp(14px, 3vw, 30px);
  color: var(--ink);
  background: var(--shell);
  font-family: var(--font-body);
  line-height: 1.5;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

body::before {
  content: "";
  position: fixed;
  inset: clamp(14px, 3vw, 30px);
  z-index: -1;
  border-radius: 12px;
  background:
    radial-gradient(circle at 82% 6%, rgba(94, 200, 240, 0.12), transparent 26%),
    radial-gradient(circle at 12% 94%, rgba(167, 139, 250, 0.08), transparent 26%),
    linear-gradient(160deg, var(--stage-top), var(--stage-bottom) 74%);
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.5);
}

.site-header,
main {
  width: min(100%, 1240px);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  z-index: 20;
  top: clamp(14px, 3vw, 30px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 36px clamp(24px, 10vw, 170px) 0;
  color: var(--ink);
}

.brand,
nav {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 6px;
  color: var(--accent-ink);
  background: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

nav {
  gap: clamp(14px, 2vw, 24px);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
}

nav a:hover {
  color: var(--accent);
}

.header-links {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-link {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.header-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.header-icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
}

.header-icon-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.hero,
.band,
.projects,
.contact,
.logbook {
  padding-inline: clamp(24px, 10vw, 170px);
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: clamp(30px, 5vw, 70px);
  align-items: start;
  padding-top: 54px;
}

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

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 26px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.pill-solid {
  color: var(--accent-ink);
  background: var(--accent);
}

.pill-mono {
  color: var(--accent);
  border: 1px solid rgba(94, 200, 240, 0.35);
  background: rgba(94, 200, 240, 0.06);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

.eyebrow,
.section-kicker,
.card-topline,
.label,
dt {
  margin: 0;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow::before,
.section-kicker::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: 0.08em;
}

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

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
}

h1 {
  max-width: 700px;
  margin: 18px 0 20px;
  font-size: clamp(3rem, 6.4vw, 5.6rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
}

h1 span {
  color: var(--accent);
}

h2 {
  max-width: 780px;
  margin-bottom: 0;
  font-size: clamp(1.9rem, 3.6vw, 3.1rem);
  line-height: 1.06;
  letter-spacing: -0.01em;
}

h3 {
  margin-bottom: 12px;
  color: var(--ink);
  font-size: 1.1rem;
  letter-spacing: 0;
}

h3 a {
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 0.18em;
  transition: color 160ms ease, text-decoration-color 160ms ease;
}

h3 a:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

.hero-quote {
  max-width: 520px;
  margin-bottom: 16px;
  color: var(--ink);
  font-size: 1.08rem;
  font-style: italic;
  opacity: 0.88;
}

.hero-copy {
  max-width: 470px;
  margin-bottom: 28px;
  color: var(--muted);
  font-size: 1rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 18px;
}

.see-more {
  display: inline-block;
  color: var(--quiet);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.see-more:hover {
  color: var(--accent);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 45px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  transition: transform 140ms ease;
}

.button.primary {
  color: var(--accent-ink);
  background: var(--accent);
  box-shadow: 0 14px 38px rgba(94, 200, 240, 0.14);
}

.button.secondary {
  color: var(--muted);
  border-color: var(--line);
  background: rgba(238, 242, 246, 0.02);
}

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

/* --- Hero terminal panel --- */
.hero-panel {
  padding-top: 4px;
}

.term {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(238, 242, 246, 0.035), rgba(94, 200, 240, 0.02));
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.term-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(238, 242, 246, 0.02);
}

.term-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--quiet);
  opacity: 0.6;
}

.term-file {
  margin-left: 6px;
  color: var(--quiet);
  font-family: var(--font-mono);
  font-size: 0.68rem;
}

.term-body {
  padding: 16px;
  font-family: var(--font-mono);
}

.term-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 10px;
  font-size: 0.82rem;
}

.term-line:last-child {
  margin-bottom: 0;
}

.term-line span {
  color: var(--quiet);
}

.term-line strong {
  color: var(--accent);
  font-weight: 600;
}

.term-label {
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
}

.cursor {
  color: var(--accent);
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.term-track {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px 16px;
  color: var(--quiet);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.term-track-line {
  position: relative;
  flex: 1;
  height: 1px;
  background: var(--line);
}

.term-track-dot {
  position: absolute;
  top: 50%;
  left: 0;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateY(-50%);
  animation: travel 3.2s ease-in-out infinite;
}

.term-track-dot[data-delay] {
  animation-delay: 1.6s;
}

@keyframes travel {
  0% {
    left: 0;
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    left: 100%;
    opacity: 0;
  }
}

.hero-panel-strip {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  margin-top: 60px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.hero-panel-strip div {
  padding: 18px 24px 18px 0;
}

.metric,
.label {
  display: block;
}

.metric {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 700;
}

.label {
  margin-top: 7px;
  color: var(--quiet);
}

/* --- Intro band --- */
.intro {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
  gap: clamp(28px, 6vw, 92px);
  align-items: end;
  padding-top: 64px;
  padding-bottom: 64px;
  border-bottom: 1px solid var(--line);
}

.intro p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1rem;
}

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

/* --- Status board --- */
.status-board {
  padding-top: 68px;
  padding-bottom: 40px;
}

.status-intro {
  max-width: 340px;
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

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

.status-card {
  padding: 18px 18px 20px;
  border-top: 2px solid var(--line);
  border-radius: 4px;
  background: rgba(238, 242, 246, 0.02);
}

.status-card.tier-shipped {
  border-top-color: var(--accent);
}

.status-card.tier-progress {
  border-top-color: var(--violet);
}

.status-card.tier-bench {
  border-top-color: var(--quiet);
}

.status-card-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 700;
}

.status-card-kicker .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--quiet);
}

.tier-shipped .dot {
  background: var(--accent);
}

.tier-progress .dot {
  background: var(--violet);
}

.status-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

.status-card li + li {
  margin-top: 8px;
}

.callout {
  margin: 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  background: rgba(238, 242, 246, 0.02);
}

.callout strong {
  color: var(--ink);
}

/* --- Logbook --- */
.logbook {
  padding-top: 66px;
  padding-bottom: 70px;
  border-bottom: 1px solid var(--line);
}

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

.log-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(238, 242, 246, 0.02);
}

.log-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.log-dot {
  width: 7px;
  height: 7px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--quiet);
}

.log-dot.dot-shipped {
  background: var(--accent);
}

.log-dot.dot-progress {
  background: var(--violet);
}

.log-file {
  flex: 1;
  color: var(--quiet);
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

.copy-btn {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: border-color 140ms ease, color 140ms ease;
}

.copy-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.copy-btn.is-copied {
  border-color: var(--accent);
  color: var(--accent);
}

.log-title {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 600;
}

.log-body {
  margin: 0;
  padding: 12px;
  border-radius: 6px;
  background: rgba(5, 7, 10, 0.5);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

/* --- Projects --- */
.projects {
  padding-top: 70px;
  padding-bottom: 78px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter {
  min-height: 33px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.filter.is-active {
  color: var(--accent-ink);
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--accent), #8fe0c9);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.loading-state {
  grid-column: 1 / -1;
  margin: 0;
  padding: 28px 20px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.project-card {
  min-height: 310px;
  display: flex;
  flex-direction: column;
  padding: 20px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(238, 242, 246, 0.015);
  transition: background 160ms ease, border-color 160ms ease;
  cursor: pointer;
}

.project-card:hover,
.project-card:focus-visible {
  border-color: rgba(94, 200, 240, 0.4);
  background: linear-gradient(180deg, var(--accent-soft), var(--violet-soft));
  outline: none;
}

.devlog-hint {
  margin-top: 14px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 700;
  opacity: 0.8;
}

.project-card:hover .devlog-hint,
.project-card:focus-visible .devlog-hint {
  opacity: 1;
}

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

.card-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 38px;
  color: var(--quiet);
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border: 1px solid rgba(94, 200, 240, 0.5);
  border-radius: 999px;
  color: var(--accent);
  background: transparent;
  font-size: 0.66rem;
}

.project-card p {
  color: var(--muted);
}

dl {
  display: grid;
  gap: 12px;
  margin: auto 0 0;
}

dt,
dd {
  margin: 0;
}

dd {
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 650;
}

/* --- Devlog overlay --- */
.devlog-open {
  overflow: hidden;
}

.devlog-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(14px, 4vw, 40px);
  background: rgba(5, 7, 10, 0.74);
  backdrop-filter: blur(6px);
}

.devlog-overlay[hidden] {
  display: none;
}

.devlog-panel {
  position: relative;
  width: min(100%, 640px);
  max-height: min(84vh, 780px);
  display: flex;
  flex-direction: column;
  padding: clamp(24px, 4vw, 40px);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, var(--stage-top), var(--stage-bottom) 80%);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
}

.devlog-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: transparent;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.devlog-close:hover,
.devlog-close:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  outline: none;
}

.devlog-head {
  padding-right: 40px;
  margin-bottom: 20px;
  flex-shrink: 0;
}

.devlog-head h2 {
  margin: 6px 0 10px;
  font-size: clamp(1.4rem, 3vw, 1.8rem);
}

.devlog-summary {
  margin: 0 0 12px;
  color: var(--muted);
}

.devlog-repo-link {
  display: inline-flex;
  color: var(--violet);
  font-weight: 650;
  font-size: 0.86rem;
}

.devlog-repo-link:hover {
  color: var(--accent);
}

.devlog-entries {
  overflow-y: auto;
  padding-right: 6px;
  border-top: 1px solid var(--line);
}

.devlog-entries::-webkit-scrollbar {
  width: 6px;
}

.devlog-entries::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 999px;
}

.devlog-entry {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.devlog-entry:last-child {
  border-bottom: none;
}

.devlog-entry-date {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-family: var(--font-mono);
}

.devlog-entry h3 {
  margin: 0 0 6px;
  font-size: 1.02rem;
}

.devlog-entry p {
  margin: 0;
  color: var(--muted);
}

.devlog-empty {
  padding: 22px 0;
  margin: 0;
  color: var(--muted);
}

/* --- Contact --- */
.contact {
  position: relative;
  min-height: 420px;
  display: grid;
  align-content: center;
  justify-items: start;
  padding-top: 80px;
  padding-bottom: 88px;
  overflow: hidden;
}

.contact::after {
  content: "p50";
  position: absolute;
  right: clamp(16px, 8vw, 110px);
  bottom: -0.1em;
  color: rgba(238, 242, 246, 0.06);
  font-family: var(--font-mono);
  font-size: clamp(8rem, 22vw, 20rem);
  font-weight: 600;
  line-height: 0.8;
  letter-spacing: -0.02em;
  pointer-events: none;
}

.contact .section-kicker {
  color: var(--muted);
}

.contact h2 {
  max-width: 700px;
  margin: 14px 0 28px;
}

.contact-actions {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 22px;
}

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

.contact-link {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

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

@media (max-width: 980px) {
  .site-header {
    padding-inline: clamp(24px, 8vw, 80px);
  }

  .hero,
  .band,
  .projects,
  .contact,
  .logbook {
    padding-inline: clamp(24px, 8vw, 80px);
  }

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

  .hero-panel {
    max-width: 420px;
  }

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

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

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

  .status-intro {
    max-width: none;
  }
}

@media (max-width: 640px) {
  body {
    padding: 10px;
  }

  body::before {
    inset: 10px;
    border-radius: 10px;
  }

  .site-header {
    position: relative;
    top: 0;
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
    padding: 28px 22px 0;
  }

  nav {
    width: 100%;
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .header-links {
    align-self: flex-start;
  }

  .hero,
  .band,
  .projects,
  .contact,
  .logbook {
    padding-inline: 22px;
  }

  .hero {
    padding-top: 46px;
  }

  h1 {
    font-size: clamp(2.6rem, 12vw, 4rem);
  }

  .hero-panel-strip,
  .project-grid {
    grid-template-columns: 1fr;
  }

  .card-topline {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 30px;
  }
}
