/* ============================================================
   JEFFREY SHI — PERSONAL SITE
   Design: "Nord Ops" — an editorial take on the Nord editor/
   terminal theme. Frost cyan dominant, aurora purple as a sharp
   secondary accent. Serif headlines, Public Sans body, JetBrains
   Mono for data/labels/code — three voices, not one blended font.
   ============================================================ */

:root {
  --bg: #1c2027;
  --surface: rgba(216, 222, 233, 0.035);
  --surface-hover: rgba(216, 222, 233, 0.065);
  --border: rgba(216, 222, 233, 0.09);
  --border-strong: rgba(216, 222, 233, 0.19);
  --text: #eceff4;                 /* Nord6 */
  --text-2: #a9b3c6;                /* muted slate — secondary body copy */
  --text-3: #6d7891;                /* muted — tertiary / labels */
  --accent: #88c0d0;                /* Nord8 frost cyan — dominant */
  --accent-2: #b48ead;              /* Nord15 aurora purple — sharp secondary */
  --accent-soft: rgba(136, 192, 208, 0.12);
  --grad: linear-gradient(120deg, #8fbcbb, #5e81ac);  /* Nord7 teal → Nord10 deep frost blue */
  --mono: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
  --sans: "Public Sans", "Segoe UI", system-ui, sans-serif;
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --radius: 14px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Ambient glows */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  background:
    radial-gradient(900px 500px at 75% -10%, rgba(136, 192, 208, 0.10), transparent 60%),
    radial-gradient(800px 500px at 10% 110%, rgba(180, 142, 173, 0.07), transparent 60%);
}

/* Faint technical grid — atmosphere/depth without a texture image */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  opacity: 0.5;
  background-image:
    linear-gradient(rgba(216, 222, 233, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(216, 222, 233, 0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(1200px 800px at 50% 0%, black, transparent 75%);
  -webkit-mask-image: radial-gradient(1200px 800px at 50% 0%, black, transparent 75%);
}

::selection { background: rgba(136, 192, 208, 0.35); color: #fff; }

#net-canvas {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.5;
}

/* ---------- Navigation ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: rgba(28, 32, 39, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  font-style: italic;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.brand-mark {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  background: var(--grad);
  box-shadow: 0 0 14px rgba(136, 192, 208, 0.55);
}

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

.nav-links a {
  position: relative;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  padding: 7px 14px;
  border-radius: 8px;
  transition: color 0.15s ease, background 0.15s ease;
}

.nav-links a:hover { color: var(--text); background: var(--surface-hover); }

.nav-links a.active { color: var(--text); }

.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--grad);
}

/* ---------- Layout ---------- */
.container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 28px;
}

.section { padding: 84px 0; }

.section-header {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 40px;
}

.section-header .tag {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.12em;
}

.section-header h2 {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  white-space: nowrap;
}

.section-header .rule {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border-strong), transparent);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: calc(100vh - 70px);
  display: flex;
  align-items: center;
  padding: 80px 0 60px;
}

.hero > div:first-child {
  position: relative;
  z-index: 1;
}

/* One orchestrated page-load sequence — staggered reveal, not scattered
   micro-interactions. Below the fold, .reveal (scroll-triggered) takes over. */
.hero-load {
  opacity: 0;
  animation: hero-load-in 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes hero-load-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-load { animation: none; opacity: 1; }
}

/* ---------- 3D hero centerpiece (signals globe) ---------- */
.hero-3d {
  position: absolute;
  top: 50%;
  right: -110px;
  transform: translateY(-50%);
  width: 620px;
  height: 620px;
  z-index: 0;
  pointer-events: none;
  /* Fade the canvas edges to nothing instead of a hard rectangle — the
     globe's own render always fills a square, so this is what makes it
     read as sitting *in* the page rather than framed by a box. */
  mask-image: radial-gradient(circle at 50% 50%, black 42%, transparent 82%);
  -webkit-mask-image: radial-gradient(circle at 50% 50%, black 42%, transparent 82%);
}

.hero-3d canvas { width: 100%; height: 100%; display: block; }

@media (max-width: 1400px) { .hero-3d { width: 520px; height: 520px; right: -70px; } }
@media (max-width: 1100px) { .hero-3d { width: 420px; height: 420px; right: -40px; opacity: 0.55; } }
@media (max-width: 900px)  { .hero-3d { display: none; } }

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 22px;
}

.eyebrow .tick { color: var(--accent); }

.hero-name {
  font-family: var(--serif);
  font-size: clamp(46px, 8vw, 88px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.02;
  color: var(--text);
}

.hero-name .grad {
  color: var(--accent); /* fallback if background-clip:text isn't supported/rendered */
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .hero-name .grad { color: transparent; }
}

.hero-role {
  margin-top: 20px;
  font-family: var(--mono);
  font-size: clamp(14px, 2vw, 17px);
  color: var(--text-2);
  min-height: 1.7em;
}

.hero-role .cursor {
  display: inline-block;
  width: 2px;
  height: 1.15em;
  margin-left: 2px;
  background: var(--accent);
  vertical-align: text-bottom;
  animation: blink 1.1s steps(1) infinite;
}

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

.hero-sub {
  margin-top: 26px;
  max-width: 620px;
  color: var(--text-2);
  font-size: 16.5px;
}

.hero-actions { margin-top: 38px; display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  padding: 11px 22px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: #f2f4f8;
  color: #171a21;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 30px rgba(136, 192, 208, 0.18);
}

.btn.amber {
  background: var(--accent-soft);
  border-color: rgba(136, 192, 208, 0.35);
  color: var(--accent);
}

.btn.amber:hover {
  background: rgba(136, 192, 208, 0.18);
  border-color: rgba(136, 192, 208, 0.6);
  box-shadow: 0 8px 30px rgba(136, 192, 208, 0.15);
}

.btn.secondary {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text-2);
}

.btn.secondary:hover {
  color: var(--text);
  border-color: rgba(216, 222, 233, 0.35);
  box-shadow: none;
}

/* ---------- Panels / cards ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 30px;
  backdrop-filter: blur(6px);
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

@media (max-width: 820px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* ---------- Fact list (about page) ---------- */
.fact-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.fact-row:last-child { border-bottom: none; }

.fact-label {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  padding-top: 3px;
}

.fact-row .val { color: var(--text); }
.fact-row .val em { font-style: normal; color: var(--accent); }

/* ---------- Domain cards ---------- */
.domain-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 26px;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  overflow: hidden;
}

.domain-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--grad);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.domain-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

.domain-card:hover::before { opacity: 1; }

.domain-card .icon {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--accent);
  letter-spacing: 0.14em;
  margin-bottom: 14px;
}

.domain-card h3 {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--text);
  margin-bottom: 10px;
}

.domain-card p { font-size: 14px; color: var(--text-2); }

.domain-card .chips { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Chips ---------- */
.chip {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 9px;
  background: rgba(216, 222, 233, 0.03);
}

.chip.green {
  color: var(--accent);
  border-color: rgba(136, 192, 208, 0.3);
  background: rgba(136, 192, 208, 0.07);
}

.chip.amber {
  color: var(--accent-2);
  border-color: rgba(180, 142, 173, 0.3);
  background: rgba(180, 142, 173, 0.07);
}

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.55s ease, transform 0.55s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- Project cards ---------- */
.case-file {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  display: flex;
  flex-direction: column;
}

.case-file:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

.case-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 11px;
}

.case-id { color: var(--text-3); letter-spacing: 0.1em; }

.case-status {
  letter-spacing: 0.1em;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid;
  font-size: 10.5px;
}

.case-status.active { color: var(--accent); border-color: rgba(136, 192, 208, 0.35); background: rgba(136, 192, 208, 0.07); }
.case-status.archived { color: var(--text-3); border-color: var(--border-strong); }
.case-status.dev { color: var(--accent-2); border-color: rgba(180, 142, 173, 0.35); background: rgba(180, 142, 173, 0.07); }

.case-body { padding: 22px 22px 24px; flex: 1; display: flex; flex-direction: column; }

.case-body h3 {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--text);
  margin-bottom: 10px;
}

.case-body p { font-size: 14px; color: var(--text-2); flex: 1; }

.case-body code {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--accent);
  background: rgba(136, 192, 208, 0.08);
  border: 1px solid rgba(136, 192, 208, 0.2);
  border-radius: 4px;
  padding: 1px 6px;
}

.case-meta {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.case-links { margin-top: 14px; display: flex; gap: 12px; }

.case-links a {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
}

.case-links a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Contact ---------- */
.contact-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

/* ---------- Footer ---------- */
.status-bar {
  margin-top: 40px;
  border-top: 1px solid var(--border);
  padding: 18px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text-3);
}

.status-bar .mono-hint kbd {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-2);
  background: var(--surface-hover);
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  padding: 1.5px 6px;
  margin: 0 2px;
}

#utc-clock { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.04em; }

/* ============================================================
   RESUME PAGE
   ============================================================ */

.dossier-header {
  margin-top: 48px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  backdrop-filter: blur(6px);
  overflow: hidden;
}

.dossier-topstrip {
  display: flex;
  justify-content: space-between;
  padding: 10px 24px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
}

.dossier-topstrip .ok { color: var(--accent); }

.dossier-main {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px;
  padding: 32px 32px 28px;
  align-items: center;
}

@media (max-width: 700px) { .dossier-main { grid-template-columns: 1fr; } }

.dossier-main h1 {
  font-family: var(--serif);
  font-size: clamp(32px, 5vw, 46px);
  font-weight: 700;
  letter-spacing: -0.015em;
}

.dossier-main h1 .grad {
  color: var(--accent); /* fallback if background-clip:text isn't supported/rendered */
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .dossier-main h1 .grad { color: transparent; }
}

.dossier-main .subject-line {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-3);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.dossier-main .role-line {
  color: var(--text-2);
  font-size: 15.5px;
  margin-top: 8px;
}

.dossier-stats {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 10px 30px;
}

.stat .num {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--accent); /* fallback if background-clip:text isn't supported/rendered */
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .stat .num { color: transparent; }
}

.stat .lbl {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.dossier-actions {
  display: flex;
  gap: 12px;
  padding: 0 32px 30px;
  flex-wrap: wrap;
}

/* --- Resume tabs (segmented control) --- */
.resume-tabs {
  position: sticky;
  top: 63px;
  z-index: 50;
  display: flex;
  gap: 4px;
  margin: 36px 0 32px;
  padding: 5px;
  background: rgba(28, 32, 39, 0.85);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow-x: auto;
  width: fit-content;
  max-width: 100%;
}

.resume-tabs button {
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-2);
  background: transparent;
  border: none;
  border-radius: 8px;
  padding: 9px 18px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s ease, background 0.15s ease;
}

.resume-tabs button:hover { color: var(--text); background: var(--surface-hover); }

.resume-tabs button.active {
  color: var(--text);
  background: rgba(216, 222, 233, 0.1);
}

/* --- Timeline --- */
.timeline { position: relative; padding-left: 32px; }

.timeline::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: linear-gradient(180deg, rgba(136, 192, 208, 0.5), var(--border) 85%);
}

.tl-entry { position: relative; margin-bottom: 16px; }

.tl-entry::before {
  content: "";
  position: absolute;
  left: -28px;
  top: 24px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.tl-entry.open::before {
  background: var(--accent);
  box-shadow: 0 0 12px rgba(136, 192, 208, 0.5);
}

.tl-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.tl-entry.open .tl-card { border-color: var(--border-strong); }

.tl-head {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 19px 24px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  color: var(--text);
}

.tl-head:hover { background: var(--surface-hover); }

.tl-head .role { font-family: var(--serif); font-size: 17px; font-weight: 600; letter-spacing: -0.005em; color: var(--text); }
.tl-head .org { font-size: 13.5px; color: var(--accent); margin-top: 3px; }
.tl-head .dates { font-family: var(--mono); font-size: 11.5px; color: var(--text-3); white-space: nowrap; letter-spacing: 0.04em; }
.tl-head .caret { font-family: var(--mono); color: var(--text-3); transition: transform 0.25s ease, color 0.25s ease; }
.tl-entry.open .caret { transform: rotate(90deg); color: var(--accent); }

.tl-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.tl-body-inner { padding: 4px 24px 22px; border-top: 1px solid var(--border); }

.tl-body ul { list-style: none; margin-top: 16px; }

.tl-body li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 9px;
  font-size: 14px;
  color: var(--text-2);
}

.tl-body li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 6px;
  height: 1.5px;
  border-radius: 1px;
  background: var(--accent);
}

.tl-body .chips { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 6px; }

/* --- Skills --- */
.skill-group h3 {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.16em;
  color: var(--text-3);
  text-transform: uppercase;
  margin-bottom: 18px;
}

.skill { margin-bottom: 14px; }

.skill .skill-label {
  display: flex;
  justify-content: space-between;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}

.skill .skill-label .pct { font-family: var(--mono); font-size: 11.5px; color: var(--text-3); }

.skill-bar {
  height: 5px;
  background: rgba(216, 222, 233, 0.06);
  border-radius: 999px;
  overflow: hidden;
}

.skill-bar .fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--grad);
  transition: width 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}

/* --- Education --- */
.edu-card { display: flex; flex-direction: column; gap: 4px; }
.edu-card .degree { font-family: var(--serif); font-size: 17px; font-weight: 600; letter-spacing: -0.005em; color: var(--text); }
.edu-card .school { color: var(--accent); font-size: 13.5px; }
.edu-card .detail { color: var(--text-2); font-size: 13.5px; margin-top: 6px; }

/* ---------- Command palette ---------- */
.cmd-palette {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%) translateY(130%);
  width: min(560px, calc(100vw - 40px));
  background: rgba(36, 41, 51, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  z-index: 300;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.cmd-palette.open { transform: translateX(-50%) translateY(0); }

.cmd-palette .cmd-row { display: flex; align-items: center; padding: 14px 18px; gap: 10px; }

.cmd-palette .p { font-family: var(--mono); color: var(--accent); font-size: 14px; }

.cmd-palette input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
}

.cmd-palette input::placeholder { color: var(--text-3); }

.cmd-hint {
  padding: 9px 18px;
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-3);
}

.cmd-hint .k { color: var(--text-2); }

.cmd-fab {
  position: fixed;
  right: 26px;
  bottom: 26px;
  z-index: 290;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-2);
  background: rgba(36, 41, 51, 0.85);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 9px 14px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.cmd-fab:hover { color: var(--text); border-color: rgba(216, 222, 233, 0.35); }

/* ---------- Cipher-scramble text reveal ---------- */
.section-header h2.scrambling,
.domain-card h3.scrambling,
.case-body h3.scrambling {
  font-family: var(--mono);
  color: var(--accent);
  text-shadow: 0 0 12px rgba(136, 192, 208, 0.4);
}

/* ---------- Ambient ops-feed ticker ---------- */
.ops-ticker {
  border-bottom: 1px solid var(--border);
  background: rgba(216, 222, 233, 0.015);
  overflow: hidden;
  white-space: nowrap;
}

.ops-track {
  display: inline-flex;
  animation: ops-scroll 38s linear infinite;
  padding: 7px 0;
}

.ops-ticker:hover .ops-track { animation-play-state: paused; }

.ops-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-3);
  padding: 0 28px;
  border-right: 1px solid var(--border);
}

.ops-item .tag { font-weight: 600; }
.ops-item .tag.ok   { color: var(--accent); }
.ops-item .tag.info { color: var(--text-2); }
.ops-item .tag.warn { color: var(--accent-2); }

@keyframes ops-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .ops-track { animation: none; }
}

/* ---------- Hidden terminal easter egg ---------- */
.term-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(14, 16, 20, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.term-overlay.open { opacity: 1; pointer-events: auto; }

.term-panel {
  width: min(640px, calc(100vw - 40px));
  max-height: min(520px, calc(100vh - 80px));
  display: flex;
  flex-direction: column;
  background: rgba(30, 34, 42, 0.97);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.65), 0 0 40px rgba(136, 192, 208, 0.08);
  overflow: hidden;
  transform: translateY(10px) scale(0.98);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.term-overlay.open .term-panel { transform: translateY(0) scale(1); }

.term-panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(216, 222, 233, 0.03);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.term-panel-head .term-dot { width: 10px; height: 10px; border-radius: 50%; }
.term-panel-head .term-dot.r { background: #bf616a; }
.term-panel-head .term-dot.y { background: #ebcb8b; }
.term-panel-head .term-dot.g { background: #a3be8c; }
.term-panel-title { margin-left: 8px; font-family: var(--mono); font-size: 12px; color: var(--text-3); }

.term-output {
  flex: 1;
  overflow-y: auto;
  padding: 14px 18px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
}

.term-line { color: var(--text-2); white-space: pre-wrap; word-break: break-word; }
.term-line.term-banner { color: var(--text-3); }
.term-line.term-prompt-line { color: var(--accent); }

.term-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.term-input-row .p { font-family: var(--mono); color: var(--accent); font-size: 13px; }

.term-input-row input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
}

.term-input-row input::placeholder { color: var(--text-3); }

@media (max-width: 640px) {
  .term-panel { width: calc(100vw - 24px); max-height: calc(100vh - 48px); }
  .ops-item { padding: 0 18px; font-size: 11px; }
}

/* ---------- Print: clean paper resume ---------- */
@media print {
  body { background: #fff; color: #111; font-size: 12px; }
  body::before, body::after, #net-canvas, .nav, .status-bar,
  .resume-tabs, .dossier-actions, .cmd-palette, .cmd-fab,
  .ops-ticker, .term-overlay { display: none !important; }
  .resume-pane { display: block !important; }
  .panel, .tl-card, .dossier-header { background: #fff; border-color: #ccc; box-shadow: none; backdrop-filter: none; }
  .tl-body { max-height: none !important; overflow: visible; }
  .tl-head { cursor: default; }
  .tl-head .role, .dossier-main h1, .edu-card .degree { color: #111; }
  .dossier-main h1 .grad, .stat .num { background: none; -webkit-background-clip: unset; background-clip: unset; color: #111; }
  .tl-head .org, .edu-card .school { color: #0e6b7a; }
  .tl-body li, .edu-card .detail { color: #333; }
  .dossier-main .role-line { color: #444; }
  .timeline::before { background: #8fd3de; }
  .tl-body li::before { background: #0e6b7a; }
  .skill-bar { background: #eee; }
  .skill-bar .fill { background: #0e6b7a; }
  .chip { color: #0e6b7a; border-color: #8fd3de; background: none; }
  .reveal { opacity: 1 !important; transform: none !important; }
  a { color: #111; text-decoration: none; }
}

@media (max-width: 640px) {
  .nav { padding: 13px 18px; }
  .nav-links a { padding: 6px 10px; font-size: 13px; }
  .container { padding: 0 20px; }
  .section { padding: 56px 0; }
  .hero { padding: 48px 0 40px; }
  .status-bar { justify-content: center; text-align: center; }
}
