/* ==========================================================================
   Alan Joy — Personal site
   assets/css/main.css
   Design system: dark "terminal" aesthetic, glass surfaces, neon accents.
   ========================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  /* Surfaces */
  --bg:              #05070d;
  --bg-elev:         #0a0e17;
  --surface:         rgba(255, 255, 255, 0.035);
  --surface-strong:  rgba(255, 255, 255, 0.06);
  --border:          rgba(255, 255, 255, 0.10);
  --border-strong:   rgba(255, 255, 255, 0.18);

  /* Accents */
  --cyan:            #22d3ee;
  --green:           #4ade80;
  --violet:          #a78bfa;
  --amber:           #fbbf24;
  --rose:            #fb7185;

  /* Text */
  --text:            #e6edf3;
  --text-muted:      #94a3b8;
  --text-dim:        #64748b;

  /* Type */
  --font-sans: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Metrics */
  --nav-h: 72px;
  --wrap: 1180px;
  --radius: 14px;
  --radius-lg: 20px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 0.45s;

  /* Shadows */
  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 16px 48px rgba(0, 0, 0, 0.5);
  --glow-cyan: 0 0 0 1px rgba(34, 211, 238, 0.35), 0 0 32px rgba(34, 211, 238, 0.18);
}

/* ---------- 2. Reset ---------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 20px);
  -webkit-text-size-adjust: 100%;
}

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

img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
ul, ol { list-style: none; }

::selection { background: rgba(34, 211, 238, 0.28); color: #fff; }

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

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: rgba(34, 211, 238, 0.4); }

/* ---------- 3. Layout helpers ---------- */
.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }

.section { padding: clamp(4.5rem, 9vw, 7.5rem) 0; position: relative; }
.section--tight { padding: clamp(3rem, 6vw, 5rem) 0; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  background: var(--cyan);
  color: #001014;
  padding: 0.75rem 1.25rem;
  font-weight: 700;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------- 4. Ambient background ---------- */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: -5;
  pointer-events: none;
  overflow: hidden; /* clips the oversized aurora/grid so they can't widen the page */
  background: var(--bg);
}

.bg-grid {
  position: absolute;
  inset: -2px;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 30%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 30%, transparent 78%);
}

.bg-aurora {
  position: absolute;
  top: -30%;
  left: -20%;
  width: 140%;
  height: 140%;
  background:
    radial-gradient(circle at 22% 28%, rgba(34, 211, 238, 0.20) 0%, rgba(34, 211, 238, 0.06) 28%, transparent 58%),
    radial-gradient(circle at 78% 18%, rgba(167, 139, 250, 0.18) 0%, rgba(167, 139, 250, 0.05) 26%, transparent 56%),
    radial-gradient(circle at 62% 74%, rgba(74, 222, 128, 0.13) 0%, rgba(74, 222, 128, 0.04) 30%, transparent 60%);
  animation: auroraDrift 34s ease-in-out infinite alternate;
}

@keyframes auroraDrift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(-3%, 3%, 0) scale(1.08); }
  100% { transform: translate3d(3%, -2%, 0) scale(1.03); }
}

.bg-noise {
  position: absolute;
  inset: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- 5. Typography ---------- */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 1rem;
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan));
}

.section-title {
  font-size: clamp(1.9rem, 4.2vw, 2.9rem);
  margin-bottom: 0.9rem;
}

.section-sub {
  color: var(--text-muted);
  max-width: 62ch;
  font-size: 1.02rem;
}

.section-head { margin-bottom: clamp(2.5rem, 5vw, 3.75rem); }
.section-head--center { text-align: center; }
.section-head--center .section-sub { margin-inline: auto; }
.section-head--center .eyebrow::after {
  content: "";
  width: 26px;
  height: 1px;
  background: linear-gradient(270deg, transparent, var(--cyan));
}

.grad-text {
  background: linear-gradient(120deg, var(--cyan) 0%, var(--violet) 55%, var(--green) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.mono { font-family: var(--font-mono); }

/* ---------- 6. Buttons ---------- */
.btn {
  --btn-bg: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.85rem 1.6rem;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--btn-bg);
  font-weight: 600;
  font-size: 0.94rem;
  letter-spacing: 0.01em;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s var(--ease), border-color 0.25s, box-shadow 0.25s, background 0.25s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  background: linear-gradient(120deg, var(--cyan), #3b82f6 60%, var(--violet));
  border-color: transparent;
  color: #04121a;
  font-weight: 700;
  box-shadow: 0 8px 28px rgba(34, 211, 238, 0.22);
}
.btn--primary:hover { box-shadow: 0 12px 36px rgba(34, 211, 238, 0.34); }

.btn--ghost { background: var(--surface); color: var(--text); backdrop-filter: blur(8px); }
.btn--ghost:hover { border-color: var(--cyan); box-shadow: var(--glow-cyan); }

.btn--sm { padding: 0.6rem 1.15rem; font-size: 0.85rem; }

/* ---------- 7. Navigation ---------- */
.progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--cyan), var(--violet), var(--green));
  z-index: 120;
  transition: width 0.1s linear;
}

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 100;
  display: flex;
  align-items: center;
  transition: background 0.35s, border-color 0.35s, backdrop-filter 0.35s;
  border-bottom: 1px solid transparent;
}
.nav.is-stuck {
  background: rgba(5, 7, 13, 0.78);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-bottom-color: var(--border);
}

.nav__inner {
  width: min(100% - 2.5rem, var(--wrap));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
}
.brand__mark {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.2), rgba(167, 139, 250, 0.2));
  border: 1px solid var(--border-strong);
  color: var(--cyan);
  font-size: 0.9rem;
  flex-shrink: 0;
}
.brand__dot { color: var(--green); }

.nav__links { display: flex; align-items: center; gap: 0.35rem; }
.nav__links a {
  position: relative;
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  font-size: 0.92rem;
  color: var(--text-muted);
  font-weight: 500;
  transition: color 0.2s, background 0.2s;
}
.nav__links a:hover { color: var(--text); background: var(--surface); }
.nav__links a.is-active { color: var(--cyan); }
.nav__links a.is-active::after {
  content: "";
  position: absolute;
  left: 50%; bottom: 2px;
  transform: translateX(-50%);
  width: 16px; height: 2px;
  border-radius: 2px;
  background: var(--cyan);
}

.nav__actions { display: flex; align-items: center; gap: 0.6rem; }

.burger {
  display: none;
  width: 42px; height: 42px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  position: relative;
}
.burger span {
  position: absolute;
  left: 11px;
  width: 18px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.2s;
}
.burger span:nth-child(1) { top: 14px; }
.burger span:nth-child(2) { top: 20px; }
.burger span:nth-child(3) { top: 26px; }
.burger.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.burger.is-open span:nth-child(2) { opacity: 0; }
.burger.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Mobile drawer */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: rgba(5, 7, 13, 0.97);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--nav-h) 2rem 2rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}
.drawer.is-open { opacity: 1; visibility: visible; }
.drawer a {
  display: block;
  font-size: 1.6rem;
  font-weight: 600;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  transform: translateX(24px);
  opacity: 0;
  transition: color 0.2s;
}
.drawer.is-open a { animation: drawerIn 0.4s var(--ease) forwards; }
.drawer a:hover, .drawer a.is-active { color: var(--cyan); }
.drawer .btn { margin-top: 2rem; width: 100%; }

@keyframes drawerIn { to { transform: translateX(0); opacity: 1; } }

@media (max-width: 900px) {
  .nav__links, .nav__actions .btn { display: none; }
  .burger { display: block; }
}

/* ---------- 8. Hero ---------- */
.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: calc(var(--nav-h) + 3rem) 0 4rem;
  position: relative;
}

.hero__grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.hero__status {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.95rem;
  border-radius: 999px;
  border: 1px solid rgba(74, 222, 128, 0.35);
  background: rgba(74, 222, 128, 0.08);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 1.6rem;
}
.hero__pulse {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7);
  animation: pulse 2.2s infinite;
}
@keyframes pulse {
  70%  { box-shadow: 0 0 0 9px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

.hero__name {
  font-size: clamp(2.6rem, 7vw, 4.6rem);
  line-height: 1.03;
  margin-bottom: 0.9rem;
}

.hero__role {
  font-family: var(--font-mono);
  font-size: clamp(0.95rem, 2.1vw, 1.25rem);
  color: var(--text-muted);
  margin-bottom: 1.4rem;
  min-height: 1.8em;
}
.hero__role .typed { color: var(--cyan); font-weight: 600; }
.caret {
  display: inline-block;
  width: 9px;
  background: var(--cyan);
  margin-left: 2px;
  animation: blink 1.05s steps(2) infinite;
  vertical-align: -2px;
  height: 1.05em;
}
@keyframes blink { 50% { opacity: 0; } }

.hero__lead {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 56ch;
  margin-bottom: 2rem;
}

.hero__cta { display: flex; flex-wrap: wrap; gap: 0.85rem; margin-bottom: 2.25rem; }

.social-row { display: flex; gap: 0.6rem; }
.social-row a {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  transition: all 0.25s var(--ease);
}
.social-row a:hover {
  color: var(--cyan);
  border-color: var(--cyan);
  transform: translateY(-3px);
  box-shadow: var(--glow-cyan);
}
.social-row svg { width: 18px; height: 18px; }

/* Terminal card */
.terminal {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  background: linear-gradient(180deg, rgba(10, 14, 23, 0.92), rgba(5, 7, 13, 0.92));
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-md), 0 0 60px rgba(34, 211, 238, 0.07);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 0.83rem;
  animation: floaty 7s ease-in-out infinite;
}
@keyframes floaty {
  50% { transform: translateY(-10px); }
}

.terminal__bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid var(--border);
}
.terminal__dot { width: 11px; height: 11px; border-radius: 50%; }
.terminal__dot--r { background: #ff5f57; }
.terminal__dot--y { background: #febc2e; }
.terminal__dot--g { background: #28c840; }
.terminal__title {
  margin-left: auto;
  color: var(--text-dim);
  font-size: 0.74rem;
  letter-spacing: 0.05em;
}

.terminal__body { padding: 1.15rem 1.25rem; line-height: 1.85; }
.terminal__body p { white-space: pre-wrap; word-break: break-word; }
.t-prompt { color: var(--green); }
.t-cmd    { color: var(--text); }
.t-out    { color: var(--text-muted); }
.t-key    { color: var(--cyan); }
.t-val    { color: var(--amber); }
.t-ok     { color: var(--green); }
.t-warn   { color: var(--rose); }

@media (max-width: 900px) {
  .hero { min-height: auto; }
  .hero__grid { grid-template-columns: 1fr; }
  .terminal { animation: none; }
}

/* ---------- 9. Cards & surfaces ---------- */
.card {
  position: relative;
  padding: 1.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(10px);
  transition: transform 0.35s var(--ease), border-color 0.35s, background 0.35s, box-shadow 0.35s;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(34, 211, 238, 0.09), transparent 42%);
  opacity: 0;
  transition: opacity 0.35s;
  pointer-events: none;
}
.card:hover {
  transform: translateY(-5px);
  border-color: var(--border-strong);
  background: var(--surface-strong);
  box-shadow: var(--shadow-md);
}
.card:hover::before { opacity: 1; }

.card__icon {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.16), rgba(167, 139, 250, 0.14));
  border: 1px solid var(--border);
  font-size: 1.35rem;
  margin-bottom: 1.1rem;
}
.card h3 { font-size: 1.15rem; margin-bottom: 0.55rem; }
.card p { color: var(--text-muted); font-size: 0.94rem; }

/* ---------- 10. Stats ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.stat {
  padding: 2rem 1.25rem;
  text-align: center;
  background: rgba(10, 14, 23, 0.7);
  backdrop-filter: blur(10px);
  transition: background 0.3s;
}
.stat:hover { background: rgba(34, 211, 238, 0.05); }
.stat__num {
  display: block;
  font-family: var(--font-mono);
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  font-weight: 700;
  line-height: 1;
  margin-bottom: 0.5rem;
  background: linear-gradient(120deg, var(--cyan), var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat__label {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* ---------- 11. Grids ---------- */
.grid { display: grid; gap: 1.25rem; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px) { .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; } }

/* ---------- 12. About ---------- */
.about {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
.about__portrait {
  position: relative;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  background: linear-gradient(155deg, rgba(34, 211, 238, 0.10), rgba(167, 139, 250, 0.08));
  padding: 2.5rem 2rem;
  overflow: hidden;
}
.about__portrait::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 26px 26px;
  pointer-events: none;
}
.avatar {
  width: 128px; height: 128px;
  border-radius: 50%;
  display: grid; place-items: center;
  margin: 0 auto 1.5rem;
  font-family: var(--font-mono);
  font-size: 2.6rem;
  font-weight: 700;
  color: var(--bg);
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  box-shadow: 0 0 0 6px rgba(34, 211, 238, 0.10), 0 0 46px rgba(34, 211, 238, 0.28);
  position: relative;
  z-index: 1;
}
.about__portrait h3 { text-align: center; font-size: 1.35rem; position: relative; z-index: 1; }
.about__portrait .role {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--cyan);
  margin-bottom: 1.5rem;
  position: relative; z-index: 1;
}

.meta-list { position: relative; z-index: 1; display: grid; gap: 0.7rem; }
.meta-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px dashed var(--border);
  font-size: 0.88rem;
}
.meta-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.meta-list .k { color: var(--text-dim); font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; }
.meta-list .v { color: var(--text); text-align: right; font-weight: 500; }

.about__body p { color: var(--text-muted); margin-bottom: 1.15rem; }
.about__body strong { color: var(--text); font-weight: 600; }

.pill-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.5rem; }
.pill {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  transition: all 0.25s;
}
.pill:hover { border-color: var(--cyan); color: var(--cyan); }

@media (max-width: 900px) { .about { grid-template-columns: 1fr; } }

/* ---------- 13. Skills ---------- */
.skill-group { padding: 1.6rem; }
.skill-group__head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.35rem;
}
.skill-group__head .ico {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  font-size: 1.05rem;
}
.skill-group__head h3 { font-size: 1.02rem; }

.bar { margin-bottom: 1.05rem; }
.bar:last-child { margin-bottom: 0; }
.bar__top {
  display: flex;
  justify-content: space-between;
  font-size: 0.84rem;
  margin-bottom: 0.4rem;
}
.bar__name { color: var(--text); font-weight: 500; }
.bar__pct { font-family: var(--font-mono); color: var(--text-dim); font-size: 0.78rem; }
.bar__track {
  height: 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}
.bar__fill {
  height: 100%;
  width: 0;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  transition: width 1.3s var(--ease);
}

/* ---------- 14. Timeline ---------- */
.timeline { position: relative; padding-left: 2.25rem; }
.timeline::before {
  content: "";
  position: absolute;
  left: 7px; top: 6px; bottom: 6px;
  width: 2px;
  background: linear-gradient(180deg, var(--cyan), var(--violet), transparent);
}
.tl-item { position: relative; padding-bottom: 2.5rem; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: "";
  position: absolute;
  left: -2.25rem; top: 8px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--cyan);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.12);
}
.tl-item--edu::before { border-color: var(--violet); box-shadow: 0 0 0 4px rgba(167, 139, 250, 0.12); }

.tl-date {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  color: var(--cyan);
  padding: 0.22rem 0.7rem;
  border: 1px solid rgba(34, 211, 238, 0.3);
  border-radius: 999px;
  margin-bottom: 0.7rem;
}
.tl-item--edu .tl-date { color: var(--violet); border-color: rgba(167, 139, 250, 0.3); }
.tl-role { font-size: 1.15rem; margin-bottom: 0.25rem; }
.tl-org { color: var(--text-dim); font-size: 0.88rem; font-family: var(--font-mono); margin-bottom: 0.8rem; }
.tl-points { display: grid; gap: 0.45rem; }
.tl-points li {
  position: relative;
  padding-left: 1.3rem;
  color: var(--text-muted);
  font-size: 0.93rem;
}
.tl-points li::before {
  content: "▹";
  position: absolute;
  left: 0;
  color: var(--cyan);
}

/* ---------- 15. Projects ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 2.5rem;
}
.filter-btn {
  padding: 0.5rem 1.15rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.25s var(--ease);
}
.filter-btn:hover { color: var(--text); border-color: var(--border-strong); }
.filter-btn.is-active {
  background: rgba(34, 211, 238, 0.12);
  border-color: var(--cyan);
  color: var(--cyan);
}

.project { display: flex; flex-direction: column; }
.project__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.project__badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  color: var(--text-dim);
  white-space: nowrap;
}
.project h3 { font-size: 1.12rem; margin-bottom: 0.5rem; }
.project p { flex: 1; }
.project__tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1.15rem; }
.project__tags span {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.22rem 0.55rem;
  border-radius: 5px;
  background: rgba(34, 211, 238, 0.08);
  color: var(--cyan);
  border: 1px solid rgba(34, 211, 238, 0.16);
}
.project__impact {
  margin-top: 1.15rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border);
  font-size: 0.85rem;
  color: var(--green);
  font-family: var(--font-mono);
}
.is-hidden { display: none !important; }

/* ---------- 16. Blog cards ---------- */
.post-card { display: flex; flex-direction: column; }
.post-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-dim);
  margin-bottom: 0.9rem;
}
.post-card__meta .tag {
  padding: 0.2rem 0.55rem;
  border-radius: 5px;
  background: rgba(167, 139, 250, 0.1);
  color: var(--violet);
  border: 1px solid rgba(167, 139, 250, 0.2);
}
.post-card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.6rem;
  transition: color 0.25s;
  line-height: 1.3;
}
.post-card:hover h3 { color: var(--cyan); }
.post-card p { flex: 1; font-size: 0.93rem; }
.post-card__more {
  margin-top: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--cyan);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.post-card__more .arrow { transition: transform 0.25s var(--ease); }
.post-card:hover .arrow { transform: translateX(5px); }

.search-bar {
  position: relative;
  max-width: 460px;
  margin: 0 auto 1.5rem;
}
.search-bar input {
  width: 100%;
  padding: 0.85rem 1rem 0.85rem 2.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.92rem;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.search-bar input::placeholder { color: var(--text-dim); }
.search-bar input:focus { outline: none; border-color: var(--cyan); box-shadow: var(--glow-cyan); }
.search-bar__ico {
  position: absolute;
  left: 1rem; top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

/* ---------- 17. Services ---------- */
.service { padding: 1.9rem 1.6rem; }
.service__num {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  margin-bottom: 0.9rem;
  display: block;
}
.service h3 { font-size: 1.08rem; margin-bottom: 0.6rem; }
.service ul { margin-top: 1.1rem; display: grid; gap: 0.4rem; }
.service ul li {
  position: relative;
  padding-left: 1.4rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}
.service ul li::before {
  content: "✓";
  position: absolute; left: 0;
  color: var(--green);
  font-size: 0.82rem;
}

/* ---------- 18. Testimonials ---------- */
.quote { padding: 1.9rem 1.7rem; display: flex; flex-direction: column; }
.quote__mark {
  font-size: 3rem;
  line-height: 1;
  color: rgba(34, 211, 238, 0.25);
  font-family: Georgia, serif;
  margin-bottom: 0.4rem;
}
.quote p { flex: 1; color: var(--text-muted); font-style: italic; }
.quote__who {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}
.quote__av {
  width: 42px; height: 42px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--bg);
  background: linear-gradient(135deg, var(--green), var(--cyan));
  flex-shrink: 0;
}
.quote__who strong { display: block; font-size: 0.92rem; }
.quote__who span { font-size: 0.78rem; color: var(--text-dim); }

/* ---------- 19. Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}
.contact-info { display: grid; gap: 1rem; }
.contact-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.15rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: all 0.3s var(--ease);
}
.contact-item:hover { border-color: var(--cyan); transform: translateX(4px); }
.contact-item .ico {
  width: 42px; height: 42px;
  flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 10px;
  background: rgba(34, 211, 238, 0.1);
  color: var(--cyan);
}
.contact-item .k {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  display: block;
}
.contact-item .v { font-size: 0.94rem; font-weight: 500; word-break: break-word; }

.form { display: grid; gap: 1.1rem; }
.field { display: grid; gap: 0.45rem; }
.field label {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.field input, .field textarea, .field select {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-size: 0.94rem;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
  resize: vertical;
}
.field input::placeholder, .field textarea::placeholder { color: var(--text-dim); }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--cyan);
  background: rgba(34, 211, 238, 0.04);
  box-shadow: var(--glow-cyan);
}
.field.has-error input, .field.has-error textarea { border-color: var(--rose); }
.field__err {
  font-size: 0.78rem;
  color: var(--rose);
  font-family: var(--font-mono);
  display: none;
}
.field.has-error .field__err { display: block; }
.field--row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }

.form-note {
  font-size: 0.82rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}
.form-status {
  padding: 0.9rem 1.1rem;
  border-radius: 10px;
  font-size: 0.9rem;
  display: none;
}
.form-status.is-ok {
  display: block;
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.3);
  color: var(--green);
}
.form-status.is-err {
  display: block;
  background: rgba(251, 113, 133, 0.1);
  border: 1px solid rgba(251, 113, 133, 0.3);
  color: var(--rose);
}

@media (max-width: 900px) {
  .contact-grid { grid-template-columns: 1fr; }
  .field--row { grid-template-columns: 1fr; }
}

/* ---------- 20. CTA band ---------- */
.cta-band {
  position: relative;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  background:
    linear-gradient(135deg, rgba(34, 211, 238, 0.10), rgba(167, 139, 250, 0.08)),
    rgba(10, 14, 23, 0.8);
  padding: clamp(2.25rem, 5vw, 3.5rem);
  text-align: center;
  overflow: hidden;
}
.cta-band::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 34px 34px;
  pointer-events: none;
}
.cta-band > * { position: relative; z-index: 1; }
.cta-band h2 { font-size: clamp(1.6rem, 3.6vw, 2.3rem); margin-bottom: 0.85rem; }
.cta-band p { color: var(--text-muted); max-width: 54ch; margin: 0 auto 1.75rem; }
.cta-band .btn-row { display: flex; gap: 0.85rem; justify-content: center; flex-wrap: wrap; }

/* ---------- 21. Footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  background: rgba(5, 7, 13, 0.6);
  padding: 3.5rem 0 2rem;
  margin-top: 3rem;
}
.footer__grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
}
.footer__grid h4 {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 1rem;
}
.footer__grid ul { display: grid; gap: 0.55rem; }
.footer__grid ul a { font-size: 0.9rem; color: var(--text-muted); transition: color 0.2s, padding-left 0.2s; }
.footer__grid ul a:hover { color: var(--cyan); padding-left: 4px; }
.footer__about p { color: var(--text-muted); font-size: 0.9rem; margin: 0.9rem 0 1.25rem; max-width: 38ch; }
.footer__bottom {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
  font-size: 0.84rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}
@media (max-width: 860px) { .footer__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer__grid { grid-template-columns: 1fr; } }

/* ---------- 22. Back to top ---------- */
.to-top {
  position: fixed;
  right: 1.5rem; bottom: 1.5rem;
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: rgba(10, 14, 23, 0.9);
  backdrop-filter: blur(10px);
  color: var(--cyan);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: all 0.3s var(--ease);
  z-index: 90;
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover { border-color: var(--cyan); box-shadow: var(--glow-cyan); }

/* ---------- 23. Article / blog post ---------- */
.post-hero { padding: calc(var(--nav-h) + 4rem) 0 2.5rem; }
.breadcrumb {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 1.5rem;
}
.breadcrumb a { color: var(--text-muted); transition: color 0.2s; }
.breadcrumb a:hover { color: var(--cyan); }
.breadcrumb .sep { margin: 0 0.5rem; opacity: 0.5; }

.post-title { font-size: clamp(1.9rem, 5vw, 3.1rem); margin-bottom: 1.1rem; max-width: 22ch; }
.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
}
.post-meta .tag {
  padding: 0.22rem 0.6rem;
  border-radius: 5px;
  background: rgba(167, 139, 250, 0.1);
  color: var(--violet);
  border: 1px solid rgba(167, 139, 250, 0.2);
}

.article {
  max-width: 76ch;
  margin-inline: auto;
  font-size: 1.03rem;
}
.article > * + * { margin-top: 1.35rem; }
.article h2 {
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  margin-top: 3rem;
  padding-top: 0.5rem;
  scroll-margin-top: calc(var(--nav-h) + 20px);
}
.article h3 { font-size: 1.2rem; margin-top: 2.25rem; }
.article p { color: #c8d3de; }
.article strong { color: #fff; font-weight: 600; }
.article a { color: var(--cyan); border-bottom: 1px solid rgba(34, 211, 238, 0.35); }
.article a:hover { border-bottom-color: var(--cyan); }

.article ul, .article ol { padding-left: 1.5rem; display: grid; gap: 0.6rem; color: #c8d3de; }
.article ul li { position: relative; list-style: none; padding-left: 0.4rem; }
.article ul li::before {
  content: "▹";
  position: absolute; left: -1.2rem;
  color: var(--cyan);
}
.article ol { list-style: decimal; }
.article ol li::marker { color: var(--cyan); font-family: var(--font-mono); font-size: 0.9em; }

.article blockquote {
  border-left: 3px solid var(--cyan);
  padding: 0.4rem 0 0.4rem 1.35rem;
  color: var(--text-muted);
  font-style: italic;
  background: rgba(34, 211, 238, 0.04);
  border-radius: 0 8px 8px 0;
}

.article hr { border: 0; height: 1px; background: var(--border); margin: 2.5rem 0; }

.article code {
  overflow-wrap: anywhere;
  font-family: var(--font-mono);
  font-size: 0.86em;
  padding: 0.15em 0.42em;
  border-radius: 5px;
  background: rgba(34, 211, 238, 0.10);
  color: var(--cyan);
  border: 1px solid rgba(34, 211, 238, 0.16);
}

.codeblock {
  position: relative;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #070a11;
  overflow: hidden;
}
.codeblock__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.9rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.copy-btn {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 0.22rem 0.6rem;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.copy-btn:hover { color: var(--cyan); border-color: var(--cyan); }
.copy-btn.is-done { color: var(--green); border-color: var(--green); }

.codeblock pre {
  margin: 0;
  padding: 1.1rem 1.15rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.83rem;
  line-height: 1.75;
  color: #c9d6e2;
}
.codeblock pre code {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

.callout {
  display: flex;
  gap: 1rem;
  padding: 1.2rem 1.35rem;
  border-radius: var(--radius);
  border: 1px solid rgba(251, 191, 36, 0.28);
  background: rgba(251, 191, 36, 0.06);
}
.callout__ico { font-size: 1.2rem; line-height: 1.4; flex-shrink: 0; }
.callout p { color: var(--text-muted); font-size: 0.95rem; margin: 0; }
.callout strong { color: var(--amber); }
.callout--danger { border-color: rgba(251, 113, 133, 0.28); background: rgba(251, 113, 133, 0.06); }
.callout--danger strong { color: var(--rose); }
.callout--ok { border-color: rgba(74, 222, 128, 0.28); background: rgba(74, 222, 128, 0.06); }
.callout--ok strong { color: var(--green); }

.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
.article table { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 460px; }
.article th, .article td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--border); }
.article th {
  background: rgba(255, 255, 255, 0.04);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.article td { color: var(--text-muted); }
.article tr:last-child td { border-bottom: 0; }

.post-footer {
  max-width: 76ch;
  margin: 3.5rem auto 0;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.author-box {
  display: flex;
  gap: 1.15rem;
  align-items: center;
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}
.author-box .av {
  width: 56px; height: 56px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--bg);
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  flex-shrink: 0;
}
.author-box h4 { font-size: 1rem; margin-bottom: 0.2rem; }
.author-box p { font-size: 0.87rem; color: var(--text-muted); }

.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.75rem;
  flex-wrap: wrap;
}

/* ---------- 24. 404 ---------- */
.err-page {
  min-height: 100svh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: var(--nav-h) 1.5rem 3rem;
}
.err-code {
  font-family: var(--font-mono);
  font-size: clamp(5rem, 20vw, 11rem);
  font-weight: 700;
  line-height: 1;
  background: linear-gradient(120deg, var(--cyan), var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- 25. Reveal animations ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.is-in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: 0.08s; }
.reveal[data-delay="2"] { transition-delay: 0.16s; }
.reveal[data-delay="3"] { transition-delay: 0.24s; }
.reveal[data-delay="4"] { transition-delay: 0.32s; }
.reveal[data-delay="5"] { transition-delay: 0.40s; }

/* ---------- 26. Utilities ---------- */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }  .mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }  .mt-4 { margin-top: 2rem; }
.mt-6 { margin-top: 3rem; }
.mb-3 { margin-bottom: 1.5rem; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- 27. Motion & print ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
  .bg-aurora, .terminal { animation: none; }
}

@media print {
  .nav, .drawer, .to-top, .bg-layer, .footer, .progress-bar, .filters, .search-bar { display: none !important; }
  body { background: #fff; color: #000; }
  .card, .article p, .article li { color: #000 !important; }
  a { color: #000; text-decoration: underline; }
}

/* ---------- 28. Very narrow screens (≤360px) ---------- */
@media (max-width: 360px) {
  .wrap { width: min(100% - 1.75rem, var(--wrap)); }
  .btn {
    white-space: normal;
    text-align: center;
    padding-inline: 1.1rem;
  }
  .stat__num { font-size: 1.5rem; }
  .article { font-size: 0.98rem; }
}

/* ---------- 29. Hero: 3D fleet monitor ---------- */
/* Replaces the flat terminal card. A rotating constellation of server nodes —
   the thing Alan actually watches all day — rendered on canvas with a live HUD
   and a streaming log strip. */

.fleet {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  background: linear-gradient(180deg, rgba(10, 14, 23, 0.97), rgba(5, 7, 13, 0.98));
  box-shadow: var(--shadow-md), 0 0 70px rgba(34, 211, 238, 0.08);
  overflow: hidden;
  font-family: var(--font-mono);
}

.fleet__stage {
  position: relative;
  aspect-ratio: 1 / 0.82;
  min-height: 260px;
  overflow: hidden;
  /* A faint floor grid gives the rotation something to read against */
  background:
    radial-gradient(ellipse 70% 55% at 50% 50%, rgba(34, 211, 238, 0.07), transparent 70%);
}

.fleet__stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}
.fleet__stage canvas:active { cursor: grabbing; }

/* HUD */
.fleet__hud {
  position: absolute;
  top: 0.9rem;
  left: 1rem;
  display: grid;
  gap: 0.45rem;
  pointer-events: none;
}
.fleet__stat {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
}
.fleet__stat .k { color: var(--text-dim); text-transform: uppercase; }
.fleet__stat .v {
  color: var(--cyan);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 0.82rem;
}
.fleet__stat .v.is-alert { color: var(--rose); }

.fleet__legend {
  position: absolute;
  right: 1rem;
  bottom: 0.9rem;
  display: grid;
  gap: 0.35rem;
  pointer-events: none;
  text-align: right;
}
.fleet__legend span {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.fleet__legend i {
  width: 7px; height: 7px;
  border-radius: 2px;
  display: inline-block;
  flex-shrink: 0;
}
.fleet__legend .ok  { background: var(--cyan); box-shadow: 0 0 8px rgba(34, 211, 238, 0.8); }
.fleet__legend .bad { background: var(--rose); box-shadow: 0 0 8px rgba(251, 113, 133, 0.8); }

.fleet__hint {
  position: absolute;
  left: 1rem;
  bottom: 0.9rem;
  font-size: 0.64rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.5);
  pointer-events: none;
}

/* Streaming log strip along the bottom */
.fleet__log {
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.025);
  padding: 0.7rem 1rem;
  font-size: 0.74rem;
  line-height: 1.5;
  color: var(--text-muted);
  min-height: 2.6rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  overflow: hidden;
  white-space: nowrap;
}
.fleet__log .ts { color: var(--text-dim); flex-shrink: 0; }
.fleet__log .lv { flex-shrink: 0; font-weight: 700; }
.fleet__log .lv--ok   { color: var(--green); }
.fleet__log .lv--warn { color: var(--amber); }
.fleet__log .lv--info { color: var(--cyan); }
.fleet__log .msg { overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 900px) {
  .fleet__stage { aspect-ratio: 1 / 0.68; }
  .fleet__legend { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .fleet__stage canvas { cursor: default; }
}

/* ---------- 30. Avatar with photo ---------- */
/* Initials sit underneath; the photo covers them once it loads. If the file is
   missing the script removes the <img> and the initials show through. */
.avatar { position: relative; overflow: hidden; }
.avatar__initials {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}
.avatar__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  z-index: 1;
}
