/* ============================================================
   AYAN — personal site styles
   Dark-first design system with light theme, custom cursor,
   scroll reveals, and component styles for every section.
   ============================================================ */

:root {
  --bg: #08090c;
  --bg-soft: #0d0f14;
  --surface: #12151c;
  --surface-2: #181c25;
  --border: rgba(255, 255, 255, 0.08);
  --text: #f4f4f0;
  --text-muted: #9aa1ab;
  --accent: #bef264;
  --accent-soft: rgba(190, 242, 100, 0.12);
  --accent-ink: #0a0d04;
  --wish: #7dd3fc;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-serif: "Instrument Serif", Georgia, serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="light"] {
  --bg: #f4f3ee;
  --bg-soft: #ecebe4;
  --surface: #ffffff;
  --surface-2: #f7f6f1;
  --border: rgba(20, 22, 16, 0.1);
  --text: #16181d;
  --text-muted: #5d636d;
  --accent: #4d7c0f;
  --accent-soft: rgba(77, 124, 15, 0.1);
  --accent-ink: #ffffff;
  --wish: #0369a1;
  --shadow: 0 24px 60px rgba(30, 32, 25, 0.12);
}

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

html { scroll-behavior: smooth; }

/* Thin accent scrollbar */
html {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--accent) 45%, var(--surface-2)) transparent;
}
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--accent) 45%, var(--surface-2));
  border-radius: 8px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* Theme-toggle circular reveal (View Transitions API) */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
  transition: background 0.45s ease, color 0.45s ease;
}

::selection { background: var(--accent); color: var(--accent-ink); }

.accent { color: var(--accent); }
.serif-italic { font-family: var(--font-serif); font-style: italic; font-weight: 400; }

/* Keyword highlights */
mark {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 7px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* Smooth language switch */
main, .footer { transition: opacity 0.3s var(--ease), transform 0.3s var(--ease); }
body.lang-fading main, body.lang-fading .footer { opacity: 0; transform: translateY(10px); }

kbd {
  font-family: var(--font-body);
  font-size: 0.72rem;
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--surface);
  color: var(--text-muted);
}

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 300;
  background: var(--accent); color: var(--accent-ink);
  padding: 8px 16px; border-radius: 0 0 8px 0; text-decoration: none;
}
.skip-link:focus { left: 0; }

/* Film-grain overlay */
.noise {
  position: fixed; inset: 0; z-index: 2; pointer-events: none; opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='linear' slope='0.05'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}

.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 120;
}
.scroll-progress span {
  display: block; height: 100%; width: 100%;
  transform: scaleX(0); transform-origin: left; /* JS drives transform — no layout work */
  background: var(--accent);
}

/* ======================= NAV ======================= */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.45s ease;
}
.nav.scrolled { border-bottom-color: var(--border); }

.nav-logo {
  font-family: var(--font-display); font-weight: 700; font-size: 1.15rem;
  color: var(--text); text-decoration: none; letter-spacing: 0.02em;
}

.nav-links { display: flex; gap: 26px; }
.nav-links a {
  color: var(--text-muted); text-decoration: none; font-size: 0.88rem; font-weight: 500;
  transition: color 0.2s ease; position: relative;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -5px; height: 2px; width: 0;
  background: var(--accent); transition: width 0.3s var(--ease);
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a.active::after { width: 100%; }

.nav-actions { display: flex; gap: 8px; align-items: center; }

.nav-clock {
  display: inline-flex; align-items: baseline; gap: 7px;
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-muted); margin-right: 8px; white-space: nowrap; cursor: default;
}
.nav-clock b {
  font-family: var(--font-display); font-weight: 600; font-size: 0.82rem;
  color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: 0.05em;
}
.nav-clock .colon { animation: colonBlink 2s ease-in-out infinite; }
@keyframes colonBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}
@media (max-width: 560px) { .nav-clock { display: none; } }

.lang-switch {
  display: flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
}
.lang-switch button {
  background: transparent; border: none; cursor: pointer;
  padding: 7px 10px; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.05em;
  font-family: var(--font-display); color: var(--text-muted);
  transition: background 0.25s var(--ease), color 0.25s var(--ease);
}
.lang-switch button:hover { color: var(--text); }
.lang-switch button.active { background: var(--accent); color: var(--accent-ink); }

.btn-ghost {
  display: inline-flex; align-items: center; gap: 4px;
  background: transparent; border: 1px solid var(--border); border-radius: 8px;
  padding: 6px 9px; color: var(--text-muted); cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.btn-ghost:hover { color: var(--text); border-color: var(--text-muted); }

.theme-btn .icon-sun { display: none; }
[data-theme="light"] .theme-btn .icon-sun { display: block; }
[data-theme="light"] .theme-btn .icon-moon { display: none; }

.burger { display: none; flex-direction: column; gap: 5px; padding: 10px 9px; }
.burger span { width: 16px; height: 2px; background: currentColor; transition: transform 0.3s var(--ease); }
.burger[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
.burger[aria-expanded="true"] span:last-child { transform: translateY(-3.5px) rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: 0; z-index: 90; display: none;
  flex-direction: column; justify-content: center; gap: 8px;
  background: color-mix(in srgb, var(--bg) 96%, transparent);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  padding: 0 32px;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  font-family: var(--font-display); font-size: 2.2rem; font-weight: 600;
  color: var(--text); text-decoration: none; padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

/* ======================= HERO ======================= */
.hero {
  min-height: 100svh;
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden; padding: 96px 24px 64px;
}
#heroCanvas { position: absolute; inset: 0; width: 100%; height: 100%; }

.hero-inner { position: relative; z-index: 3; max-width: 980px; text-align: center; }

.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.82rem; color: var(--text-muted); letter-spacing: 0.04em;
  border: 1px solid var(--border); border-radius: 999px; padding: 7px 16px;
  background: color-mix(in srgb, var(--surface) 60%, transparent);
  margin-bottom: 30px;
}
.pulse-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 var(--accent-soft), 0 0 0 0 var(--accent); opacity: 1; }
  70% { box-shadow: 0 0 0 9px transparent; opacity: 0.8; }
  100% { box-shadow: 0 0 0 0 transparent; opacity: 1; }
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6.4vw, 5rem);
  line-height: 1.08; font-weight: 700; letter-spacing: -0.02em;
  margin-bottom: 26px;
}
.scramble { display: inline-block; min-width: 1ch; }

.hero-sub {
  font-size: clamp(1rem, 1.9vw, 1.25rem); color: var(--text-muted);
  max-width: 560px; margin: 0 auto 38px;
}

.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-weight: 600; font-size: 0.95rem;
  padding: 13px 26px; border-radius: 12px; text-decoration: none;
  border: 1px solid transparent; cursor: pointer;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.2s, color 0.2s, border-color 0.2s;
  will-change: transform;
}
.btn-primary {
  background: var(--accent); color: var(--accent-ink);
}
.btn-primary:hover { box-shadow: 0 8px 32px var(--accent-soft), 0 4px 18px rgba(0,0,0,0.25); }
.btn-outline {
  background: transparent; color: var(--text); border-color: var(--border);
}
.btn-outline:hover { border-color: var(--text-muted); }
.btn-big { font-size: 1.15rem; padding: 18px 36px; border-radius: 16px; }

.hero-scroll {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%);
  width: 24px; height: 38px; border: 1.5px solid var(--border); border-radius: 12px;
  z-index: 3;
}
.hero-scroll span {
  position: absolute; top: 7px; left: 50%; width: 3px; height: 8px; margin-left: -1.5px;
  border-radius: 2px; background: var(--text-muted);
  animation: scrollNudge 1.8s var(--ease) infinite;
}
@keyframes scrollNudge {
  0% { transform: translateY(0); opacity: 1; }
  70% { transform: translateY(12px); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}

/* ======================= SECTIONS ======================= */
.section {
  max-width: 1080px; margin: 0 auto; padding: 110px 24px;
}
.section-wide { max-width: 1180px; }

.section-head { margin-bottom: 54px; }
.section-index {
  font-family: var(--font-display); font-size: 0.85rem; color: var(--accent);
  letter-spacing: 0.22em;
}
.section-head h2 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2rem, 4.6vw, 3.4rem); letter-spacing: -0.02em; line-height: 1.1;
  margin-top: 6px;
}
.section-sub { color: var(--text-muted); margin-top: 14px; max-width: 560px; }

/* Reveal-on-scroll */
.reveal {
  opacity: 0; transform: translateY(26px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.reveal.visible { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: 0.05s; }
.reveal.d2 { transition-delay: 0.15s; }
.reveal.d3 { transition-delay: 0.25s; }
.reveal.d4 { transition-delay: 0.35s; }

/* ======================= ABOUT ======================= */
.about-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 56px; align-items: start; }
.about-text p { color: var(--text-muted); font-size: 1.06rem; margin-bottom: 18px; }
.about-text p strong { color: var(--text); font-weight: 600; }
.about-text p::first-letter { }

.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 22px 20px;
  transition: transform 0.3s var(--ease), border-color 0.3s;
}
.stat-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.stat-value {
  font-family: var(--font-display); font-size: 2.3rem; font-weight: 700; color: var(--accent);
  line-height: 1.1;
}
.stat-label { font-size: 0.82rem; color: var(--text-muted); margin-top: 4px; }

/* ======================= TIMELINE ======================= */
.timeline { position: relative; padding-left: 0; }
.timeline-track {
  position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px;
  background: var(--border); border-radius: 2px; overflow: hidden;
}
.timeline-track span {
  display: block; width: 100%; height: 100%;
  transform: scaleY(0); transform-origin: top; /* JS drives transform — no layout work */
  background: linear-gradient(to bottom, var(--accent), color-mix(in srgb, var(--accent) 40%, transparent));
}

.tl-item {
  position: relative; width: 50%; padding: 0 48px 56px;
}
.tl-item.left { left: 0; text-align: right; }
.tl-item.right { left: 50%; text-align: left; margin-top: -120px; }

.tl-node {
  position: absolute; top: 6px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--text-muted);
  transition: border-color 0.4s, box-shadow 0.4s;
}
.tl-item.left .tl-node { right: -7px; }
.tl-item.right .tl-node { left: -7px; }
.tl-item.visible .tl-node { border-color: var(--accent); box-shadow: 0 0 0 6px var(--accent-soft); }

.tl-year {
  font-family: var(--font-display); font-size: 2.6rem; font-weight: 700;
  color: color-mix(in srgb, var(--text) 22%, transparent);
  line-height: 1; letter-spacing: -0.02em;
}
.tl-item.now .tl-year { color: var(--accent); }

.tl-card {
  display: inline-block; margin-top: 12px; text-align: left;
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  padding: 22px 24px; max-width: 380px;
  transition: transform 0.35s var(--ease), border-color 0.3s, box-shadow 0.35s;
}
.tl-card:hover { transform: translateY(-5px); border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); box-shadow: var(--shadow); }
.tl-title { font-family: var(--font-display); font-weight: 600; font-size: 1.12rem; }
.tl-org { color: var(--accent); font-size: 0.82rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; margin-top: 3px; }
.tl-text { color: var(--text-muted); font-size: 0.93rem; margin-top: 10px; }
.tl-text strong { color: var(--accent); font-weight: 600; }
.tl-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.tl-tags span {
  font-size: 0.72rem; font-weight: 500; padding: 4px 10px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
}
.tl-item.reveal { transform: translateY(36px); }

/* ---------- Education & honors ---------- */
.edu { margin-top: 26px; }
.edu-head {
  font-family: var(--font-display); font-size: 1.7rem; font-weight: 700;
}
.edu-sub { color: var(--text-muted); font-size: 0.95rem; margin: 6px 0 26px; }

.edu-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.edu-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  padding: 26px 24px;
  transition: transform 0.3s var(--ease), border-color 0.3s;
}
.edu-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.edu-degree {
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent);
}
.edu-school { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; margin-top: 6px; }
.edu-meta { color: var(--text-muted); font-size: 0.83rem; margin-top: 3px; }
.edu-points { list-style: none; margin-top: 14px; display: flex; flex-direction: column; gap: 7px; }
.edu-points li {
  color: var(--text-muted); font-size: 0.88rem; padding-left: 18px; position: relative;
}
.edu-points li::before {
  content: "—"; position: absolute; left: 0; color: var(--accent);
}

.honors { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.honor-chip {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.82rem; font-weight: 500; color: var(--text);
  padding: 9px 16px; border-radius: 999px;
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}
.honor-chip i { color: var(--accent); font-style: normal; }

/* ======================= CRAFT ======================= */
.craft-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px;
  margin-bottom: 72px;
}
.craft-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  padding: 28px 24px; position: relative; overflow: hidden;
  transition: border-color 0.3s;
  transform-style: preserve-3d;
}
.craft-card::before {
  content: ""; position: absolute; inset: 0; opacity: 0;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), var(--accent-soft), transparent 65%);
  transition: opacity 0.35s;
  pointer-events: none;
}
.craft-card:hover::before { opacity: 1; }
.craft-card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.craft-icon {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); margin-bottom: 18px;
}
.craft-card h3 { font-family: var(--font-display); font-size: 1.12rem; font-weight: 600; margin-bottom: 8px; }
.craft-card p { color: var(--text-muted); font-size: 0.9rem; }
.craft-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.craft-chips span {
  font-size: 0.72rem; padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--text-muted);
}

/* ---------- Org / school logo chips ---------- */
.org-logo {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  background: #fff; border: 1px solid var(--border);
  display: grid; place-items: center; overflow: hidden;
}
.org-logo img { width: 28px; height: 28px; object-fit: contain; display: block; }
.org-logo i { display: none; }
.org-logo.fallback { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.org-logo.fallback i {
  display: block; font-style: normal; font-family: var(--font-display);
  font-weight: 700; font-size: 0.78rem; color: var(--accent); letter-spacing: 0.02em;
}

.tl-head { display: flex; align-items: center; gap: 12px; }
.edu-head-row { display: flex; align-items: flex-start; gap: 14px; }
.edu-head-row .org-logo { margin-top: 2px; }

/* ======================= WORLD / GLOBE ======================= */
.world-wrap {
  display: grid; grid-template-columns: 1.35fr 1fr; gap: 40px; align-items: center;
}
.globe-box {
  position: relative; aspect-ratio: 1 / 1; max-height: 640px;
  display: grid; place-items: center;
}
#globeCanvas { width: 100%; height: 100%; cursor: grab; touch-action: none; }
#globeCanvas.dragging { cursor: grabbing; }

.globe-hint {
  position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%);
  font-size: 0.75rem; color: var(--text-muted); letter-spacing: 0.14em; text-transform: uppercase;
  opacity: 0.7;
}

.globe-tooltip {
  position: absolute; z-index: 5; pointer-events: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 14px; font-size: 0.85rem; box-shadow: var(--shadow);
  opacity: 0; transform: translate(-50%, -8px) scale(0.96);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
  white-space: nowrap;
}
.globe-tooltip.show { opacity: 1; transform: translate(-50%, -14px) scale(1); }
.globe-tooltip b { font-family: var(--font-display); display: block; }
.globe-tooltip small { color: var(--text-muted); }

.world-stats { display: flex; gap: 28px; margin-bottom: 22px; }
.world-stat b { font-family: var(--font-display); font-size: 2.2rem; font-weight: 700; color: var(--accent); line-height: 1; }
.world-stat span { display: block; font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }

.world-legend { display: flex; gap: 18px; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 18px; }
.world-legend .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.dot-home { background: var(--text); }
.dot-visited { background: var(--accent); }
.dot-wish { background: var(--wish); }

.world-list { display: flex; flex-direction: column; gap: 16px; }
.place-group-label {
  display: block; font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 8px;
}
.place-group-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.place-chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 0.83rem; font-weight: 500; font-family: var(--font-body);
  padding: 8px 14px; border-radius: 999px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  transition: border-color 0.2s, transform 0.2s var(--ease), background 0.2s;
}
.place-chip:hover { transform: translateY(-2px); border-color: var(--accent); }
.place-chip.active { background: var(--accent-soft); border-color: var(--accent); }
.place-chip i { width: 7px; height: 7px; border-radius: 50%; }
.place-chip[data-kind="visited"] i { background: var(--accent); }
.place-chip[data-kind="wishlist"] i { background: var(--wish); }
.place-chip[data-kind="home"] i { background: var(--text); }

/* ======================= CONTACT ======================= */
.contact { text-align: center; padding-bottom: 140px; }
.contact-eyebrow { font-family: var(--font-display); color: var(--accent); letter-spacing: 0.22em; font-size: 0.85rem; }
.contact-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2.6rem, 7vw, 5.4rem); line-height: 1.05; letter-spacing: -0.02em;
  margin: 18px 0 20px;
}
.contact-sub { color: var(--text-muted); margin-bottom: 44px; }
.contact-cta { display: flex; justify-content: center; }
.contact-links { display: flex; justify-content: center; gap: 12px; margin-top: 36px; }
.contact-links a {
  display: inline-flex; align-items: center; gap: 9px;
  color: var(--text-muted); text-decoration: none; font-size: 0.9rem; font-weight: 500;
  padding: 10px 18px; border: 1px solid var(--border); border-radius: 999px;
  transition: color 0.2s, border-color 0.2s, transform 0.25s var(--ease);
}
.contact-links a svg { display: block; }
.contact-links a:hover { color: var(--text); border-color: var(--accent); transform: translateY(-2px); }

.footer {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px;
  max-width: 1080px; margin: 0 auto; padding: 26px 24px;
  border-top: 1px solid var(--border);
  color: var(--text-muted); font-size: 0.82rem;
}
.footer em { font-style: normal; color: var(--accent); }

/* Keyboard hints are meaningless without a keyboard */
@media (hover: none) {
  .footer-hint { display: none; }
}

/* ======================= COMMAND PALETTE ======================= */
.cmdk { position: fixed; inset: 0; z-index: 200; display: none; }
.cmdk.open { display: block; }
.cmdk-backdrop {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.cmdk-panel {
  position: relative; max-width: 560px; margin: 14vh auto 0; z-index: 2;
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  overflow: hidden; box-shadow: var(--shadow);
  animation: cmdkIn 0.22s var(--ease);
}
@keyframes cmdkIn {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
#cmdkInput {
  width: 100%; padding: 18px 22px; font-size: 1rem; font-family: var(--font-body);
  background: transparent; border: none; outline: none; color: var(--text);
  border-bottom: 1px solid var(--border);
}
.cmdk-list { list-style: none; max-height: 320px; overflow-y: auto; padding: 8px; }
.cmdk-list li {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 10px; cursor: pointer;
  font-size: 0.92rem; color: var(--text-muted);
}
.cmdk-list li .ck-icon { width: 18px; text-align: center; }
.cmdk-list li.selected { background: var(--accent-soft); color: var(--text); }
.cmdk-list li.selected .ck-label::before { content: "→ "; color: var(--accent); }
.cmdk-list .ck-group {
  font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-muted); padding: 10px 14px 4px; cursor: default;
}
.cmdk-foot {
  display: flex; gap: 18px; padding: 10px 18px;
  border-top: 1px solid var(--border); font-size: 0.75rem; color: var(--text-muted);
}

/* ======================= TOAST / CONFETTI / CURSOR ======================= */
.toast {
  position: fixed; bottom: 30px; left: 50%; transform: translate(-50%, 80px); z-index: 250;
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  padding: 12px 22px; border-radius: 12px; font-size: 0.9rem; box-shadow: var(--shadow);
  opacity: 0; transition: transform 0.35s var(--ease), opacity 0.35s;
  pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

.confetti { position: fixed; inset: 0; z-index: 240; pointer-events: none; }

.cursor-dot, .cursor-ring {
  position: fixed; top: 0; left: 0; z-index: 260; pointer-events: none; border-radius: 50%;
  display: none;
}
.cursor-dot { width: 6px; height: 6px; background: var(--accent); margin: -3px 0 0 -3px; }
.cursor-ring {
  width: 34px; height: 34px; margin: -17px 0 0 -17px;
  border: 1.5px solid color-mix(in srgb, var(--accent) 60%, transparent);
  transition: width 0.25s var(--ease), height 0.25s var(--ease), margin 0.25s var(--ease), opacity 0.2s;
}
.cursor-ring.grow { width: 54px; height: 54px; margin: -27px 0 0 -27px; }

@media (pointer: fine) {
  body.custom-cursor, body.custom-cursor a, body.custom-cursor button,
  body.custom-cursor .place-chip { cursor: none; }
  body.custom-cursor #globeCanvas { cursor: none; }
  body.custom-cursor .cursor-dot, body.custom-cursor .cursor-ring { display: block; }
}

/* ======================= RESPONSIVE ======================= */
@media (max-width: 900px) {
  .hero-eyebrow { font-size: 0.72rem; padding: 6px 14px; }
  .nav-links { display: none; }
  .burger { display: flex; }
  .cmdk-hint { display: none; }

  .about-grid { grid-template-columns: 1fr; gap: 36px; }
  .world-wrap { grid-template-columns: 1fr; gap: 8px; }
  .globe-box { max-width: 520px; margin: 0 auto; }

  .timeline-track { left: 10px; }
  .tl-item, .tl-item.left, .tl-item.right {
    width: 100%; left: 0; text-align: left; padding: 0 0 56px 42px; margin-top: 0;
  }
  .tl-item.left .tl-node,
  .tl-item.right .tl-node { left: 3px; right: auto; }
  .tl-year { font-size: 2rem; }

  .contact-links { flex-wrap: wrap; }
}

@media (max-width: 420px) {
  .hero-eyebrow { font-size: 0.68rem; padding: 6px 12px; letter-spacing: 0.02em; }
}

/* ======================= LITE MODE (weak devices) =======================
   Set by JS from device hints or the runtime frame governor. Drops the
   costliest paint effects while keeping the design intact. */
html.lite .noise { display: none; }
html.lite .nav {
  backdrop-filter: none; -webkit-backdrop-filter: none;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
}
html.lite .mobile-menu {
  backdrop-filter: none; -webkit-backdrop-filter: none;
  background: color-mix(in srgb, var(--bg) 98%, transparent);
}
html.lite .cmdk-backdrop {
  backdrop-filter: none; -webkit-backdrop-filter: none;
  background: rgba(0, 0, 0, 0.72);
}
html.lite .pulse-dot { animation: none; box-shadow: none; }
html.lite .craft-card::before { display: none; }
html.lite .tl-card, html.lite .stat-card, html.lite .edu-card, html.lite .craft-card { box-shadow: none !important; }

/* Static mode (?static=1): everything revealed, no animation */
html.no-anim .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
html.no-anim * { animation: none !important; }
html.no-anim .hero { min-height: 820px; }

/* ======================= REDUCED MOTION ======================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
