/* ==========================================================================
   COCOON CANDIDATE APP — canvas + screen labels + shared helpers
   ========================================================================== */

/* Design tokens (colors_and_type.css) are linked directly in index.html <head>
   before this file — no @import chain, so both stylesheets load in parallel. */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: #E8E3D5; font-family: var(--font-sans); color: var(--cocoon-ink); }

/* ---------- Canvas ---------- */
.canvas {
  min-height: 100vh;
  padding: 56px 56px 96px;
}
.canvas-head {
  max-width: 980px;
  margin: 0 auto 56px;
  border-bottom: 1px solid var(--cocoon-ink);
  padding-bottom: 28px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 64px;
  align-items: end;
}
.canvas-head .chap {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--cocoon-graphite); margin: 0 0 16px;
}
.canvas-head h1 {
  font-family: var(--font-serif); font-weight: 400;
  font-size: clamp(56px, 7vw, 96px); line-height: 0.94; letter-spacing: -0.02em;
  margin: 0; color: var(--cocoon-ink);
}
.canvas-head h1 em { font-style: italic; color: var(--cocoon-graphite); }
.canvas-head p {
  font-family: var(--font-sans); font-size: 16px; line-height: 1.55;
  color: var(--cocoon-graphite); margin: 0;
}

/* Flow rail */
.flow {
  margin-bottom: 96px;
}
.flow-head {
  max-width: 1320px;
  margin: 0 auto 32px;
  display: flex; align-items: center; gap: 24px;
}
.flow-head .num {
  font-family: var(--font-serif); font-size: 72px; line-height: 0.85;
  color: var(--cocoon-yellow);
  width: 88px; flex-shrink: 0; text-align: center;
}
.flow-head .info { flex: 1; }
.flow-head .info h2 {
  font-family: var(--font-serif); font-weight: 400;
  font-size: 44px; line-height: 1; letter-spacing: -0.015em;
  margin: 0 0 6px; color: var(--cocoon-ink);
}
.flow-head .info p {
  font-family: var(--font-sans); font-size: 15px; line-height: 1.5;
  color: var(--cocoon-graphite); margin: 0; max-width: 60ch;
}
.flow-head .meta {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--cocoon-mid);
  flex-shrink: 0;
}

.rail {
  display: flex;
  gap: 32px;
  overflow-x: auto;
  padding: 12px 56px 28px;
  margin: 0 -56px;
  scroll-snap-type: x mandatory;
  scroll-padding-left: 56px;
}
.rail::-webkit-scrollbar { height: 8px; }
.rail::-webkit-scrollbar-thumb { background: rgba(31,36,33,0.18); border-radius: 999px; }

/* Screen card */
.screen-card {
  flex-shrink: 0;
  scroll-snap-align: start;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.screen-card .lbl {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--cocoon-graphite);
  display: flex; align-items: center; gap: 10px;
}
.screen-card .lbl .step {
  display: inline-grid; place-items: center;
  width: 22px; height: 22px; border-radius: 999px;
  background: var(--cocoon-ink); color: var(--cocoon-yellow);
  font-size: 10px; font-weight: 700; letter-spacing: 0;
}
.screen-card .title {
  font-family: var(--font-serif); font-size: 17px; color: var(--cocoon-ink);
  font-weight: 400; letter-spacing: -0.01em;
}

/* Bottom tab bar (reusable inside screens) */
.tabbar {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  padding: 10px 6px 30px;
  background: var(--cocoon-paper);
  border-top: 0.5px solid rgba(31,36,33,0.10);
  overflow: visible; z-index: 30;
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 6px 0; cursor: pointer; border: none; background: none;
}
.tab-center { justify-content: flex-start; }
.tab-bf {
  width: 74px; height: 74px; border-radius: 50%;
  display: grid; place-items: center; margin-top: -42px;
  background: var(--cocoon-ink); border: 5px solid var(--cocoon-paper);
  box-shadow: 0 4px 14px rgba(31,36,33,0.22);
  transition: transform 160ms;
}
.tab-center:active .tab-bf { transform: scale(0.94); }
.tab svg { width: 24px; height: 24px; color: var(--cocoon-mid); }
.tab .tab-l {
  font-size: 10px; font-weight: 500; color: var(--cocoon-mid);
  font-family: -apple-system, system-ui; white-space: nowrap;
}
.tab.active svg { color: var(--cocoon-ink); }
.tab.active .tab-l { color: var(--cocoon-ink); font-weight: 600; }

/* ---------- Inside-screen primitives ---------- */
.app-bg-paper { background: var(--cocoon-paper); }
.app-bg-cream { background: var(--cocoon-cream); }

.scr {
  position: absolute; inset: 0;
  padding-top: 54px;            /* status bar safe area */
  padding-bottom: 84px;         /* tab bar safe area */
  overflow: hidden;
}
.scr.no-tab { padding-bottom: 34px; }

.scr-inner {
  height: 100%;
  overflow-y: auto;
  padding: 12px 20px 8px;
}
.scr-inner::-webkit-scrollbar { display: none; }

/* Headers */
.scr-h-eyebrow {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--cocoon-graphite); margin-bottom: 6px;
}
.scr-h-title {
  font-family: var(--font-serif); font-weight: 400;
  font-size: 32px; line-height: 1.02; letter-spacing: -0.018em;
  color: var(--cocoon-ink); margin: 0;
}
.scr-h-title em { font-style: italic; color: var(--cocoon-graphite); }
.scr-h-sub {
  font-size: 13px; line-height: 1.45; color: var(--cocoon-graphite);
  margin: 8px 0 0;
}

/* Buttons */
.app-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; cursor: pointer;
  font-family: -apple-system, system-ui; font-weight: 600; font-size: 15px;
  padding: 14px 22px; border-radius: 999px;
  transition: opacity 150ms ease;
}
.app-btn:active { opacity: 0.7; }
.app-btn-primary { background: var(--cocoon-yellow); color: var(--cocoon-ink); }
.app-btn-ink { background: var(--cocoon-ink); color: var(--cocoon-cream); }
.app-btn-ghost { background: transparent; color: var(--cocoon-ink); border: 1px solid var(--cocoon-ink); }
.app-btn-block { width: 100%; }

/* Chip */
.app-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 500; color: var(--cocoon-ink);
  background: #fff; border: 1px solid var(--cocoon-border);
  font-family: -apple-system, system-ui;
}
.app-chip.yellow { background: var(--cocoon-yellow); border-color: var(--cocoon-yellow); }
.app-chip.ink { background: var(--cocoon-ink); color: var(--cocoon-cream); border-color: var(--cocoon-ink); }

/* Card */
.app-card {
  background: #fff; border-radius: 18px; padding: 16px;
  border: 1px solid var(--cocoon-border);
}
.app-card.ink {
  background: var(--cocoon-ink); color: var(--cocoon-cream);
  border-color: var(--cocoon-ink);
}

/* Animated mic */
@keyframes pulseRing {
  0%, 100% { transform: scale(1); opacity: 0.55; }
  50% { transform: scale(1.15); opacity: 0.25; }
}
@keyframes waveBar {
  0%, 100% { transform: scaleY(0.35); }
  50%      { transform: scaleY(1); }
}
.waveform {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  height: 64px;
}
.waveform span {
  display: inline-block; width: 4px; height: 100%;
  background: var(--cocoon-ink); border-radius: 999px;
  transform-origin: center;
  animation: waveBar 1.1s var(--ease-in-out) infinite;
}
.waveform.yellow span { background: var(--cocoon-yellow); }
.waveform span:nth-child(1)  { animation-delay: 0.00s; }
.waveform span:nth-child(2)  { animation-delay: 0.06s; }
.waveform span:nth-child(3)  { animation-delay: 0.12s; }
.waveform span:nth-child(4)  { animation-delay: 0.18s; }
.waveform span:nth-child(5)  { animation-delay: 0.24s; }
.waveform span:nth-child(6)  { animation-delay: 0.30s; }
.waveform span:nth-child(7)  { animation-delay: 0.36s; }
.waveform span:nth-child(8)  { animation-delay: 0.42s; }
.waveform span:nth-child(9)  { animation-delay: 0.48s; }
.waveform span:nth-child(10) { animation-delay: 0.54s; }
.waveform span:nth-child(11) { animation-delay: 0.60s; }
.waveform span:nth-child(12) { animation-delay: 0.66s; }
.waveform span:nth-child(13) { animation-delay: 0.72s; }
.waveform span:nth-child(14) { animation-delay: 0.78s; }
.waveform span:nth-child(15) { animation-delay: 0.84s; }
.waveform span:nth-child(16) { animation-delay: 0.90s; }
.waveform span:nth-child(17) { animation-delay: 0.78s; }
.waveform span:nth-child(18) { animation-delay: 0.66s; }
.waveform span:nth-child(19) { animation-delay: 0.54s; }
.waveform span:nth-child(20) { animation-delay: 0.42s; }
.waveform span:nth-child(21) { animation-delay: 0.30s; }
.waveform span:nth-child(22) { animation-delay: 0.18s; }
.waveform span:nth-child(23) { animation-delay: 0.06s; }
.waveform span:nth-child(24) { animation-delay: 0.00s; }

.pulse-ring {
  position: absolute; inset: 0;
  border-radius: 50%; border: 2px solid var(--cocoon-yellow);
  animation: pulseRing 1.8s var(--ease-in-out) infinite;
}
.pulse-ring.delay { animation-delay: 0.6s; }

/* ===== Push-to-start butterfly button ===== */
.push-btn {
  position: relative;
  width: 188px; height: 188px;
  border: 0; background: none; cursor: pointer;
  display: grid; place-items: center;
  -webkit-tap-highlight-color: transparent;
}
.push-btn .pulse-ring { inset: 0; }
.push-disc {
  position: relative; z-index: 2;
  width: 188px; height: 188px; border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 50% 38%, rgba(252,210,9,0.18) 0%, rgba(252,210,9,0.06) 60%, rgba(252,210,9,0) 72%);
  border: 1.5px solid rgba(252,210,9,0.45);
  transition: transform 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
}
.push-disc-ink {
  background: var(--cocoon-ink);
  border: 0;
  box-shadow: 0 18px 44px rgba(31,36,33,0.34);
}
.push-btn:hover .push-disc { transform: scale(1.04); }
.push-btn:active .push-disc { transform: scale(0.96); }

@keyframes butterflyBreathe {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.06); }
}

/* Pressable job cards — make tappability obvious */
.job-card:hover {
  border-color: var(--cocoon-ink) !important;
  box-shadow: 0 8px 22px rgba(31,36,33,0.10);
  transform: translateY(-2px);
}
.job-card:hover .job-card-arrow { transform: translateX(3px); }
.job-card:active { transform: translateY(0) scale(0.99); }

@keyframes storyFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-10px) rotate(-2deg); }
}

/* ============ SPLASH — brand emergence ============ */
.splash-disc {
  position: relative;
  width: 168px; height: 168px;
  border-radius: 50%;
  background: var(--cocoon-ink);
  display: grid; place-items: center;
  box-shadow: 0 24px 60px rgba(31,36,33,0.32);
  animation: splashDisc 900ms var(--ease-out) both;
}
.splash-bf {
  transform-origin: 50% 60%;
  animation: splashBloom 1100ms var(--ease-out) 240ms both,
             splashFlutter 2.6s var(--ease-in-out) 1340ms infinite;
}
.splash-word {
  animation: splashRise 760ms var(--ease-out) 620ms both;
}
.splash-tag {
  animation: splashRise 760ms var(--ease-out) 900ms both;
}
.splash-ring {
  position: absolute; left: 50%; top: 50%;
  width: 168px; height: 168px; margin: -84px 0 0 -84px;
  border-radius: 50%;
  border: 1.5px solid rgba(31,36,33,0.28);
  opacity: 0;
  animation: splashPulse 2.8s var(--ease-out) infinite;
}
.splash-ring.r1 { animation-delay: 1.2s; }
.splash-ring.r2 { animation-delay: 1.9s; }
.splash-ring.r3 { animation-delay: 2.6s; }

@keyframes splashDisc {
  0%   { transform: scale(0.6); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes splashBloom {
  0%   { transform: scale(0.2) rotate(-18deg); opacity: 0; filter: brightness(0.4); }
  60%  { opacity: 1; filter: brightness(1); }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
@keyframes splashFlutter {
  0%, 100% { transform: scaleX(1)    translateY(0); }
  50%      { transform: scaleX(0.82) translateY(-3px); }
}
@keyframes splashRise {
  0%   { transform: translateY(16px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}
@keyframes splashPulse {
  0%   { transform: scale(1);   opacity: 0.5; }
  100% { transform: scale(2.3); opacity: 0; }
}
