:root {
  --bg: #0a0f0a;
  --panel: #101710;
  --panel-strong: #0d140d;
  --text: #d5f6d7;
  --body: #c3e8c7;
  --phosphor: #6dff8f;
  --phosphor-strong: #98ffad;
  --border: rgba(109, 255, 143, 0.28);
  --border-strong: rgba(109, 255, 143, 0.48);
  --amber: #ffb000;
  --cyan: #7df9ff;
  --shadow: 0 0 0 1px rgba(109, 255, 143, 0.08), 0 22px 60px rgba(0, 0, 0, 0.45);
  --font-ui: "IBM Plex Mono", "JetBrains Mono", "Fira Code", "Source Code Pro", "SFMono-Regular",
    Consolas, "Liberation Mono", "Courier New", monospace;
  --max-width: 48rem;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top, rgba(109, 255, 143, 0.07), transparent 32rem),
    var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.64;
  text-rendering: optimizeLegibility;
  position: relative;
}

/* Subtle scanlines keep the CRT motif without compromising legibility. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.045),
      rgba(255, 255, 255, 0.045) 1px,
      transparent 1px,
      transparent 4px
    );
  opacity: 0.09;
  pointer-events: none;
  z-index: 2;
}

/* A soft vignette stops the page from feeling like a flat black slab. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, transparent 52%, rgba(0, 0, 0, 0.34) 100%);
  pointer-events: none;
  z-index: 1;
}

a {
  color: var(--cyan);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.2em;
}

a:hover,
a:focus-visible {
  color: var(--amber);
}

button,
a {
  transition: color 140ms ease, border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
}

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: 0.5rem;
  transform: translateY(-140%);
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-strong);
  background: var(--panel);
  color: var(--text);
  z-index: 4;
}

.skip-link:focus {
  transform: translateY(0);
}

.container {
  width: min(calc(100% - 2rem), var(--max-width));
  margin: 0 auto;
  position: relative;
  z-index: 3;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(10px);
  background: rgba(10, 15, 10, 0.82);
  border-bottom: 1px solid rgba(109, 255, 143, 0.18);
}

.masthead {
  display: grid;
  gap: 0.85rem;
  padding: 1rem 0 0.95rem;
}

.boot-line,
.prompt-line,
.section-heading,
.entry-meta,
.entry-state,
.project-kicker,
.project-stack,
.site-nav,
.hero-grid dt,
.skill-block h3,
.footer-inner {
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.boot-line {
  margin: 0;
  font-size: 0.82rem;
  color: var(--phosphor);
  text-shadow: 0 0 8px rgba(109, 255, 143, 0.28);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  font-size: 0.86rem;
}

.site-nav a {
  color: var(--text);
  text-decoration: none;
}

.site-nav a[aria-current="true"] {
  color: var(--phosphor-strong);
  text-shadow: 0 0 10px rgba(109, 255, 143, 0.22);
}

.site-nav a[aria-current="true"]::after {
  content: " _";
  animation: blink 1s steps(1) infinite;
}

main {
  padding: 2rem 0 4rem;
}

.panel {
  background: linear-gradient(180deg, rgba(16, 23, 16, 0.96), rgba(13, 20, 13, 0.96));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 1.4rem;
  position: relative;
}

.panel + .panel {
  margin-top: 1rem;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0.6rem;
  border: 1px dashed rgba(109, 255, 143, 0.14);
  pointer-events: none;
}

.hero {
  padding-top: 1.7rem;
}

.prompt-line {
  margin: 0 0 0.8rem;
  color: var(--amber);
  font-size: 0.82rem;
}

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

p,
li,
dd {
  color: var(--body);
  line-height: 1.58;
}

h1 {
  margin-bottom: 0.6rem;
  font-size: clamp(2.1rem, 7vw, 3.6rem);
  line-height: 1.02;
  color: var(--phosphor-strong);
  text-shadow: 0 0 14px rgba(109, 255, 143, 0.2);
}

.typed-line {
  margin: 0 0 1rem;
  min-height: 1.8rem;
  color: var(--body);
  font-size: 0.96rem;
}

.typed-label {
  color: var(--amber);
  font-weight: 700;
}

.typed-text {
  color: var(--phosphor-strong);
  font-weight: 600;
}

.cursor {
  display: inline-block;
  width: 0.7ch;
  height: 1.1em;
  margin-left: 0.1rem;
  vertical-align: -0.18em;
  background: var(--phosphor);
  box-shadow: 0 0 12px rgba(109, 255, 143, 0.28);
  animation: blink 1s steps(1) infinite;
}

.lede,
.section-copy,
.entry ul,
.project-card p,
.skill-block li {
  max-width: 65ch;
}

.lede {
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  line-height: 1.42;
  color: var(--text);
  max-width: 60ch;
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
  margin-bottom: 1.25rem;
}

.hero-grid div {
  border: 1px solid rgba(109, 255, 143, 0.16);
  padding: 0.9rem;
  background: rgba(109, 255, 143, 0.04);
}

.hero-grid dt {
  margin-bottom: 0.4rem;
  color: var(--amber);
  font-size: 0.72rem;
}

.hero-grid dd {
  margin: 0;
  color: var(--text);
  font-size: 0.88rem;
  line-height: 1.5;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.35rem;
  padding: 0.55rem 0.8rem;
  border: 1px solid rgba(255, 176, 0, 0.5);
  background: rgba(255, 176, 0, 0.12);
  color: var(--amber);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
}

.button:hover,
.button:focus-visible {
  background: rgba(255, 176, 0, 0.18);
  border-color: rgba(255, 176, 0, 0.72);
  color: var(--amber);
  box-shadow: 0 0 0 1px rgba(255, 176, 0, 0.12);
}

.button-secondary {
  background: rgba(255, 176, 0, 0.08);
}

.section-heading {
  margin-bottom: 1rem;
  color: var(--amber);
  font-size: 1.08rem;
  font-weight: 700;
  text-shadow: 0 0 10px rgba(255, 176, 0, 0.18);
}

.section-copy {
  margin-bottom: 1.1rem;
}

.section p {
  font-size: 0.88rem;
  line-height: 1.42;
  max-width: 62ch;
}

.entry + .entry {
  margin-top: 1.15rem;
  padding-top: 1.15rem;
  border-top: 1px solid rgba(109, 255, 143, 0.14);
}

.entry-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 0.7rem;
}

.entry h3,
.project-card h3,
.skill-block h3 {
  margin-bottom: 0.35rem;
  font-size: 1.15rem;
  color: var(--phosphor-strong);
  font-weight: 700;
  line-height: 1.35;
}

.entry h3 span {
  color: rgba(217, 255, 217, 0.9);
  font-weight: 500;
}

.entry-meta {
  margin-bottom: 0;
  color: rgba(217, 255, 217, 0.66);
  font-size: 0.68rem;
}

.entry-state {
  margin: 0;
  flex-shrink: 0;
  color: var(--amber);
  font-size: 0.72rem;
  font-weight: 700;
}

.entry ul,
.skill-block ul {
  margin-bottom: 0;
  padding-left: 1.2rem;
}

.entry li,
.skill-block li,
.project-card p,
.contact-list a {
  font-size: 0.9rem;
  line-height: 1.52;
}

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

.project-card,
.skill-block {
  height: 100%;
  border: 1px solid rgba(109, 255, 143, 0.16);
  background: rgba(109, 255, 143, 0.03);
  padding: 1rem;
}

.project-card:hover,
.project-card:focus-within {
  border-color: rgba(255, 176, 0, 0.45);
  box-shadow: 0 0 0 1px rgba(255, 176, 0, 0.16);
}

.project-kicker,
.project-stack strong,
.skill-block h3 {
  color: var(--amber);
  font-size: 0.73rem;
}

.project-card h3 a {
  color: var(--phosphor-strong);
}

.project-stack {
  margin-bottom: 0;
  color: rgba(217, 255, 217, 0.86);
  font-size: 0.78rem;
}

.contact-list {
  display: grid;
  gap: 0.7rem;
}

.contact-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
}

.contact-inline a {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid rgba(109, 255, 143, 0.16);
  background: rgba(109, 255, 143, 0.04);
  text-decoration: none;
  word-break: break-word;
}

.site-footer {
  padding: 0 0 2rem;
}

.footer-inner {
  display: flex;
  justify-content: center;
  gap: 1rem;
  padding-top: 0.4rem;
  font-size: 0.8rem;
  color: rgba(217, 255, 217, 0.72);
}

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

@media (max-width: 720px) {
  .container {
    width: min(calc(100% - 1rem), var(--max-width));
  }

  main {
    padding-top: 1.25rem;
  }

  .panel {
    padding: 1rem;
  }

  .panel::before {
    inset: 0.45rem;
  }

  .hero-grid,
  .project-grid,
  .skill-grid,
  .entry-header,
  .footer-inner {
    grid-template-columns: 1fr;
    display: grid;
  }

  .entry-header {
    gap: 0.5rem;
  }

  .entry-state {
    justify-self: start;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  :root {
    --bg: #ffffff;
    --panel: #ffffff;
    --panel-strong: #ffffff;
    --text: #101010;
    --body: #202020;
    --phosphor: #101010;
    --phosphor-strong: #000000;
    --border: rgba(0, 0, 0, 0.18);
    --border-strong: rgba(0, 0, 0, 0.32);
    --amber: #000000;
    --cyan: #000000;
    --shadow: none;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 11px;
    line-height: 1.45;
  }

  body::before,
  body::after,
  .site-header,
  .skip-link,
  .hero-actions,
  .site-footer {
    display: none;
  }

  .container {
    width: auto;
    margin: 0;
  }

  main {
    padding: 0;
  }

  .panel {
    padding: 0.75rem 0;
    border: none;
    box-shadow: none;
    background: #fff;
  }

  .panel::before {
    display: none;
  }

  .panel + .panel {
    margin-top: 0.2rem;
  }

  .project-grid,
  .skill-grid {
    gap: 0.5rem;
  }

  .project-card,
  .skill-block,
  .hero-grid div,
  .contact-list a {
    background: transparent;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: none;
  }

  a {
    color: #000;
  }

  .cursor {
    display: none;
  }

  .entry,
  .project-card,
  .skill-block {
    break-inside: avoid;
  }
}
