/* ---------- design tokens ---------- */
:root {
  --bg: #0b0d10;
  --bg-elev: #11151b;
  --bg-elev-2: #161b22;
  --line: #1f262f;
  --line-strong: #2a323d;
  --text: #e7eaf0;
  --text-muted: #7a8290;
  --text-faint: #4a5260;
  --accent: #7df9c0;
  --accent-soft: rgba(125, 249, 192, 0.18);
  --accent-glow: rgba(125, 249, 192, 0.35);
  --danger: #ff8b6b;

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Inter Tight", "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;

  --max-w: 1180px;
  --nav-h: 64px;
}

/* ---------- reset-ish ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* note: native scroll-behavior:smooth is intentionally NOT used —
   we drive scroll in JS with our own easing curve (see script.js). */

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

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

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

::selection {
  background: var(--accent-soft);
  color: var(--text);
}

.skip-link {
  position: absolute;
  left: -9999px;
}
.skip-link:focus {
  left: 16px;
  top: 16px;
  padding: 8px 12px;
  background: var(--accent);
  color: var(--bg);
  border-radius: var(--r-sm);
  z-index: 100;
}

/* ---------- ambient background ---------- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(
      1000px 600px at 80% -10%,
      rgba(125, 249, 192, 0.06),
      transparent 60%
    ),
    radial-gradient(
      800px 500px at -10% 110%,
      rgba(125, 249, 192, 0.04),
      transparent 60%
    );
  pointer-events: none;
  z-index: -1;
}

/* ---------- nav ---------- */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  background: rgba(11, 13, 16, 0.65);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid transparent;
  z-index: 50;
  transition: border-color 0.25s ease, background 0.25s ease;
}

.site-nav.scrolled {
  border-bottom-color: var(--line);
  background: rgba(11, 13, 16, 0.85);
}

.wordmark {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.wordmark-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.85); }
}

.wordmark-muted {
  color: var(--text-muted);
}

.site-nav nav ul {
  display: flex;
  gap: 4px;
}

.site-nav nav a {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  padding: 8px 12px;
  border-radius: var(--r-sm);
  transition: color 0.18s ease, background 0.18s ease;
  position: relative;
}

.site-nav nav a:hover,
.site-nav nav a:focus-visible {
  color: var(--text);
  background: var(--bg-elev);
}

.site-nav nav a.active {
  color: var(--accent);
}

/* ---------- hero ---------- */
.hero {
  min-height: 100vh;
  padding: calc(var(--nav-h) + 32px) 32px 64px;
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 48px;
  align-items: center;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: lowercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin: 0 0 24px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  animation: pulse 2.4s ease-in-out infinite;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(48px, 7.5vw, 92px);
  line-height: 0.98;
  letter-spacing: -0.03em;
  margin: 0 0 24px;
}

.cursor {
  display: inline-block;
  width: 0.45ch;
  height: 0.85em;
  margin-left: 0.08em;
  background: var(--accent);
  vertical-align: -0.05em;
  animation: blink 1.1s steps(2) infinite;
  box-shadow: 0 0 12px var(--accent-glow);
}

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

.lede {
  font-size: 18px;
  line-height: 1.55;
  color: var(--text);
  max-width: 52ch;
  margin: 0 0 32px;
}

.lede .hl {
  color: var(--accent);
  font-weight: 500;
}

.lede .ext {
  border-bottom: 1px dashed var(--text-muted);
  transition: color 0.18s ease, border-color 0.18s ease;
}

.lede .ext:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.btn {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  padding: 12px 20px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    color 0.18s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn.primary {
  background: var(--accent);
  color: var(--bg);
  box-shadow: 0 0 0 0 var(--accent-glow);
}

.btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px -8px var(--accent-glow);
}

.btn.ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--text);
}

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

/* ---------- hero stats ---------- */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin: 0;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  max-width: 480px;
}

.hero-stats div {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hero-stats dt {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
}

.hero-stats dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
}

/* ---------- graph ---------- */
.hero-graph {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 560px;
  justify-self: end;
  border-radius: var(--r-lg);
  overflow: hidden;
}

.hero-graph canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}

.hero-graph canvas:active {
  cursor: grabbing;
}

.graph-caption {
  position: absolute;
  bottom: 12px;
  left: 16px;
  color: var(--text-faint);
  font-size: 11px;
  pointer-events: none;
  user-select: none;
}

.mono {
  font-family: var(--font-mono);
}

/* ---------- scroll cue ---------- */
.scroll-cue {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text-faint);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.scroll-cue .arrow {
  animation: bob 1.8s ease-in-out infinite;
  font-size: 14px;
  color: var(--accent);
}

@keyframes bob {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50% { transform: translateY(4px); opacity: 1; }
}

/* ---------- sections ---------- */
.section {
  padding: 120px 32px;
  max-width: var(--max-w);
  margin: 0 auto;
  scroll-margin-top: calc(var(--nav-h) + 8px);
  position: relative;
}

.section + .section {
  border-top: 1px dashed var(--line);
}

.section-frame {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2.3fr);
  gap: 56px;
  align-items: start;
}

.section-meta {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.section-index {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.section-index::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--accent);
  display: inline-block;
}

.section h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(34px, 4.6vw, 52px);
  letter-spacing: -0.025em;
  line-height: 1.02;
  margin: 0;
}

.section-kicker {
  color: var(--text-faint);
  font-size: 12px;
  margin: 0;
}

.section-summary {
  color: var(--text-muted);
  font-size: 14.5px;
  line-height: 1.6;
  max-width: 34ch;
  margin: 4px 0 0;
}

/* ---------- panel (shared "content card" component) ---------- */
.panel {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background:
    linear-gradient(
      180deg,
      rgba(22, 27, 34, 0.55) 0%,
      rgba(17, 21, 27, 0.35) 100%
    );
  overflow: hidden;
  position: relative;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.panel::before {
  /* subtle scanline / dot pattern bg */
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(
    rgba(255, 255, 255, 0.025) 1px,
    transparent 1px
  );
  background-size: 18px 18px;
  pointer-events: none;
  opacity: 0.6;
}

.panel:hover {
  border-color: var(--line-strong);
  box-shadow: 0 24px 60px -28px rgba(0, 0, 0, 0.6);
}

.panel-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 13, 16, 0.4);
}

.panel-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
}

.panel-status .status-dot {
  width: 6px;
  height: 6px;
}

.panel-path {
  font-size: 11px;
  color: var(--text-faint);
}

.panel-body {
  position: relative;
  padding: 32px;
  min-height: 200px;
}

.panel-body.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  font-size: 13px;
  min-height: 240px;
}

.panel-body.placeholder::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 24px;
  height: 1px;
  background: var(--accent);
  opacity: 0.4;
}

/* ---------- contact page ---------- */
.contact-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.contact-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--nav-h) + 32px) 32px 28px;
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
}

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 56px;
  align-items: center;
  width: 100%;
}

.contact-copy h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(44px, 6vw, 72px);
  letter-spacing: -0.035em;
  line-height: 0.95;
  margin: 0 0 20px;
}

.contact-copy .lede {
  font-size: 15.5px;
  margin: 0 0 22px;
}

/* Lock contact page to one viewport on roomy desktop — no scroll feel. */
@media (min-width: 880px) and (min-height: 660px) {
  .contact-page {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }
  .contact-main {
    flex: 1 1 auto;
    min-height: 0;
  }
  .contact-page .site-footer {
    padding: 14px 32px;
  }
}

.contact-channels {
  /* uses .panel */
}

.channel {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
  transition: background 0.2s ease, padding-left 0.2s ease;
  position: relative;
}

.channel:last-child {
  border-bottom: none;
}

.channel:hover {
  background: rgba(125, 249, 192, 0.04);
  padding-left: 32px;
}

.channel-kind {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
}

.channel-value {
  font-size: 16px;
  color: var(--text);
  font-weight: 500;
}

.channel-arrow {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 18px;
  transition: transform 0.2s ease;
}

.channel:hover .channel-arrow {
  transform: translateX(4px);
}

.contact-foot {
  margin-top: 28px;
  color: var(--text-faint);
  font-size: 12px;
}

/* ---------- channel list (compact, on contact page copy column) ---------- */
.channel-list {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.channel-list a {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 8px 12px;
  margin-left: -12px;
  border-radius: var(--r-sm);
  transition: background 0.18s ease, transform 0.18s ease;
  color: var(--text);
}

.channel-list a:hover {
  background: rgba(125, 249, 192, 0.05);
  transform: translateX(4px);
}

.channel-list .channel-kind {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
}

.channel-list .channel-value {
  font-size: 14px;
  color: var(--text);
}

.channel-list .channel-arrow {
  color: var(--accent);
  font-family: var(--font-mono);
}

/* ---------- contact form ---------- */
.form-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
}

.field input,
.field textarea {
  width: 100%;
  padding: 10px 13px;
  background: rgba(11, 13, 16, 0.55);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  font-family: var(--font-sans);
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
  resize: vertical;
}

.field textarea {
  min-height: 88px;
  line-height: 1.55;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--text-faint);
}

.field input:hover,
.field textarea:hover {
  border-color: var(--line-strong);
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(11, 13, 16, 0.85);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.btn .btn-arrow {
  transition: transform 0.18s ease;
}

.btn:hover .btn-arrow {
  transform: translateX(2px);
}

.form-status {
  font-size: 12px;
  color: var(--text-muted);
  min-height: 1.4em;
}

.form-status.success {
  color: var(--accent);
}

.form-status.error {
  color: var(--danger);
}

button[type="submit"][disabled] {
  opacity: 0.7;
  cursor: progress;
}

/* ---------- about ---------- */
.about-body {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 48px;
  padding: 40px;
  align-items: start;
}

.about-side {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.about-portrait {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.portrait-frame {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: var(--r-md);
  background:
    radial-gradient(
      120% 80% at 50% 100%,
      rgba(125, 249, 192, 0.07),
      transparent 60%
    ),
    rgba(11, 13, 16, 0.6);
  border: 1px solid var(--line);
  overflow: hidden;
  isolation: isolate;
}

.portrait-frame img {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.portrait-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 84px;
  font-weight: 500;
  color: rgba(125, 249, 192, 0.35);
  letter-spacing: -0.03em;
  z-index: 1;
  user-select: none;
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 14px 14px;
}

.portrait-corner {
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: var(--accent);
  border-style: solid;
  border-width: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.8;
}

.portrait-corner.tl {
  top: 8px;
  left: 8px;
  border-top-width: 1px;
  border-left-width: 1px;
}
.portrait-corner.tr {
  top: 8px;
  right: 8px;
  border-top-width: 1px;
  border-right-width: 1px;
}
.portrait-corner.bl {
  bottom: 8px;
  left: 8px;
  border-bottom-width: 1px;
  border-left-width: 1px;
}
.portrait-corner.br {
  bottom: 8px;
  right: 8px;
  border-bottom-width: 1px;
  border-right-width: 1px;
}

.portrait-caption {
  font-size: 11px;
  color: var(--text-faint);
  text-align: left;
}

.about-prose {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-muted);
  max-width: 56ch;
}

.about-prose p + p {
  margin-top: 18px;
}

.about-prose .about-lead {
  font-size: 19px;
  line-height: 1.5;
  color: var(--text);
  font-weight: 500;
  margin-bottom: 22px;
}

.about-prose em {
  font-style: normal;
  color: var(--accent);
  font-weight: 500;
}

.hl-soft {
  background: linear-gradient(180deg, transparent 60%, var(--accent-soft) 60%);
  padding: 0 2px;
  border-radius: 2px;
  color: var(--text);
}

.ext {
  border-bottom: 1px dashed var(--text-muted);
  transition: color 0.18s ease, border-color 0.18s ease;
  color: var(--text);
}

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

.about-facts {
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.about-facts dl {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
}

.about-facts dt {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-faint);
  margin-bottom: 3px;
}

.about-facts dd {
  margin: 0;
  font-size: 13.5px;
  color: var(--text);
}

/* ---------- work / role cards ---------- */
.work-body {
  padding: 12px 0 32px;
}

.role-list {
  display: flex;
  flex-direction: column;
}

.role {
  padding: 32px 36px;
  border-top: 1px solid var(--line);
  position: relative;
  transition: background 0.2s ease;
}

.role:first-child {
  border-top: none;
}

.role::before {
  /* tiny vertical accent on the left */
  content: "";
  position: absolute;
  left: 0;
  top: 32px;
  bottom: 32px;
  width: 2px;
  background: transparent;
  transition: background 0.2s ease;
}

.role:hover::before {
  background: var(--accent);
}

.role-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.role-id {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.role-company {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.01em;
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.role-client {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0;
}

.role-title {
  font-size: 13.5px;
  color: var(--text-muted);
  margin: 0;
}

.role-time {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.role-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: 1px solid var(--line-strong);
  color: var(--text-muted);
}

.role-tag.current {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.role-dates {
  font-size: 12px;
  color: var(--text-faint);
}

.role-summary {
  margin: 0 0 14px;
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.6;
}

.role-bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0;
}

.role-bullets[data-bullets="collapsed"] > li:nth-child(n + 4) {
  display: none;
}

.role-bullets > li {
  position: relative;
  padding-left: 22px;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.65;
}

.role-bullets > li::before {
  content: "›";
  position: absolute;
  left: 4px;
  top: 0;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 14px;
}

.role-bullets strong {
  color: var(--text);
  font-weight: 500;
}

.role-toggle {
  margin-top: 14px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 11.5px;
  cursor: pointer;
  padding: 4px 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: color 0.18s ease;
  letter-spacing: 0.02em;
}

.role-toggle:hover {
  color: var(--accent);
}

.role-toggle-arrow {
  transition: transform 0.22s ease;
  display: inline-block;
}

.role-toggle[aria-expanded="true"] .role-toggle-arrow {
  transform: rotate(180deg);
}

.role-stack {
  font-size: 11.5px;
  color: var(--text-faint);
  margin: 22px 0 0;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

.role-footnote {
  padding: 20px 36px 0;
  border-top: 1px dashed var(--line);
  margin-top: 8px;
  color: var(--text-faint);
  font-size: 12px;
}

/* ---------- projects ---------- */
.projects-body {
  padding: 28px;
}

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

.project-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(11, 13, 16, 0.4);
  transition:
    border-color 0.2s ease,
    transform 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
  color: var(--text);
  text-decoration: none;
  position: relative;
}

.project-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 20px 40px -24px var(--accent-glow);
  background: rgba(125, 249, 192, 0.03);
}

.project-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.project-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: 1px solid var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.project-meta {
  font-size: 11px;
  color: var(--text-faint);
}

.project-card h3 {
  font-family: var(--font-display);
  font-size: 18px;
  margin: 0;
  letter-spacing: -0.01em;
  font-weight: 600;
}

.project-card p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-muted);
}

.project-link {
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--accent);
  transition: transform 0.18s ease;
}

.project-card:hover .project-link {
  transform: translateX(4px);
}

/* ---------- stack ---------- */
.stack-body {
  padding: 28px 32px;
}

.stack-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
}

.stack-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 24px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px dashed var(--line);
}

.stack-row:last-child {
  border-bottom: none;
}

.stack-row dt {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
}

.stack-row dd {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(11, 13, 16, 0.4);
  color: var(--text);
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

/* ---------- minimap ---------- */
.minimap {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 140px;
  height: 140px;
  background: rgba(17, 21, 27, 0.7);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transform: translateY(12px) scale(0.95);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  z-index: 40;
}

.minimap.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.minimap canvas {
  width: 100%;
  height: 100%;
  cursor: pointer;
}

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
  max-width: var(--max-w);
  margin: 0 auto;
}

.site-footer .muted {
  color: var(--text-faint);
}

/* ---------- responsive ---------- */
@media (max-width: 880px) {
  .site-nav {
    padding: 0 20px;
  }
  .site-nav nav ul {
    gap: 0;
  }
  .site-nav nav a {
    padding: 8px 8px;
    font-size: 12px;
  }

  .hero {
    padding: calc(var(--nav-h) + 24px) 20px 48px;
  }
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .hero-graph {
    justify-self: center;
    max-width: 420px;
  }
  .hero-stats {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .section {
    padding: 72px 20px;
  }

  .section-frame {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .section-meta {
    position: static;
  }

  .panel-body {
    padding: 24px;
  }

  .contact-main {
    padding: calc(var(--nav-h) + 32px) 20px 40px;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .channel {
    grid-template-columns: 64px 1fr auto;
    padding: 18px 18px;
  }

  .minimap {
    width: 96px;
    height: 96px;
    bottom: 16px;
    right: 16px;
  }

  .site-footer {
    flex-direction: column;
    gap: 8px;
    text-align: center;
    padding: 20px;
  }

  .channel-list a {
    grid-template-columns: 64px 1fr auto;
  }

  .about-body {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 24px;
  }

  .about-side {
    flex-direction: row;
    gap: 24px;
    align-items: flex-start;
  }

  .about-portrait {
    width: 160px;
    flex-shrink: 0;
  }

  .about-facts {
    flex: 1;
    padding-top: 0;
    border-top: none;
    border-left: 1px solid var(--line);
    padding-left: 20px;
  }

  .role {
    padding: 24px 20px;
  }

  .role-footnote {
    padding: 16px 20px 0;
  }

  .role-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

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

  .projects-body,
  .stack-body {
    padding: 20px;
  }

  .stack-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 12px 0;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .form-body {
    padding: 20px;
  }
}

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