/* ============================================================
   Anjan Das — personal site
   Inspired by studiotypo.xyz · Space Mono · light/dark theme
   ============================================================ */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: 'Space Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: var(--fg);
  background: var(--bg);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: hidden;
  cursor: none; /* custom cursor */
}
img { max-width: 100%; height: auto; display: block; }
button, input { font: inherit; color: inherit; background: none; border: none; cursor: none; }
a { color: inherit; text-decoration: none; cursor: none; }
ul { list-style: none; }
em { font-style: italic; }
strong { font-weight: 700; }

@media (hover: none) {
  body, a, button, input { cursor: auto; }
}

/* ---------- Tokens ---------- */
:root {
  --bg: #f4f1ea;
  --bg-alt: #ebe6da;
  --fg: #0f1114;
  --fg-soft: #3a3a3f;
  --muted: #888880;
  --line: #d6cfbf;
  --line-soft: #e3ddd0;
  --accent: #c84e1f;
  --accent-soft: rgba(200, 78, 31, 0.12);
  --card: #fdfaf2;
  --shadow: 0 1px 0 var(--line);
  --max: 1100px;
  --gutter: 28px;
  --radius: 4px;
}

[data-theme="dark"] {
  --bg: #0f1114;
  --bg-alt: #14161a;
  --fg: #f0ede6;
  --fg-soft: #c8c5be;
  --muted: #6b6b73;
  --line: #2a2c32;
  --line-soft: #1c1e22;
  --accent: #ff7a45;
  --accent-soft: rgba(255, 122, 69, 0.16);
  --card: #181a1f;
  --shadow: 0 1px 0 var(--line);
}

/* ---------- Layout primitives ---------- */
.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  position: relative;
  z-index: 2;
}

.section {
  padding: 100px 0;
  border-top: 1px solid var(--line);
  position: relative;
}
.section-alt { background: var(--bg-alt); }
.section-hero {
  padding-top: 140px;
  padding-bottom: 100px;
  border-top: none;
}

.section-label {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--muted);
  margin-bottom: 28px;
  text-transform: uppercase;
}
.section-label .line {
  flex: 0 0 60px;
  height: 1px;
  background: var(--muted);
  opacity: 0.4;
}

/* ---------- Typography ---------- */
.section-h2 {
  font-size: clamp(1.6rem, 3.8vw, 2.4rem);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 36px;
}
.section-sub { margin-bottom: 32px; font-size: 0.85rem; letter-spacing: 0.05em; }
.sub-h3 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 56px 0 8px;
  text-transform: uppercase;
}
.muted { color: var(--muted); }

.prose .lead { font-size: 1.1rem; margin-bottom: 18px; font-weight: 700; }
.prose p { margin-bottom: 16px; color: var(--fg-soft); max-width: 70ch; }

kbd {
  display: inline-block;
  font-family: inherit;
  font-size: 11px;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 3px;
  background: var(--card);
  color: var(--fg);
  letter-spacing: 0.04em;
  vertical-align: 1px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 22px;
  z-index: 50;
  padding: 0 var(--gutter);
  pointer-events: none;
}
.site-header > * { pointer-events: auto; }
.header-row {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 12px 18px;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.brand {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; letter-spacing: 0.02em;
}
.brand-dot {
  width: 8px; height: 8px; background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--accent-soft);
  animation: brand-pulse 2.4s ease-in-out infinite;
}
@keyframes brand-pulse {
  0%, 100% { box-shadow: 0 0 0 3px var(--accent-soft); }
  50% { box-shadow: 0 0 0 6px var(--accent-soft); }
}
.site-nav { display: flex; gap: 20px; font-size: 12px; letter-spacing: 0.05em; }
.site-nav a {
  color: var(--muted);
  transition: color 0.2s;
  position: relative;
}
.site-nav a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -4px;
  height: 1px; background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.25s ease;
}
.site-nav a:hover { color: var(--fg); }
.site-nav a:hover::after { transform: scaleX(1); }
.site-nav a.is-current { color: var(--fg); }
.site-nav a.is-current::after { transform: scaleX(1); }

.header-meta { display: flex; align-items: center; gap: 16px; font-size: 11px; letter-spacing: 0.08em; color: var(--muted); text-transform: uppercase; }
.status { display: inline-flex; align-items: center; gap: 6px; }
.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.25);
  animation: status-pulse 2s ease-in-out infinite;
}
[data-theme="dark"] .status-dot { box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.3); }
@keyframes status-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}
.clock { font-variant-numeric: tabular-nums; min-width: 76px; text-align: right; }
.icon-btn {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 50%;
  color: var(--fg);
  transition: background 0.2s, transform 0.15s;
}
.icon-btn:hover { background: var(--accent-soft); }
.icon-btn .icon-moon, [data-theme="light"] .icon-btn .icon-moon { display: none; }
[data-theme="dark"] .icon-btn .icon-sun { display: none; }
[data-theme="dark"] .icon-btn .icon-moon { display: block; }

@media (max-width: 880px) {
  .site-nav { display: none; }
  .header-meta .status { display: none; }
  .header-row { padding: 10px 16px; gap: 14px; }
}

/* ---------- Marquee ---------- */
.marquee {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  padding: 8px 0;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
  z-index: 4;
}
.marquee-track {
  display: inline-flex;
  white-space: nowrap;
  animation: marquee 55s linear infinite;
}
.marquee-track span {
  padding: 0 28px;
  border-right: 1px solid var(--line);
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.marquee:hover .marquee-track { animation-play-state: paused; }

/* ---------- Scroll progress ---------- */
#scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: var(--accent);
  z-index: 200;
  pointer-events: none;
  transition: width 0.08s linear;
}

/* ---------- Background canvas ---------- */
#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.6;
}
[data-theme="dark"] #bg-canvas { opacity: 0.45; }

/* ---------- Cursor ---------- */
#cursor-dot, #cursor-ring {
  position: fixed; top: 0; left: 0;
  pointer-events: none;
  z-index: 1000;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  will-change: transform;
  mix-blend-mode: difference;
}
#cursor-dot {
  width: 4px; height: 4px;
  background: #fff;
  transition: width 0.15s ease, height 0.15s ease, background 0.2s ease;
}
#cursor-ring {
  width: 18px; height: 18px;
  border: 1px solid #fff;
  transition: width 0.18s ease, height 0.18s ease, opacity 0.18s ease;
}
body.cursor-hover #cursor-dot { width: 0; height: 0; }
body.cursor-hover #cursor-ring { width: 28px; height: 28px; background: rgba(255,255,255,0.06); }
body.cursor-down #cursor-ring { width: 12px; height: 12px; }
@media (hover: none) {
  #cursor-dot, #cursor-ring { display: none; }
}

/* ---------- Boot screen ---------- */
#boot {
  position: fixed; inset: 0;
  z-index: 500;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  transition: opacity 0.6s ease, visibility 0.6s ease, filter 0.6s ease;
}
body.booted #boot { opacity: 0; visibility: hidden; filter: blur(8px); }

.boot-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.5;
  mask-image: radial-gradient(circle at center, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(circle at center, black 30%, transparent 75%);
  animation: boot-grid-drift 8s linear infinite;
}
@keyframes boot-grid-drift {
  from { background-position: 0 0, 0 0; }
  to { background-position: 48px 48px, 48px 48px; }
}

.boot-scanline {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom,
    transparent 0%,
    transparent 49.5%,
    var(--accent-soft) 50%,
    transparent 50.5%,
    transparent 100%);
  background-size: 100% 8px;
  opacity: 0.25;
  pointer-events: none;
  animation: boot-scan 3s linear infinite;
}
@keyframes boot-scan {
  from { background-position-y: 0; }
  to { background-position-y: 100%; }
}

.boot-inner {
  position: relative;
  z-index: 2;
  text-align: center;
  display: flex; flex-direction: column; align-items: center;
  gap: 16px;
  padding: 0 24px;
}

.boot-stamp {
  font-size: 10px;
  letter-spacing: 0.4em;
  padding: 4px 12px;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 999px;
  animation: boot-stamp-pulse 1.4s ease-in-out infinite;
}
@keyframes boot-stamp-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.06); opacity: 0.7; }
}

.boot-monogram {
  font-size: clamp(2.4rem, 7vw, 4.6rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--fg);
  position: relative;
  line-height: 1;
  text-shadow: 0 0 20px var(--accent-soft);
  animation: boot-mono-flicker 3.4s linear infinite;
}
@keyframes boot-mono-flicker {
  0%, 92%, 100% { opacity: 1; }
  93% { opacity: 0.4; }
  94% { opacity: 1; }
  96% { opacity: 0.7; }
  97% { opacity: 1; }
}
.boot-monogram::before,
.boot-monogram::after {
  content: attr(data-text);
  position: absolute;
  top: 0; left: 0;
  width: 100%;
}
.boot-monogram::before {
  color: var(--accent);
  animation: boot-glitch-1 2.4s infinite linear;
  clip-path: polygon(0 0, 100% 0, 100% 33%, 0 33%);
  text-shadow: -1px 0 var(--accent);
}
.boot-monogram::after {
  color: #4ade80;
  animation: boot-glitch-2 3.1s infinite linear;
  clip-path: polygon(0 66%, 100% 66%, 100% 100%, 0 100%);
  text-shadow: 1px 0 #4ade80;
}
@keyframes boot-glitch-1 {
  0%, 100% { transform: translate(0); }
  20% { transform: translate(-2px, 1px); }
  40% { transform: translate(-1px, -2px); }
  60% { transform: translate(2px, 1px); }
  80% { transform: translate(1px, -1px); }
}
@keyframes boot-glitch-2 {
  0%, 100% { transform: translate(0); }
  25% { transform: translate(2px, -1px); }
  50% { transform: translate(-1px, 1px); }
  75% { transform: translate(-2px, -1px); }
}

.boot-tagline {
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--muted);
  text-transform: uppercase;
}
.boot-tagline-rotate {
  color: var(--accent);
  display: inline-block;
  min-width: 18ch;
  animation: boot-tagline-blink 0.6s steps(2) infinite;
}
@keyframes boot-tagline-blink {
  50% { opacity: 0.6; }
}

.boot-bar {
  width: min(260px, 80vw);
  height: 3px;
  background: var(--line);
  overflow: hidden;
  border-radius: 999px;
  position: relative;
}
.boot-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255,255,255,0.4) 50%,
    transparent 100%);
  transform: translateX(-100%);
  animation: boot-bar-shine 1.4s linear infinite;
}
@keyframes boot-bar-shine {
  to { transform: translateX(100%); }
}
.boot-bar-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, #ff9a45 100%);
  transition: width 0.2s ease;
  box-shadow: 0 0 12px var(--accent);
}

.boot-log {
  list-style: none;
  padding: 0;
  margin: 4px 0 0;
  min-height: 6em;
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--muted);
  width: min(320px, 80vw);
}
.boot-log li {
  opacity: 0;
  transform: translateX(-6px);
  animation: boot-log-in 0.25s ease forwards;
  white-space: nowrap;
}
.boot-log li.is-ok::before { content: '[OK]  '; color: #4ade80; font-weight: 700; }
.boot-log li.is-rdy::before { content: '[ ✓ ] '; color: var(--accent); font-weight: 700; }
.boot-log li.is-rdy { color: var(--fg); font-weight: 700; }
@keyframes boot-log-in {
  to { opacity: 1; transform: translateX(0); }
}

.boot-hint {
  font-size: 9px;
  letter-spacing: 0.3em;
  color: var(--muted);
  margin-top: 4px;
  opacity: 0.7;
}
.boot-hint kbd {
  font-size: 9px;
  padding: 1px 4px;
}

/* ---------- Hero ---------- */
.hero-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 56px;
  align-items: center;
  margin-bottom: 64px;
}
.hero-h1 {
  font-size: clamp(2.2rem, 5.2vw, 3.4rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin-bottom: 28px;
  display: block;
}
.hero-h1 .reveal-line {
  display: block;
  opacity: 0;
  transform: translateY(20px);
  animation: hero-line 0.7s ease forwards;
}
.hero-h1 .reveal-line:nth-child(1) { animation-delay: 0.05s; }
.hero-h1 .reveal-line:nth-child(2) { animation-delay: 0.22s; }
.hero-h1 .reveal-line:nth-child(3) { animation-delay: 0.39s; color: var(--accent); }
.hero-h1 .reveal-line:nth-child(4) { animation-delay: 0.56s; color: var(--muted); font-weight: 400; font-size: 0.7em; margin-top: 12px; }
@keyframes hero-line {
  to { opacity: 1; transform: translateY(0); }
}
body.boot-pending .hero-h1 .reveal-line { animation-play-state: paused; }

.cursor-blink {
  display: inline-block;
  width: 0.55ch;
  color: var(--accent);
  animation: blink 1s steps(2) infinite;
}
@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.hero-tagline {
  color: var(--fg-soft);
  max-width: 50ch;
  margin-bottom: 32px;
  font-size: 1.02rem;
}

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border: 1px solid var(--fg);
  background: var(--fg);
  color: var(--bg);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: 999px;
  transition: transform 0.15s, background 0.15s, color 0.15s;
}
.btn:hover { transform: translateY(-2px); background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-ghost {
  background: transparent;
  color: var(--fg);
}

.hero-photo { position: relative; }
.photo-frame {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  padding: 14px;
  transform: rotate(0deg);
  transition: transform 0.2s ease;
  will-change: transform;
}
.photo-frame::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent-soft) 0%, transparent 70%);
  pointer-events: none;
  opacity: 0.5;
}
.photo-frame img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  border-radius: 2px;
}
.photo-meta {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--muted);
  margin-top: 12px;
  text-transform: uppercase;
}

/* Stat grid */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 28px 0;
}
.stat { display: flex; flex-direction: column; gap: 6px; }
.stat-num {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  display: flex; align-items: baseline; gap: 4px;
}
.stat-unit { font-size: 0.5em; color: var(--muted); letter-spacing: 0; }
.stat-label {
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
}

@media (max-width: 720px) {
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .hero-photo .photo-frame { max-width: 320px; margin: 0 auto; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
}

/* ---------- Reveal animations ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- Key-value list ---------- */
.kv-list { margin-top: 32px; border-top: 1px solid var(--line); }
.kv-list li {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.kv-list .kv-k {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
}
.kv-list .kv-v { color: var(--fg-soft); }

/* ---------- Cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.2s ease, border-color 0.2s, box-shadow 0.2s;
  position: relative;
}
.card:hover {
  border-color: var(--accent);
  box-shadow: 0 12px 28px -16px var(--accent-soft);
}
.card-num {
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--muted);
  font-weight: 700;
}
.card h3 { font-size: 1.4rem; line-height: 1.15; letter-spacing: -0.01em; }
.card-meta { color: var(--muted); font-size: 0.85rem; }
.card p { color: var(--fg-soft); font-size: 0.92rem; }
.card-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: auto;
}
.card-tags li {
  font-size: 10px;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  text-transform: uppercase;
}
.card-link {
  font-size: 13px;
  font-weight: 700;
  margin-top: 6px;
  color: var(--accent);
  display: inline-block;
  position: relative;
}
.card-link::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: -2px;
  height: 1px; background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.25s ease;
}
.card-link:hover::after { transform: scaleX(1); }
.card-link.muted { color: var(--muted); }
.card-link.muted::after { background: var(--muted); }

/* ---------- Carousels ---------- */
.carousel {
  position: relative;
  outline: none;
}
.carousel:focus-visible .carousel-viewport { box-shadow: 0 0 0 2px var(--accent); }
.carousel-viewport {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  cursor: grab;
}
.carousel-viewport.is-grabbing { cursor: grabbing; }
.carousel-track {
  display: flex;
  gap: 16px;
  padding: 16px;
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: transform;
}
.carousel-track > * {
  flex: 0 0 calc(100% - 32px);
  user-select: none;
}
@media (min-width: 720px) {
  .carousel-track > * { flex-basis: calc(50% - 24px); }
}
@media (min-width: 1024px) {
  .carousel-track > * { flex-basis: calc(33.333% - 22px); }
}

.carousel-photo .photo-slide {
  flex: 0 0 calc(100% - 32px);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
}
@media (min-width: 720px) {
  .carousel-photo .photo-slide { flex-basis: calc(60% - 24px); }
}
@media (min-width: 1024px) {
  .carousel-photo .photo-slide { flex-basis: calc(50% - 16px); }
}
.photo-slide img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: contain;
  object-position: center;
  background: var(--bg);
}
.photo-slide figcaption {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 12px 16px;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-style: normal;
}
.photo-slide figcaption span:first-child {
  font-size: 10px; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--accent); font-weight: 700;
}

.carousel-controls {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-top: 16px;
}
.carousel-btn {
  width: 40px; height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--fg);
  background: var(--card);
  transition: background 0.15s, transform 0.15s, color 0.15s;
  font-size: 14px;
}
.carousel-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.carousel-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.carousel-dots { display: flex; gap: 8px; }
.carousel-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--line);
  transition: background 0.2s, transform 0.2s;
}
.carousel-dot.is-active { background: var(--accent); transform: scale(1.3); }

/* ---------- Brand logos (chips) ---------- */
.brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.96);
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
  margin-right: 10px;
  line-height: 0;
  vertical-align: middle;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 1px 0 rgba(0,0,0,0.04);
}
[data-theme="dark"] .brand-logo {
  background: #fbfaf6;
  border-color: rgba(255,255,255,0.08);
  box-shadow: 0 2px 10px -4px rgba(0,0,0,0.5);
}
.brand-logo:hover { transform: translateY(-1px); box-shadow: 0 4px 14px -6px var(--accent-soft); }
.brand-logo img {
  display: block;
  height: 22px;
  width: auto;
}
.brand-logo-sm { padding: 3px 7px; margin-right: 8px; border-radius: 4px; }
.brand-logo-sm img { height: 14px; }
.brand-logo-md img { height: 32px; }
.brand-logo-lg img { height: 48px; }

/* Variant for full-bleed app icons (Bimi, AstroMate) — no chip padding, just a rounded frame */
.brand-logo-icon {
  padding: 0;
  background: transparent;
  border: none;
  overflow: hidden;
  border-radius: 7px;
  box-shadow: 0 2px 8px -2px rgba(0,0,0,0.25), 0 0 0 1px var(--line);
}
[data-theme="dark"] .brand-logo-icon {
  box-shadow: 0 4px 12px -4px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.05);
}
.brand-logo-icon img {
  border-radius: 7px;
  height: 26px;
  width: 26px;
  object-fit: cover;
}

/* In headlines, ensure heights line up with caps */
h2 .brand-logo, h3 .brand-logo { margin-bottom: 2px; }

/* ---------- Salesforce role timeline ---------- */
.role-list {
  list-style: none;
  padding: 0;
  margin: 40px 0 0;
  position: relative;
}
.role-list::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 14px;
  bottom: 14px;
  width: 1px;
  background: var(--line);
}
.role {
  position: relative;
  padding: 0 0 36px 36px;
}
.role:last-child { padding-bottom: 0; }
.role::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--bg);
  transition: transform 0.2s ease;
}
.section-alt .role::before { box-shadow: 0 0 0 4px var(--bg-alt); }
.role:hover::before { transform: scale(1.15); }
.role-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.role-head h3 {
  font-size: 1.18rem;
  line-height: 1.2;
  margin: 0;
}
.role-level {
  font-size: 0.78em;
  font-weight: 400;
  margin-left: 2px;
}
.role-when {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.role-summary {
  color: var(--fg-soft);
  font-size: 0.96rem;
  margin: 0 0 14px;
}
.role-outcomes {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}
.role-outcomes li {
  padding: 4px 0 4px 22px;
  position: relative;
  color: var(--fg-soft);
  font-size: 0.9rem;
  line-height: 1.5;
}
.role-outcomes li + li { padding-top: 6px; }
.role-outcomes li::before {
  content: '→';
  position: absolute;
  left: 0;
  top: 3px;
  color: var(--accent);
  font-weight: 700;
}
.role-outcomes strong { color: var(--fg); font-weight: 700; }
.role .card-tags { margin-top: 6px; }

@media (max-width: 600px) {
  .role { padding-left: 28px; }
  .role::before { width: 11px; height: 11px; }
  .role-head { gap: 4px; }
  .role-when { font-size: 10px; }
}

/* ---------- Work extras (Recognition · Patents · Talks) ---------- */
.work-extras {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 16px;
}
.extras-card {
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.extras-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.extras-icon {
  font-size: 1.1rem;
  line-height: 1;
}
.extras-card h4 {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.005em;
  margin: 0;
}
.extras-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.extras-list li {
  font-size: 0.88rem;
  color: var(--fg-soft);
  padding-left: 14px;
  position: relative;
  line-height: 1.5;
}
.extras-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent);
  font-weight: 700;
}
.extras-list li strong { color: var(--fg); font-weight: 700; }
.extras-list li em { font-style: italic; color: var(--fg); }
.extras-sub {
  margin-top: 3px;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.45;
}
.extras-foot {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-size: 0.82rem;
}
.extras-foot em { color: var(--fg); font-style: italic; }

@media (max-width: 920px) {
  .work-extras { grid-template-columns: 1fr; }
}

/* ---------- Early-career list ---------- */
.early-list {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
  border-top: 1px solid var(--line);
}
.early-list li {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 28px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
  transition: background 0.2s;
}
.early-list li:hover { background: color-mix(in srgb, var(--accent-soft) 60%, transparent); }
.early-when {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
}
.early-what strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 4px;
}
.early-what p {
  color: var(--fg-soft);
  font-size: 0.9rem;
  margin: 4px 0 0;
}
.early-what a { color: var(--accent); }
@media (max-width: 600px) {
  .early-list li { grid-template-columns: 1fr; gap: 6px; padding: 18px 0; }
}

/* ---------- Run block (transformation) ---------- */
.run-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: center;
  margin-bottom: 64px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}
.run-block h3 {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.run-block .arrow { color: var(--accent); }
.run-block p { color: var(--fg-soft); }
.run-block-photo img {
  border-radius: var(--radius);
  border: 1px solid var(--line);
}
.run-block-photo figcaption {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  margin-top: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
@media (max-width: 720px) {
  .run-block { grid-template-columns: 1fr; }
}

/* ---------- Contact list ---------- */
.contact-list { border-top: 1px solid var(--line); margin-top: 16px; }
.contact-list li {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 16px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  align-items: center;
}
.contact-list a {
  font-size: clamp(1.1rem, 2.4vw, 1.6rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--fg);
  transition: color 0.2s;
  position: relative;
  display: inline-block;
}
.contact-list a::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: -2px;
  height: 2px; background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.3s ease;
}
.contact-list a:hover { color: var(--accent); }
.contact-list a:hover::after { transform: scaleX(1); }
.contact-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
}
@media (max-width: 600px) {
  .contact-list li { grid-template-columns: 1fr; gap: 4px; padding: 16px 0; }
}

/* ---------- Footer ---------- */
.site-footer {
  padding: 32px 0 48px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* ---------- Overlays (palette + shortcuts) ---------- */
.overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 14vh;
  z-index: 600;
  opacity: 0; visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.overlay[aria-hidden="false"] { opacity: 1; visibility: visible; }
.palette-card {
  width: min(560px, 92vw);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  transform: translateY(-12px);
  transition: transform 0.2s ease;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.4);
}
.overlay[aria-hidden="false"] .palette-card { transform: translateY(0); }
.palette-input-row {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.palette-prompt { color: var(--accent); font-weight: 700; }
#palette-input {
  flex: 1;
  outline: none;
  color: var(--fg);
  font-size: 14px;
}
#palette-input::placeholder { color: var(--muted); }
.palette-close {
  font-size: 10px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  letter-spacing: 0.1em;
}
.palette-results { padding: 8px; max-height: 320px; overflow-y: auto; }
.palette-results li {
  padding: 10px 12px;
  display: flex; align-items: center; gap: 12px;
  border-radius: 4px;
  cursor: none;
  font-size: 13px;
}
.palette-results li.is-active { background: var(--accent-soft); color: var(--fg); }
.palette-results .res-id { color: var(--muted); font-size: 10px; letter-spacing: 0.15em; min-width: 28px; }
.palette-foot {
  display: flex; gap: 14px;
  padding: 8px 18px;
  border-top: 1px solid var(--line);
  font-size: 10px; letter-spacing: 0.1em;
}
.shortcut-list { padding: 8px; }
.shortcut-list li {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  font-size: 13px;
}
.shortcut-list li kbd { margin-right: 2px; }
.shortcut-list li span { color: var(--fg-soft); margin-left: auto; }

/* ---------- Sound toggle, easter egg flash ---------- */
.sound-btn { margin-left: 6px; }
.flash {
  position: fixed; inset: 0;
  background: var(--accent);
  z-index: 700;
  pointer-events: none;
  opacity: 0;
  animation: flash 0.45s ease-out;
}
@keyframes flash {
  0% { opacity: 0; }
  20% { opacity: 0.5; }
  100% { opacity: 0; }
}

/* ---------- Click ripple ---------- */
.ripple {
  position: fixed;
  pointer-events: none;
  z-index: 900;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  transform: translate(-50%, -50%) scale(0);
  animation: ripple 0.7s ease-out forwards;
}
@keyframes ripple {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 0.7; }
  100% { transform: translate(-50%, -50%) scale(6); opacity: 0; }
}

/* ---------- Section indicator (right rail) ---------- */
.rail {
  position: fixed;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 40;
}
.rail-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 10px; letter-spacing: 0.18em; color: var(--muted);
  text-transform: uppercase;
}
.rail-item .pip {
  width: 8px; height: 8px; border-radius: 50%;
  border: 1px solid var(--muted);
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}
.rail-item .label {
  opacity: 0; transform: translateX(8px);
  transition: opacity 0.2s, transform 0.2s;
}
.rail-item:hover .label { opacity: 1; transform: translateX(0); }
.rail-item.is-active .pip { background: var(--accent); border-color: var(--accent); transform: scale(1.3); }
.rail-item.is-active .label { opacity: 1; transform: translateX(0); color: var(--fg); }
@media (max-width: 900px) { .rail { display: none; } }

/* ---------- Print ---------- */
@media print {
  body { background: white; color: black; cursor: auto; }
  .marquee, .site-header, .site-footer, .rail, #boot, #bg-canvas, #cursor-dot, #cursor-ring, .overlay, .carousel-controls, #scroll-progress { display: none !important; }
  .section { padding: 12pt 0; border: none; }
  a { color: black; text-decoration: underline; }
  a[href^="http"]::after { content: " (" attr(href) ")"; color: #555; font-size: 9pt; }
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .marquee-track { animation: none; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Bimi brand color — H1 "Bimi" word in red ---------- */
.hero-h1 em {
  color: #FF385C;
  font-style: normal;
  font-weight: 700;
}
