/* ============================================================
   TEMPER VC — Interactive Dot Navigation
   ============================================================ */

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

:root {
  --gold:    #C4923E;
  --goldL:   #E4B86A;
  --steel:   #4A5C6D;
  --ch:      #1A1D23;
  --cream:   #F5F0E8;
  --white:   #FAFAF8;
  --muted:   #6B7280;
  --ease:    cubic-bezier(0.16, 1, 0.3, 1);
  --easeOut: cubic-bezier(0.0, 0.0, 0.2, 1);
}

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  font-family: 'DM Sans', -apple-system, sans-serif;
  font-weight: 400;
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
  line-height: 1.7;
}

/* ── Canvas ── */
#tCanvas {
  position: fixed;
  inset: 0;
  width: 100%; height: 100%;
  z-index: 10;
}

/* ── Wordmark ── */
.wordmark {
  position: fixed;
  z-index: 20;
  text-align: center;
  pointer-events: none;
  /* top/left set by JS */
}
.wordmark__rule {
  width: 72px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 0 auto 12px;
  opacity: 0.55;
  transition: opacity 0.5s;
}
.wordmark__temper {
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  font-size: clamp(16px, 1.8vw, 24px);
  letter-spacing: 0.28em;
  color: var(--ch);
  transition: color 0.5s;
}
.wordmark__sub {
  font-size: 8px; font-weight: 400;
  letter-spacing: 0.3em;
  color: var(--muted);
  margin-top: 5px;
  transition: color 0.5s;
}
/* Hide wordmark when ANY chapter is active */
body[class*="theme-"] .wordmark { opacity: 0 !important; pointer-events: none; transition: opacity 0.3s; }

/* Wordmark on dark backgrounds */
.theme-dark       .wordmark__temper,
.theme-dark-steel .wordmark__temper,
.theme-proptech   .wordmark__temper,
.theme-healthtech .wordmark__temper,
.theme-ai         .wordmark__temper,
.theme-steel      .wordmark__temper { color: rgba(250,245,235,0.85); }
.theme-dark       .wordmark__sub,
.theme-dark-steel .wordmark__sub,
.theme-proptech   .wordmark__sub,
.theme-healthtech .wordmark__sub,
.theme-ai         .wordmark__sub,
.theme-steel      .wordmark__sub  { color: rgba(250,245,235,0.35); }

/* ── Entry prompt ── */
.entry-prompt {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: rgba(250,250,248,0.85);
  transition: opacity 0.6s ease;
}
.entry-prompt.hidden {
  opacity: 0;
  pointer-events: none;
}
.entry-prompt__text {
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  font-size: 14px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  animation: promptPulse 2.5s ease-in-out infinite;
}
@keyframes promptPulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* ── Nav hint ── */
.nav-hint {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%);
  z-index: 30; display: flex; align-items: center; gap: 10px;
  pointer-events: none;
  opacity: 1; transition: opacity 0.8s;
}
.nav-hint.hidden { opacity: 0; }
.nav-hint__dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold);
  animation: pulse 2s ease-in-out infinite;
}
.nav-hint__text {
  font-size: 10px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--muted);
}
@keyframes pulse {
  0%,100% { opacity: 0.35; transform: scale(0.8); }
  50%     { opacity: 1;    transform: scale(1.2); }
}

/* ── Tooltip ── */
.dot-tooltip {
  position: fixed; z-index: 50;
  background: rgba(26,29,35,0.88);
  color: #FAF5EB;
  font-size: 10px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  padding: 5px 12px;
  pointer-events: none;
  opacity: 0; transition: opacity 0.18s;
  transform: translateX(-50%);
  white-space: nowrap;
}
.dot-tooltip.visible { opacity: 1; }

/* ── Chapter backgrounds ── */
.chapters {
  position: fixed; inset: 0; z-index: 1;
}

.chapter {
  position: absolute; inset: 0;
  opacity: 0; pointer-events: none;
  transition: opacity 0.65s var(--easeOut);
}
.chapter.active {
  opacity: 1; pointer-events: all;
}

/* Backgrounds */
.chapter[data-theme="dark"]       { background: #1A1D23; }
.chapter[data-theme="light"]      { background: #FAFAF8; }
.chapter[data-theme="dark-steel"] { background: linear-gradient(140deg,#162030 0%,#0E1820 100%); }
.chapter[data-theme="proptech"]   { background: linear-gradient(140deg,#2C1808 0%,#1E1008 100%); }
.chapter[data-theme="healthtech"] { background: linear-gradient(140deg,#071C28 0%,#0A2C3E 100%); }
.chapter[data-theme="ai"]         { background: linear-gradient(140deg,#08101E 0%,#0C1830 100%); }
.chapter[data-theme="steel"]      { background: linear-gradient(140deg,var(--steel) 0%,#2E3E50 100%); }

/* Radial accent glow on dark chapters — more vibrant */
.chapter[data-theme="dark"]::after,
.chapter[data-theme="dark-steel"]::after,
.chapter[data-theme="proptech"]::after,
.chapter[data-theme="healthtech"]::after,
.chapter[data-theme="ai"]::after,
.chapter[data-theme="steel"]::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 70% 50% at 65% 75%, rgba(212,160,48,0.09) 0%, transparent 100%),
              radial-gradient(ellipse 50% 40% at 30% 20%, rgba(56,104,192,0.06) 0%, transparent 100%);
  pointer-events: none; z-index: 0;
}

/* ── Content panel — scrollable from below T mark ── */
.chapter__inner {
  position: absolute;
  top: 42%;
  bottom: 0;
  left: 0; right: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: clamp(16px,2vw,32px) clamp(28px,7vw,110px) 48px;
  /* Subtle thin scrollbar for visibility */
  scrollbar-width: thin;
  scrollbar-color: rgba(196,146,62,0.3) transparent;
}
.chapter__inner::-webkit-scrollbar { width: 4px; }
.chapter__inner::-webkit-scrollbar-track { background: transparent; }
.chapter__inner::-webkit-scrollbar-thumb { background: rgba(196,146,62,0.3); border-radius: 2px; }
.chapter__inner--centered { text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; }

/* Fade overlay at top of content panel — hides content scrolling behind T */
.chapter::before {
  content: '';
  position: absolute;
  top: 38%; left: 0; right: 0;
  height: 5vh;
  z-index: 2;
  pointer-events: none;
}
.chapter[data-theme='dark']::before       { background: linear-gradient(#1A1D23, transparent); }
.chapter[data-theme='light']::before      { background: linear-gradient(#FAFAF8, transparent); }
.chapter[data-theme='dark-steel']::before  { background: linear-gradient(#162030, transparent); }
.chapter[data-theme='proptech']::before    { background: linear-gradient(#2C1808, transparent); }
.chapter[data-theme='healthtech']::before  { background: linear-gradient(#071C28, transparent); }
.chapter[data-theme='ai']::before          { background: linear-gradient(#08101E, transparent); }
.chapter[data-theme='steel']::before       { background: linear-gradient(var(--steel), transparent); }

/* ── Stagger-in animations ── */
.chapter__label,
.chapter__headline,
.chapter__sub,
.chapter__body,
.chapter__callout,
.chapter__two-col,
.chapter__compare,
.chapter__stats,
.chapter__pillars,
.chapter__stat-row,
.chapter__team,
.chapter__cta,
.chapter__contact-row,
.chapter__logos,
.chapter__logos-label,
.chapter__conviction {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s ease, transform 0.55s var(--ease);
}
.chapter.active .chapter__label      { opacity:1; transform:none; transition-delay:0.08s; }
.chapter.active .chapter__headline   { opacity:1; transform:none; transition-delay:0.14s; }
.chapter.active .chapter__sub        { opacity:1; transform:none; transition-delay:0.20s; }
.chapter.active .chapter__body       { opacity:1; transform:none; transition-delay:0.26s; }
.chapter.active .chapter__callout    { opacity:1; transform:none; transition-delay:0.32s; }
.chapter.active .chapter__two-col    { opacity:1; transform:none; transition-delay:0.22s; }
.chapter.active .chapter__compare    { opacity:1; transform:none; transition-delay:0.36s; }
.chapter.active .chapter__stats      { opacity:1; transform:none; transition-delay:0.22s; }
.chapter.active .chapter__pillars    { opacity:1; transform:none; transition-delay:0.30s; }
.chapter.active .chapter__stat-row   { opacity:1; transform:none; transition-delay:0.34s; }
.chapter.active .chapter__team       { opacity:1; transform:none; transition-delay:0.22s; }
.chapter.active .chapter__cta        { opacity:1; transform:none; transition-delay:0.28s; }
.chapter.active .chapter__contact-row{ opacity:1; transform:none; transition-delay:0.42s; }
.chapter.active .chapter__logos      { opacity:1; transform:none; transition-delay:0.42s; }
.chapter.active .chapter__logos-label{ opacity:1; transform:none; transition-delay:0.36s; }
.chapter.active .chapter__conviction { opacity:1; transform:none; transition-delay:0.42s; }

/* ── Typography ── */
.chapter__label {
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 10px;
}

.chapter__headline {
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  font-size: clamp(26px, 4vw, 56px);
  line-height: 1.12; letter-spacing: -0.025em;
  margin-bottom: 10px;
}

.chapter__sub {
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  font-size: clamp(14px, 1.5vw, 20px);
  margin-bottom: 14px;
  line-height: 1.5;
}

.chapter__body {
  font-size: clamp(14px, 1.1vw, 16px);
  line-height: 1.85; max-width: 680px;
  font-weight: 400;
}
.chapter__body p + p { margin-top: 10px; }

/* Color per theme */
[data-theme="dark"] .chapter__headline,
[data-theme="dark"] .chapter__sub { color: #EDE6D6; }
[data-theme="dark"] .chapter__body { color: #9A9288; }

[data-theme="dark-steel"] .chapter__headline,
[data-theme="dark-steel"] .chapter__sub { color: #E0D8CC; }
[data-theme="dark-steel"] .chapter__body { color: #8A8278; }

[data-theme="proptech"] .chapter__headline,
[data-theme="proptech"] .chapter__sub { color: #F0E0C8; }
[data-theme="proptech"] .chapter__body { color: #B09070; }

[data-theme="healthtech"] .chapter__headline,
[data-theme="healthtech"] .chapter__sub { color: #C8DCE8; }
[data-theme="healthtech"] .chapter__body { color: #7898A8; }

[data-theme="ai"] .chapter__headline,
[data-theme="ai"] .chapter__sub { color: #B8C8E0; }
[data-theme="ai"] .chapter__body { color: #6878A0; }

[data-theme="steel"] .chapter__headline { color: #FAF5EB; }
[data-theme="steel"] .chapter__sub,
[data-theme="steel"] .chapter__body { color: rgba(250,245,235,0.75); }

[data-theme="light"] .chapter__headline,
[data-theme="light"] .chapter__sub { color: var(--ch); }
[data-theme="light"] .chapter__body { color: #4A4F58; }

.accent  { color: var(--gold); }
.accent-light { color: var(--goldL); }
[data-theme="light"] strong.accent,
[data-theme="light"] span.accent { color: var(--gold); }

/* ── Callout box ── */
.chapter__callout {
  margin-top: 14px; padding: 14px 18px;
  border-left: 2px solid var(--gold);
  font-size: clamp(12px, 1vw, 14px);
  line-height: 1.7; background: rgba(196,146,62,0.06);
}
.chapter__callout--cream { background: rgba(245,240,232,0.08); }

/* Light theme callout */
[data-theme="light"] .chapter__callout { color: var(--ch); background: var(--cream); }

/* ── Two-col ── */
.chapter__two-col {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 16px; margin-bottom: 14px;
}
.chapter__item {
  padding: 12px 16px;
  border-left: 2px solid rgba(196,146,62,0.25);
}
.chapter__item--gold { border-left-color: var(--gold); }
.chapter__item-title {
  font-family: 'DM Sans', sans-serif; font-weight: 600;
  font-size: clamp(18px, 1.8vw, 24px);
  color: var(--ch); margin-bottom: 6px;
}
.chapter__item-body { font-size: 14px; line-height: 1.7; color: #4A4F58; }

/* ── Compare table ── */
.chapter__compare {
  display: grid; grid-template-columns: repeat(3,1fr);
  gap: 1px; background: rgba(196,146,62,0.2); margin-top: 14px;
}
.compare-col {
  background: #F0EDE8; padding: 12px 14px;
}
.compare-col--temper { background: var(--ch); }
.compare-col__title {
  font-size: 9px; font-weight: 600;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 6px;
}
.compare-col--temper .compare-col__title { color: var(--gold); }
.compare-col__body { font-size: 12px; line-height: 1.6; color: var(--ch); }
.compare-col--temper .compare-col__body { color: #B8B0A4; }

/* ── Stats grid ── */
.chapter__stats {
  display: grid; grid-template-columns: repeat(4,1fr);
  gap: 20px; margin: 14px 0;
}
.stat__num {
  font-family: 'DM Sans', sans-serif;
  font-weight: 300; font-size: clamp(28px,3.2vw,48px);
  color: var(--goldL); letter-spacing: -0.02em; line-height: 1;
}
.stat__label { font-size: 12px; color: #A09888; margin-top: 5px; }
.stat__sub   { font-size: 10px; color: #6A6258; margin-top: 3px; }

.chapter__logos-label {
  font-size: 9px; letter-spacing: 0.2em; text-transform: uppercase;
  color: #6A6258; margin-bottom: 8px;
}
.chapter__logos {
  display: flex; gap: 12px; flex-wrap: wrap;
}
.chapter__logos span {
  font-size: 11px; color: #8A8278; letter-spacing: 0.06em;
  padding: 3px 10px; border: 1px solid rgba(255,255,255,0.07);
}

/* ── Pillars ── */
.chapter__pillars {
  display: grid; grid-template-columns: repeat(3,1fr);
  gap: 14px; margin-top: 14px;
}
.pillar {
  padding: 14px 12px;
  border-top: 1px solid rgba(196,146,62,0.28);
}
.pillar:hover { border-top-color: var(--gold); transition: border-color 0.3s; }
.pillar__num  {
  font-family: 'Sora', sans-serif; font-size: 11px;
  color: var(--gold); margin-bottom: 6px;
}
.pillar__title {
  font-family: 'DM Sans', sans-serif; font-weight: 600;
  font-size: clamp(14px,1.1vw,17px); margin-bottom: 6px;
}
.pillar__body { font-size: 13px; line-height: 1.7; }

[data-theme="light"] .pillar__title { color: var(--ch); }
[data-theme="light"] .pillar__body  { color: var(--muted); }
[data-theme="proptech"] .pillar__title { color: #F0E0C8; }
[data-theme="proptech"] .pillar__body  { color: #A08060; }
[data-theme="healthtech"] .pillar__title { color: #B8D0DC; }
[data-theme="healthtech"] .pillar__body  { color: #708898; }
[data-theme="ai"] .pillar__title { color: #A8B8D8; }
[data-theme="ai"] .pillar__body  { color: #607090; }

/* ── Stat row ── */
.chapter__stat-row {
  display: flex; align-items: center; gap: 20px; margin-top: 14px; flex-wrap: wrap;
}
.stat-row__num {
  font-family: 'DM Sans', sans-serif; font-weight: 300;
  font-size: clamp(26px,2.8vw,42px);
  color: var(--goldL); line-height: 1;
}
.stat-row__label { font-size: 10px; color: rgba(200,220,232,0.55); margin-top: 3px; }
.stat-row__arrow { font-size: 20px; color: rgba(196,146,62,0.35); }
.stat-row__item--accent .stat-row__num { color: var(--gold); }

/* ── AI conviction ── */
.chapter__conviction {
  margin-top: 14px; padding: 12px 16px;
  border-left: 2px solid var(--gold);
  font-style: italic; font-size: clamp(12px,1vw,14px);
  color: rgba(168,184,216,0.85);
}

/* ── Team ── */
.chapter__team {
  display: grid; grid-template-columns: 1fr 1fr; gap: 28px;
}
.team-member__name {
  font-family: 'DM Sans', sans-serif; font-weight: 500;
  font-size: clamp(20px,2vw,28px); color: #EDE6D6; margin-bottom: 4px;
}
.team-member__role {
  font-size: 9px; font-weight: 600;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 10px;
}
.team-member__bio { font-size: 12px; line-height: 1.75; color: #8A8280; }
.team-member__callout {
  margin-top: 10px; padding: 9px 12px;
  border-left: 2px solid var(--gold);
  font-size: 12px; color: #B8B0A8;
  background: rgba(196,146,62,0.05);
}

/* ── CTA ── */
.chapter__cta { margin: 18px 0 12px; }
.cta-btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: 'Outfit', sans-serif;
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--steel); background: #fff;
  padding: 13px 28px; text-decoration: none;
  transition: all 0.35s var(--ease);
}
.cta-btn:hover { background: var(--gold); color: #fff; }
.cta-btn__arrow { transition: transform 0.3s; }
.cta-btn:hover .cta-btn__arrow { transform: translateX(4px); }

.chapter__contact-row {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; flex-wrap: wrap;
  font-size: 12px; color: rgba(250,245,235,0.55);
  margin-top: 4px;
}
.contact-dot { color: var(--gold); opacity: 0.45; }

/* ── Progress ── */
.progress {
  position: fixed; right: 22px; top: 50%;
  transform: translateY(-50%);
  z-index: 30; display: flex; flex-direction: column; gap: 7px;
}
.progress-dot {
  width: 4px; height: 4px; border-radius: 50%;
  background: rgba(196,146,62,0.2);
  cursor: pointer; transition: all 0.35s var(--ease);
}
.progress-dot.active {
  background: var(--gold); transform: scale(1.7);
}

/* ── Mobile ── */
@media (max-width: 768px) {
  .chapter__inner { top: 45%; padding: 16px 16px 40px; }
  .chapter__stats { grid-template-columns: 1fr 1fr; gap: 12px; }
  .chapter__two-col { grid-template-columns: 1fr; }
  .chapter__compare { grid-template-columns: 1fr; }
  .chapter__pillars { grid-template-columns: 1fr 1fr; }
  .chapter__team { grid-template-columns: 1fr; gap: 18px; }
  .progress { right: 8px; }
}
@media (max-width: 480px) {
  .chapter__pillars { grid-template-columns: 1fr; }
  .chapter__inner { top: 52%; }
}

@media (prefers-reduced-motion: reduce) {
  .chapter, .chapter__label, .chapter__headline, .chapter__sub,
  .chapter__body, .chapter__callout, .chapter__two-col, .chapter__compare,
  .chapter__stats, .chapter__pillars, .chapter__stat-row, .chapter__team,
  .chapter__cta, .chapter__contact-row, .chapter__logos, .chapter__logos-label,
  .chapter__conviction { transition: none !important; opacity: 1 !important; transform: none !important; }
}
