/* =========================================================
   Home (immersive scroll-driven research journey)
   ========================================================= */

:root {
  --home-bg: #03060d;
  --home-bg-mid: #0a0a14;
  --home-bg-deep: #1a0608;
  --home-fg: #ffffff;
  --home-muted: #d3d8e3;
  --home-accent: #8fd6ff;
  --home-accent-warm: #ffc28a;
  --home-accent-hot: #ff7a55;
  --home-accent-quantum: #c9a8ff;
  --home-display: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --home-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  /* Used for text-shadows against the WebGL canvas */
  --home-textshadow: 0 1px 2px rgba(0,0,0,0.85), 0 0 24px rgba(0,0,0,0.7);
}

html.home-immersive,
html.home-immersive body.home-body {
  margin: 0;
  padding: 0;
  background: var(--home-bg);
  color: var(--home-fg);
  font-family: var(--home-ui);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  /* Explicitly allow vertical pan — iOS Safari sometimes guesses wrong
     when there's a fixed WebGL canvas above the content. */
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

/* Hide the standard masthead/footer chrome on the home page */
html.home-immersive .masthead,
html.home-immersive .page__footer,
html.home-immersive .greedy-nav,
html.home-immersive .site-title,
html.home-immersive .site-subtitle { display: none !important; }

html.home-immersive a { color: var(--home-accent); }

/* ---------- Top nav (replaces masthead) ---------- */
.home-topnav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  padding: 14px 28px;
  gap: 8px;
  background: linear-gradient(180deg, rgba(3,6,13,0.92), rgba(3,6,13,0.55));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-family: var(--home-ui);
  font-size: 14px;
  letter-spacing: 0.02em;
}
/* Push primary nav + hamburger to the right edge */
/* (margin-left:auto is set inside .home-topnav__primary itself below) */
.home-topnav .nav-toggle { margin-left: 16px; }
.home-topnav__brand {
  color: var(--home-fg) !important;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  line-height: 1;
}
.brand-name {
  font-family: var(--home-ui);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--home-fg);
  /* divider between π and name */
  padding-left: 14px;
  border-left: 1px solid rgba(255, 255, 255, 0.18);
}
@media (max-width: 720px) {
  /* Keep "π · Name" visible on small screens; just trim sizes so they fit. */
  .brand-pi   { font-size: 30px; }
  .brand-name { font-size: 13px; padding-left: 10px; }
  .home-topnav__brand { gap: 10px; }
}

/* π logo mark — used in top-left of every page */
.brand-pi {
  font-family: var(--home-display, "Source Serif 4", Georgia, serif);
  font-style: italic;
  font-weight: 600;
  font-size: 42px;
  line-height: 1;
  background: linear-gradient(135deg, #8fd6ff 0%, #c9a8ff 60%, #ffc28a 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  /* Source Serif italic π sits visually ~7% above its box center;
     nudge down so it middle-aligns with the upright Inter name. */
  transform: translateY(0.03em);
  transition: transform 0.25s ease, filter 0.25s ease;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6));
}
.home-topnav__brand:hover .brand-pi,
.site-nav__brand:hover   .brand-pi {
  transform: translateY(0.03em) scale(1.08) rotate(-3deg);
  filter: drop-shadow(0 2px 6px rgba(143, 214, 255, 0.5));
}
/* Primary inline links: Scholar, CV, Blog — pushed to the right edge */
.home-topnav__primary {
  display: flex;
  gap: 22px;
  margin: 0 0 0 auto;   /* margin-left: auto pushes to the right */
  padding: 0;
  list-style: none;
}
.home-topnav__primary a {
  color: var(--home-muted) !important;
  text-decoration: none;
  transition: color 0.2s ease;
}
.home-topnav__primary a:hover { color: var(--home-fg) !important; }

/* Social-icon dropdown panel */
.home-topnav__dropdown {
  position: absolute;
  top: calc(100% - 4px);
  right: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  background: rgba(3, 6, 13, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.home-topnav.is-open .home-topnav__dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.nav-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--home-muted);
  transition: color 0.2s ease, transform 0.2s ease;
}
.nav-social-link:hover {
  color: var(--home-fg) !important;
  transform: translateY(-1px);
}
.nav-icon { display: block; }

/* ---------- Language toggle ---------- */
/* Hide whichever language doesn't match the <html lang> attribute */
html[lang="en"] [lang="vi"],
html[lang="vi"] [lang="en"] { display: none !important; }

.lang-switch__divider {
  width: 1px;
  height: 18px;
  background: rgba(255, 255, 255, 0.18);
  display: inline-block;
}
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-family: var(--home-ui);
  font-size: 12px;
  letter-spacing: 0.08em;
}
.lang-switch__btn {
  background: transparent;
  border: 0;
  padding: 4px 8px;
  cursor: pointer;
  color: var(--home-muted);
  font-weight: 500;
  letter-spacing: 0.08em;
  border-radius: 4px;
  font-family: inherit;
  font-size: inherit;
  transition: color 0.2s ease, background 0.2s ease;
}
.lang-switch__btn:hover { color: var(--home-fg); }
.lang-switch__btn[aria-pressed="true"] {
  color: var(--home-fg);
  background: rgba(143, 214, 255, 0.15);
}
/* Hamburger button (≡ → ✕) — visible at all widths */
.nav-toggle {
  display: flex;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  width: 40px; height: 36px;
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch;
  transition: border-color 0.2s ease;
}
.nav-toggle:hover { border-color: var(--home-accent); }
.nav-toggle__bar {
  display: block;
  width: 100%; height: 2px;
  background: var(--home-fg);
  border-radius: 1px;
  transition: transform 0.25s ease, opacity 0.2s ease;
}
.home-topnav.is-open .nav-toggle__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.home-topnav.is-open .nav-toggle__bar:nth-child(2) { opacity: 0; }
.home-topnav.is-open .nav-toggle__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Mobile (≤720px) ---------- */
@media (max-width: 720px) {
  .home-topnav { padding: 10px 16px; }

  /* Hamburger sits at the far-right on mobile (primary collapses below
     so margin-left:auto on primary no longer pushes the toggle over) */
  .home-topnav .nav-toggle { margin-left: auto; }

  /* Collapse the inline primary links into the dropdown stack */
  .home-topnav__primary {
    order: 3;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    font-size: 14px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    padding: 0 4px;
    transition: max-height 0.35s ease, opacity 0.2s ease, padding 0.3s ease;
  }
  .home-topnav.is-open .home-topnav__primary {
    max-height: 60vh;
    opacity: 1;
    padding: 12px 4px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  }

  /* Dropdown card becomes a full-width row at the bottom on mobile */
  .home-topnav__dropdown {
    order: 4;
    position: static;
    width: 100%;
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0 4px;
    transform: none;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    pointer-events: none;
    transition: max-height 0.35s ease, opacity 0.2s ease, padding 0.3s ease;
    gap: 20px;
  }
  .home-topnav.is-open .home-topnav__dropdown {
    opacity: 1;
    pointer-events: auto;
    max-height: 60px;
    padding: 10px 4px;
  }
}

/* ---------- Fixed WebGL canvas ---------- */
#home-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  display: block;
  background: radial-gradient(ellipse at 50% 40%, #0a1224 0%, #03060d 60%, #000 100%);
  /* Critical for mobile: let touches pass through so the page can scroll. */
  pointer-events: none;
  touch-action: pan-y;
}

/* ---------- Scroll progress bar ---------- */
.home-progress {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 2px;
  z-index: 60;
  background: rgba(255,255,255,0.05);
  pointer-events: none;
}
.home-progress__bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--home-accent), var(--home-accent-warm), var(--home-accent-hot), var(--home-accent-quantum));
  transition: width 0.1s linear;
}

/* ---------- Scenes ---------- */
#home-main {
  position: relative;
  z-index: 1;
}

.home-scene {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 32px;
  box-sizing: border-box;
}

.home-scene__inner {
  position: relative;
  max-width: 760px;
  width: 100%;
  text-align: center;
  padding: 36px 32px;
  z-index: 1;
}
/* Frosted blur of the WebGL canvas, only behind the text, softly fading at the edges. */
.home-scene__inner::before {
  content: "";
  position: absolute;
  inset: -6% -6%;
  z-index: -1;
  pointer-events: none;
  /* Slight dark tint on top of the blurred canvas for legibility */
  background: rgba(3, 6, 13, 0.32);
  backdrop-filter: blur(14px) saturate(1.05);
  -webkit-backdrop-filter: blur(14px) saturate(1.05);
  /* Soft elliptical mask so the blur fades out at the edges
     instead of looking like a hard card. */
  -webkit-mask-image: radial-gradient(ellipse at center,
    rgba(0,0,0,1) 0%,
    rgba(0,0,0,0.95) 45%,
    rgba(0,0,0,0.6) 70%,
    rgba(0,0,0,0) 95%);
          mask-image: radial-gradient(ellipse at center,
    rgba(0,0,0,1) 0%,
    rgba(0,0,0,0.95) 45%,
    rgba(0,0,0,0.6) 70%,
    rgba(0,0,0,0) 95%);
}
/* Fallback for browsers without backdrop-filter (older Firefox) */
@supports not (backdrop-filter: blur(1px)) {
  .home-scene__inner::before {
    background: radial-gradient(ellipse at center,
      rgba(3, 6, 13, 0.78) 0%,
      rgba(3, 6, 13, 0.55) 35%,
      rgba(3, 6, 13, 0.0)  72%);
  }
}

.home-scene__eyebrow {
  font-family: var(--home-ui);
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--home-accent);
  margin: 0 0 18px;
  text-shadow: var(--home-textshadow);
}

.home-scene__title {
  font-family: var(--home-display);
  font-weight: 600;
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1.1;
  margin: 0 0 18px;
  letter-spacing: -0.01em;
  color: var(--home-fg);
  text-shadow: var(--home-textshadow);
}

.home-scene__sub {
  font-family: var(--home-display);
  font-style: italic;
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  color: #e8ecf4;
  margin: 0 auto 22px;
  max-width: 60ch;
  text-shadow: var(--home-textshadow);
}

.home-scene__body {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--home-muted);
  margin: 0 auto;
  max-width: 60ch;
  text-shadow: 0 1px 2px rgba(0,0,0,0.85);
}
.home-scene__body strong { color: #ffffff; font-weight: 600; }

.home-scene__cta {
  margin-top: 28px;
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--home-muted);
  opacity: 0.7;
  animation: home-bounce 2.4s ease-in-out infinite;
}
@keyframes home-bounce {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50%      { transform: translateY(6px); opacity: 0.9; }
}

/* ---------- Hero specifics ---------- */
.home-hero .home-scene__title {
  font-size: clamp(2.4rem, 6.5vw, 5rem);
}
.home-hero .home-scene__sub { color: #cfd4e0; }

/* Research-image cards that slide in next to scenes */
.home-figure {
  position: relative;
  margin: 32px auto 0;
  max-width: 560px;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
}
.home-figure img { display: block; width: 100%; height: auto; }
.home-figure figcaption {
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--home-muted);
  padding: 10px 14px;
  text-align: left;
  background: rgba(0,0,0,0.4);
  border-top: 1px solid rgba(255,255,255,0.06);
}

/* Two-up image row for the atoms scene */
.home-figrow {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 28px auto 0;
}
.home-figrow .home-figure { margin: 0; flex: 1 1 240px; max-width: 280px; }

/* ---------- Per-scene tints (background gradients layered over canvas) ---------- */
/* Narrative: qubits -> dft -> atoms (md) -> mantle -> planet -> outro */
.home-scene--hero    { background: transparent; }
.home-scene--dft     { background: linear-gradient(180deg, rgba(20,8,40,0) 0%, rgba(20,8,40,0.4) 100%); }
.home-scene--atoms   { background: linear-gradient(180deg, rgba(20,8,40,0.4) 0%, rgba(40,16,8,0.45) 100%); }
.home-scene--mantle  { background: linear-gradient(180deg, rgba(40,16,8,0.45) 0%, rgba(80,18,8,0.55) 100%); }
.home-scene--planet  { background: linear-gradient(180deg, rgba(80,18,8,0.55) 0%, rgba(8,18,40,0.55) 100%); }
.home-scene--solar   { background: linear-gradient(180deg, rgba(8,18,40,0.55) 0%, rgba(40,12,40,0.5) 100%); }
.home-scene--galaxy  { background: linear-gradient(180deg, rgba(40,12,40,0.5) 0%, rgba(8,6,28,0.6) 100%); }
.home-scene--outro   { background: linear-gradient(180deg, rgba(8,6,28,0.6) 0%, rgba(3,6,13,1) 100%); }

/* ---------- Scale indicator (powers of 10 ruler) ---------- */
.home-scale {
  position: fixed;
  right: 26px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  font-family: var(--home-ui);
  font-size: 14px;
  letter-spacing: 0.08em;
  color: var(--home-muted);
  pointer-events: none;
  user-select: none;
}
.home-scale__rail {
  position: relative;
  width: 3px;
  height: 320px;
  background: rgba(255,255,255,0.10);
  border-radius: 2px;
  overflow: visible;
}
.home-scale__dot {
  position: absolute;
  right: -5px;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--home-accent);
  box-shadow: 0 0 18px var(--home-accent);
  transform: translateY(-50%);
  /* No transition on top — let it update at scroll-tick frame rate so
     it stays exactly in sync with the trail. */
  transition: background 0.3s ease, box-shadow 0.3s ease;
  top: 0%;
  z-index: 10;
}
.home-scale__label {
  font-variant-numeric: tabular-nums;
  color: var(--home-fg);
  font-weight: 500;
  font-size: 17px;
}
.home-scale__caption {
  opacity: 0.65;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}
/* ============================================================
   Mobile perf overrides — kill the expensive effects that block
   scroll on phones. backdrop-filter is the worst offender because
   it forces the GPU to re-blur the WebGL canvas every frame.
   ============================================================ */
@media (max-width: 720px) {
  /* No live blur of the canvas on mobile — use a flat dark scrim. */
  .home-topnav,
  .home-topnav__dropdown,
  .home-scene__inner::before,
  .home-ask,
  .home-outro__card {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  /* Slightly stronger dark backdrops so text stays readable without the blur */
  .home-scene__inner::before { background: rgba(3, 6, 13, 0.72); }
  .home-topnav { background: rgba(3, 6, 13, 0.95); }
  .home-topnav__dropdown { background: rgba(3, 6, 13, 0.96); }
  .home-ask { background: rgba(3, 6, 13, 0.7); }
  .home-outro__card { background: rgba(3, 6, 13, 0.75); }
}

/* Compact scale ruler on phones — smaller rail, smaller label */
@media (max-width: 720px) {
  .home-scale {
    right: 10px;
    gap: 6px;
    font-size: 10px;
  }
  .home-scale__rail   { width: 2px; height: 180px; }
  .home-scale__dot    { width: 9px;  height: 9px; right: -4px; }
  .home-scale__label  { font-size: 13px; }
  .home-scale__caption { font-size: 9px; letter-spacing: 0.14em; }
}

/* ---------- Outro / about ---------- */
.home-outro__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 28px;
  text-align: left;
}
@media (min-width: 720px) {
  .home-outro__grid { grid-template-columns: repeat(3, 1fr); }
}
.home-outro__card {
  display: block;
  padding: 18px 20px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 12px;
  background: rgba(3,6,13,0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  text-decoration: none !important;
  color: inherit;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.home-outro__card:hover {
  background: rgba(3,6,13,0.78);
  border-color: rgba(140, 200, 255, 0.4);
  transform: translateY(-2px);
}
.home-outro__card h3 {
  margin: 0 0 8px;
  font-family: var(--home-display);
  font-weight: 600;
  font-size: 1.05rem;
}
.home-outro__card p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--home-muted);
  line-height: 1.6;
}
.home-outro__contact {
  margin-top: 26px;
  font-size: 14px;
  color: var(--home-muted);
}
.home-outro__contact a { color: var(--home-fg); text-decoration: none; border-bottom: 1px solid var(--home-accent); padding-bottom: 2px; }

/* ---------- Flip-card portrait above the hero title ---------- */
.hero-portrait-flip {
  display: block;
  width: 160px;
  height: 160px;
  margin: 0 auto 22px;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
  perspective: 1000px;
  animation: hero-portrait-rise 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.hero-portrait-flip:focus-visible {
  outline: 2px dashed rgba(143, 214, 255, 0.7);
  outline-offset: 6px;
  border-radius: 50%;
}
.hero-portrait-flip__inner {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.85s cubic-bezier(0.4, 0, 0.2, 1);
}
.hero-portrait-flip[aria-pressed="true"] .hero-portrait-flip__inner {
  transform: rotateY(180deg);
}
.hero-portrait {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  -webkit-clip-path: circle(50%);
          clip-path: circle(50%);
  object-fit: cover;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.16);
  box-shadow:
    0 0 38px rgba(143, 214, 255, 0.22),
    0 10px 34px rgba(0, 0, 0, 0.55);
  filter: saturate(1.05);
  -webkit-backface-visibility: hidden;
          backface-visibility: hidden;
  transform: translateZ(0);
}
.hero-portrait--back {
  transform: rotateY(180deg) translateZ(0);
}
@keyframes hero-portrait-rise {
  0%   { opacity: 0; transform: translate3d(0, 18px, 0) scale(0.92); }
  100% { opacity: 1; transform: translate3d(0, 0, 0)    scale(1); }
}
@media (max-width: 720px) {
  .hero-portrait-flip {
    width: 110px;
    height: 110px;
    margin-bottom: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .hero-portrait-flip,
  .hero-portrait-flip__inner { animation: none; transition: none; }
}

/* ---------- "Ben" word in the hero — bright ↔ doom pulse ---------- */
.hero-ben10 {
  cursor: pointer;
  display: inline-block;
  position: relative;
  transition: transform 0.25s ease;
  animation: ben-bright-doom 1.8s ease-in-out infinite;
}
@keyframes ben-bright-doom {
  /* DOOM — dim, almost swallowed by the void */
  0%, 100% {
    color: rgba(255, 255, 255, 0.45);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
  }
  /* BRIGHT — full Omnitrix green flare */
  50% {
    color: #d8ffd8;
    text-shadow:
      0 0 10px #7fff7f,
      0 0 26px rgba(127, 255, 127, 0.85),
      0 0 52px rgba(127, 255, 127, 0.55),
      0 1px 2px rgba(0, 0, 0, 0.85);
  }
}
.hero-ben10:hover {
  animation: none;
  color: #d8ffd8;
  transform: scale(1.04);
  text-shadow:
    0 0 14px #7fff7f,
    0 0 34px rgba(127, 255, 127, 0.95),
    0 0 64px rgba(127, 255, 127, 0.6),
    0 1px 2px rgba(0, 0, 0, 0.85);
}
.hero-ben10:focus-visible {
  outline: 2px dashed rgba(127, 255, 127, 0.7);
  outline-offset: 4px;
  border-radius: 4px;
}
@media (prefers-reduced-motion: reduce) {
  .hero-ben10 { animation: none; color: #d8ffd8; }
}

/* ---------- Anonymous question box ---------- */
.home-ask {
  margin: 40px auto 0;
  max-width: 560px;
  padding: 22px 24px 24px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  text-align: left;
}
.home-ask__title {
  font-family: var(--home-display);
  font-weight: 600;
  font-size: 1.15rem;
  line-height: 1.3;
  margin: 0 0 6px;
  color: var(--home-fg);
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}
.home-ask__sub {
  font-size: 13px;
  color: var(--home-muted);
  margin: 0 0 18px;
  line-height: 1.5;
}
.home-ask__form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}
.home-ask__form textarea,
.home-ask__form input[type="text"],
.home-ask__form input[type="email"] {
  /* border-box so width:100% includes the padding — otherwise the
     inputs overflow the card on narrow screens. */
  box-sizing: border-box;
  width: 100%;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--home-fg);
  font-family: var(--home-ui);
  font-size: 14px;
  line-height: 1.5;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.home-ask__form textarea {
  resize: vertical;
  min-height: 88px;
  font-family: var(--home-display);
  font-size: 15px;
}
.home-ask__form textarea:focus,
.home-ask__form input:focus {
  outline: none;
  border-color: var(--home-accent);
  background: rgba(0, 0, 0, 0.6);
}
.home-ask__form ::placeholder { color: rgba(255, 255, 255, 0.40); }
.home-ask__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 480px) {
  .home-ask__row { grid-template-columns: 1fr; }
}
/* Honeypot — visually hidden, accessible-hidden, bot bait */
.home-ask__honey {
  position: absolute !important;
  left: -9999px;
  top: -9999px;
  opacity: 0;
  height: 0; width: 0;
  pointer-events: none;
}
.home-ask__send {
  align-self: flex-start;
  margin-top: 4px;
  padding: 10px 22px;
  background: rgba(143, 214, 255, 0.10);
  border: 1px solid rgba(143, 214, 255, 0.45);
  color: var(--home-fg);
  font-family: var(--home-ui);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.home-ask__send:hover {
  background: rgba(143, 214, 255, 0.22);
  border-color: var(--home-accent);
  transform: translateY(-1px);
}
.home-ask__send:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}
.home-ask__status {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--home-muted);
}
.home-ask__status.is-success { color: #4dd28a; }
.home-ask__status.is-error   { color: #ff9270; }

/* ---------- Visitor stats ---------- */
.home-visitors {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  color: var(--home-muted);
}
.home-visitors__hello-line {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.home-visitors__flag {
  font-size: 16px;
  line-height: 1;
}
.home-visitors__hello { letter-spacing: 0.01em; }

.home-visitors__flagcounter {
  display: inline-block;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  line-height: 0;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.home-visitors__flagcounter:hover {
  border-color: rgba(143, 214, 255, 0.4);
  box-shadow: 0 0 18px rgba(143, 214, 255, 0.15);
  transform: translateY(-1px);
}
.home-visitors__flagcounter img {
  display: block;
  border-radius: 4px;
}

/* ---------- Reduced motion / fallback ---------- */
@media (prefers-reduced-motion: reduce) {
  #home-canvas { display: none; }
  .home-scene { min-height: auto; padding: 60px 32px; }
  .home-scene__cta { animation: none; }
}

/* Show static images inline if WebGL isn't running (JS sets this class on body) */
.home-fallback #home-canvas { display: none; }
.home-fallback .home-scene { min-height: auto; padding: 60px 32px; }
.home-fallback .home-scene--hero::before {
  content: "";
  display: block;
  width: 200px; height: 200px;
  margin: 0 auto 28px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 25% 30%, #b48bff 0%, transparent 35%),
    radial-gradient(circle at 75% 70%, #6cc7ff 0%, transparent 35%),
    #0a0820;
  box-shadow: 0 0 80px rgba(180,139,255,0.35);
}
