/* ============================================================
   alokbhawankar.dev — portfolio stylesheet
   Dark sci-fi network theme with retro-arcade accents
   ============================================================ */

:root {
  --bg: #04060d;
  --bg-raised: rgba(13, 19, 34, 0.72);
  --bg-raised-solid: #0d1322;
  --border: rgba(148, 209, 255, 0.10);
  --border-bright: rgba(34, 211, 238, 0.45);
  --text: #e6edf7;
  --text-muted: #93a0b8;
  --text-faint: #5c6a84;
  --accent: #22d3ee;
  --accent-dim: rgba(34, 211, 238, 0.12);
  --accent-2: #a78bfa;
  --retro: #ffb454;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Space Grotesk", var(--font-body);
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, monospace;
  --font-pixel: "Press Start 2P", var(--font-mono);
  --max-w: 1080px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 96px; }

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

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

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #1c2740; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #2a3a5e; }

/* ---------- background canvas ---------- */

#net-bg {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 55% at 50% -10%, rgba(34, 88, 160, 0.16), transparent 60%),
    radial-gradient(ellipse 60% 45% at 85% 110%, rgba(124, 58, 237, 0.09), transparent 60%),
    var(--bg);
}

/* ---------- typography helpers ---------- */

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

h1, h2, h3 { font-family: var(--font-display); line-height: 1.2; }

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: none; }

.cursor {
  display: inline-block;
  color: var(--accent);
  animation: blink 1.05s steps(1) infinite;
  font-weight: 400;
}

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

/* ---------- nav ---------- */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  transition: background 0.35s ease, border-color 0.35s ease, padding 0.35s ease;
  border-bottom: 1px solid transparent;
}

.nav.scrolled {
  padding: 12px 28px;
  background: rgba(4, 6, 13, 0.82);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--border);
}

.nav__logo {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--text);
  letter-spacing: 0.02em;
}

.nav__logo span { color: var(--accent); }

.nav__links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav__links a {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  transition: color 0.2s ease;
}

.nav__links a:hover { color: var(--accent); }

.nav__links a::before { content: "./"; color: var(--text-faint); }

.nav__links a.btn::before { content: none; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  padding: 11px 22px;
  border-radius: 6px;
  border: 1px solid var(--border-bright);
  color: var(--accent) !important;
  background: transparent;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.btn:hover {
  background: var(--accent-dim);
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.18);
  transform: translateY(-1px);
}

.btn--primary {
  background: var(--accent);
  color: #04121a !important;
  border-color: var(--accent);
  font-weight: 600;
}

.btn--primary:hover {
  background: #53e0f5;
  box-shadow: 0 0 32px rgba(34, 211, 238, 0.35);
}

.btn--ghost { border-color: rgba(148, 209, 255, 0.22); color: var(--text-muted) !important; }
.btn--ghost:hover { color: var(--accent) !important; border-color: var(--border-bright); }

.btn--small { padding: 7px 16px; font-size: 0.78rem; }

/* ---------- hero ---------- */

.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  padding: 130px 0 80px;
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 56px;
  align-items: center;
  /* scroll-linked dolly-out (driven by JS) */
  transform-origin: 50% 30%;
  will-change: transform, opacity;
}

.hero__eyebrow {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.hero__eyebrow .prompt { color: var(--accent-2); }

.hero h1 {
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  background: linear-gradient(105deg, #f2f7ff 40%, #7ddcf0 75%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero__role {
  font-family: var(--font-mono);
  font-size: clamp(1rem, 2.2vw, 1.25rem);
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 26px;
  min-height: 1.6em;
}

.hero__role .gt { color: var(--text-faint); }

.hero__summary {
  color: var(--text-muted);
  max-width: 560px;
  margin-bottom: 34px;
  font-size: 1.02rem;
  background: rgba(9, 14, 26, 0.55);
  -webkit-backdrop-filter: blur(9px);
  backdrop-filter: blur(9px);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
}

.hero__summary strong { color: var(--text); font-weight: 600; }

.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 52px; }

.hero__quip {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--retro);
  letter-spacing: 0.02em;
  padding: 12px 20px;
  border: 1px dashed rgba(255, 180, 84, 0.4);
  border-radius: 8px;
  background: rgba(255, 180, 84, 0.05);
  box-shadow: 0 0 24px rgba(255, 180, 84, 0.07);
  animation: quip-glow 3.2s ease-in-out infinite;
}

@keyframes quip-glow {
  0%, 100% { box-shadow: 0 0 12px rgba(255, 180, 84, 0.06); border-color: rgba(255, 180, 84, 0.3); }
  50% { box-shadow: 0 0 30px rgba(255, 180, 84, 0.16); border-color: rgba(255, 180, 84, 0.55); }
}

/* portrait */

.hero__portrait {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 48px; /* outer orbit ring extends 30px past the frame — keep the tag clear of it */
}

.portrait-frame {
  position: relative;
  width: min(280px, 60vw);
  aspect-ratio: 1;
  cursor: pointer;
}

.portrait-frame:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 34px;
  border-radius: 50%;
}

.portrait-frame::before {
  content: "";
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  border: 1px dashed rgba(34, 211, 238, 0.35);
  animation: spin 28s linear infinite;
}

.portrait-frame::after {
  content: "";
  position: absolute;
  inset: -30px;
  border-radius: 50%;
  border: 1px solid rgba(167, 139, 250, 0.14);
  border-top-color: rgba(167, 139, 250, 0.5);
  animation: spin 44s linear infinite reverse;
}

@keyframes spin { to { transform: rotate(360deg); } }

.portrait-clip {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(34, 211, 238, 0.5);
  box-shadow:
    0 0 40px rgba(34, 100, 238, 0.25),
    0 0 90px rgba(34, 211, 238, 0.12);
}

.portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: filter 0.5s ease, transform 0.5s ease;
}

/* while veiled: the image itself is blurred, uniformly across the circle;
   scale hides the blur's soft outer fringe behind the hard clip edge */
html.veil .portrait-frame img {
  filter: blur(16px);
  transform: scale(1.08);
}

/* full-circle grainy tint + hint text shown while the image is veiled */
.portrait-hint {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: clamp(0.9rem, 2vw, 1.05rem);
  letter-spacing: 0.1em;
  color: #eaf6ff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
  background-color: rgba(6, 10, 20, 0.3);
  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='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.16'/%3E%3C/svg%3E");
  background-size: 140px 140px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

/* visible from first paint while html.veil is set; fades out when it drops */
html.veil .portrait-hint { opacity: 1; }

html.light .portrait-hint {
  background-color: rgba(240, 245, 252, 0.35);
  color: #14213d;
  text-shadow: none;
}

.portrait-tag {
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  color: var(--retro);
  letter-spacing: 0.08em;
  padding: 10px 16px;
  border: 1px solid rgba(255, 180, 84, 0.3);
  border-radius: 4px;
  background: rgba(255, 180, 84, 0.05);
  white-space: nowrap;
}

.scroll-hint {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  color: var(--text-faint);
  animation: bob 2.2s ease-in-out infinite;
}

.scroll-hint:hover { color: var(--accent); }

@keyframes bob {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 7px); }
}

/* ---------- sections ---------- */

.section { padding: 110px 0; position: relative; }

.section__heading {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 14px;
}

.section__index {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
}

.section__index::before { content: "["; color: var(--text-faint); }
.section__index::after { content: "]"; color: var(--text-faint); }

.section h2 {
  font-size: clamp(1.7rem, 3.6vw, 2.3rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.section__sub {
  font-family: var(--font-mono);
  color: var(--text-faint);
  font-size: 0.85rem;
  margin-bottom: 56px;
}

.section__sub::before { content: "// "; }

/* ---------- experience timeline (center line, alternating cards) ---------- */

.xp-timeline { position: relative; padding: 10px 0; }

.xp-line {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  transform: translateX(-50%);
  background: rgba(148, 209, 255, 0.10);
  border-radius: 2px;
}

.xp-progress {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 0%;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  border-radius: 2px;
  box-shadow: 0 0 14px rgba(34, 211, 238, 0.5);
}

.xp-item {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 70px;
  padding: 30px 0 80px;
}

.xp-item:last-child { padding-bottom: 10px; }

.xp-item.left .xp-card { grid-column: 1; grid-row: 1; }
.xp-item.left .xp-meta { grid-column: 2; grid-row: 1; }
.xp-item.right .xp-card { grid-column: 2; grid-row: 1; }
.xp-item.right .xp-meta { grid-column: 1; grid-row: 1; text-align: right; }

.xp-dot {
  position: absolute;
  left: 50%;
  top: 44px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  transform: translateX(-50%);
  background: var(--bg);
  border: 2px solid rgba(148, 209, 255, 0.35);
  transition: border-color 0.4s ease, background 0.4s ease, box-shadow 0.4s ease;
  z-index: 1;
}

.xp-item.passed .xp-dot {
  border-color: var(--accent);
  background: rgba(34, 211, 238, 0.3);
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.65);
}

.xp-num {
  position: absolute;
  top: -14px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 4.4rem;
  line-height: 1;
  color: rgba(34, 211, 238, 0.13);
  pointer-events: none;
}

@supports (-webkit-text-stroke: 1px cyan) {
  .xp-num {
    color: transparent;
    -webkit-text-stroke: 1.5px rgba(34, 211, 238, 0.35);
  }
}

.xp-item.left .xp-num { right: calc(50% + 44px); }
.xp-item.right .xp-num { left: calc(50% + 44px); }

.xp-meta { padding-top: 38px; }

.xp-dates {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(34, 211, 238, 0.2);
  padding: 3px 12px;
  border-radius: 99px;
  letter-spacing: 0.03em;
}

.xp-loc {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-faint);
  margin-top: 10px;
}

.xp-card { text-align: left; }

.job__company {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.job__company a { color: var(--text); transition: color 0.2s ease; }
.job__company a:hover { color: var(--accent); }

.job__role {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.xp-card ul { list-style: none; margin-bottom: 22px; }

.xp-card li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 12px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.xp-card li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.85em;
  top: 2px;
}

.xp-card li strong { color: var(--text); font-weight: 600; }

/* entrance: cards slide in from their side once JS arms the reveal system */
html.reveal-armed .xp-item .xp-card {
  opacity: 0;
  transition: opacity 0.7s ease, transform 0.7s ease;
}

html.reveal-armed .xp-item.left .xp-card { transform: translateX(-46px) scale(0.96); }
html.reveal-armed .xp-item.right .xp-card { transform: translateX(46px) scale(0.96); }

html.reveal-armed .xp-item .xp-meta,
html.reveal-armed .xp-item .xp-num {
  opacity: 0;
  transition: opacity 0.7s ease 0.2s;
}

html.reveal-armed .xp-item.in-view .xp-card { opacity: 1; transform: none; }
html.reveal-armed .xp-item.in-view .xp-meta,
html.reveal-armed .xp-item.in-view .xp-num { opacity: 1; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }

.tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  background: rgba(148, 209, 255, 0.04);
  padding: 4px 12px;
  border-radius: 99px;
  letter-spacing: 0.02em;
  transition: border-color 0.2s ease, color 0.2s ease;
}

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

/* ---------- skills ---------- */

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.card {
  background: var(--bg-raised);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
  border-color: var(--border-bright);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(2, 8, 20, 0.55), 0 0 24px rgba(34, 211, 238, 0.07);
}

.skill-card__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.skill-card__icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--accent-dim);
  border: 1px solid rgba(34, 211, 238, 0.22);
  color: var(--accent);
  flex-shrink: 0;
}

.skill-card__icon svg { width: 20px; height: 20px; }

.skill-card h3 { font-size: 1.02rem; font-weight: 600; }

.skill-card--ai .skill-card__icon {
  background: rgba(167, 139, 250, 0.12);
  border-color: rgba(167, 139, 250, 0.3);
  color: var(--accent-2);
}

/* ---------- projects ---------- */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 20px;
  margin-bottom: 36px;
}

.project { display: flex; flex-direction: column; }

.project__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.project__glyph {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 1.1rem;
}

.project__lvl {
  font-family: var(--font-pixel);
  font-size: 0.5rem;
  color: var(--text-faint);
  letter-spacing: 0.1em;
}

.project h3 { font-size: 1.1rem; margin-bottom: 10px; }

.project p { color: var(--text-muted); font-size: 0.93rem; flex-grow: 1; margin-bottom: 20px; }

.projects-more {
  font-family: var(--font-mono);
  font-size: 0.88rem;
}

.projects-more a { color: var(--text-muted); transition: color 0.2s ease; }
.projects-more a:hover { color: var(--accent); }
.projects-more .arrow { color: var(--accent); }

/* ---------- education ---------- */

.edu-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.edu-card h3 { font-size: 1.2rem; margin-bottom: 6px; }

.edu-card .edu__degree { color: var(--text-muted); font-size: 0.95rem; }

.edu-card .edu__meta {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-faint);
  line-height: 2;
}

.edu-card .edu__meta .gpa { color: var(--retro); }

/* ---------- contact ---------- */

.contact { text-align: center; padding-bottom: 140px; }

.contact h2 { margin-bottom: 18px; }

.contact__blurb {
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 40px;
}

.contact__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  margin-bottom: 48px;
}

.contact__offclock {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-faint);
}

.contact__offclock .heart { color: #f0507a; }

/* ---------- footer ---------- */

.footer {
  border-top: 1px solid var(--border);
  padding: 34px 0;
  background: rgba(4, 6, 13, 0.6);
}

.footer .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.footer__copy {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-faint);
}

.footer__copy .heart { color: #f0507a; }

.press-start {
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  color: var(--retro);
  background: none;
  border: none;
  cursor: pointer;
  letter-spacing: 0.12em;
  animation: blink 1.6s steps(1) infinite;
  padding: 8px;
}

.press-start:hover { animation: none; text-shadow: 0 0 12px rgba(255, 180, 84, 0.8); }

/* ---------- scroll-to-top ---------- */

.to-top {
  position: fixed;
  right: 26px;
  bottom: 26px;
  z-index: 60;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  font-family: var(--font-pixel);
  font-size: 0.8rem;
  color: var(--accent);
  background: var(--bg-raised);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-bright);
  border-radius: 8px;
  cursor: pointer;
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.to-top.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.to-top:hover {
  background: var(--accent-dim);
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.25);
}

@media (max-width: 720px) {
  .to-top { right: 16px; bottom: 16px; }
}

/* ---------- light theme (toggled by clicking the portrait; dark is default) ---------- */

html.light {
  --bg: #eef2f9;
  --bg-raised: rgba(255, 255, 255, 0.78);
  --bg-raised-solid: #ffffff;
  --border: rgba(15, 40, 80, 0.14);
  --border-bright: rgba(8, 145, 178, 0.55);
  --text: #14213d;
  --text-muted: #45536e;
  --text-faint: #7c8aa0;
  --accent: #0891b2;
  --accent-dim: rgba(8, 145, 178, 0.10);
  --accent-2: #7c3aed;
  --retro: #b45309;
}

html.light #net-bg {
  background:
    radial-gradient(ellipse 80% 55% at 50% -10%, rgba(59, 130, 246, 0.10), transparent 60%),
    radial-gradient(ellipse 60% 45% at 85% 110%, rgba(124, 58, 237, 0.07), transparent 60%),
    var(--bg);
}

html.light ::selection { background: rgba(8, 145, 178, 0.25); color: #0b1526; }
html.light ::-webkit-scrollbar-thumb { background: #c3cede; }
html.light ::-webkit-scrollbar-track { background: var(--bg); }

html.light .nav.scrolled { background: rgba(238, 242, 249, 0.86); }

html.light .hero h1 {
  background: linear-gradient(105deg, #1e293b 40%, #0e7490 75%, #6d28d9 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

html.light .hero__summary { background: rgba(255, 255, 255, 0.68); }

html.light .hero__quip {
  border-color: rgba(180, 83, 9, 0.45);
  background: rgba(180, 83, 9, 0.06);
  box-shadow: none;
  animation: none;
}

html.light .xp-line { background: rgba(15, 40, 80, 0.14); }

html.light .xp-num { color: rgba(8, 145, 178, 0.25); }

@supports (-webkit-text-stroke: 1px cyan) {
  html.light .xp-num {
    color: transparent;
    -webkit-text-stroke: 1.5px rgba(8, 145, 178, 0.45);
  }
}

html.light .xp-dates { border-color: rgba(8, 145, 178, 0.35); }

html.light .card:hover {
  box-shadow: 0 12px 32px rgba(30, 60, 110, 0.14), 0 0 20px rgba(8, 145, 178, 0.08);
}

html.light .footer { background: rgba(238, 242, 249, 0.7); }

html.light .portrait-tag {
  border-color: rgba(180, 83, 9, 0.4);
  background: rgba(180, 83, 9, 0.06);
}

/* ---------- reveal-on-scroll ----------
   The hidden state only applies once JS "arms" it (html.reveal-armed),
   so content stays visible if scripts fail to load or run. */

.reveal {
  transition: opacity 0.7s ease, transform 0.7s ease;
}

html.reveal-armed .reveal {
  opacity: 0;
  transform: translateY(20px) scale(0.94);
}

html.reveal-armed .reveal.in-view { opacity: 1; transform: translateY(0) scale(1); }

.reveal--d1 { transition-delay: 0.08s; }
.reveal--d2 { transition-delay: 0.16s; }
.reveal--d3 { transition-delay: 0.24s; }

/* ---------- CRT mode (konami / press start) ---------- */

.scanlines {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(0, 0, 0, 0) 0px,
      rgba(0, 0, 0, 0) 2px,
      rgba(4, 10, 18, 0.22) 3px,
      rgba(4, 10, 18, 0.22) 4px
    );
}

body.crt .scanlines { opacity: 1; }

body.crt .hero h1,
body.crt .section h2 {
  text-shadow: 2px 0 0 rgba(255, 60, 90, 0.35), -2px 0 0 rgba(40, 220, 255, 0.35);
}

body.crt #net-bg { filter: saturate(1.5) contrast(1.06); }

/* ---------- toast ---------- */

.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translate(-50%, 90px);
  z-index: 100;
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  color: var(--retro);
  background: var(--bg-raised-solid);
  border: 1px solid rgba(255, 180, 84, 0.5);
  border-radius: 6px;
  padding: 16px 24px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(255, 180, 84, 0.15);
  transition: transform 0.45s cubic-bezier(0.2, 1.4, 0.4, 1);
  white-space: nowrap;
}

.toast.show { transform: translate(-50%, 0); }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; gap: 48px; }
  .hero__portrait { order: -1; }
  .portrait-frame { width: min(200px, 55vw); }
  .hero { padding-top: 120px; }
}

@media (max-width: 900px) {
  /* timeline collapses to a single left-rail column */
  .xp-line { left: 7px; transform: none; }
  .xp-item { grid-template-columns: 1fr; padding: 16px 0 56px 40px; }
  .xp-item.left .xp-meta,
  .xp-item.right .xp-meta {
    grid-column: 1;
    grid-row: 1;
    text-align: left;
    padding-top: 0;
    margin-bottom: 18px;
  }
  .xp-item.left .xp-card,
  .xp-item.right .xp-card {
    grid-column: 1;
    grid-row: 2;
  }
  .xp-dot { left: 8px; top: 20px; }
  .xp-num { display: none; }
  .xp-loc { display: inline-block; margin: 0 0 0 12px; }
  html.reveal-armed .xp-item.left .xp-card,
  html.reveal-armed .xp-item.right .xp-card { transform: translateY(26px) scale(0.97); }
}

@media (max-width: 720px) {
  .nav__links a:not(.btn) { display: none; }
  .section { padding: 80px 0; }
  .edu-card .edu__meta { text-align: left; }
  .footer .container { justify-content: center; text-align: center; }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal,
  html.reveal-armed .reveal,
  html.reveal-armed .xp-item .xp-card,
  html.reveal-armed .xp-item .xp-meta,
  html.reveal-armed .xp-item .xp-num { opacity: 1 !important; transform: none !important; }
}
