/* IntersectionObserver API for all scroll-triggered animations (no scroll event listeners) at 20% threshold. */
:root {
  --bg: #0B1628;
  --sidebar: #1E2D4D;
  --text: #E8EDF5;
  --glow: #78A0FF;
  --lav: #A78BFA;
  --mesh-a: #6366F1;
  --mesh-b: #38BDF8;
  --mesh-c: #F472B6;
  --card: #131C33;
  --muted: #374151;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Quicksand", sans-serif;
  overflow-x: hidden;
}
.thinking-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 240px;
  background: linear-gradient(160deg, rgba(30,45,77,.82), rgba(19,28,51,.68));
  backdrop-filter: blur(24px);
  border-right: 1px solid rgba(120,160,255,.18);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 0;
}
.vertical-title {
  font-family: "Noto Sans JP", "Nunito", sans-serif;
  font-feature-settings: 'palt';
  font-weight: 800;
  font-size: 28px;
  line-height: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--text);
  text-shadow: 0 0 22px rgba(120,160,255,.45);
}
.vertical-title span:last-child { font-family: "Nunito", sans-serif; font-size: 16px; color: var(--glow); }
.bubble-nav { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 32px; }
.dotted-line { position: absolute; width: 1px; height: 70%; border-left: 2px dotted var(--muted); opacity: .9; }
.nav-bubble {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 22%, #E8EDF5, var(--lav) 35%, #6366F1);
  display: grid;
  place-items: center;
  text-decoration: none;
  color: #0B1628;
  font-family: "Noto Sans JP", "Nunito", sans-serif;
  font-weight: 800;
  position: relative;
  box-shadow: 0 8px 24px rgba(99,102,241,.25);
  transition: all .4s cubic-bezier(.34,1.56,.64,1);
  scroll-snap-align: center;
}
.nav-bubble:hover:after { content: ""; position: absolute; inset: -15px; border-radius: 50%; background: radial-gradient(circle, rgba(120,160,255,.24), transparent 65%); animation: pulse .9s ease-out; }
.nav-bubble.active { width: 56px; height: 56px; box-shadow: 0 0 20px rgba(120,160,255,.4), 0 0 42px rgba(56,189,248,.25); }
.nav-bubble i { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: var(--glow); opacity: 0; }
.nav-bubble.burst i { animation: burst .6s ease-out; }
.nav-bubble i:nth-child(2) { --x: 32px; --y: -18px; }
.nav-bubble i:nth-child(3) { --x: 34px; --y: 20px; }
.nav-bubble i:nth-child(4) { --x: -28px; --y: -16px; }
.nav-bubble i:nth-child(5) { --x: -34px; --y: 14px; }
.nav-bubble i:nth-child(6) { --x: 4px; --y: -38px; }
.nav-bubble i:nth-child(7) { --x: 0; --y: 38px; }
.main-column { margin-left: 240px; width: calc(100vw - 240px); padding: 0 64px 120px; }
.panel, .card { min-height: 100vh; position: relative; }
.opening { display: grid; place-items: center; overflow: hidden; }
.hero-mesh { position: absolute; inset: 0; background: radial-gradient(circle at 20% 20%, rgba(99,102,241,.58), transparent 38%), radial-gradient(circle at 78% 34%, rgba(56,189,248,.52), transparent 34%), radial-gradient(circle at 48% 78%, rgba(244,114,182,.42), transparent 40%); filter: blur(2px); animation: meshDrift 20s infinite alternate ease-in-out; }
.hero-title { font-family: "Nunito", "Noto Sans JP", sans-serif; font-size: clamp(9rem, 22vw, 17rem); letter-spacing: -.08em; margin: 0; z-index: 1; text-shadow: 0 18px 70px rgba(56,189,248,.28); animation: bounceIn 1.1s cubic-bezier(.34,1.56,.64,1); }
.letter-subtitle { z-index: 1; margin-top: -14vh; font-size: clamp(1.2rem, 2vw, 2rem); font-weight: 500; }
.letter-subtitle span { display: inline-block; margin: .2em; opacity: 0; animation: fadeWord .8s forwards; }
.letter-subtitle span:nth-child(2) { animation-delay: .3s; }
.letter-subtitle span:nth-child(3) { animation-delay: .55s; }
.letter-subtitle span:nth-child(4) { animation-delay: .8s; }
.scroll-bubble { position: absolute; bottom: 54px; width: 46px; height: 46px; border: 1px solid var(--glow); border-radius: 50%; display: grid; place-items: center; color: var(--glow); animation: float 4s infinite; }
.card { margin: 70px 0 0; padding: 72px; border: 1px solid rgba(120,160,255,.18); border-radius: 42px; background: var(--card); overflow: hidden; box-shadow: 0 30px 100px rgba(0,0,0,.28); }
.card:before { content: ""; position: absolute; inset: 0; opacity: .15; transition: opacity .8s; }
.card.in-view:before, .card:hover:before { opacity: .25; }
.mesh-one:before { background: radial-gradient(circle at 18% 24%, var(--mesh-a), transparent 44%), radial-gradient(circle at 84% 20%, var(--mesh-b), transparent 46%), radial-gradient(circle at 58% 90%, var(--mesh-c), transparent 42%); }
.mesh-two:before { background: radial-gradient(circle at 70% 18%, var(--mesh-a), transparent 44%), radial-gradient(circle at 18% 72%, var(--mesh-b), transparent 42%), radial-gradient(circle at 90% 82%, var(--mesh-c), transparent 40%); }
.mesh-three:before { background: radial-gradient(circle at 12% 84%, var(--mesh-a), transparent 46%), radial-gradient(circle at 50% 18%, var(--mesh-b), transparent 42%), radial-gradient(circle at 86% 55%, var(--mesh-c), transparent 44%); }
.mesh-four:before { background: radial-gradient(circle at 25% 15%, var(--mesh-c), transparent 42%), radial-gradient(circle at 76% 75%, var(--mesh-b), transparent 46%), radial-gradient(circle at 45% 58%, var(--mesh-a), transparent 40%); }
.mesh-final:before { background: radial-gradient(circle at 18% 28%, var(--mesh-a), transparent 48%), radial-gradient(circle at 78% 24%, var(--mesh-b), transparent 48%), radial-gradient(circle at 48% 78%, var(--mesh-c), transparent 48%); }
.card-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 2fr 1fr; gap: 56px; align-items: start; }
.eyebrow { color: var(--glow); text-transform: uppercase; letter-spacing: .18em; font-weight: 600; font-size: .82rem; }
.prose h2 { font-family: "Nunito", sans-serif; font-size: clamp(2rem, 5vw, 3.5rem); letter-spacing: -.02em; line-height: 1.02; margin: .1em 0 .45em; opacity: 0; }
.in-view .prose h2 { animation: bounceIn .9s cubic-bezier(.34,1.56,.64,1) forwards; }
.prose p { font-size: clamp(1rem, 1.2vw, 1.15rem); line-height: 1.72; max-width: 740px; }
.margin-note { font-weight: 300; font-size: .9em; line-height: 1.65; color: var(--glow); border-left: 2px dotted var(--muted); padding-left: 26px; }
.thought { width: 100%; max-width: 180px; overflow: visible; }
.thought circle { fill: rgba(120,160,255,.08); stroke: var(--glow); stroke-width: 2; }
.thought text { font-family: "Noto Sans JP"; font-size: 28px; fill: var(--text); }
.bubble-cluster { display: inline-block; padding: 16px 20px; border: 1px solid rgba(120,160,255,.45); border-radius: 999px; background: rgba(120,160,255,.08); }
.diagram { position: relative; z-index: 1; width: min(520px, 90%); height: 190px; margin: 54px auto 0; display: block; }
.diagram path { fill: none; stroke: var(--glow); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 14px rgba(120,160,255,.35)); stroke-dasharray: 900; stroke-dashoffset: 900; }
.diagram.draw path { animation: draw 2s ease-in-out forwards, strokeSwap 2s ease-in-out forwards; }
.separator { height: 120px; display: grid; place-items: center; }
.separator span { font-family: "Nunito"; font-size: 48px; color: var(--glow); animation: rotateSlow 30s linear infinite; }
.floating-bubbles { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.floating-bubbles span { position: absolute; border: 1px solid rgba(120,160,255,.45); background: radial-gradient(circle, rgba(56,189,248,.12), rgba(167,139,250,.04)); border-radius: 50%; animation: float 18s infinite ease-in-out; }
.floating-bubbles span:nth-child(1) { width: 18px; height: 18px; left: 30%; top: 80%; animation-duration: 17s; }
.floating-bubbles span:nth-child(2) { width: 24px; height: 24px; left: 86%; top: 62%; animation-duration: 22s; }
.floating-bubbles span:nth-child(3) { width: 10px; height: 10px; left: 50%; top: 28%; animation-duration: 15s; }
.floating-bubbles span:nth-child(4) { width: 20px; height: 20px; left: 72%; top: 15%; animation-duration: 25s; }
.floating-bubbles span:nth-child(5) { width: 12px; height: 12px; left: 18%; top: 38%; animation-duration: 19s; }
.floating-bubbles span:nth-child(6) { width: 22px; height: 22px; left: 92%; top: 86%; animation-duration: 21s; }
.floating-bubbles span:nth-child(7) { width: 9px; height: 9px; left: 42%; top: 58%; animation-duration: 16s; }
.floating-bubbles span:nth-child(8) { width: 16px; height: 16px; left: 63%; top: 42%; animation-duration: 24s; }
@keyframes bounceIn { 0% { opacity: 0; transform: translateY(40px) scale(.9); } 60% { transform: translateY(-8px) scale(1.02); } 100% { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes fadeWord { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes meshDrift { to { transform: scale(1.08) translate(2%,-2%); filter: hue-rotate(12deg) blur(2px); } }
@keyframes float { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-60px) scale(1.1); } }
@keyframes pulse { to { transform: scale(1.7); opacity: 0; } }
@keyframes burst { 0% { opacity: .9; transform: translate(0,0) scale(1); } 100% { opacity: 0; transform: translate(var(--x),var(--y)) scale(.2); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes strokeSwap { 50% { stroke: var(--mesh-c); } 100% { stroke: var(--glow); } }
@keyframes rotateSlow { to { transform: rotate(360deg); } }
@media (max-width: 768px) {
  .thinking-sidebar { inset: auto 0 0 0; width: 100%; height: 94px; flex-direction: row; padding: 10px 14px; border-right: 0; border-top: 1px solid rgba(120,160,255,.18); }
  .vertical-title { font-size: 18px; flex-direction: row; margin-right: 16px; }
  .bubble-nav { flex: 1; flex-direction: row; justify-content: flex-start; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; }
  .dotted-line { height: 1px; width: 88%; border-left: 0; border-top: 2px dotted var(--muted); }
  .main-column { margin-left: 0; width: 100%; padding: 0 18px 130px; }
  .card { padding: 34px 24px; border-radius: 28px; }
  .card-grid { grid-template-columns: 1fr; gap: 26px; }
  .margin-note { border-left: 0; border-top: 2px dotted var(--muted); padding: 20px 0 0; }
  .hero-title { font-size: 32vw; }
  .letter-subtitle { margin-top: -20vh; }
  .separator { height: 90px; }
}
