:root {
  --bg: #0a0d12;
  --bg-panel: rgba(9, 13, 19, 0.85);
  --bg-panel-solid: rgba(9, 13, 19, 0.96);
  --bg-input: #0a0e14;
  --bg-card: linear-gradient(160deg, rgba(15, 20, 27, 0.9), rgba(10, 13, 18, 0.9));
  --cyan: #35e0f0;
  --cyan-bright: #8af4ff;
  --cyan-soft: #7fe7f3;
  --magenta: #f45ac8;
  --magenta-soft: #f9a4dd;
  --green: #4ade80;
  --green-soft: #86efac;
  --yellow: #facc15;
  --ink: #05070a;
  --text-hi: #f2fbfd;
  --text: #eaf6f8;
  --text-body: #d8e2e8;
  --text-body-2: #b8c6d1;
  --text-body-3: #b3c1cd;
  --text-mid: #a9b8c4;
  --text-mid-2: #a4b3bf;
  --text-muted: #9fb2bf;
  --text-muted-2: #93a2af;
  --text-dim: #8f9daa;
  --text-faint: #6e7d8b;
  --text-faintest: #6f7e8b;
  --border: #1e2833;
  --border-2: #23303c;
  --border-3: #2c3947;
  --divider: #1a2330;
  --border-cyan: rgba(53, 224, 240, 0.22);
  --border-cyan-faint: rgba(53, 224, 240, 0.12);
  --mx: 50%;
  --my: 40%;
  --max-width: 1240px;
  --max-post-width: 820px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-body);
  font-family: "Segoe UI", Inter, Arial, sans-serif;
  line-height: 1.6;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 13, 18, 0.25), rgba(10, 13, 18, 0.7));
  pointer-events: none;
  z-index: 5;
}

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

a {
  color: var(--cyan);
  text-decoration: none;
}

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

code, pre, textarea, input, select, button {
  font-family: "JetBrains Mono", "Consolas", "SFMono-Regular", monospace;
}

.site-shell {
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
}

.background-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.grid-layer {
  position: absolute;
  inset: -60px;
  background-image:
    linear-gradient(rgba(53, 224, 240, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(53, 224, 240, 0.055) 1px, transparent 1px);
  background-size: 60px 60px;
}

.ambient {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.65;
}

.ambient-left {
  width: 50vw;
  height: 40vw;
  left: -10vw;
  top: -5vh;
  background: rgba(53, 224, 240, 0.16);
}

.ambient-right {
  width: 42vw;
  height: 34vw;
  right: -10vw;
  bottom: 8vh;
  background: rgba(244, 90, 200, 0.12);
}

.matrix-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  /* Only the leading edge of each column is bright (see scripts/site.js),
     so this can sit high enough to be seen without becoming a curtain. */
  opacity: 0.45;
}

.scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    180deg,
    transparent 0px,
    transparent 2px,
    rgba(0, 0, 0, 0.22) 3px,
    transparent 4px
  );
  mix-blend-mode: multiply;
}

/* The sweep is retired: it was permanent ambient motion that read as a
   gimmick. Kept as a rule so it can be brought back in one line. */
.sweep {
  display: none;
}

.cursor-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--mx) var(--my), rgba(53, 224, 240, 0.12), transparent 35%);
}

.vignette {
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 220px 60px rgba(5, 7, 10, 0.9);
}

.site-header,
main,
.site-footer {
  position: relative;
  z-index: 10;
}

/* ---------------------------------------------------------------------------
   Build rail

   A pixel-art tower that assembles itself as you scroll. scripts/site.js adds
   .on to each stage group in turn, and .powered to the rail at the last one.
   Everything is drawn on a whole-pixel grid with crispEdges, so no anti-
   aliasing softens the blocks.
   --------------------------------------------------------------------------- */

.build-rail {
  --build-progress: 0;
  position: fixed;
  left: 26px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  width: 180px;
  pointer-events: none;
}

.build-svg {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  transition: filter 0.6s ease;
}

/* Each component starts absent and snaps into place. steps() keeps the
   movement chunky rather than gliding, which suits the pixel art. */
.bflow,
.bbar {
  transform-box: fill-box;
  transform-origin: left center;
}

.bstage {
  opacity: 0;
  transform: translateY(6px);
  transform-box: fill-box;
  transform-origin: center;
  transition: opacity 0.25s steps(3), transform 0.25s steps(3);
}

.bstage.on {
  opacity: 1;
  transform: none;
}

/* Once the power supply is fitted, the machine comes up. */
.build-rail.powered .build-svg {
  filter: drop-shadow(0 0 12px rgba(53, 224, 240, 0.5));
}

.build-rail.powered .btrace {
  fill: #35e0f0;
}

/* Ceiling lights come up with the room. */
.build-rail.powered .bceil {
  fill: #35e0f0;
  opacity: 0.55;
}

/* Cold air rising from the floor vents. */
.build-rail.powered .bflow {
  animation: build-flow 1.8s steps(4) infinite;
}

@keyframes build-flow {
  from { transform: translateY(0); opacity: 0.45; }
  to { transform: translateY(-6px); opacity: 0; }
}

/* Activity bars on the wall console. */
.build-rail.powered .bbar {
  animation: build-bar 2.2s steps(3) infinite alternate;
}

.build-rail.powered .bbar:nth-of-type(2) { animation-delay: 0.4s; }
.build-rail.powered .bbar:nth-of-type(3) { animation-delay: 0.8s; }
.build-rail.powered .bbar:nth-of-type(4) { animation-delay: 1.2s; }

@keyframes build-bar {
  from { transform: scaleX(0.35); }
  to { transform: scaleX(1); }
}

.build-rail.powered .bled {
  animation: build-blink 1.2s steps(1) infinite;
}

.build-rail.powered .bled:nth-of-type(6n + 4) { animation-delay: 0.4s; }
.build-rail.powered .bled:nth-of-type(6n + 6) { animation-delay: 0.8s; }

@keyframes build-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0.2; }
}

/* Two-frame sprite animation: the blades alternate rather than rotating,
   the way a spinning fan is drawn in pixel art. */
.pxfan-a,
.pxfan-b {
  opacity: 0;
}

.bstage.on .pxfan-a {
  animation: px-frame-a 0.7s steps(1) infinite;
}

.bstage.on .pxfan-b {
  animation: px-frame-b 0.7s steps(1) infinite;
}

@keyframes px-frame-a {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@keyframes px-frame-b {
  0%, 49% { opacity: 0; }
  50%, 100% { opacity: 1; }
}

/* Build progress under the tower. */
.build-meter {
  margin-top: 14px;
  height: 4px;
  background: var(--divider);
  overflow: hidden;
}

.build-meter-fill {
  height: 100%;
  width: calc(var(--build-progress) * 100%);
  background: var(--cyan);
  box-shadow: 0 0 10px rgba(53, 224, 240, 0.8);
  transition: width 0.15s steps(6);
}

.build-caption {
  margin-top: 10px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.16em;
}

.build-step {
  color: var(--magenta);
}

.build-label {
  color: var(--text-faint);
  transition: color 0.3s ease;
}

.build-rail.powered .build-label {
  color: var(--cyan-bright);
}

/* The tower needs a clear gutter beside the 1240px content column, so it
   only appears once the window is wide enough to hold both. */
@media (max-width: 1660px) {
  .build-rail {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bstage {
    transition: opacity 0.2s ease;
    transform: none;
  }

  .build-rail.powered .bled,
  .build-rail.powered .bflow,
  .build-rail.powered .bbar,
  .bstage.on .pxfan-a,
  .bstage.on .pxfan-b {
    animation: none;
  }

  .bstage.on .pxfan-a {
    opacity: 1;
  }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(10, 13, 18, 0.78);
  border-bottom: 1px solid rgba(53, 224, 240, 0.16);
}

.nav-inner,
.footer-inner,
.section-inner,
.page-shell,
.post-shell {
  width: min(var(--max-width), calc(100% - 48px));
  margin: 0 auto;
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 14px 24px;
  flex-wrap: wrap;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

.wordmark-block {
  width: 10px;
  height: 10px;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
  opacity: 0.35;
  animation: wordmarkPulse 2s ease-in-out infinite;
}

.wordmark-text {
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 17px;
}

.site-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}

.site-nav a,
.footer-links a {
  font-family: "JetBrains Mono", monospace;
  font-size: 12.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  transition: color 0.2s ease;
}

.site-nav a:hover,
.footer-links a:hover {
  color: var(--cyan);
  text-shadow: 0 0 10px rgba(53, 224, 240, 0.6);
}

.primary-button,
.secondary-button,
.submit-button,
.inline-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  cursor: pointer;
}

.primary-button {
  background: rgba(53, 224, 240, 0.06);
  color: var(--cyan);
  border-color: var(--cyan);
  padding: 9px 16px;
}

.primary-button:hover {
  background: var(--cyan);
  color: var(--ink);
  box-shadow: 0 0 22px rgba(53, 224, 240, 0.45);
}

.secondary-button {
  background: transparent;
  color: var(--text-body);
  border-color: var(--border-3);
  padding: 15px 26px;
}

.secondary-button:hover {
  color: var(--magenta);
  border-color: rgba(244, 90, 200, 0.5);
  box-shadow: 0 0 24px rgba(244, 90, 200, 0.3);
}

.hero {
  width: min(var(--max-width), calc(100% - 48px));
  margin: 0 auto;
  padding: 96px 24px 80px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  align-items: center;
  gap: 56px;
}

.hero-copy {
  max-width: 54rem;
}

.eyebrow,
.meta-line,
.field-label,
.section-number,
.card-id,
.service-tag,
.status-tag,
.newsletter-label,
.cert-label,
.chip,
.pill, .blog-metadata {
  font-family: "JetBrains Mono", monospace;
  text-transform: uppercase;
}

.eyebrow {
  font-size: 12.5px;
  letter-spacing: 0.18em;
  color: var(--magenta);
  margin-bottom: 22px;
}

h1 {
  font-size: clamp(42px, 7vw, 76px);
  line-height: 0.98;
  letter-spacing: -0.035em;
  font-weight: 700;
  color: var(--text-hi);
  margin-bottom: 18px;
  text-wrap: balance;
}

.highlight {
  color: var(--cyan);
  text-shadow: 0 0 30px rgba(53, 224, 240, 0.55);
}

.typed-line {
  min-height: 2.6em;
  font-family: "JetBrains Mono", monospace;
  font-size: clamp(14px, 2vw, 18px);
  color: var(--text-body);
  margin-bottom: 22px;
  white-space: pre-wrap;
}

.typed-line .prompt {
  color: var(--green);
}

.typed-line .username {
  color: var(--green);
}

.cursor {
  display: inline-block;
  width: 0.7ch;
  background: var(--cyan);
  animation: blink 1s step-end infinite;
  vertical-align: middle;
  transform: translateY(-1px);
}

.hero-copy p {
  font-size: 17.5px;
  line-height: 1.65;
  color: var(--text-mid);
  max-width: 52ch;
  text-wrap: pretty;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 32px;
}

.hero-actions .primary-button,
.hero-actions .secondary-button {
  padding: 15px 26px;
}

.hero-actions .primary-button {
  background: var(--cyan);
  color: var(--ink);
  border-color: var(--cyan);
}

.hero-actions .primary-button:hover {
  box-shadow: 0 0 34px rgba(53, 224, 240, 0.6);
  transform: translateY(-2px);
}

.cert-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.cert-pill {
  border: 1px solid rgba(53, 224, 240, 0.3);
  background: rgba(53, 224, 240, 0.06);
  color: var(--cyan-soft);
  padding: 7px 12px;
  font-size: 12px;
  letter-spacing: 0.08em;
  font-family: "JetBrains Mono", monospace;
}

.cert-pill.green {
  border-color: rgba(74, 222, 128, 0.35);
  background: rgba(74, 222, 128, 0.07);
  color: var(--green-soft);
}

.cert-pill.magenta {
  border-color: rgba(244, 90, 200, 0.3);
  background: rgba(244, 90, 200, 0.06);
  color: var(--magenta-soft);
}

.terminal-panel {
  border: 1px solid var(--border-cyan);
  background: rgba(9, 13, 19, 0.85);
  box-shadow: 0 0 60px rgba(53, 224, 240, 0.1), inset 0 0 60px rgba(0, 0, 0, 0.5);
}

.window-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  background: rgba(53, 224, 240, 0.04);
  border-bottom: 1px solid rgba(53, 224, 240, 0.18);
}

.traffic-lights {
  display: flex;
  gap: 8px;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.dot.magenta { background: var(--magenta); }
.dot.yellow { background: var(--yellow); }
.dot.green { background: var(--green); }

.window-title {
  color: var(--text-faint);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
}

.terminal-body {
  padding: 20px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12.5px;
  line-height: 1.85;
  color: var(--text-muted);
}

.terminal-line {
  white-space: pre;
}

.terminal-line .prompt { color: var(--green); }
.terminal-line .warn { color: var(--magenta); }
.terminal-line .muted { color: var(--text-faint); }
.terminal-line .cyan { color: var(--cyan); }
.terminal-line .green { color: var(--green); }

.section-shell {
  border-top: 1px solid var(--border-cyan-faint);
  padding: 70px 24px;
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 38px;
}

.section-number {
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--magenta);
}

.section-header h2 {
  color: var(--text-hi);
  margin: 0;
  font-size: clamp(30px, 4.5vw, 46px);
  letter-spacing: -0.03em;
}

.section-standfirst {
  max-width: 60ch;
  color: var(--text-dim);
  font-size: 16.5px;
  line-height: 1.6;
  margin-bottom: 44px;
}

.services-grid,
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 18px;
}

.service-card,
.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 26px 24px 28px;
  transition: transform 0.15s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  transform-style: preserve-3d;
}

.service-card:hover,
.project-card:hover {
  border-color: rgba(53, 224, 240, 0.55);
  box-shadow: 0 0 40px rgba(53, 224, 240, 0.14);
}

.project-card:hover {
  border-color: rgba(244, 90, 200, 0.5);
  box-shadow: 0 0 40px rgba(244, 90, 200, 0.12);
}

.card-id {
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--text-faintest);
  margin-bottom: 16px;
}

.service-card h3,
.project-card h3,
.log-list h3 {
  color: var(--text);
  margin-bottom: 12px;
  letter-spacing: -0.015em;
}

.service-card h3 {
  font-size: 20px;
}

.project-card h3 {
  font-size: 21px;
}

.service-card p,
.project-card p,
.log-item p,
.about-panel p,
.post-body p,
.post-body li {
  color: var(--text-muted-2);
  font-size: 14.5px;
  line-height: 1.6;
  text-wrap: pretty;
}

.service-tag,
.status-tag,
.repo-line,
.meta-line,
.log-item .read-more,
.post-meta {
  font-family: "JetBrains Mono", monospace;
  text-transform: uppercase;
}

.service-tag {
  margin-top: auto;
  color: var(--cyan);
  font-size: 12px;
  letter-spacing: 0.12em;
  padding-top: 18px;
}

.project-card {
  padding-top: 24px;
  text-decoration: none;
}

.project-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.status-tag {
  color: var(--magenta);
  font-size: 12px;
  letter-spacing: 0.12em;
}

.stack-tag {
  color: var(--text-faintest);
  font-size: 12px;
  font-family: "JetBrains Mono", monospace;
  letter-spacing: 0.08em;
}

.repo-line {
  margin-top: auto;
  padding-top: 18px;
  color: var(--cyan);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.log-list {
  border-top: 1px solid var(--divider);
}

.log-item {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 8px 28px;
  align-items: center;
  padding: 26px 18px;
  border-bottom: 1px solid var(--divider);
  transition: background-color 0.2s ease, padding-left 0.2s ease;
}

.log-item:hover {
  background: rgba(53, 224, 240, 0.05);
  padding-left: 28px;
}

.log-item h3 {
  font-size: clamp(19px, 2.4vw, 25px);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.log-item .meta-line {
  color: var(--text-faintest);
  font-size: 12px;
  letter-spacing: 0.12em;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.log-item .meta-line .category {
  color: var(--cyan);
}

.log-item .dek {
  max-width: 70ch;
  color: var(--text-dim);
  line-height: 1.6;
}

.log-item .read-more {
  color: var(--cyan);
  font-size: 12px;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.about-grid,
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 48px;
  align-items: start;
}

.about-panel,
.contact-panel,
.newsletter-box,
.form-panel {
  border: 1px solid var(--border);
  background: rgba(15, 20, 27, 0.7);
}

.about-panel p {
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-body-3);
  margin-bottom: 18px;
}

.cert-list-column {
  margin-top: 24px;
}

.cert-label {
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--text-faint);
  margin-bottom: 18px;
}

.cert-table {
  border-top: 1px solid var(--divider);
}

.cert-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--divider);
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
}

.cert-row .name {
  color: var(--text-body);
}

.cert-row .issuer {
  color: var(--text-faint);
}

.skill-list {
  margin-top: 20px;
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}

.skill-chip {
  padding: 7px 12px;
  border: 1px solid var(--border-2);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-mid-2);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.skill-chip:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

.contact-panel {
  padding: 22px 24px;
}

.contact-panel .terminal-line {
  font-family: "JetBrains Mono", monospace;
  font-size: 12.5px;
  line-height: 1.9;
  color: var(--text-muted);
}

.newsletter-box {
  padding: 22px 24px;
}

.newsletter-box .label {
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--text-faint);
  margin-bottom: 8px;
}

.newsletter-box p {
  color: var(--text-muted-2);
  font-size: 14.5px;
  margin-bottom: 18px;
}

.newsletter-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

newsletter-form input,
form input,
form select,
form textarea {
  font-size: 13.5px;
}

.newsletter-form input,
.form-field,
.form-panel textarea,
.form-panel select {
  width: 100%;
  border: 1px solid var(--border-2);
  background: var(--bg-input);
  color: var(--text-body);
  padding: 13px 14px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.newsletter-form input:focus,
.form-field:focus,
.form-panel textarea:focus,
.form-panel select:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 20px rgba(53, 224, 240, 0.2);
}

.newsletter-form button,
.submit-button {
  background: var(--cyan);
  color: var(--ink);
  border: none;
  min-height: 48px;
  padding: 0 18px;
  font-size: 12.5px;
  letter-spacing: 0.12em;
  cursor: pointer;
}

.newsletter-form button:hover,
.submit-button:hover {
  box-shadow: 0 0 34px rgba(53, 224, 240, 0.6);
}

.form-panel {
  background: rgba(9, 13, 19, 0.85);
  border-color: rgba(53, 224, 240, 0.22);
  box-shadow: 0 0 60px rgba(53, 224, 240, 0.08);
  padding: 28px 26px;
}

.form-panel form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-field-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-label {
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--text-faint);
}

.form-helper {
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 46ch;
  font-size: 17px;
}

.form-message {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--magenta);
  min-height: 1.2em;
}

.form-message.success {
  color: var(--green);
}

.input-error {
  border-color: var(--magenta) !important;
  box-shadow: 0 0 0 1px rgba(244, 90, 200, 0.35);
}

.site-footer {
  padding: 40px 24px 60px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  border-top: 1px solid rgba(53, 224, 240, 0.12);
  padding-top: 26px;
}

.footer-legal,
.footer-links {
  font-family: "JetBrains Mono", monospace;
  letter-spacing: 0.06em;
  font-size: 12px;
  color: var(--text-faint);
}

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

.page-shell {
  padding-top: 64px;
  padding-bottom: 64px;
}

.post-shell {
  max-width: var(--max-post-width);
  padding-top: 64px;
  padding-bottom: 120px;
}

.post-panel {
  border: 1px solid var(--border-cyan);
  background: rgba(9, 13, 19, 0.96);
  box-shadow: 0 0 80px rgba(53, 224, 240, 0.1);
  padding: clamp(26px, 5vw, 56px);
  animation: fadeIn 0.35s ease-out;
}

.post-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--text-faint);
}

.post-meta .category {
  color: var(--cyan);
}

.post-body h1,
.post-body h2,
.post-body h3,
.post-body h4 {
  color: var(--text-hi);
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-top: 2em;
  margin-bottom: 0.75em;
}

.post-body h1 {
  font-size: clamp(30px, 5vw, 46px);
}

.post-body h2 {
  font-size: clamp(24px, 3vw, 34px);
}

.post-body h3 {
  font-size: clamp(20px, 2.5vw, 26px);
}

.post-body p,
.post-body li {
  color: var(--text-body-2);
  font-size: 17px;
  line-height: 1.8;
  margin-bottom: 22px;
}

.post-body blockquote {
  border-left: 2px solid var(--cyan);
  padding-left: 18px;
  margin: 28px 0;
  color: var(--text-muted);
}

.post-body a {
  color: var(--cyan);
  text-decoration: underline;
  text-decoration-color: rgba(53, 224, 240, 0.5);
}

.post-body a:hover {
  color: var(--cyan-bright);
}

.post-body ul,
.post-body ol {
  margin: 0 0 24px 1.5rem;
  padding-left: 0.5rem;
}

.post-body li::marker {
  color: var(--cyan);
}

.post-body code {
  background: rgba(53, 224, 240, 0.08);
  border: 1px solid var(--border-2);
  padding: 2px 6px;
  color: var(--cyan-soft);
  font-size: 0.92em;
}

.post-body pre {
  background: rgba(9, 13, 19, 0.85);
  border: 1px solid rgba(53, 224, 240, 0.2);
  padding: 20px;
  overflow-x: auto;
  margin: 24px 0;
}

.post-body img {
  width: 100%;
  border: 1px solid var(--border);
  margin: 18px 0;
}

.post-body figure {
  margin: 22px 0;
}

.post-body figcaption {
  color: var(--text-faint);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  margin-top: 8px;
}

.post-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
}

.post-body th,
.post-body td {
  border-bottom: 1px solid var(--divider);
  padding: 10px 12px;
  text-align: left;
}

.post-body th {
  color: var(--text-body);
  border-bottom-color: rgba(53, 224, 240, 0.4);
}

.post-dek {
  margin: 0 0 34px;
  padding-left: 18px;
  border-left: 2px solid var(--magenta);
  font-size: 19px;
  line-height: 1.6;
  color: var(--text-muted);
}

.post-footer {
  margin-top: 40px;
  padding-top: 26px;
  border-top: 1px solid var(--divider);
  color: var(--text-faint);
  font-family: "JetBrains Mono", monospace;
  font-size: 12.5px;
  line-height: 1.8;
}

.series-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 18px;
  margin-top: 36px;
}

.related-posts {
  margin-top: 30px;
}

.related-posts h3 {
  margin-bottom: 18px;
  color: var(--text-hi);
  font-size: 22px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.related-post {
  display: block;
  padding: 18px;
  border: 1px solid var(--divider);
  background: rgba(15, 20, 27, 0.7);
}

.related-post .category {
  color: var(--cyan);
  font-size: 12px;
  letter-spacing: 0.12em;
  font-family: "JetBrains Mono", monospace;
}

.related-post h4 {
  margin: 10px 0 8px;
  color: var(--text);
  font-size: 20px;
}

.related-post p {
  color: var(--text-muted-2);
  margin: 0;
  font-size: 14px;
}

.back-link {
  color: var(--cyan);
  font-family: "JetBrains Mono", monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 12px;
}

.error-panel {
  max-width: 700px;
  margin: 120px auto 0;
}

@keyframes driftGrid {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(0, 60px, 0); }
}

@keyframes sweep {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100vh); }
}

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@keyframes wordmarkPulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

@keyframes fadeIn {
  0% { opacity: 0; transform: translateY(14px); }
  100% { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1024px) {
  .hero {
    padding: 64px 24px 56px;
    gap: 40px;
  }

  .section-shell {
    padding: 56px 24px;
  }

  .nav-inner,
  .footer-inner,
  .section-inner,
  .page-shell,
  .post-shell {
    width: min(var(--max-width), calc(100% - 32px));
  }

  .about-grid,
  .contact-grid {
    gap: 32px;
  }
}

@media (max-width: 700px) {
  .hero {
    padding-top: 72px;
  }

  .services-grid,
  .projects-grid,
  .about-grid,
  .contact-grid,
  .related-grid {
    grid-template-columns: 1fr;
  }

  .log-item {
    grid-template-columns: 1fr;
    padding: 22px 14px;
  }

  .nav-inner,
  .footer-inner {
    gap: 16px;
  }

  .site-nav {
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .grid-layer,
  .sweep,
  .cursor,
  .wordmark-block,
  .matrix-canvas,
  .service-card,
  .project-card,
  .log-item,
  .post-panel {
    animation: none !important;
    transition: none !important;
  }

  .cursor-glow {
    opacity: 0.2;
  }
}

::selection {
  background: var(--cyan);
  color: var(--ink);
}
