/* ============================================================
   03 — AURORA GLASS 2030
   deep space · glass · glow
   ============================================================ */

:root {
  --void: #05060A;
  --panel: rgba(13, 15, 28, 0.68); /* darkened: keeps --muted ≥ 5:1 over the brightest blob overlap */
  --panel-solid: #0d0f1c;
  --violet: #7C5CFF;
  --cyan: #22D3EE;
  --magenta: #F472B6;
  --text: #F4F4F8;
  --muted: #c2c4dd; /* brightened from #b9bad4 — bare-canvas worst case (violet+cyan blob overlap) was ~5.1:1, now ~5.6:1 */
  --hairline: rgba(255, 255, 255, 0.12);
  --hairline-strong: rgba(255, 255, 255, 0.22);
  --display: "Space Grotesk", system-ui, sans-serif;
  --body: "Inter", system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --aurora-grad: linear-gradient(100deg, var(--violet), var(--cyan) 50%, var(--magenta));
  --radius: 18px;
}

* { box-sizing: border-box; }

html { scroll-behavior: auto; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

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

h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0; }
p { margin: 0; }
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.skip {
  position: absolute;
  left: 1rem; top: -3rem;
  z-index: 100;
  background: var(--panel-solid);
  border: 1px solid var(--hairline-strong);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: top 150ms ease;
}
.skip:focus { top: 1rem; }

/* ---------- scroll progress ---------- */
.progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  z-index: 60;
}
.progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--aurora-grad);
  box-shadow: 0 0 12px rgba(124, 92, 255, 0.8);
}

/* ---------- aurora mesh ---------- */
.aurora {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}
.blob {
  position: absolute;
  width: 68vmax;
  height: 68vmax;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.42;
  will-change: transform, opacity;
}
.blob-violet {
  top: -28vmax; left: -18vmax;
  background: radial-gradient(circle at center, rgba(124, 92, 255, 0.55), transparent 62%);
}
.blob-cyan {
  top: 8vmax; right: -30vmax;
  background: radial-gradient(circle at center, rgba(34, 211, 238, 0.4), transparent 62%);
}
.blob-magenta {
  bottom: -34vmax; left: 12vmax;
  background: radial-gradient(circle at center, rgba(244, 114, 182, 0.35), transparent 62%);
}
@media (prefers-reduced-motion: no-preference) {
  .blob-violet  { animation: drift-a 26s ease-in-out infinite alternate; }
  .blob-cyan    { animation: drift-b 30s ease-in-out infinite alternate; }
  .blob-magenta { animation: drift-c 24s ease-in-out infinite alternate; }
}
@keyframes drift-a {
  from { transform: translate3d(0, 0, 0) scale(1); opacity: 0.42; }
  to   { transform: translate3d(9vmax, 7vmax, 0) scale(1.15); opacity: 0.55; }
}
@keyframes drift-b {
  from { transform: translate3d(0, 0, 0) scale(1.1); opacity: 0.38; }
  to   { transform: translate3d(-8vmax, 10vmax, 0) scale(0.95); opacity: 0.5; }
}
@keyframes drift-c {
  from { transform: translate3d(0, 0, 0) scale(1); opacity: 0.32; }
  to   { transform: translate3d(7vmax, -8vmax, 0) scale(1.2); opacity: 0.45; }
}

/* ---------- starfield ---------- */
#starfield {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

/* ---------- shell ---------- */
.shell {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 clamp(1.1rem, 4vw, 2.5rem);
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.6rem;
}

/* ---------- glass ---------- */
.glass {
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09);
}

/* ---------- hero ---------- */
.hero {
  padding: clamp(4.5rem, 12vh, 8rem) 0 clamp(2.5rem, 6vh, 4rem);
  text-align: center;
}
.avatar-hero {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--hairline);
  box-shadow: 0 0 0 4px var(--panel), 0 0 30px rgba(124, 92, 255, 0.35);
  margin-bottom: 1.1rem;
}
.name {
  font-size: clamp(2.7rem, 9vw, 5.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  filter: drop-shadow(0 0 22px rgba(124, 92, 255, 0.45));
  margin: 0.4rem 0 0.7rem;
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .name {
    background: var(--aurora-grad);
    background-size: 220% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .name { animation: grad-slide 9s ease-in-out infinite alternate; }
}
@keyframes grad-slide {
  from { background-position: 0% 50%; }
  to   { background-position: 100% 50%; }
}
.role {
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 0.22em;
  color: var(--muted);
}
/* the persona line IS the theme switcher — each word opens a themed lens.
   Gold + a soft breathing glow to invite the click. */
.persona a {
  color: #f5c97a;
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px dashed rgba(245, 201, 122, 0.4);
  transition: color 150ms ease, border-color 150ms ease, text-shadow 150ms ease;
}
.persona a:hover {
  color: #ffe4ac;
  border-bottom-color: #f5c97a;
  text-shadow: 0 0 16px rgba(245, 201, 122, 0.8);
}
.persona a[aria-current] {
  color: #ffe4ac;
  border-bottom: 1px solid #f5c97a;
  text-shadow: 0 0 14px rgba(245, 201, 122, 0.7);
}
.persona span { color: var(--muted); }
@media (prefers-reduced-motion: no-preference) {
  .persona a { animation: persona-glow 2.6s ease-in-out infinite; }
  .persona a:nth-of-type(2) { animation-delay: 0.3s; }
  .persona a:nth-of-type(3) { animation-delay: 0.6s; }
  .persona a:hover { animation: none; }
}
@keyframes persona-glow {
  0%, 100% { text-shadow: 0 0 5px rgba(245, 201, 122, 0.2); }
  50% { text-shadow: 0 0 16px rgba(245, 201, 122, 0.7); }
}
.tagline {
  font-family: var(--display);
  font-size: clamp(1.1rem, 2.6vw, 1.45rem);
  margin-top: 0.9rem;
  color: var(--text);
}

.now-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 1.6rem;
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  font-size: 0.86rem;
}
.now-label {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.7rem;
  color: var(--cyan);
}
.now-text { color: var(--text); }

.pulse-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
  flex: none;
}
@media (prefers-reduced-motion: no-preference) {
  .pulse-dot { animation: pulse 2.2s ease-in-out infinite; }
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.45; transform: scale(0.72); }
}

/* clocks */
.clocks {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  margin-top: 1.4rem;
  flex-wrap: wrap;
}
.clock {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.45rem 0.95rem;
  border-radius: 12px;
}
.clock-city {
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}
.clock-time {
  font-family: var(--display);
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}
.clock-link { color: var(--muted); font-size: 1.1rem; }

/* ---------- buttons ---------- */
.hero-actions {
  display: flex;
  justify-content: center;
  gap: 0.9rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}
.btn {
  position: relative;
  display: inline-block;
  font-family: var(--display);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
  padding: 0.65rem 1.5rem;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color 200ms ease, box-shadow 200ms ease;
  will-change: transform;
}
.btn:hover {
  text-decoration: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.35), 0 0 22px rgba(34, 211, 238, 0.25);
}
.btn-primary {
  border-color: var(--violet);
  box-shadow: 0 0 0 1px rgba(124, 92, 255, 0.4), 0 0 24px rgba(124, 92, 255, 0.3);
}
.btn-primary:hover {
  border-color: var(--magenta);
  box-shadow: 0 0 0 1px rgba(244, 114, 182, 0.45), 0 0 28px rgba(244, 114, 182, 0.35);
}
@media (prefers-reduced-motion: no-preference) {
  .btn { transition: border-color 200ms ease, box-shadow 200ms ease, transform 200ms ease; }
}

/* ---------- sections ---------- */
.section { padding: clamp(2.2rem, 6vh, 3.8rem) 0; }
.section-title {
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  font-weight: 700;
  margin-bottom: 1.4rem;
}

/* ---------- education marquee ---------- */
.edu { padding: clamp(1.5rem, 4vh, 2.5rem) 0; }
.edu-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1.4rem;
  padding: clamp(1.3rem, 4vw, 2rem) clamp(1.3rem, 4vw, 2.2rem);
  overflow: hidden;
  border-color: rgba(124, 92, 255, 0.45);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 0 34px rgba(124, 92, 255, 0.22);
}
.edu-badge {
  flex: none;
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: var(--aurora-grad);
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.3rem;
  color: #05060A;
  box-shadow: 0 0 24px rgba(124, 92, 255, 0.65);
}
@media (prefers-reduced-motion: no-preference) {
  .edu-badge { animation: badge-glow 4s ease-in-out infinite alternate; }
}
@keyframes badge-glow {
  from { box-shadow: 0 0 16px rgba(124, 92, 255, 0.5); }
  to   { box-shadow: 0 0 34px rgba(34, 211, 238, 0.75); }
}
.edu-name { font-size: clamp(1.4rem, 4.4vw, 2.1rem); font-weight: 700; }
.edu-line { color: var(--muted); margin-top: 0.35rem; font-size: 1rem; }
.edu-sub { font-size: 0.82rem; opacity: 0.75; }
.edu-body .eyebrow { margin-bottom: 0.35rem; }
.edu-glow {
  position: absolute;
  top: -60%; right: -12%;
  width: 45%;
  height: 220%;
  background: radial-gradient(circle at center, rgba(34, 211, 238, 0.16), transparent 65%);
  pointer-events: none;
}

/* ---------- stats ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  padding: clamp(1.5rem, 4vh, 2.5rem) 0;
}
.stat {
  padding: 1.3rem 1rem;
  text-align: center;
}
.stat-num {
  display: block;
  font-family: var(--display);
  font-size: clamp(2rem, 5vw, 2.9rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--cyan);
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .stat-num {
    background: var(--aurora-grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}
.stat-label {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* ---------- project grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.1rem;
}
.card {
  position: relative;
  padding: 1.4rem 1.5rem;
  will-change: transform;
}
.card-img {
  display: block;
  width: calc(100% + 3rem);
  margin: -1.4rem -1.5rem 1rem;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: var(--radius) var(--radius) 0 0;
}
/* aurora gradient ring, masked to a 1px border; fades in over the hairline.
   @supports guard: without mask-composite the gradient would fill the card. */
@supports ((-webkit-mask-composite: xor) or (mask-composite: exclude)) {
  .card::after {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: var(--radius);
    padding: 1px;
    background: var(--aurora-grad);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 250ms ease;
    pointer-events: none;
  }
  .card:hover::after,
  .card:focus-within::after { opacity: 0.75; }
}
/* fallback highlight for browsers without mask-composite */
.card:hover,
.card:focus-within { border-color: var(--hairline-strong); }
@media (prefers-reduced-motion: no-preference) {
  .bob { animation: bob 6s ease-in-out infinite alternate; }
  .bob:nth-child(2n) { animation-delay: -2s; }
  .bob:nth-child(3n) { animation-delay: -4s; }
  .bob:hover { animation: none; }
}
@keyframes bob {
  from { transform: translateY(0); }
  to   { transform: translateY(-5px); }
}
.card-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}
.card h3 { font-size: 1.08rem; font-weight: 500; }
.card h3 a { color: var(--text); }
.card h3 a:hover { color: var(--cyan); }
.card p { font-size: 0.92rem; color: var(--muted); }
.card-meta {
  margin-top: 0.7rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--cyan);
}

.chip {
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--hairline-strong);
  white-space: nowrap;
  flex: none;
}
.chip-live {
  color: var(--cyan);
  border-color: rgba(34, 211, 238, 0.5);
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.25);
}
.chip-sample {
  color: var(--magenta);
  border-color: rgba(244, 114, 182, 0.5);
}

.smaller-label {
  margin-top: 1.8rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--hairline);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}
.smaller {
  list-style: none;
  margin: 0.9rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.smaller li {
  position: relative;
  font-size: 0.9rem;
  color: var(--muted);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 0.68rem 2.3rem 0.68rem 0.95rem;
  background: rgba(13, 15, 28, 0.55);
  transition: color 200ms ease, border-color 200ms ease, background 200ms ease, box-shadow 200ms ease;
}
/* a chevron that says "this row is clickable", nudging on hover */
.smaller li::after {
  content: "→";
  position: absolute;
  right: 0.95rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  opacity: 0.35;
  transition: opacity 200ms ease, transform 200ms ease, color 200ms ease;
}
.smaller li:hover,
.smaller li:focus-visible {
  color: var(--text);
  border-color: rgba(34, 211, 238, 0.45);
  background: rgba(34, 211, 238, 0.06);
  box-shadow: 0 0 14px rgba(34, 211, 238, 0.15);
}
.smaller li:hover::after,
.smaller li:focus-visible::after {
  opacity: 1;
  color: var(--cyan);
  transform: translate(3px, -50%);
}

/* ---------- clickable project cards + smaller-craft chips ---------- */
.proj { cursor: pointer; }
.proj:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}
.card.proj:hover { border-color: rgba(34, 211, 238, 0.4); }

/* ---------- project detail modal ---------- */
dialog.pmodal {
  padding: 0;
  border: none;
  background: transparent;
  max-width: min(640px, 90vw);
  max-height: 85vh;
  color: var(--text);
}
dialog.pmodal::backdrop {
  background: rgba(5, 6, 10, 0.72);
  backdrop-filter: blur(3px);
}
@media (prefers-reduced-motion: no-preference) {
  dialog.pmodal {
    animation: pmodal-in 220ms cubic-bezier(0.2, 0.7, 0.3, 1);
  }
  @keyframes pmodal-in {
    from { opacity: 0; transform: translateY(10px) scale(0.98); }
  }
}
.pmodal__panel {
  position: relative;
  background: var(--panel-solid);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius);
  padding: 2rem;
  max-height: 85vh;
  overflow-y: auto;
}
.pmodal__close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--hairline);
  border-radius: 50%;
  cursor: pointer;
}
.pmodal__close:hover { color: var(--text); border-color: var(--cyan); }
.pmodal__eyebrow {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cyan);
  margin: 0 2.2rem 0.6rem 0;
}
.pmodal__title {
  font-family: var(--display);
  font-size: 1.5rem;
  margin: 0 2.2rem 1rem 0;
}
.pmodal__gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.pmodal__gallery img {
  width: 100%;
  aspect-ratio: 16 / 10; /* height derives from width — robust in a grid regardless of load state */
  height: auto;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--hairline);
}
.pmodal__desc { font-size: 0.95rem; line-height: 1.6; color: var(--muted); margin: 0 0 1.2rem; }
.pmodal__links { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0; }
.pmodal__links a {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text);
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  text-decoration: none;
}
.pmodal__links a:hover { border-color: var(--cyan); color: var(--cyan); }

/* ---------- timeline ---------- */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0.9rem;
}
.timeline li {
  display: flex;
  align-items: baseline;
  gap: 0.35rem 0.9rem;
  flex-wrap: wrap;
  padding: 1.05rem 0.7rem;
  border-radius: 12px;
  border-bottom: 1px dashed var(--hairline);
  transition: background-color 180ms ease, box-shadow 180ms ease;
}
.timeline li:last-child { border-bottom: none; }
.timeline li:hover {
  background-color: rgba(255, 255, 255, 0.045);
  box-shadow: inset 2px 0 0 rgba(34, 211, 238, 0.6);
}
.tl-role { font-family: var(--display); font-weight: 500; }
.tl-org { color: var(--muted); font-size: 0.92rem; }
.tl-when {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--cyan);
  letter-spacing: 0.08em;
}
.timeline li:hover .tl-role { color: var(--text); }

/* ---------- awards ---------- */
.awards {
  list-style: none;
  margin: 0;
  padding: 0.4rem 1.5rem;
}
.awards li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
  padding: 0.85rem 0;
  border-bottom: 1px dashed var(--hairline);
}
.awards li:last-child { border-bottom: none; }
.award-name { color: var(--muted); font-size: 0.95rem; }
.award-left { display: flex; align-items: center; gap: 0.9rem; }
.award-thumb {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--hairline);
  flex: none;
  display: block;
}
/* whole row is the trigger (JS only) */
html.js li.award {
  cursor: zoom-in;
  border-radius: 12px;
  margin: 0 -0.7rem;
  padding-left: 0.7rem;
  padding-right: 0.7rem;
}
html.js li.award:hover {
  background-color: rgba(255, 255, 255, 0.045);
  box-shadow: inset 2px 0 0 rgba(34, 211, 238, 0.6);
}
li.award:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: -2px;
  border-radius: 12px;
}
html.js li.award:hover .award-thumb { border-color: var(--cyan); }
@media (prefers-reduced-motion: no-preference) {
  .award-thumb { transition: border-color 180ms ease, transform 180ms ease; }
  html.js li.award:hover .award-thumb { transform: scale(1.05); }
}

/* ---------- award lightbox ---------- */
dialog.alightbox {
  padding: 0;
  border: none;
  background: transparent;
  max-width: min(900px, 92vw);
  max-height: 90vh;
  color: var(--text);
}
dialog.alightbox::backdrop {
  background: rgba(5, 6, 10, 0.8);
  backdrop-filter: blur(3px);
}
@media (prefers-reduced-motion: no-preference) {
  dialog.alightbox { animation: pmodal-in 220ms cubic-bezier(0.2, 0.7, 0.3, 1); }
}
.alightbox__panel {
  position: relative;
  background: var(--panel-solid);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius);
  padding: 0.6rem;
  max-height: 90vh;
  overflow-y: auto;
}
.alightbox__close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--text);
  background: rgba(5, 6, 10, 0.55);
  border: 1px solid var(--hairline);
  border-radius: 50%;
  cursor: pointer;
}
.alightbox__close:hover { border-color: var(--cyan); }
.alightbox__img {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(90vh - 5rem);
  object-fit: contain;
  border-radius: calc(var(--radius) - 6px);
}
.alightbox__caption {
  margin: 0.9rem 0.4rem 0.5rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* ---------- signal ---------- */
.signal-panel { padding: 1.4rem 1.5rem; }
.signal-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--hairline);
}
.signal-live {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--cyan);
}
.signal-sub { font-size: 0.8rem; color: var(--muted); }
.signal-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.signal-list li {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  flex-wrap: wrap;
  padding: 0.85rem 0;
  border-bottom: 1px dashed var(--hairline);
  font-size: 0.92rem;
}
.signal-list li:last-child { border-bottom: none; }
.signal-date {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.06em;
  flex: none;
}
.signal-type {
  font-family: var(--mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--violet);
  border: 1px solid rgba(124, 92, 255, 0.5);
  border-radius: 999px;
  padding: 0.12rem 0.5rem;
  flex: none;
}
.signal-title { color: var(--text); }
a.signal-title:hover { color: var(--cyan); }
.signal-loading, .signal-error {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  padding: 0.85rem 0;
}
/* the loading row is a JS artifact — without JS the <noscript> note speaks instead */
html:not(.js) .signal-loading { display: none; }
.signal-noscript { padding: 0.85rem 0; font-size: 0.85rem; color: var(--muted); }
.signal-foot {
  display: flex;
  gap: 1.4rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--hairline);
  font-size: 0.85rem;
}

/* ---------- contact ---------- */
.contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

/* ---------- footer ---------- */
.footer {
  padding: 2.6rem 0 5.5rem;
  margin-top: 1rem;
  border-top: 1px solid var(--hairline);
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
  font-family: var(--mono);
}
.footer p + p { margin-top: 0.45rem; }
.footer em { font-style: normal; color: var(--text); }
.footer a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 150ms ease;
}
.footer a:hover { color: var(--cyan); }
.footer-sub { opacity: 0.75; }

/* ---------- theme switcher ---------- */
.theme-switch {
  position: fixed;
  right: 0.9rem;
  bottom: 0.9rem;
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  background: rgba(13, 15, 28, 0.8);
  border: 1px solid var(--hairline);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.ts-label { color: var(--muted); }
.theme-switch a { color: var(--muted); }
.theme-switch a:hover { color: var(--text); text-decoration: none; }
.theme-switch a.ts-current {
  color: var(--cyan);
  font-weight: 600;
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .theme-switch a.ts-current {
    background: var(--aurora-grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}

/* ---------- reveal on scroll (JS + motion only) ---------- */
/* variants: default = rise · .reveal-scale = settle in · .reveal-fade = fade only */
@media (prefers-reduced-motion: no-preference) {
  html.js .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 480ms ease, transform 480ms ease;
  }
  html.js .reveal-scale { transform: translateY(8px) scale(0.97); }
  html.js .reveal-fade  { transform: none; }
  html.js .reveal.in {
    opacity: 1;
    transform: none;
  }
}

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .edu-card { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .tl-when { margin-left: 0; }
  .theme-switch { right: 0.6rem; bottom: 0.6rem; }
}

/* ---------- reduced motion: kill decor motion ---------- */
@media (prefers-reduced-motion: reduce) {
  #starfield { display: none; }
  .blob { opacity: 0.3; }
}

/* ---------- archive page (signal.html) ---------- */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}
.page-hero { padding: 4.5rem 0 2.2rem; text-align: center; }
.page-title {
  font-family: var(--display);
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  margin: 0.4rem 0 0.6rem;
}
.page-sub { color: var(--muted); max-width: 46ch; margin: 0 auto; }
.archive-meta {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 0.75rem 0 0.15rem;
}
.archive-meta[hidden] { display: none; }
.archive .signal-list li {
  display: grid;
  grid-template-columns: 7.5rem 5rem 1fr;
  gap: 0.35rem 1rem;
  align-items: baseline;
  padding: 1rem 0.25rem;
}
.archive .signal-summary {
  grid-column: 3;
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.archive .signal-src {
  grid-column: 3;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  opacity: 0.75;
}
.archive .signal-list li[data-fallback="true"] { border-left: 2px dashed rgba(244, 244, 248, 0.25); padding-left: 0.9rem; }
.signal-type[data-type="til"]  { color: var(--violet, #7C5CFF); border-color: rgba(124, 92, 255, 0.4); }
.signal-type[data-type="news"] { color: var(--cyan, #22D3EE); border-color: rgba(34, 211, 238, 0.4); }
.signal-type[data-type="link"] { color: var(--magenta, #F472B6); border-color: rgba(244, 114, 182, 0.4); }
.signal-type[data-type="tweet"]      { color: #FBBF24; border-color: rgba(251, 191, 36, 0.4); }
.signal-type[data-type="screenshot"] { color: var(--muted); border-color: rgba(163, 163, 176, 0.4); }

/* entry images: a small thumb in the row, click to enlarge in the lightbox */
.signal-img-btn {
  flex-basis: 100%;
  margin: 0.4rem 0 0.1rem;
  padding: 0;
  background: none;
  border: none;
  cursor: zoom-in;
  text-align: left;
}
.signal-img {
  display: block;
  max-width: min(100%, 22rem);
  max-height: 13rem;
  border-radius: 10px;
  border: 1px solid var(--hairline);
}
.signal-img-btn:hover .signal-img,
.signal-img-btn:focus-visible .signal-img { border-color: var(--cyan, #22D3EE); }
.archive .signal-img-btn { grid-column: 3; }
.archive-foot {
  display: flex; gap: 0.8rem; align-items: center; justify-content: center;
  padding: 1.8rem 0 3rem;
}
@media (max-width: 640px) {
  .archive .signal-list li { grid-template-columns: 1fr; gap: 0.15rem; }
  .archive .signal-summary, .archive .signal-src { grid-column: 1; }
}

/* ---------- 404 (404.html — no JS on that page, everything below is static/CSS) ---------- */
.lost {
  min-height: 76vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 0 3rem;
}
.lost-title {
  font-size: clamp(4.5rem, 20vw, 8.5rem);
  margin: 0.4rem 0 1rem;
}
.lost-line {
  color: var(--muted);
  max-width: 44ch;
}
.lost .hero-actions { margin-top: 2.2rem; }
