/* ── Reset & Base ─────────────────────────────── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #0a0e14;
  --bg-card: #0f1419;
  --bg-card-hover: #141a22;
  --border: #1e2a36;
  --border-glow: #00ff4133;
  --green: #00ff41;
  --green-dim: #00cc33;
  --green-dark: #00802080;
  --cyan: #00d4ff;
  --text: #c5cdd8;
  --text-dim: #5a6a7a;
  --white: #e8edf3;
  --font: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
}

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--green-dark) var(--bg);
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.7;
  overflow-x: hidden;
}

a {
  color: var(--green);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--cyan);
}

::selection {
  background: var(--green-dark);
  color: var(--white);
}

/* ── Scanline overlay ────────────────────────── */
.scanline {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 999;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
}

/* ── Sections ────────────────────────────────── */
.section {
  max-width: 800px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

.hero {
  padding-top: 3rem;
  padding-bottom: 1rem;
}

/* ── Prompt lines ────────────────────────────── */
.prompt {
  color: var(--green);
  font-size: 0.85rem;
  margin-bottom: 1.2rem;
  opacity: 0.8;
}

/* ── Hero ────────────────────────────────────── */
.hero-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
}

.hero-text {
  flex: 1;
}

.hero-text h1 {
  color: var(--white);
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.hero-text h2 {
  color: var(--green);
  font-size: 1rem;
  font-weight: 400;
  margin-bottom: 1.2rem;
}

.bio {
  color: var(--text);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  max-width: 550px;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.5rem;
  font-size: 0.85rem;
}

.hero-links a {
  color: var(--text-dim);
  border-bottom: 1px dashed var(--border);
  padding-bottom: 2px;
}

.hero-links a:hover {
  color: var(--green);
  border-color: var(--green);
}

.hero-avatar img {
  width: 180px;
  height: 180px;
  border-radius: 8px;
  border: 2px solid var(--border);
  transition: border-color 0.3s;
  image-rendering: pixelated;
}

.hero-avatar img:hover {
  border-color: var(--green);
  box-shadow: 0 0 20px var(--green-dark);
}

/* ── Tags ────────────────────────────────────── */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.8rem;
  color: var(--text-dim);
  background: var(--bg-card);
  transition: all 0.2s;
}

.tag:hover {
  border-color: var(--green);
  color: var(--green);
}

.tag.highlight {
  border-color: var(--green-dim);
  color: var(--green);
}

.tag.sm {
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
}

/* ── Stack Grid ──────────────────────────────── */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.stack-group h3 {
  color: var(--text-dim);
  font-size: 0.8rem;
  font-weight: 400;
  margin-bottom: 0.8rem;
}

/* ── Timeline ────────────────────────────────── */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  margin-bottom: 2.5rem;
}

.timeline-marker {
  position: absolute;
  left: -2rem;
  top: 6px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid var(--green-dim);
  background: var(--bg);
  z-index: 1;
}

.timeline-item:first-child .timeline-marker {
  background: var(--green);
  box-shadow: 0 0 8px var(--green-dark);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.timeline-header h3 {
  color: var(--white);
  font-size: 1rem;
  font-weight: 500;
}

.timeline-date {
  color: var(--text-dim);
  font-size: 0.8rem;
}

.timeline-company {
  color: var(--green-dim);
  font-size: 0.85rem;
  display: block;
  margin-bottom: 0.6rem;
}

.timeline-content ul {
  list-style: none;
  padding: 0;
}

.timeline-content ul li {
  position: relative;
  padding-left: 1.2rem;
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
  color: var(--text);
}

.timeline-content ul li::before {
  content: '>';
  position: absolute;
  left: 0;
  color: var(--green-dim);
}

.compact-roles li {
  margin-bottom: 0.5rem;
}

.compact-roles strong {
  color: var(--white);
}

/* ── Page heads (subpages) ───────────────────── */
.page-head {
  padding-top: 3rem;
  padding-bottom: 1rem;
}

.page-head h1 {
  color: var(--white);
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.6rem;
}

.lede {
  color: var(--text);
  font-size: 0.9rem;
  max-width: 640px;
  margin-bottom: 0.8rem;
}

.lede strong {
  color: var(--white);
  font-weight: 500;
}

.section-note {
  color: var(--text-dim);
  font-size: 0.82rem;
  margin: -0.6rem 0 1.2rem;
  max-width: 640px;
}

/* Wider column for the home page (hero + work grid) */
.section.wide {
  max-width: 1040px;
}

.page-head + .section {
  padding-top: 1rem;
}

/* ── Home hero ───────────────────────────────── */
.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 480px);
  grid-template-areas:
    "intro signup"
    "cred  signup";
  /* Reason: the signup spans both rows; 1fr on the second row keeps the cred line
     right under the intro instead of splitting the leftover height between rows. */
  grid-template-rows: auto 1fr;
  column-gap: 3rem;
  align-items: start;
}

.hero-intro { grid-area: intro; }
.hero-signup { grid-area: signup; }
.hero-cred { grid-area: cred; }

.hero-id {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-bottom: 1.2rem;
}

.hero-id img {
  width: 96px;
  height: 96px;
  flex-shrink: 0;
  border-radius: 8px;
  border: 2px solid var(--border);
  image-rendering: pixelated;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.hero-id img:hover {
  border-color: var(--green);
  box-shadow: 0 0 20px var(--green-dark);
}

.hero-id h1 {
  color: var(--white);
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.2;
}

.tagline {
  color: var(--green);
  font-size: 0.95rem;
  line-height: 1.5;
}

.hero-line {
  color: var(--white);
  font-size: 1.05rem;
  line-height: 1.6;
  margin-bottom: 1.2rem;
  max-width: 560px;
}

.cred {
  color: var(--text);
  font-size: 0.85rem;
  margin-bottom: 1.2rem;
}

.hero-signup .prompt {
  margin-bottom: 0;
}

.hero-signup .jx-embed {
  margin-top: 0.6rem;
}

/* ── Cards (data/*.json via tools/build.py) ──── */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 1.2rem;
}

.card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.2rem;
  transition: border-color 0.3s, background 0.3s, box-shadow 0.3s;
}

.card:hover {
  border-color: var(--green);
  background: var(--bg-card-hover);
  box-shadow: 0 0 15px rgba(0, 255, 65, 0.05);
}

.card-title,
.row-title {
  color: var(--green);
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 0.5rem;
  overflow-wrap: anywhere;
}

.card-title a::after,
.row-title a::after {
  content: " \2192";
  color: var(--text-dim);
}

.card-desc,
.row-desc {
  color: var(--white);
  font-size: 0.82rem;
  line-height: 1.6;
  margin-bottom: 0.8rem;
  overflow-wrap: anywhere;
}

.card-meta {
  color: var(--text-dim);
  font-size: 0.75rem;
  line-height: 1.5;
  margin-bottom: 0.8rem;
  overflow-wrap: anywhere;
}

.card .tags {
  margin-top: auto;
}

.card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.2rem;
  margin-top: 0.8rem;
  font-size: 0.8rem;
}

.card-links a {
  color: var(--text-dim);
  border-bottom: 1px dashed var(--border);
  padding-bottom: 1px;
  overflow-wrap: anywhere;
}

.card-links a:hover {
  color: var(--green);
  border-color: var(--green);
}

/* Compact rows for long lists (recipes) */
.rows {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
}

.row {
  min-width: 0;
  padding: 0.8rem 0.2rem;
  border-bottom: 1px solid var(--border);
}

.row .row-title {
  margin-bottom: 0.2rem;
}

.row .row-desc {
  margin-bottom: 0.2rem;
}

.row .card-meta {
  margin-bottom: 0;
}

.row .card-links {
  margin-top: 0.3rem;
}

.row .tags {
  margin-top: 0.4rem;
}

.text-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.5rem;
  font-size: 0.85rem;
}

.text-links a {
  color: var(--text-dim);
  border-bottom: 1px dashed var(--border);
  padding-bottom: 2px;
}

.text-links a:hover {
  color: var(--green);
  border-color: var(--green);
}

/* ── Education ───────────────────────────────── */
.edu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.2rem;
}

.edu-item {
  padding: 1rem;
  border-left: 2px solid var(--border);
  transition: border-color 0.3s;
}

.edu-item:hover {
  border-color: var(--green);
}

.edu-item h3 {
  color: var(--white);
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 0.2rem;
}

.edu-school {
  color: var(--green-dim);
  font-size: 0.82rem;
  display: block;
}

.edu-item p {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-top: 0.3rem;
}

/* ── Languages ───────────────────────────────── */
.languages {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.lang-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
}

.lang-level {
  color: var(--green-dim);
  font-size: 0.8rem;
  letter-spacing: 2px;
}

/* ── Contact ─────────────────────────────────── */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.8rem;
}

.contact-item {
  display: flex;
  flex-direction: column;
  padding: 0.8rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.82rem;
  transition: all 0.3s;
}

.contact-item:hover {
  border-color: var(--green);
  background: var(--bg-card-hover);
  color: var(--green);
}

.contact-label {
  color: var(--text-dim);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.2rem;
}

/* ── Utils ───────────────────────────────────── */
.dim {
  color: var(--text-dim);
  font-size: 0.8rem;
}

/* ── Fade-in animation ───────────────────────── */
.fade-in {
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Responsive ──────────────────────────────── */
@media (max-width: 860px) {
  .home-hero {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "intro"
      "signup"
      "cred";
    grid-template-rows: none;
  }

  .hero-signup {
    margin-bottom: 1.5rem;
  }
}

@media (max-width: 640px) {
  .section {
    padding: 2rem 16px;
  }

  .hero,
  .page-head {
    padding-top: 1.5rem;
  }

  .page-head h1 {
    font-size: 1.4rem;
  }

  .hero-id {
    gap: 0.9rem;
    margin-bottom: 0.8rem;
  }

  .hero-id img {
    width: 64px;
    height: 64px;
  }

  .hero-id h1 {
    font-size: 1.6rem;
  }

  .tagline {
    font-size: 0.85rem;
  }

  .hero-line {
    font-size: 0.95rem;
    margin-bottom: 1rem;
  }

  .hero-content {
    flex-direction: column-reverse;
    align-items: center;
    text-align: center;
  }

  .hero-text h1 {
    font-size: 1.6rem;
  }

  .hero-links {
    justify-content: center;
  }

  .hero-avatar img {
    width: 140px;
    height: 140px;
  }

  .timeline {
    padding-left: 1.5rem;
  }

  .timeline-header {
    flex-direction: column;
    gap: 0.2rem;
  }

  .stack-grid {
    grid-template-columns: 1fr;
  }

  .edu-grid {
    grid-template-columns: 1fr;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .bio {
    text-align: left;
  }
}
