:root {
  --font-mono: 'Share Tech Mono', 'Courier New', monospace;
  --font-sans: -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --bg:    #f8f8f8;
  --text:  #111111;
  --muted: rgba(0,0,0,0.38);
}

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

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--bg);
  font-family: var(--font-mono);
}

/* ── CANVAS ───────────────────────────────────────────── */
#canvas {
  position: fixed;
  inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
}

/* ── OVERLAYS ─────────────────────────────────────────── */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.75s ease;
}
.overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Scene 0: centred hero */
#ov-0 {
  gap: 14px;
  text-align: center;
  color: var(--text);
  cursor: default;
  user-select: none;
}

/* Scenes 1-3: content anchored bottom-left */
.ov-bottom {
  position: fixed;
  bottom: 60px;
  left: 48px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  color: var(--text);
}

/* ── TEXT ELEMENTS ────────────────────────────────────── */
.ov-kicker {
  font-size: 10px;
  letter-spacing: 4px;
  color: var(--muted);
}
.ov-title {
  font-family: var(--font-mono);
  font-size: clamp(72px, 13vw, 148px);
  letter-spacing: 0.05em;
  line-height: 1;
  color: var(--text);
}
/* Product/about titles in bottom overlay are shorter */
.ov-bottom .ov-title { font-size: clamp(32px, 7vw, 88px); }

.ov-sub {
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--muted);
}

/* ── ABOUT DESC ───────────────────────────────────────── */
.ov-desc {
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.7;
  color: rgba(0,0,0,0.48);
  max-width: 380px;
  margin-top: 2px;
}

/* ── APP STORE / EMAIL CTA ────────────────────────────── */
.ov-cta {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 6px;
  padding: 10px 22px;
  border: 1px solid rgba(0,0,0,0.14);
  border-radius: 10px;
  background: rgba(0,0,0,0.04);
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 1.5px;
  font-family: var(--font-mono);
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  width: fit-content;
}
.ov-cta:hover {
  background: rgba(0,0,0,0.08);
  border-color: rgba(0,0,0,0.28);
  transform: translateY(-2px);
}
.ov-cta__apple {
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1;
}

/* ── IN TESTING BADGE ─────────────────────────────────── */
.ov-badge {
  display: inline-block;
  margin-top: 4px;
  padding: 4px 12px;
  border: 1px solid rgba(100,60,190,0.30);
  border-radius: 4px;
  font-size: 9px;
  letter-spacing: 2px;
  color: rgba(90,50,175,0.70);
  width: fit-content;
}

/* ── SCENE NAV DOTS ───────────────────────────────────── */
.scene-nav {
  position: fixed;
  right: 26px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.sdot {
  position: relative;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.22);
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: background 0.3s, border-color 0.3s, transform 0.3s;
}
.sdot::after {
  content: '';
  position: absolute;
  inset: -12px;
}
.sdot.active {
  background: #444;
  border-color: #444;
  transform: scale(1.5);
}

/* ── SCROLL HINT ──────────────────────────────────────── */
.scroll-hint {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 8px;
  letter-spacing: 3px;
  color: #aaa;
  transition: opacity 0.5s;
}
.scroll-hint.hidden { opacity: 0; pointer-events: none; }
.scroll-hint__line {
  width: 1px;
  height: 34px;
  background: linear-gradient(to bottom, #aaa, transparent);
  animation: scrollBounce 1.7s ease-in-out infinite;
}

/* ── GESTURE TOAST ────────────────────────────────────── */
.gesture-toast {
  position: fixed;
  bottom: 44px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  z-index: 30;
  padding: 8px 22px;
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 8px;
  background: rgba(255,255,255,0.85);
  color: rgba(0,0,0,0.65);
  font-size: 9px;
  letter-spacing: 2px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.28s ease;
}
.gesture-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── MOBILE ───────────────────────────────────────────── */
@media (max-width: 540px) {
  .ov-bottom {
    left: 20px;
    right: 48px;
    bottom: 36px;
  }
  .ov-desc {
    max-width: 100%;
    font-size: 12px;
  }
  .ov-cta {
    padding: 9px 16px;
    font-size: 11px;
  }
  .scene-nav {
    right: 14px;
    gap: 12px;
  }
  .scroll-hint { bottom: 16px; }
}

/* ── ABOUT STACKED ROWS ───────────────────────────────── */
.about-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid rgba(0,0,0,0.10);
}
.about-row {
  display: flex;
  align-items: baseline;
  gap: 14px;
}
.about-row-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 3px;
  color: var(--muted);
  min-width: 90px;
}
.about-row-text {
  font-family: var(--font-sans);
  font-size: 12px;
  color: rgba(0,0,0,0.45);
}

/* ── KEYFRAMES ────────────────────────────────────────── */
@keyframes scrollBounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(10px); }
}

/* ── EDUCATION & EXPERIENCE SCENE ────────────────────── */
.ee-bottom {
  position: fixed;
  bottom: 60px;
  left: 48px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.ee-title {
  font-family: var(--font-mono);
  font-size: clamp(32px, 7vw, 88px);
  letter-spacing: 0.05em;
  line-height: 1;
  color: var(--text);
}

.ee-wrap {
  display: inline-block;
  overflow: hidden;
  max-width: 1ch;
  white-space: nowrap;
  vertical-align: bottom;
  transition: max-width 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: default;
}
.ee-wrap:hover { max-width: 13ch; }
.ee-inner { display: inline-block; }

.ee-amp {
  display: inline-block;
  padding: 0 0.12em;
}

/* ── TIMELINE ─────────────────────────────────────────── */
.ee-tl-container {
  position: fixed;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: none;
  padding: 24px 60px;
  cursor: grab;
  transition: top 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.ee-tl-container::-webkit-scrollbar { display: none; }
.ee-tl-container:active { cursor: grabbing; }
.ee-tl-container.pushed { top: 70%; }

.ee-tl-track {
  position: relative;
  display: flex;
  align-items: center;
  gap: 72px;
  padding: 28px 32px;
  width: max-content;
  margin: 0 auto;
  user-select: none;
}

.ee-tl-line {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(0,0,0,0.10);
  transform: translateY(-50%);
  pointer-events: none;
}

.ee-tl-node {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  z-index: 1;
}

.ee-tl-year {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--muted);
  transition: color 0.2s;
}

.ee-tl-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid rgba(0,0,0,0.25);
  background: var(--bg);
  flex-shrink: 0;
  transition: background 0.25s, border-color 0.25s, transform 0.25s;
}

.ee-tl-label {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 1.5px;
  color: var(--muted);
  text-align: center;
  max-width: 90px;
  line-height: 1.55;
  transition: color 0.2s;
}

.ee-tl-node:hover .ee-tl-dot,
.ee-tl-node.active .ee-tl-dot {
  background: var(--text);
  border-color: var(--text);
  transform: scale(1.5);
}
.ee-tl-node:hover .ee-tl-year,
.ee-tl-node:hover .ee-tl-label,
.ee-tl-node.active  .ee-tl-year,
.ee-tl-node.active  .ee-tl-label { color: var(--text); }

/* ── DETAIL CARD ─────────────────────────────────────── */
.ee-card {
  position: fixed;
  top: 52px;
  left: 50%;
  transform: translateX(-50%) translateY(-24px);
  width: min(520px, calc(100vw - 80px));
  padding: 28px 32px;
  background: rgba(248,248,248,0.93);
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 14px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
  z-index: 15;
}
.ee-card.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.ee-card-logos {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.ee-card-img {
  height: 44px;
  width: auto;
  max-width: 240px;
  object-fit: contain;
  opacity: 0.85;
  display: block;
}
.ee-card-img.hidden { display: none; }

.ee-card-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 16px;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  font-family: var(--font-sans);
  transition: color 0.2s;
}
.ee-card-close:hover { color: var(--text); }

.ee-card-meta {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 3px;
  color: var(--muted);
  margin-bottom: 8px;
}

.ee-card-title {
  font-family: var(--font-mono);
  font-size: clamp(15px, 2.2vw, 21px);
  letter-spacing: 0.06em;
  color: var(--text);
  margin-bottom: 12px;
  font-weight: normal;
}

.ee-card-body {
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.75;
  color: rgba(0,0,0,0.55);
}

/* ── MOBILE E&E ───────────────────────────────────────── */
@media (max-width: 540px) {
  .ee-bottom { left: 20px; bottom: 36px; }
  .ee-tl-container { padding: 20px; }
  .ee-tl-container.pushed { top: 68%; }
  .ee-card {
    width: calc(100vw - 40px);
    padding: 20px;
    top: 36px;
  }
}

/* ── WORLD MAP ────────────────────────────────────────── */
#wm-wrap {
  position: fixed;
  top: 52px;
  right: 48px;
  width: min(660px, 54vw);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wm-kicker {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 3px;
  color: var(--muted);
}

.wm-map-box {
  position: relative;
}

#wm-canvas {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid rgba(0,0,0,0.09);
  border-radius: 8px;
  cursor: crosshair;
}

#wm-tip {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 1.5px;
  color: var(--text);
  background: rgba(248,248,248,0.92);
  border: 1px solid rgba(0,0,0,0.10);
  padding: 4px 10px;
  border-radius: 4px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  white-space: nowrap;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
#wm-tip.show { opacity: 1; }

#wm-popup {
  position: relative;
  background: rgba(248,248,248,0.95);
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 10px;
  padding: 18px 20px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 0.28s ease, transform 0.28s ease;
}
#wm-popup.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

#wm-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  padding: 2px 6px;
  font-family: var(--font-sans);
  transition: color 0.2s;
}
#wm-close:hover { color: var(--text); }

#wm-photo {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 10px;
}

#wm-cname {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--text);
}

/* ── MOBILE WORLD MAP ─────────────────────────────────── */

/* Portrait phones: map at top, full width */
@media (max-width: 767px) and (orientation: portrait) {
  #wm-wrap {
    top: 10px;
    left: 10px;
    right: 52px; /* clear of nav dots */
    width: auto;
  }
  /* Canvas must not be too tall — leave room for figures below */
  #wm-canvas {
    max-height: 36vh;
    width: 100%;
    height: auto;
  }
  .wm-kicker { font-size: 8px; letter-spacing: 2px; }
  #wm-popup {
    position: fixed;
    bottom: 80px;
    left: 10px;
    right: 52px;
    top: auto;
  }
}

/* Landscape phones: smaller right panel (same side as desktop) */
@media (max-width: 900px) and (orientation: landscape) and (max-height: 520px) {
  #wm-wrap {
    top: 8px;
    right: 44px;
    width: min(380px, 44vw);
  }
}
