/* =========================================================
   CRT Terminal Portfolio — phosphor green console aesthetic
   ========================================================= */

:root {
  --bg: #000000;
  --panel: #050805;
  --panel-lift: #070b07;
  --hairline: #143614;
  --hairline-bright: #1f4d1f;
  --phosphor: #39ff7a;
  --phosphor-mid: #2bbf5c;
  --phosphor-dim: #1c7a3c;
  --sage: #5f8d68;
  --ink: #eafff1;
  --amber: #ffd24a;
  --cyan: #5cf6ff;
  --dot-red: #ff5f56;
  --dot-amber: #ffbd2e;
  --dot-green: #27c93f;
  --font: "JetBrains Mono", "IBM Plex Mono", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", ui-monospace, sans-serif;
  --font-sec: "IBM Plex Mono", "JetBrains Mono", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", ui-monospace, sans-serif;
  --glow:
    0 0 8px rgba(57, 255, 122, 0.45),
    0 0 24px rgba(57, 255, 122, 0.18);
  --glow-soft:
    0 0 6px rgba(57, 255, 122, 0.28),
    0 0 16px rgba(57, 255, 122, 0.1);
  --radius: 6px;
  --radius-lg: 8px;
  --max: 1120px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--sage);
  background:
    radial-gradient(ellipse 70% 55% at 88% 8%, rgba(57, 255, 122, 0.08), transparent 55%),
    radial-gradient(ellipse 55% 50% at 8% 42%, rgba(57, 255, 122, 0.05), transparent 50%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: rgba(57, 255, 122, 0.3);
  color: var(--ink);
}

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

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

h1, h2, h3, p {
  margin: 0;
}

.glow {
  text-shadow: var(--glow);
}

.glow-soft {
  text-shadow: var(--glow-soft);
}

.hl {
  color: var(--phosphor);
}

/* ---------- CRT overlays ---------- */

.crt-scanlines {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.5;
  mix-blend-mode: multiply;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 2px,
    rgba(0, 0, 0, 0.16) 3px,
    transparent 4px
  );
}

.crt-vignette {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  box-shadow: inset 0 0 120px rgba(0, 0, 0, 0.55);
}

/* ---------- Page + terminal frame ---------- */

.page {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px 24px 48px;
}

.terminal {
  max-width: var(--max);
  margin: 0 auto;
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  box-shadow:
    0 0 0 1px rgba(57, 255, 122, 0.04),
    0 0 40px rgba(57, 255, 122, 0.08),
    0 24px 60px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

/* ---------- Title bar ---------- */

.titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 14px;
  background: var(--panel-lift);
  border-bottom: 1px solid var(--hairline);
  flex-wrap: wrap;
}

.titlebar-left,
.titlebar-right {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.traffic-lights {
  display: flex;
  gap: 7px;
  flex-shrink: 0;
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.dot.red { background: var(--dot-red); }
.dot.amber { background: var(--dot-amber); }
.dot.green { background: var(--dot-green); }

.path-label {
  font-family: var(--font-sec);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.path-user {
  color: var(--phosphor);
  font-weight: 600;
}

.path-rest {
  color: var(--sage);
}

.nav {
  display: flex;
  gap: 16px;
  font-size: 12px;
}

.nav a {
  color: var(--sage);
  transition: color 0.15s ease;
}

.nav a:hover,
.nav a:focus-visible {
  color: var(--phosphor);
  text-shadow: var(--glow-soft);
  outline: none;
}

.status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--amber);
  white-space: nowrap;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 8px rgba(255, 210, 74, 0.7);
  animation: blink-soft 1.2s step-end infinite;
}

.status-text {
  letter-spacing: 0.02em;
}

/* ---------- Body ---------- */

.terminal-body {
  padding: 28px 32px 0;
}

.section {
  padding: 8px 0 36px;
}

.cmd {
  font-size: 13px;
  margin-bottom: 18px;
  word-break: break-word;
}

.prompt {
  margin-right: 8px;
}

.prompt-user {
  color: var(--cyan);
  font-weight: 600;
}

.prompt-path {
  color: var(--phosphor);
}

.cmd-text {
  color: var(--ink);
  font-weight: 500;
}

.section-label {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--phosphor-dim);
  margin-bottom: 6px;
}

.section-heading {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 22px;
}

.rule {
  border: 0;
  height: 1px;
  margin: 0;
  background: linear-gradient(
    90deg,
    transparent,
    var(--phosphor-dim) 12%,
    var(--phosphor-mid) 50%,
    var(--phosphor-dim) 88%,
    transparent
  );
  opacity: 0.55;
}

/* ---------- Blinking cursor ---------- */

.cursor-block {
  display: inline-block;
  width: 0.55em;
  height: 0.95em;
  margin-left: 2px;
  vertical-align: -0.08em;
  background: var(--phosphor);
  box-shadow: var(--glow-soft);
  animation: blink 1.1s step-end infinite;
}

.cursor-inline {
  width: 0.5em;
  height: 1em;
  vertical-align: -0.15em;
}

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

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

/* ---------- Hero ---------- */

.name-banner {
  font-family: "JetBrains Mono", monospace !important;
  font-size: 60px !important;
  font-weight: 800 !important;
  line-height: 1.05 !important;
  color: var(--ink) !important;
  letter-spacing: -0.02em;
  text-shadow: var(--glow);
  margin-bottom: 14px;
}

.role {
  font-size: 17px;
  color: var(--phosphor);
  font-weight: 500;
  margin-bottom: 16px;
}

.role-prefix {
  color: var(--sage);
  margin-right: 6px;
}

.intro {
  max-width: 640px;
  font-size: 14px;
  color: var(--sage);
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.intro-row {
  display: grid;
  grid-template-columns: 11.5em 1fr;
  column-gap: 1em;
  align-items: baseline;
}

.intro-row.intro-work {
  grid-template-columns: 11.5em 3em 1fr;
}

.intro-when {
  color: var(--phosphor-dim);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.intro-what,
.intro-detail {
  color: var(--sage);
}

.intro-org {
  color: var(--sage);
  white-space: nowrap;
}

.meta-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-bottom: 24px;
  font-size: 13px;
}

.check {
  color: var(--phosphor);
  margin-right: 6px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  border-radius: 4px;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:focus-visible {
  outline: 1px solid var(--phosphor);
  outline-offset: 2px;
}

.btn-solid {
  background: var(--phosphor);
  color: #031409;
  border-color: var(--phosphor);
  box-shadow: var(--glow);
}

.btn-solid:hover {
  transform: translateY(-1px);
  box-shadow:
    0 0 12px rgba(57, 255, 122, 0.55),
    0 0 28px rgba(57, 255, 122, 0.25);
}

.btn-ghost {
  background: transparent;
  color: var(--phosphor);
  border-color: var(--hairline-bright);
}

.btn-ghost:hover {
  border-color: var(--phosphor-mid);
  background: rgba(57, 255, 122, 0.05);
  text-shadow: var(--glow-soft);
}

/* ---------- Neofetch ---------- */

.neofetch-panel {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 28px;
  padding: 22px;
  background: var(--panel-lift);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
}

.avatar-col {
  text-align: center;
}

.ascii-avatar {
  margin: 0;
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.15;
  color: var(--phosphor);
  white-space: pre;
  overflow: hidden;
}

.avatar-label {
  margin-top: 10px;
  font-size: 12px;
  color: var(--phosphor-mid);
}

.identity-title {
  color: var(--ink);
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 14px;
}

.identity-list {
  display: grid;
  gap: 6px;
  margin: 0 0 10px;
}

.kv {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px;
  font-size: 13px;
}

.kv dt {
  color: var(--phosphor);
  font-weight: 600;
  margin: 0;
}

.kv dd {
  margin: 0;
  color: var(--sage);
}

.ext-link {
  color: var(--phosphor);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(57, 255, 122, 0.35);
  word-break: break-all;
  transition: color 0.15s ease, text-shadow 0.15s ease;
}

.ext-link:hover,
.ext-link:focus-visible {
  color: var(--ink);
  text-shadow: var(--glow-soft);
  outline: none;
}

.more-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin: 0 0 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--phosphor-mid);
  font-family: var(--font);
  font-size: 12px;
  cursor: pointer;
  transition: color 0.15s ease;
}

.more-toggle:hover,
.more-toggle:focus-visible {
  color: var(--phosphor);
  text-shadow: var(--glow-soft);
  outline: none;
}

.more-toggle[aria-expanded="true"] {
  color: var(--phosphor);
}

.more-caret {
  color: var(--phosphor);
  animation: blink 1.1s step-end infinite;
}

.more-plea {
  margin: 0 0 14px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--amber);
  background: rgba(255, 210, 74, 0.06);
  border: 1px solid rgba(255, 210, 74, 0.35);
  border-radius: 3px;
  text-shadow: 0 0 8px rgba(255, 210, 74, 0.35);
}

.more-face {
  display: inline-block;
  margin-right: 8px;
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.02em;
  vertical-align: -1px;
  color: var(--phosphor);
  text-shadow: var(--glow-soft);
  animation: sob 1.4s ease-in-out infinite;
}

@keyframes sob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(1px); }
}

.status-available {
  color: var(--amber);
  font-weight: 600;
  text-shadow: 0 0 8px rgba(255, 210, 74, 0.45);
}

.swatches {
  display: flex;
  gap: 6px;
}

.swatches span {
  width: 18px;
  height: 12px;
  border-radius: 2px;
  background: var(--sw);
  border: 1px solid rgba(57, 255, 122, 0.15);
}

/* ---------- Work grid ---------- */

.work-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.project-card {
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.project-card:hover {
  transform: translateY(-2px);
  border-color: var(--hairline-bright);
  box-shadow:
    0 0 0 1px rgba(57, 255, 122, 0.08),
    0 0 24px rgba(57, 255, 122, 0.12);
}

.project-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.project-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--phosphor);
  text-shadow: var(--glow-soft);
}

.slash {
  color: var(--phosphor-dim);
  font-weight: 400;
}

.project-meta {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-shrink: 0;
  white-space: nowrap;
  font-size: 11px;
  line-height: 1;
}

.stars {
  color: var(--amber);
  font-weight: 600;
}

.perms {
  color: var(--phosphor-dim);
  font-family: var(--font-sec);
}

.project-desc {
  font-size: 13px;
  margin-bottom: 0;
  color: var(--sage);
}

.project-card > .project-desc {
  margin-bottom: 12px;
}

.project-aspect {
  margin-bottom: 12px;
}

.project-aspect .project-desc {
  margin-top: 4px;
}

.aspect-label {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--phosphor);
}

.aspect-label-tags {
  margin-bottom: 8px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.tags li {
  font-size: 11px;
  padding: 3px 8px;
  border: 1px solid var(--hairline-bright);
  border-radius: 3px;
  color: var(--sage);
}

.tags .tag-amber {
  color: var(--amber);
  border-color: rgba(255, 210, 74, 0.45);
  background: rgba(255, 210, 74, 0.06);
}

.project-links {
  display: flex;
  gap: 16px;
  font-size: 12px;
}

.project-links a {
  color: var(--sage);
  transition: color 0.15s ease;
}

.project-links a:hover,
.project-links a:focus-visible {
  color: var(--phosphor);
  outline: none;
}

.arrow {
  color: var(--phosphor);
  margin-right: 4px;
}

/* ---------- Skills ---------- */

.skills-panel {
  padding: 20px;
  background: var(--panel-lift);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
}

.skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 28px;
}

.skill-row {
  display: grid;
  grid-template-columns: 150px 1fr 44px;
  align-items: center;
  gap: 12px;
}

.skill-label {
  font-size: 12px;
  color: var(--sage);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.skill-track {
  height: 9px;
  background: #030503;
  border: 1px solid var(--hairline);
  border-radius: 2px;
  overflow: hidden;
}

.skill-fill {
  height: 100%;
  width: var(--pct);
  background: linear-gradient(90deg, var(--phosphor-mid), var(--phosphor));
  box-shadow: 0 0 10px rgba(57, 255, 122, 0.45);
  border-radius: 1px;
}

.skill-pct {
  font-size: 11px;
  color: var(--phosphor-mid);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ---------- Contact ---------- */

.contact-panel {
  text-align: center;
  padding: 36px 28px 32px;
  background:
    linear-gradient(180deg, rgba(57, 255, 122, 0.06), rgba(5, 8, 5, 0.2) 40%, transparent),
    var(--panel-lift);
  border: 1px solid var(--hairline-bright);
  border-radius: var(--radius);
  box-shadow:
    0 0 0 1px rgba(57, 255, 122, 0.05),
    0 0 36px rgba(57, 255, 122, 0.08);
}

.contact-headline {
  font-size: 26px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 10px;
}

.contact-sub {
  max-width: 480px;
  margin: 0 auto 22px;
  font-size: 13px;
  color: var(--sage);
}

.command-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  margin: 0 auto;
  background: #030503;
  border: 1px solid var(--hairline-bright);
  border-radius: 4px;
  color: var(--phosphor);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--glow-soft);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.command-box:hover,
.command-box:focus-visible {
  border-color: var(--phosphor-mid);
  box-shadow: var(--glow);
  outline: none;
}

.cmd-dollar {
  color: var(--phosphor-mid);
}

.copy-hint {
  margin-top: 8px;
  font-size: 11px;
  color: var(--amber);
}

.social-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
}

.social-pills a {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  font-size: 12px;
  color: var(--sage);
  border: 1px solid var(--hairline-bright);
  border-radius: 3px;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.social-pills a:hover,
.social-pills a:focus-visible {
  color: var(--phosphor);
  border-color: var(--phosphor-mid);
  background: rgba(57, 255, 122, 0.04);
  outline: none;
}

/* ---------- Footer ---------- */

.footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px 0 24px;
  margin-top: 8px;
  border-top: 1px solid var(--hairline);
  font-size: 11px;
}

.footer-echo {
  color: var(--sage);
  max-width: 640px;
  word-break: break-word;
}

.footer-git {
  color: var(--phosphor-dim);
  font-family: var(--font-sec);
  white-space: nowrap;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .page {
    padding: 16px 12px 32px;
  }

  .terminal-body {
    padding: 22px 18px 0;
  }

  .name-banner {
    font-size: 40px !important;
  }

  .titlebar-right {
    width: 100%;
    justify-content: space-between;
  }

  .nav {
    display: none;
  }

  .neofetch-panel {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .identity-col {
    width: 100%;
  }

  .work-grid,
  .skills-grid {
    grid-template-columns: 1fr;
  }

  .skill-row {
    grid-template-columns: 120px 1fr 40px;
  }

  .project-top {
    flex-wrap: wrap;
  }

  .footer-git {
    white-space: normal;
  }
}

@media (max-width: 520px) {
  .name-banner {
    font-size: 32px !important;
  }

  .role {
    font-size: 15px;
  }

  .kv {
    grid-template-columns: 72px 1fr;
  }

  .skill-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .skill-pct {
    text-align: left;
  }

  .contact-headline {
    font-size: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cursor-block,
  .status-dot {
    animation: none;
  }

  .project-card,
  .btn {
    transition: none;
  }

  html {
    scroll-behavior: auto;
  }
}
