/* ============================================================
   SURAJ KADAM — portfolio v2 (light theme)
   Warm cream paper, ink-black text, accent crimson,
   designed to be readable + sophisticated + surprisingly alive
   ============================================================ */

:root {
  --paper: #faf8f3;          /* warm cream */
  --paper-2: #f3efe6;         /* slightly darker card */
  --paper-3: #e8e3d6;         /* border tone */
  --ink-0: #15151a;           /* near-black text */
  --ink-1: #2a2a32;           /* body text */
  --ink-2: #6a6a72;           /* muted */
  --ink-3: #9a9aa3;           /* very muted */
  --ink-inv: #faf8f3;         /* on dark */
  --line: rgba(21, 21, 26, 0.10);
  --line-strong: rgba(21, 21, 26, 0.18);
  --red: #d63b3b;             /* crimson accent */
  --red-2: #b82525;
  --red-tint: rgba(214, 59, 59, 0.08);
  --red-tint-2: rgba(214, 59, 59, 0.18);
  --green: #2f7a3e;
  --amber: #c87f1a;
  --radius: 12px;
  --radius-lg: 18px;
  --font-sans: 'Geist', 'Inter', -apple-system, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --font-serif: 'Instrument Serif', 'Georgia', serif;
  --max-w: 1240px;
  --gutter: clamp(20px, 5vw, 56px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--paper);
  color: var(--ink-0);
  font-feature-settings: 'ss01', 'cv11';
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  cursor: none;
}
@media (hover: none), (pointer: coarse) { body { cursor: auto; } .cursor-ring, .cursor-dot { display: none; } }

a { color: inherit; text-decoration: none; }

::selection { background: var(--red); color: var(--paper); }

/* subtle paper texture */
body::before {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(800px 600px at 8% -5%, var(--red-tint), transparent 60%),
    radial-gradient(900px 700px at 95% 10%, rgba(214,59,59,0.05), transparent 60%);
  pointer-events: none;
  z-index: -1;
}

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--gutter); position: relative; }
.muted { color: var(--ink-2); }
.kyoto { font-style: italic; color: var(--red); font-family: var(--font-serif); }
.lead { font-size: clamp(16px, 1.5vw, 19px); color: var(--ink-1); line-height: 1.6; max-width: 56ch; }

/* ============== custom cursor ============== */
.cursor-ring, .cursor-dot {
  position: fixed; top: 0; left: 0;
  pointer-events: none;
  z-index: 9999;
}
.cursor-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--red); transform: translate(-50%, -50%); }
.cursor-ring { width: 32px; height: 32px; border: 1.5px solid rgba(214,59,59,0.6); border-radius: 50%; transform: translate(-50%, -50%); transition: width 0.25s, height 0.25s, border-color 0.25s, background 0.25s; }
.cursor-ring.is-hover { width: 50px; height: 50px; border-color: var(--red); background: rgba(214,59,59,0.08); }
.cursor-ring.is-text { width: 4px; height: 24px; border-radius: 4px; border: none; background: var(--red); }

/* ============== top meta ============== */
.top-meta {
  position: fixed; top: 16px; right: var(--gutter);
  display: flex; gap: 10px;
  z-index: 100;
}
.meta-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(250, 248, 243, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  padding: 6px 14px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-1);
}
.meta-pill--mono { gap: 10px; }
.meta-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); animation: pulse 2.2s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
.meta-label { color: var(--ink-3); }
.meta-num { color: var(--red); font-weight: 600; }
#chapterName { color: var(--ink-0); font-weight: 500; }

/* ============== buttons ============== */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px;
  font-size: 15px; font-weight: 500;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  color: var(--ink-0);
  transition: transform 0.2s ease, background 0.2s, border-color 0.2s, box-shadow 0.3s;
  cursor: none;
  font-family: inherit;
}
.btn--primary { background: var(--red); border-color: var(--red); color: var(--ink-inv); box-shadow: 0 8px 24px rgba(214,59,59,0.25); }
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(214,59,59,0.4); }
.btn--ghost { background: transparent; }
.btn--ghost:hover { background: var(--paper-2); border-color: var(--ink-3); }
.btn--big { padding: 18px 28px; font-size: 16px; }
.btn-pre { font-weight: 700; }
.btn-handle { font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); margin-left: 8px; }
.btn--primary .btn-handle { color: rgba(250,248,243,0.7); }

/* ============== chapter base ============== */
.chapter {
  position: relative;
  padding: clamp(80px, 14vh, 140px) 0;
  min-height: 50vh;
}

/* ============== BOOT (chapter 01) ============== */
.chapter--boot { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 100px 0 60px; }
.boot-screen { padding: 0 var(--gutter); max-width: 920px; margin: 0 auto 30px; font-family: var(--font-mono); font-size: clamp(12px, 1.3vw, 15px); line-height: 1.8; color: var(--ink-1); }
.boot-line { opacity: 0; }
.boot-line.visible { opacity: 1; }
.prompt { color: var(--ink-3); }
.cmd { color: var(--red); font-weight: 600; }
.ok { color: var(--green); font-weight: 600; }
.boot-cursor::after { content: '▋'; color: var(--red); animation: blink 1s steps(2) infinite; }
@keyframes blink { 0%,50% { opacity: 1; } 51%,100% { opacity: 0; } }
.type-cursor { color: var(--red); animation: blink 1s steps(2) infinite; }

.boot-reveal { padding: 0 var(--gutter); max-width: 1100px; margin: 0 auto; opacity: 0; transform: translateY(20px); transition: opacity 1s ease, transform 1s cubic-bezier(0.2, 0.8, 0.2, 1); }
.boot-reveal.visible { opacity: 1; transform: translateY(0); }
.hero-tag {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 13px;
  color: var(--ink-2);
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  margin-bottom: 32px;
  background: var(--paper-2);
}
.hero-tag-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--red); }
.hero-tag .kyoto { font-size: 15px; }
.hero-title { font-size: clamp(48px, 8vw, 110px); font-weight: 600; letter-spacing: -0.045em; line-height: 0.98; margin-bottom: 28px; color: var(--ink-0); }
.hero-row { display: block; overflow: hidden; }
.hero-row[data-stagger] { opacity: 0; transform: translateY(110%); transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1); }
.hero-row[data-stagger].visible { opacity: 1; transform: translateY(0); }
.hero-row:nth-child(2) { transition-delay: 0.18s; }
.hero-row--accent { color: var(--red); }
.hero-sub { font-size: clamp(17px, 1.8vw, 22px); color: var(--ink-1); max-width: 60ch; margin-bottom: 36px; line-height: 1.55; }
.hero-sub[data-stagger] { opacity: 0; transition: opacity 0.8s ease 0.5s; }
.hero-sub[data-stagger].visible { opacity: 1; }
.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-ctas[data-stagger] { opacity: 0; transform: translateY(20px); transition: opacity 0.8s ease 0.7s, transform 0.8s ease 0.7s; }
.hero-ctas[data-stagger].visible { opacity: 1; transform: translateY(0); }

/* hero grid: text + illustration side by side */
.hero-grid {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(40px, 6vw, 80px);
  align-items: center;
}
@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-illust { max-width: 360px; margin: 0 auto; }
}
.hero-illust {
  width: 100%;
  max-width: 480px;
}
.hero-illust svg {
  filter: drop-shadow(0 12px 32px rgba(21,21,26,0.08));
}
.hero-orbit {
  transform-origin: 240px 240px;
  animation: orbit 60s linear infinite;
}
@keyframes orbit { to { transform: rotate(360deg); } }

/* illustration bars on top of pillars + process + live */
.pillar-illust {
  margin-bottom: 20px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
}
.pillar-illust svg { display: block; }
.process-illust {
  margin-bottom: 16px;
}
.live-illust {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

/* marquee */
.hero-marquee {
  margin-top: 60px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
  overflow: hidden;
  mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
}
.marquee-track {
  display: flex; gap: 32px;
  white-space: nowrap;
  animation: marquee 28s linear infinite;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-2);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.marquee-track span { flex-shrink: 0; }
.marquee-track span:nth-child(even) { color: var(--red); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ============== UNDERDOG (chapter 02) ============== */
.chapter--underdog { background: var(--paper-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.underdog-grid { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--gutter); display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 80px); align-items: start; }
@media (max-width: 880px) { .underdog-grid { grid-template-columns: 1fr; } }
.underdog-eyebrow { font-family: var(--font-mono); font-size: 12px; color: var(--red); text-transform: uppercase; letter-spacing: 0.14em; margin-bottom: 18px; }
.underdog-h { font-size: clamp(32px, 4.5vw, 52px); font-weight: 500; letter-spacing: -0.025em; line-height: 1.12; margin-bottom: 24px; color: var(--ink-0); }
.underdog-p { font-size: 17px; color: var(--ink-1); margin-bottom: 32px; line-height: 1.6; max-width: 50ch; }
.underdog-timeline { display: flex; flex-direction: column; gap: 14px; }
.tl-item { display: grid; grid-template-columns: 64px 1fr; gap: 16px; padding: 12px 0; border-bottom: 1px dashed var(--line); align-items: baseline; }
.tl-year { font-family: var(--font-mono); font-size: 13px; font-weight: 600; color: var(--red); }
.tl-text { color: var(--ink-1); font-size: 14px; }

.shayari-wrap {
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  position: sticky;
  top: 80px;
  box-shadow: 0 4px 20px rgba(21,21,26,0.04);
}
.shayari-label { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 24px; }
.shayari-line { font-family: var(--font-serif); font-size: clamp(22px, 2.6vw, 30px); color: var(--ink-0); line-height: 1.55; margin-bottom: 6px; font-weight: 400; font-style: italic; }
.shayari-line[data-stagger] { opacity: 0; transform: translateY(10px); transition: opacity 0.8s ease, transform 0.8s ease; }
.shayari-line[data-stagger].visible { opacity: 1; transform: translateY(0); }
.shayari-gap { height: 22px; }
.shayari-translation {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px dashed var(--line);
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.65;
  font-family: var(--font-sans);
  font-style: normal;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.6s ease 0.3s, max-height 0.6s ease 0.3s;
}
.shayari-translation.show { opacity: 1; max-height: 200px; }
.trans-label { display: block; font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 8px; }

/* ============== PILLARS (chapter 03) ============== */
.pillars-head { margin-bottom: 56px; max-width: 800px; }
.pillars-head h2 { font-size: clamp(32px, 4.5vw, 52px); font-weight: 500; letter-spacing: -0.03em; margin-bottom: 16px; line-height: 1.1; color: var(--ink-0); }
.pillar-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.pillar {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  position: relative;
  overflow: hidden;
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.3s, box-shadow 0.3s;
  min-height: 280px;
  cursor: none;
  text-align: left;
  font-family: inherit;
  color: inherit;
  display: flex; flex-direction: column;
}
.pillar::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(400px 200px at var(--mx, 50%) var(--my, 50%), var(--red-tint), transparent 60%);
  opacity: 0; transition: opacity 0.3s;
}
.pillar:hover::before { opacity: 1; }
.pillar:hover, .pillar:focus-visible, .pillar.is-open { border-color: var(--red); transform: translateY(-4px); box-shadow: 0 10px 30px rgba(21,21,26,0.06); }
.pillar-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; position: relative; z-index: 1; }
.pillar-icon { width: 44px; height: 44px; border-radius: 10px; background: var(--red-tint); display: flex; align-items: center; justify-content: center; color: var(--red); }
.pillar h3 { font-size: 21px; font-weight: 600; letter-spacing: -0.015em; color: var(--ink-0); }
.pillar-blurb { color: var(--ink-1); font-size: 14px; line-height: 1.55; margin-bottom: 14px; position: relative; z-index: 1; }
.pillar-reveal {
  max-height: 0; overflow: hidden; opacity: 0;
  transition: max-height 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.4s, margin-top 0.3s;
  margin-top: 0;
  position: relative; z-index: 1;
}
.pillar:hover .pillar-reveal, .pillar:focus-visible .pillar-reveal, .pillar.is-open .pillar-reveal { max-height: 600px; opacity: 1; margin-top: 8px; }
.proof-row { display: flex; justify-content: space-between; align-items: baseline; padding: 7px 0; border-top: 1px dashed var(--line); font-size: 13px; }
.proof-label { color: var(--ink-2); }
.proof-num { color: var(--red); font-family: var(--font-mono); font-weight: 600; }
.pillar-foot { font-family: var(--font-mono); font-size: 10px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.12em; margin-top: auto; padding-top: 12px; position: relative; z-index: 1; }

/* ============== PROOF (chapter 04) ============== */
.chapter--proof { background: var(--paper-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.proof-head { margin-bottom: 56px; max-width: 800px; }
.proof-head h2 { font-size: clamp(36px, 5vw, 56px); font-weight: 500; letter-spacing: -0.03em; margin-bottom: 12px; line-height: 1.05; color: var(--ink-0); }
.proof-quote {
  font-family: var(--font-serif);
  font-size: clamp(22px, 2.8vw, 30px);
  font-style: italic;
  color: var(--ink-0);
  line-height: 1.35;
  margin: 24px 0;
  padding-left: 20px;
  border-left: 3px solid var(--red);
}
.pq-symbol { color: var(--red); font-weight: 700; padding: 0 4px; }
.pq-by { font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); letter-spacing: 0.1em; text-transform: uppercase; margin-top: 10px; font-style: normal; }
.proof-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.proof-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 26px;
  transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
}
.proof-card:hover { border-color: var(--red); transform: translateY(-3px); box-shadow: 0 8px 24px rgba(21,21,26,0.06); }
.proof-card.big { grid-column: span 2; background: linear-gradient(135deg, var(--paper), var(--red-tint)); }
.proof-card.atc-card { background: linear-gradient(135deg, var(--paper), rgba(47,122,62,0.06)); border-color: rgba(47,122,62,0.2); }
.proof-card.atc-card:hover { border-color: var(--green); }
@media (max-width: 720px) { .proof-card.big { grid-column: span 1; } }
.proof-eyebrow { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 14px; }
.proof-number { font-size: clamp(40px, 5.5vw, 64px); font-weight: 700; color: var(--red); font-family: var(--font-mono); letter-spacing: -0.03em; line-height: 1; }
.proof-card.atc-card .proof-number { color: var(--green); }
.proof-unit { font-size: 17px; color: var(--ink-1); margin-left: 12px; font-weight: 400; }
.proof-meta { font-size: 13px; color: var(--ink-2); margin-top: 14px; line-height: 1.5; }

/* ============== BRANDS (chapter 05) ============== */
.brands-head { margin-bottom: 56px; max-width: 800px; }
.brands-head h2 { font-size: clamp(32px, 4.5vw, 52px); font-weight: 500; letter-spacing: -0.03em; margin-bottom: 12px; line-height: 1.1; color: var(--ink-0); }
.brand-section { margin-bottom: 40px; }
.brand-section-label { font-family: var(--font-mono); font-size: 12px; color: var(--red); text-transform: uppercase; letter-spacing: 0.14em; margin-bottom: 14px; }
.brand-mosaic { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.brand-tile {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
  display: flex; flex-direction: column; gap: 4px;
}
.brand-tile:hover { border-color: var(--red); transform: translateY(-2px); box-shadow: 0 6px 18px rgba(21,21,26,0.05); }
.brand-tile.mine { border-left: 3px solid var(--red); background: linear-gradient(90deg, var(--red-tint), var(--paper) 40%); }
.brand-tile.atc { border-left: 3px solid var(--green); }
.brand-name { font-size: 15px; font-weight: 600; color: var(--ink-0); letter-spacing: -0.01em; }
.brand-role { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.1em; }
.brand-fineprint { margin-top: 32px; font-size: 12px; color: var(--ink-3); text-align: center; }

/* ============== HOW (chapter 06) ============== */
.chapter--how { background: var(--paper-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.how-head { margin-bottom: 56px; max-width: 800px; }
.how-head h2 { font-size: clamp(32px, 4.5vw, 52px); font-weight: 500; letter-spacing: -0.03em; margin-bottom: 12px; line-height: 1.1; color: var(--ink-0); }
.how-quote {
  font-family: var(--font-serif);
  font-size: clamp(22px, 2.8vw, 30px);
  font-style: italic;
  color: var(--ink-0);
  line-height: 1.35;
  margin: 20px 0;
  padding-left: 20px;
  border-left: 3px solid var(--red);
}
.process-track { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.process-step {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
}
.process-step:hover { border-color: var(--red); transform: translateY(-3px); box-shadow: 0 8px 22px rgba(21,21,26,0.05); }
.step-num { font-family: var(--font-mono); font-size: 14px; color: var(--red); font-weight: 600; margin-bottom: 14px; letter-spacing: 0.1em; }
.process-step h3 { font-size: 22px; font-weight: 600; letter-spacing: -0.015em; margin-bottom: 10px; color: var(--ink-0); }
.process-step p { color: var(--ink-2); font-size: 14px; line-height: 1.55; margin-bottom: 18px; }
.step-detail { border-top: 1px dashed var(--line); padding-top: 14px; }
.step-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 12px; }
.step-row span:first-child { color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.08em; font-family: var(--font-mono); }
.step-row span:last-child { color: var(--ink-0); font-weight: 500; font-family: var(--font-mono); }

/* ============== FUN (chapter 06) — LIGHT THEME ============== */
.chapter--fun { background: var(--paper-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); position: relative; }
.chapter--fun h2 { font-size: clamp(32px, 4.5vw, 48px); font-weight: 500; letter-spacing: -0.025em; margin-bottom: 12px; color: var(--ink-0); }
.chapter--fun .lead { color: var(--ink-2); margin-bottom: 40px; }
.fun-illust {
  margin: 0 auto 32px;
  max-width: 800px;
  display: block;
  opacity: 0.6;
}
.fun-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.fun-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px 26px;
}
.fun-label { font-family: var(--font-mono); font-size: 11px; color: var(--red); text-transform: uppercase; letter-spacing: 0.14em; margin-bottom: 18px; }

/* fortune */
.fortune-box {
  background: var(--ink-0);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  min-height: 100px;
  color: var(--ink-inv);
}
.fortune-prompt { color: var(--red); margin-bottom: 10px; }
.fortune-answer { color: rgba(250,248,243,0.9); white-space: pre-wrap; }
.fortune-input {
  width: 100%;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 14px 16px;
  color: var(--ink-0);
  font-family: var(--font-mono);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  cursor: none;
}
.fortune-input:focus { border-color: var(--red); }
.fortune-input::placeholder { color: var(--ink-3); }

/* trust gauge */
.trust-wrap { display: flex; gap: 24px; align-items: center; }
.trust-ring { position: relative; flex-shrink: 0; }
.trust-num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; font-family: var(--font-mono); }
.trust-num > span:first-child { font-size: 36px; font-weight: 700; color: var(--ink-0); }
.trust-pct { font-size: 14px; color: var(--red); }
.trust-meta { flex: 1; }
.trust-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 12px; border-top: 1px dashed var(--line); }
.trust-row span:first-child { color: var(--ink-3); }
.trust-row span:last-child { color: var(--ink-0); font-family: var(--font-mono); font-weight: 600; }

/* sign */
.sign-board {
  background: var(--paper);
  color: var(--ink-0);
  border-radius: var(--radius);
  padding: 40px 24px;
  margin-bottom: 16px;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: var(--font-serif);
  font-size: clamp(18px, 2vw, 22px);
  font-style: italic;
  line-height: 1.4;
  box-shadow: inset 0 0 0 6px var(--paper-2), 0 0 0 1px var(--line);
  transition: opacity 0.18s;
}
.sign-btn {
  width: 100%;
  background: var(--red);
  color: var(--ink-inv);
  border: none;
  border-radius: var(--radius);
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: none;
  transition: transform 0.2s, box-shadow 0.3s;
}
.sign-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(214,59,59,0.5); }

/* ============== CTA (chapter 07) — LIGHT THEME ============== */
.chapter--cta {
  min-height: 80vh;
  display: flex; align-items: center;
  padding: clamp(80px, 14vh, 140px) 0;
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, var(--paper) 0%, var(--red-tint) 50%, var(--paper) 100%);
}
.cta-illust {
  margin: 0 auto 32px;
  width: 160px;
  display: block;
  animation: floatY 4s ease-in-out infinite;
}
@keyframes floatY { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.cta-container { text-align: center; max-width: 880px; margin: 0 auto; }
.cta-eyebrow { font-family: var(--font-mono); font-size: 12px; color: var(--red); text-transform: uppercase; letter-spacing: 0.14em; margin-bottom: 24px; }
.cta-title { font-size: clamp(40px, 7vw, 84px); font-weight: 500; letter-spacing: -0.035em; line-height: 1.02; margin-bottom: 28px; color: var(--ink-0); }
.cta-title .kyoto { font-size: 1.05em; }
.cta-sub { font-size: clamp(17px, 1.8vw, 21px); color: var(--ink-1); max-width: 50ch; margin: 0 auto 44px; line-height: 1.55; }
.cta-buttons { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.cta-buttons .btn--ghost { background: transparent; color: var(--ink-0); border-color: var(--line-strong); }
.cta-buttons .btn--ghost:hover { background: var(--paper-2); border-color: var(--ink-3); }
.cta-fineprint { margin-top: 44px; font-family: var(--font-mono); font-size: 13px; color: var(--ink-3); letter-spacing: 0.06em; }

/* ============== FOOTER / LIVE (chapter 09) ============== */
.live-head { margin-bottom: 48px; max-width: 800px; }
.live-head h2 { font-size: clamp(32px, 4.5vw, 52px); font-weight: 500; letter-spacing: -0.03em; margin-bottom: 12px; line-height: 1.1; color: var(--ink-0); }
.live-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 56px; }
.live-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 20px; }
.live-label { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 10px; }
.live-num { font-size: clamp(26px, 3vw, 34px); font-weight: 700; color: var(--green); font-family: var(--font-mono); letter-spacing: -0.015em; }
.live-foot { font-size: 12px; color: var(--ink-2); margin-top: 6px; }

.footer-mark { padding: 40px 0 30px; border-top: 1px solid var(--line); }
.footer-mark-big { font-family: var(--font-serif); font-size: clamp(36px, 5vw, 56px); color: var(--ink-0); font-style: italic; line-height: 1; margin-bottom: 8px; }
.footer-mark-alias { font-family: var(--font-mono); font-size: 13px; color: var(--ink-2); }
.footer-mark-alias .kyoto { color: var(--red); font-size: 16px; font-family: var(--font-serif); font-style: italic; }

.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 32px; padding: 30px 0; border-top: 1px solid var(--line); }
.footer-col-label { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 14px; }
.footer-col a { display: block; color: var(--ink-1); font-size: 14px; padding: 4px 0; transition: color 0.2s; }
.footer-col a:hover { color: var(--red); }

.footer-fine { padding-top: 24px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); }
.easter-hint { color: var(--red); letter-spacing: 0.08em; }
.copyright { padding: 24px 0; font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); text-align: center; border-top: 1px solid var(--line); margin-top: 16px; }

/* ============== FAB CTAs ============== */
.fab {
  position: fixed; bottom: 20px;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(250, 248, 243, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line-strong);
  color: var(--ink-0);
  font-size: 14px; font-weight: 500;
  z-index: 100;
  transition: transform 0.25s, background 0.25s, box-shadow 0.3s;
  cursor: none;
  box-shadow: 0 4px 12px rgba(21,21,26,0.08);
}
.fab:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(21,21,26,0.15); }
.fab--wa { right: 20px; background: #25D366; border-color: #25D366; color: white; animation: pulseFab 2.6s ease-in-out infinite; }
.fab--wa:hover { background: #20bd5a; }
.fab--ig { right: 168px; }
.fab--ig:hover { background: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); border-color: transparent; color: white; }
@keyframes pulseFab {
  0%,100% { box-shadow: 0 8px 20px rgba(37, 211, 102, 0.4); }
  50% { box-shadow: 0 8px 30px rgba(37, 211, 102, 0.7); }
}
@media (max-width: 540px) {
  .fab--ig span, .fab--wa span { display: none; }
  .fab--ig, .fab--wa { padding: 14px; }
  .fab--ig { right: 76px; }
}

/* ============== reveal ============== */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1); }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ============== easter egg ============== */
.easter-egg { position: fixed; inset: 0; background: rgba(21,21,26,0.75); backdrop-filter: blur(8px); display: none; align-items: center; justify-content: center; z-index: 9999; opacity: 0; transition: opacity 0.3s; }
.easter-egg.show { display: flex; opacity: 1; }
.ee-card { background: var(--paper); border: 1px solid var(--red); border-radius: var(--radius-lg); padding: 36px 40px; max-width: 420px; text-align: center; position: relative; animation: pop 0.4s cubic-bezier(0.2, 0.8, 0.2, 1.4); color: var(--ink-0); }
@keyframes pop { from { transform: scale(0.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.ee-head { font-size: 24px; font-weight: 600; color: var(--red); margin-bottom: 12px; }
.ee-card p { color: var(--ink-1); margin-bottom: 24px; }
.ee-close { position: absolute; top: 12px; right: 16px; background: transparent; border: none; color: var(--ink-2); font-size: 28px; line-height: 1; cursor: none; padding: 4px 10px; border-radius: 8px; }
.ee-close:hover { background: var(--paper-2); color: var(--red); }

/* ============== RESPONSIVE — comprehensive mobile fixes ============== */

/* TABLET + smaller desktop */
@media (max-width: 880px) {
  .underdog-grid { grid-template-columns: 1fr; }
  .underdog-right { order: -1; margin-bottom: 32px; }
  .top-meta { top: 12px; right: 12px; }
}

/* MOBILE — applies to phones (≤ 720px) */
@media (max-width: 720px) {
  /* container + chapter spacing */
  .container { padding: 0 16px; }
  .chapter { padding: 56px 0; min-height: 0; }
  .chapter-rail { position: static; padding: 0 16px; margin-bottom: 20px; font-size: 10px; }

  /* prevent horizontal overflow — root cause of the bug */
  html, body { overflow-x: hidden; max-width: 100vw; }
  body { position: relative; }

  /* boot reveal — was 1100px wide on mobile, breaking the layout */
  .boot-screen { padding: 0 16px; font-size: 12px; }
  .boot-reveal { padding: 0; max-width: 100%; width: 100%; }

  /* hero grid — collapse to single column, constrain width */
  .hero-grid {
    grid-template-columns: 1fr !important;
    gap: 32px;
    padding: 0;
    width: 100%;
    max-width: 100%;
  }
  .hero-text { width: 100%; min-width: 0; }
  .hero-title { font-size: clamp(36px, 10vw, 56px); line-height: 1.05; }
  .hero-row { overflow: visible; }
  .hero-sub { font-size: 16px; max-width: 100%; }
  .hero-ctas { flex-direction: column; align-items: stretch; }
  .hero-ctas .btn { justify-content: center; width: 100%; }
  .hero-illust { max-width: 280px; margin: 0 auto; width: 100%; }
  .hero-illust svg { width: 100%; height: auto; }

  /* marquee — disable on small mobile to avoid overflow */
  .hero-marquee { margin-top: 40px; padding: 12px 0; }

  /* top-meta — collapse to one pill, smaller, on mobile */
  .top-meta {
    top: 10px; right: 10px; left: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .meta-pill { font-size: 10px; padding: 4px 10px; }
  .meta-pill--mono { display: none; }  /* hide "you are here" pill on mobile — saves space */
  #istClock { font-size: 11px; }

  /* boot chapter — add top padding so floating meta doesn't overlap */
  .chapter--boot { padding-top: 60px; }

  /* pillar grid */
  .pillar-grid { grid-template-columns: 1fr; gap: 16px; }
  .pillar { min-height: 0; padding: 22px 20px; }
  .pillar h3 { font-size: 19px; }
  .pillar-blurb { font-size: 14px; }
  .pillar-foot { font-size: 9px; }
  .pillar-illust svg { width: 100%; height: auto; }

  /* pillar reveal — auto-expand on mobile (hover doesn't work) */
  .pillar-reveal {
    max-height: 600px !important;
    opacity: 1 !important;
    margin-top: 12px !important;
  }
  .pillar-foot { display: none; }  /* no need for "click to expand" when already expanded */
  .proof-row { font-size: 12px; padding: 6px 0; }

  /* proof cards — all single-column on mobile */
  .proof-grid { gap: 14px; }
  .proof-card { padding: 22px 20px; }
  .proof-card.big,
  .proof-card.atc-card,
  .proof-card.hero-stat-card {
    grid-column: span 1 !important;
    width: 100% !important;
    max-width: 100%;
  }
  .proof-number { font-size: clamp(32px, 9vw, 48px); }
  .proof-unit { font-size: 15px; margin-left: 8px; }
  .proof-eyebrow { font-size: 10px; }
  .proof-meta { font-size: 12px; }

  /* brand mosaic */
  .brand-mosaic { grid-template-columns: 1fr; gap: 10px; }
  .brand-tile { padding: 16px 18px; }
  .brand-name { font-size: 14px; }

  /* process */
  .process-track { grid-template-columns: 1fr; gap: 14px; }
  .process-step { padding: 22px 20px; }

  /* fun */
  .fun-grid { grid-template-columns: 1fr; gap: 16px; }
  .fun-card { padding: 22px 20px; }
  .trust-wrap { flex-direction: column; align-items: flex-start; gap: 16px; }
  .trust-ring svg { width: 120px; height: 120px; }
  .trust-num > span:first-child { font-size: 28px; }
  .sign-board { min-height: 120px; padding: 28px 20px; font-size: 17px; }

  /* CTA */
  .cta-title { font-size: clamp(32px, 8vw, 48px); }
  .cta-buttons { flex-direction: column; align-items: stretch; }
  .cta-buttons .btn { justify-content: center; width: 100%; padding: 16px 20px; }
  .cta-buttons .btn-handle { display: none; }
  .cta-illust svg { width: 120px; height: 120px; }
  .cta-fineprint { font-size: 11px; padding: 0 12px; }

  /* live grid */
  .live-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .live-card { padding: 16px 14px; }
  .live-num { font-size: 22px; }
  .live-label { font-size: 10px; }

  /* footer */
  .footer-mark-big { font-size: 32px; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .footer-col a { padding: 8px 0; min-height: 44px; display: flex; align-items: center; }  /* tap target */
  .footer-fine { flex-direction: column; align-items: flex-start; gap: 8px; font-size: 10px; }

  /* FAB */
  .fab--wa { padding: 12px; }
  .fab--ig { right: 68px; padding: 12px; }

  /* tap target — bump small links/buttons to min 44px tap area */
  a { min-height: 0; }  /* don't force on every link, only specific ones */
  .btn { min-height: 44px; }
  .fab { min-width: 44px; min-height: 44px; }
  .meta-pill { min-height: 28px; }  /* pill itself is small by design, don't bloat */

  /* headings */
  h1, h2, h3 { word-wrap: break-word; overflow-wrap: anywhere; }
  .work-head h2, .proof-head h2, .brands-head h2, .how-head h2, .live-head h2 { font-size: clamp(28px, 7vw, 40px); }
}

/* SMALL PHONES (≤ 480px) — tighter spacing */
@media (max-width: 480px) {
  .container { padding: 0 14px; }
  .hero-title { font-size: 32px; }
  .hero-illust { max-width: 240px; }
  .live-grid { grid-template-columns: 1fr; }
  .live-card { padding: 16px 16px; }
  .proof-number { font-size: 32px; }
  .meta-pill { font-size: 9px; padding: 3px 8px; }
}

/* ============== reduce motion ============== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .reveal, .hero-row[data-stagger], .boot-reveal, .shayari-line[data-stagger] { opacity: 1; transform: none; }
  .marquee-track { animation: none; }
}