/* ============================================================
   Token system
   bg-0   #0a0e14  page background
   bg-1   #10161f  card/section surface
   bg-2   #161d29  raised surface (hover, header)
   border #212a38  hairline borders
   text-0 #c9d1d9  primary text
   text-1 #8b96a5  muted / secondary text
   accent-cyan  #55b7ff  primary accent (links, headings, active state)
   accent-amber #f2a93b  status / attention accent
   accent-red   #ef5b5b  reserved (not currently used, kept for status states)
   ============================================================ */

:root {
  --bg-0: #0a0e14;
  --bg-1: #10161f;
  --bg-2: #161d29;
  --border: #212a38;
  --text-0: #c9d1d9;
  --text-1: #8b96a5;
  --accent-cyan: #55b7ff;
  --accent-amber: #f2a93b;
  --accent-red: #ef5b5b;

  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", monospace;
  --font-sans: "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

body {
  background: var(--bg-0);
  color: var(--text-0);
  font-family: var(--font-sans);
  line-height: 1.55;
  position: relative;
  overflow-x: hidden;
}

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

:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
  border-radius: 2px;
}

/* subtle CRT scanline atmosphere */
.scanline {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.015) 0px,
    rgba(255, 255, 255, 0.015) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: overlay;
}

/* ---------------- header ---------------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px clamp(20px, 5vw, 64px);
  border-bottom: 1px solid var(--border);
  background: rgba(10, 14, 20, 0.85);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 40;
}

.prompt {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 14px;
  color: var(--accent-cyan);
}
.prompt .path { color: var(--text-1); }

nav { display: flex; gap: 28px; }
nav a {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-1);
  transition: color 0.15s ease;
}
nav a:hover { color: var(--accent-cyan); }

/* ---------------- hero ---------------- */
.hero {
  padding: clamp(72px, 14vw, 140px) clamp(20px, 5vw, 64px) clamp(48px, 8vw, 80px);
  max-width: 920px;
}

.hero-tag {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent-amber);
  margin-bottom: 18px;
}

.hero h1 {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(28px, 5.2vw, 52px);
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--text-0);
}

.cursor {
  display: inline-block;
  color: var(--accent-cyan);
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-sub {
  margin-top: 22px;
  max-width: 620px;
  font-size: 17px;
  color: var(--text-1);
}

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

.btn {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  padding: 12px 22px;
  border-radius: 6px;
  border: 1px solid var(--border);
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.btn-primary {
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
  color: #061019;
}
.btn-primary:hover { background: #79c6ff; border-color: #79c6ff; }

.btn-ghost {
  color: var(--text-0);
  background: transparent;
}
.btn-ghost:hover { border-color: var(--accent-cyan); color: var(--accent-cyan); }

/* ---------------- stat strip ---------------- */
.strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.strip-item {
  padding: 28px clamp(16px, 3vw, 32px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.strip-item:last-child { border-right: none; }

.strip-num {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(20px, 3vw, 28px);
  color: var(--accent-cyan);
}
.strip-num small {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-1);
  margin-left: 3px;
}

.strip-label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-1);
  text-transform: lowercase;
}

/* ---------------- section shell ---------------- */
section h2 {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.tag { color: var(--accent-amber); }

.section-sub {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-1);
  margin-top: 8px;
}

.stack-section, .experience-section, .projects-section, .contact-section {
  padding: clamp(48px, 8vw, 80px) clamp(20px, 5vw, 64px);
  border-bottom: 1px solid var(--border);
}

/* ---------------- stack ---------------- */
.stack-grid {
  margin-top: 32px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.stack-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.stack-card:hover { border-color: var(--accent-cyan); transform: translateY(-2px); }

.stack-head {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-amber);
  margin-bottom: 14px;
}

.stack-card ul { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.stack-card li {
  font-size: 14px;
  color: var(--text-0);
  padding-left: 16px;
  position: relative;
}
.stack-card li::before {
  content: "›";
  position: absolute;
  left: 0;
  color: var(--accent-cyan);
}

/* ---------------- experience (systemctl style) ---------------- */
.unit-card {
  margin-top: 24px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-cyan);
  border-radius: 8px;
  padding: 24px clamp(18px, 4vw, 28px);
}

.unit-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
}

.unit-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
  flex-shrink: 0;
}

.unit-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--text-0);
}

.unit-state {
  margin-left: auto;
  font-size: 12px;
  color: var(--accent-cyan);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 999px;
}

.unit-meta {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-1);
  line-height: 1.7;
}

.unit-log {
  margin-top: 16px;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px dashed var(--border);
  padding-top: 16px;
}

.unit-log li {
  font-size: 14px;
  color: var(--text-0);
  padding-left: 22px;
  position: relative;
}
.unit-log li::before {
  content: "•";
  position: absolute;
  left: 4px;
  color: var(--accent-amber);
}

/* ---------------- projects ---------------- */
.project-list { margin-top: 28px; display: flex; flex-direction: column; }

.project-row {
  padding: 22px 0;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 220px 1fr auto;
  gap: 20px;
  align-items: start;
}
.project-row:last-child { border-bottom: 1px solid var(--border); }

.project-name {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 14px;
  color: var(--text-0);
}

.project-desc { font-size: 14px; color: var(--text-1); }

.project-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.project-tags span {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-cyan);
  border: 1px solid var(--border);
  padding: 4px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

/* ---------------- contact ---------------- */
.contact-section p { color: var(--text-1); margin-top: 10px; }

.contact-links {
  margin-top: 24px;
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 14px;
}
.contact-links a {
  color: var(--accent-cyan);
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease;
}
.contact-links a:hover { border-color: var(--accent-cyan); }

/* ---------------- footer ---------------- */
footer {
  padding: 22px clamp(20px, 5vw, 64px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-1);
}

.footer-status { display: flex; align-items: center; gap: 6px; }
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-cyan);
  display: inline-block;
}

/* ---------------- responsive ---------------- */
@media (max-width: 860px) {
  .strip { grid-template-columns: repeat(2, 1fr); }
  .strip-item:nth-child(2) { border-right: none; }
  .stack-grid { grid-template-columns: 1fr; }
  .project-row { grid-template-columns: 1fr; gap: 8px; }
}

@media (max-width: 560px) {
  nav { gap: 16px; }
  .strip { grid-template-columns: 1fr; }
  .strip-item { border-right: none; border-bottom: 1px solid var(--border); }
}

