:root {
  color-scheme: dark;
  --bg: #030711;
  --panel: rgba(7, 17, 31, .88);
  --panel-soft: rgba(12, 28, 49, .72);
  --line: rgba(76, 166, 224, .20);
  --line-hot: rgba(48, 205, 255, .58);
  --text: #edf7ff;
  --muted: #96adc1;
  --cyan: #3ad5ff;
  --blue: #5786ff;
  --green: #5de2b1;
  --shadow: 0 28px 90px rgba(0, 0, 0, .42);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.7;
  background:
    radial-gradient(circle at 76% 4%, rgba(46, 144, 255, .14), transparent 34rem),
    radial-gradient(circle at 12% 52%, rgba(0, 209, 255, .08), transparent 30rem),
    var(--bg);
  isolation: isolate;
}

a { color: var(--cyan); text-underline-offset: .18em; }
a:hover { color: #b9f3ff; }

canvas#matrix {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  opacity: .44;
  pointer-events: none;
}
.ambient-grid {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(66, 144, 200, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(66, 144, 200, .04) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(to bottom, #000, transparent 94%);
}
.site-header, .page-shell, .site-footer { position: relative; z-index: 2; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--line);
  background: rgba(3, 7, 17, .80);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.header-inner, .page-shell, .footer-inner {
  width: min(1120px, calc(100% - 42px));
  margin: 0 auto;
}
.header-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand { display: inline-flex; align-items: center; text-decoration: none; }
.full-logo { display: block; width: auto; height: 49px; max-width: min(320px, 56vw); margin: 0; }
.site-nav { display: flex; align-items: center; gap: 6px; }
.site-nav a {
  padding: 9px 13px;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-size: .86rem;
  font-weight: 750;
}
.site-nav a:hover { color: var(--text); background: rgba(56, 203, 255, .08); }

.page-shell { padding: 40px 0 76px; }
.project-panel {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: linear-gradient(120deg, rgba(5, 13, 25, .97), rgba(9, 22, 41, .90));
  box-shadow: var(--shadow);
}
.project-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 28px 0;
  border-right: 1px solid var(--line);
  color: #6fbad7;
}
.rail-code {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .67rem;
  letter-spacing: .22em;
}
.rail-pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 7px rgba(93, 226, 177, .08), 0 0 18px var(--green);
  animation: pulse 2.2s ease-in-out infinite;
}
.content-column { min-width: 0; padding: clamp(28px, 6vw, 68px); }
.project-heading { max-width: 850px; padding: 4px 0 34px; }
.eyebrow {
  margin: 0 0 12px;
  color: var(--cyan);
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.project-heading h1 {
  margin: 0;
  font-size: clamp(2.45rem, 6vw, 5.25rem);
  line-height: .98;
  letter-spacing: -.055em;
}
.project-summary { max-width: 760px; margin: 22px 0 0; color: #b4c8d9; font-size: 1.06rem; }
.content-card {
  min-width: 0;
  padding: clamp(24px, 4.5vw, 48px);
  border: 1px solid var(--line);
  border-radius: 19px;
  background: linear-gradient(150deg, rgba(18, 39, 64, .72), rgba(5, 14, 27, .91));
}

.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose h1, .prose h2, .prose h3, .prose h4 { color: var(--text); line-height: 1.2; letter-spacing: -.025em; scroll-margin-top: 95px; }
.prose h1 { font-size: 2.15rem; }
.prose h2 { margin-top: 2.2em; padding-bottom: .45rem; border-bottom: 1px solid var(--line); font-size: 1.65rem; }
.prose h3 { margin-top: 1.8em; font-size: 1.28rem; }
.prose p, .prose li { color: #c0cfdd; }
.prose strong { color: var(--text); }
.prose blockquote { margin: 1.5rem 0; padding: .5rem 1.25rem; border-left: 3px solid var(--cyan); color: #b9cddd; background: rgba(58, 213, 255, .05); }
.prose hr { height: 1px; margin: 2.5rem 0; border: 0; background: var(--line); }
.prose img { display: block; width: auto; max-width: 100%; height: auto; margin: 1.6rem auto; border-radius: 12px; }
.prose table { width: 100%; margin: 1.5rem 0; border-collapse: collapse; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; }
.prose th, .prose td { padding: .75rem .9rem; border-bottom: 1px solid var(--line); text-align: left; }
.prose th { color: var(--text); background: rgba(58, 213, 255, .08); }
.prose code { padding: .16rem .4rem; border: 1px solid rgba(58, 213, 255, .16); border-radius: 5px; color: #a8edff; background: rgba(2, 9, 18, .75); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; }
.prose pre { position: relative; max-width: 100%; margin: 1.5rem 0; overflow-x: auto; border: 1px solid rgba(58, 213, 255, .25); border-radius: 11px; background: #040b14; box-shadow: inset 0 1px 0 rgba(255,255,255,.025); }
.prose pre code { display: block; min-width: max-content; padding: 1.2rem; border: 0; color: #bceeff; background: transparent; line-height: 1.55; }
.copy-button { position: absolute; top: 9px; right: 9px; z-index: 2; padding: 6px 9px; border: 1px solid var(--line-hot); border-radius: 7px; color: var(--cyan); background: rgba(4, 11, 20, .92); cursor: pointer; font: 700 .72rem/1 ui-sans-serif, system-ui, sans-serif; }
.copy-button:hover { color: #03101b; background: var(--cyan); }

.site-footer { padding-bottom: 30px; border-top: 1px solid var(--line); background: rgba(3, 7, 17, .80); }
.footer-inner { min-height: 132px; display: flex; align-items: center; justify-content: space-between; gap: 30px; color: var(--muted); }
.footer-inner strong { color: var(--text); }
.footer-inner p { margin: 3px 0 0; }
.footer-meta { display: flex; flex-direction: column; align-items: flex-end; text-align: right; font-size: .84rem; }
.footer-meta a { text-decoration: none; font-weight: 800; }
.status-bar { position: fixed; z-index: 110; bottom: 0; left: 0; right: 0; min-height: 30px; padding: 5px max(14px, env(safe-area-inset-right)) 5px max(14px, env(safe-area-inset-left)); display: flex; align-items: center; justify-content: center; gap: clamp(18px, 6vw, 74px); border-top: 1px solid var(--line); color: #83b8ce; background: rgba(3, 8, 16, .94); backdrop-filter: blur(12px); font: 700 .68rem/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .04em; text-transform: uppercase; }
.status-bar i { display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 9px var(--green); }

@keyframes pulse { 50% { opacity: .45; transform: scale(.8); } }
@media (max-width: 720px) {
  .header-inner, .page-shell, .footer-inner { width: min(100% - 24px, 1120px); }
  .header-inner { min-height: 64px; }
  .full-logo { height: 42px; }
  .site-nav a:not(:last-child) { display: none; }
  .page-shell { padding-top: 22px; }
  .project-panel { grid-template-columns: 1fr; border-radius: 20px; }
  .project-rail { display: none; }
  .content-column { padding: 27px 20px 30px; }
  .project-heading h1 { font-size: 2.75rem; }
  .content-card { padding: 24px 19px; }
  .footer-inner { padding: 28px 0; flex-direction: column; align-items: flex-start; }
  .footer-meta { align-items: flex-start; text-align: left; }
  .status-bar span:nth-child(2) { display: none; }
}
@media (max-width: 430px) { .status-bar span:nth-child(3) { display: none; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  canvas#matrix { display: none; }
}
