/* ── Base ── */
:root {
  --bg: #0a0a0a;
  --fg: #c8c8c8;
  --dim: #555;
  --hl: #fff;
  --green: #5af78e;
  --cyan: #59cfff;
  --yellow: #f3f99d;
  --red: #ff5c57;
  --glow-green: rgba(90, 247, 142, 0.4);
  --glow-cyan: rgba(89, 207, 255, 0.4);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'SF Mono', monospace;
  font-size: 14px;
  line-height: 1.7;
  position: relative;
  overflow-x: hidden;
}

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

/* ── CRT Screen ── */
.crt {
  position: relative;
}

.crt::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(0, 0, 0, 0.12) 2px,
    rgba(0, 0, 0, 0.12) 4px
  );
}

.crt::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background: radial-gradient(
    ellipse at center,
    transparent 55%,
    rgba(0, 0, 0, 0.45) 100%
  );
}

/* Phosphor glow on text */
.crt {
  text-shadow: 0 0 1px rgba(200, 200, 200, 0.15);
}

/* Subtle screen flicker */
@keyframes flicker {
  0%, 100% { opacity: 1; }
  92% { opacity: 1; }
  93% { opacity: 0.96; }
  94% { opacity: 1; }
  96% { opacity: 0.985; }
  97% { opacity: 1; }
}

.site-content {
  animation: flicker 6s infinite;
}

/* Noise texture overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9997;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 256px 256px;
}

/* ── Boot sequence ── */
.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--bg);
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 48px;
  font-size: 14px;
  color: var(--green);
  text-shadow: 0 0 6px var(--glow-green);
  overflow: hidden;
}

.boot-screen.hidden {
  display: none;
}

.boot-log {
  white-space: pre-wrap;
  line-height: 1.6;
}

.boot-log .ok { color: var(--green); }
.boot-log .warn { color: var(--yellow); }
.boot-log .err { color: var(--red); }
.boot-log .info { color: var(--cyan); text-shadow: 0 0 6px var(--glow-cyan); }
.boot-log .dim { color: var(--dim); text-shadow: none; }

.boot-cursor {
  display: inline;
  animation: blink 0.7s step-end infinite;
}

.boot-skip {
  position: fixed;
  bottom: 32px;
  right: 48px;
  z-index: 10001;
  color: var(--dim);
  font-size: 12px;
  font-family: inherit;
  animation: fade-in-up 0.5s ease 1s both;
}

.boot-skip kbd {
  color: var(--yellow);
  border: 1px solid #333;
  padding: 1px 6px;
  font-family: inherit;
  font-size: 12px;
}

.boot-interrupted {
  color: var(--red);
  text-shadow: 0 0 6px rgba(255, 92, 87, 0.4);
}

@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

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

/* ── Layout ── */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Nav ── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #1a1a1a;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 100%;
}

.nav-prompt {
  color: var(--green);
  font-size: 13px;
  white-space: nowrap;
  text-shadow: 0 0 6px var(--glow-green);
}

.nav-links {
  display: flex;
  gap: 20px;
}

.nav-links a {
  color: var(--dim);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.15s, text-shadow 0.15s;
}

.nav-links a:hover {
  color: var(--cyan);
  text-shadow: 0 0 8px var(--glow-cyan);
}

/* ── Hero ── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 48px;
}

.ascii-name {
  color: var(--cyan);
  font-size: 13px;
  line-height: 1.2;
  margin-bottom: 24px;
  opacity: 0.9;
  user-select: none;
  text-shadow: 0 0 8px var(--glow-cyan);
}

.typing {
  color: var(--hl);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
}

.hl {
  color: var(--green);
  font-weight: 700;
  text-shadow: 0 0 6px var(--glow-green);
}

.dim { color: var(--dim); }

.hero-body {
  margin: 16px 0 32px;
}

.hero-body p {
  margin-bottom: 4px;
}

.comment {
  color: var(--dim);
  font-style: italic;
}

.hero-nav {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.hero-nav a {
  color: var(--yellow);
  text-decoration: none;
  transition: color 0.15s, text-shadow 0.15s;
  font-size: 14px;
}

.hero-nav a:hover {
  color: var(--hl);
  text-shadow: 0 0 8px rgba(243, 249, 157, 0.4);
}

.prompt {
  font-size: 14px;
}

.prompt .user {
  color: var(--green);
  text-shadow: 0 0 6px var(--glow-green);
}

.prompt .cursor {
  animation: blink 1s step-end infinite;
  color: var(--fg);
}

/* ── Subpages ── */
.page {
  padding-top: 80px;
  min-height: 100vh;
}

.page .container {
  padding-top: 40px;
  padding-bottom: 60px;
}

/* ── Section headers ── */
h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--cyan);
  margin-bottom: 32px;
  letter-spacing: 1px;
  text-shadow: 0 0 8px var(--glow-cyan);
}

/* ── Projects ── */
.project-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.project-card {
  border: 1px solid #1a1a1a;
  padding: 20px;
  transition: border-color 0.2s, background 0.2s;
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  border-color: #333;
  background: rgba(255, 255, 255, 0.015);
}

.project-card h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--hl);
  margin-bottom: 8px;
}

.project-card p {
  color: var(--dim);
  font-size: 12px;
  line-height: 1.7;
  flex: 1;
}

.project-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.tag {
  font-size: 10px;
  color: var(--cyan);
  border: 1px solid rgba(89, 207, 255, 0.2);
  padding: 1px 7px;
  letter-spacing: 0.5px;
}

.project-card .project-link {
  margin-top: 12px;
  color: var(--yellow);
  text-decoration: none;
  font-size: 12px;
  transition: color 0.15s;
}

.project-card .project-link:hover {
  color: var(--hl);
}

/* ── Contact ── */
.contact-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-list a {
  color: var(--fg);
  text-decoration: none;
  transition: color 0.15s, text-shadow 0.15s;
}

.contact-list a:hover {
  color: var(--cyan);
  text-shadow: 0 0 8px var(--glow-cyan);
}

.contact-list a::before {
  content: "> ";
  color: var(--green);
}

/* ── Dithered separator ── */
.dither-line {
  height: 4px;
  background: repeating-linear-gradient(
    90deg,
    var(--fg) 0px,
    var(--fg) 1px,
    transparent 1px,
    transparent 3px
  );
  opacity: 0.04;
}

/* ── Footer ── */
footer {
  padding: 40px 0;
  border-top: 1px solid #1a1a1a;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .ascii-name { font-size: 9px; }
  .typing { font-size: 14px; }
  .nav-prompt { display: none; }
  .project-grid { grid-template-columns: 1fr; }
  .boot-screen { padding: 24px; font-size: 13px; }
  .boot-skip { bottom: 20px; right: 24px; }
}

/* ── Link defaults ── */
a {
  transition: text-shadow 0.2s;
}
