/* ============================================================
   DOLCELINO · Investor Experience
   Paper-white keynote minimalism · navy ink · pastel fleet
   ============================================================ */

:root {
  --paper: #FBFAF7;
  --paper-2: #F4F1EA;
  --ink: #18184A;
  --ink-soft: #40406E;
  --muted: #8B8BA3;
  --hairline: rgba(24, 24, 74, 0.08);
  --hairline-2: rgba(24, 24, 74, 0.14);

  --sky: #BFD9F2;
  --mint: #CDE8DA;
  --blush: #F4B8CE;
  --tang: #F29B52;
  --lilac: #D4BEE8;
  --butter: #F2DD9B;

  --ez: cubic-bezier(0.32, 0.72, 0, 1);
  --shadow-soft: 0 24px 70px -32px rgba(24, 24, 74, 0.22), 0 8px 24px -16px rgba(24, 24, 74, 0.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }

body {
  font-family: 'Switzer', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--paper-2);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

.num { font-variant-numeric: tabular-nums; }

/* Film grain */
.noise {
  position: fixed; inset: 0; z-index: 90; pointer-events: none; opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ============ App frame ============ */
#app {
  position: relative;
  height: 100dvh;
  max-width: 520px;
  margin: 0 auto;
  background: var(--paper);
  overflow: hidden;
}
@media (min-width: 560px) {
  #app { box-shadow: 0 0 0 1px var(--hairline), 0 40px 120px -40px rgba(24,24,74,.35); }
}

/* ============ Topbar ============ */
.topbar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 40;
  display: flex; align-items: center; gap: 14px;
  padding: calc(14px + env(safe-area-inset-top)) 20px 14px;
  transition: opacity .6s var(--ez), transform .6s var(--ez);
}
.topbar.hidden { opacity: 0; transform: translateY(-12px); pointer-events: none; }
.topbar.on-dark { color: #fff; }

.back {
  width: 34px; height: 34px; flex: 0 0 34px;
  display: grid; place-items: center;
  border: 1px solid var(--hairline-2); border-radius: 50%;
  background: rgba(251, 250, 247, 0.72);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  color: var(--ink); cursor: pointer;
  transition: opacity .5s var(--ez), transform .5s var(--ez);
}
.back svg { width: 18px; height: 18px; }
.back:active { transform: scale(0.92); }
.back.hidden { opacity: 0; pointer-events: none; }
.topbar.on-dark .back { background: rgba(24,24,74,.28); border-color: rgba(255,255,255,.25); color: #fff; }

.progress {
  flex: 1; height: 2px; border-radius: 2px;
  background: rgba(24, 24, 74, 0.1);
  overflow: hidden;
}
.topbar.on-dark .progress { background: rgba(255,255,255,.22); }
.progress-fill {
  height: 100%; width: 0%;
  background: var(--ink);
  border-radius: 2px;
  transition: width .8s var(--ez);
}
.topbar.on-dark .progress-fill { background: #fff; }

.stepcount {
  font-size: 10px; letter-spacing: 0.18em; font-weight: 500;
  color: var(--muted); font-variant-numeric: tabular-nums;
}
.topbar.on-dark .stepcount { color: rgba(255,255,255,.7); }

/* ============ Slides engine ============ */
.slide {
  position: absolute; inset: 0;
  overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  opacity: 0; pointer-events: none;
  transform: translateY(26px) scale(0.99);
  filter: blur(10px);
  transition: opacity .75s var(--ez), transform .75s var(--ez), filter .75s var(--ez);
  z-index: 1;
  display: flex; flex-direction: column;
  background: var(--paper);
}
.slide.active { opacity: 1; pointer-events: auto; transform: none; filter: none; z-index: 2; }
.slide.leaving { opacity: 0; transform: translateY(-26px) scale(0.99); filter: blur(10px); z-index: 3; }

.col {
  width: 100%; max-width: 460px; margin: 0 auto;
  padding: calc(76px + env(safe-area-inset-top)) 24px calc(40px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 18px;
  flex: 1;
}
.col.center { justify-content: center; padding-bottom: calc(90px + env(safe-area-inset-bottom)); }

/* Builds (keynote-style staggered reveals) */
[data-build] {
  opacity: 0;
  transform: translateY(30px);
  filter: blur(7px);
  transition: opacity .9s var(--ez), transform .9s var(--ez), filter .9s var(--ez);
}
[data-build].on { opacity: 1; transform: none; filter: none; }

/* ============ Typography ============ */
.eyebrow {
  align-self: flex-start;
  font-size: 10px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--ink-soft);
  padding: 7px 13px; border-radius: 999px;
  border: 1px solid var(--hairline-2);
  background: rgba(255, 255, 255, 0.5);
}
.eyebrow.light { color: rgba(255,255,255,.92); border-color: rgba(255,255,255,.3); background: rgba(255,255,255,.1); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }

.display {
  font-family: 'Clash Display', 'Switzer', sans-serif;
  font-weight: 600;
  font-size: clamp(30px, 8.6vw, 40px);
  line-height: 1.06;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.display em { font-style: normal; color: var(--tang); }
.display.light { color: #fff; }
.display.light em { color: var(--butter); }

.lede { font-size: 15.5px; line-height: 1.55; color: var(--ink-soft); max-width: 42ch; }
.lede.light { color: rgba(255, 255, 255, 0.88); }

.note { font-size: 13px; line-height: 1.55; color: var(--muted); }
.note strong { color: var(--ink-soft); font-weight: 600; }
.note.center-text { text-align: center; }

.micro { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 500; }
.micro.light { color: rgba(255, 255, 255, 0.65); }

.plain-link { color: var(--ink-soft); text-decoration: underline; text-underline-offset: 3px; }

/* ============ CTA — pill with nested icon ============ */
.cta {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 12px;
  padding: 9px 9px 9px 24px;
  border: none; border-radius: 999px;
  background: var(--ink); color: #fff;
  font-family: inherit; font-size: 15px; font-weight: 500; letter-spacing: 0.01em;
  cursor: pointer; text-decoration: none;
  box-shadow: 0 18px 44px -18px rgba(24, 24, 74, 0.55);
  transition: transform .5s var(--ez), box-shadow .5s var(--ez);
}
.cta:active { transform: scale(0.97); }
.cta-ic {
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  display: grid; place-items: center;
  transition: transform .5s var(--ez), background .5s var(--ez);
}
.cta-ic svg { width: 17px; height: 17px; }
.cta:hover .cta-ic { transform: translateY(2px); background: rgba(255,255,255,.22); }

.cta.light { background: rgba(251, 250, 247, 0.96); color: var(--ink); box-shadow: 0 18px 44px -14px rgba(0,0,0,.4); }
.cta.light .cta-ic { background: rgba(24, 24, 74, 0.08); }

.cta.whatsapp { background: #1FAD58; align-self: stretch; justify-content: center; padding: 12px 12px 12px 24px; font-size: 16px; box-shadow: 0 18px 44px -16px rgba(31, 173, 88, 0.6); }
.cta.whatsapp .cta-ic { width: 38px; height: 38px; background: rgba(255,255,255,.18); }
.cta.whatsapp .cta-ic svg { width: 20px; height: 20px; }

/* ============ Double-bezel shells ============ */
.shell {
  background: rgba(24, 24, 74, 0.045);
  border: 1px solid var(--hairline);
  border-radius: 26px;
  padding: 6px;
  display: flex;
}
.shell .core {
  flex: 1; width: 100%;
  background: #fff;
  border-radius: 20px;
  padding: 18px;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.9), 0 1px 0 rgba(24, 24, 74, 0.03);
}
.shell.tinted .core { background: linear-gradient(135deg, #FFFDF8, #F6F9FD); }
.shell.mint .core { background: linear-gradient(135deg, #F2FBF6, #E7F6EE); }

/* ============ Bento stats ============ */
.bento { display: flex; flex-wrap: wrap; gap: 10px; }
.bento .shell { flex: 1 1 100%; }
.bento .shell.half { flex: 1 1 calc(50% - 5px); }
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat-n {
  font-family: 'Clash Display', sans-serif; font-weight: 600;
  font-size: 32px; line-height: 1; letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.stat-n small { font-size: 18px; color: var(--muted); font-weight: 500; }
.stat-l { font-size: 12px; color: var(--muted); line-height: 1.4; }

.quote p { font-family: 'Clash Display', sans-serif; font-weight: 500; font-size: 19px; line-height: 1.3; margin-bottom: 10px; }
.quote span { font-size: 11.5px; color: var(--muted); line-height: 1.5; display: block; }

/* ============ Hero ============ */
.slide-hero { background: var(--ink); }
.hero-video, .photo-bg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 0;
}
.hero-shade {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(24,24,74,.5) 0%, rgba(24,24,74,.12) 38%, rgba(16,16,52,.78) 82%, rgba(16,16,52,.92) 100%);
}
.hero-col { position: relative; z-index: 2; justify-content: space-between; padding-top: calc(28px + env(safe-area-inset-top)); }
.hero-top { display: flex; justify-content: center; }
.hero-logo { width: 190px; height: auto; filter: drop-shadow(0 6px 24px rgba(0,0,0,.35)); }
.hero-bottom { display: flex; flex-direction: column; gap: 16px; }

/* ============ Photo slides ============ */
.slide-photo { background: var(--ink); }
.photo-shade {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(16,16,52,.46) 0%, rgba(16,16,52,.1) 40%, rgba(16,16,52,.82) 85%, rgba(16,16,52,.94) 100%);
}
.photo-col { position: relative; z-index: 2; justify-content: flex-end; gap: 14px; }

.pricebar {
  display: flex; align-items: baseline; gap: 12px;
  padding: 14px 18px; border-radius: 18px;
  background: rgba(251, 250, 247, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  align-self: flex-start;
}
.pricebar-n { font-family: 'Clash Display', sans-serif; font-weight: 600; font-size: 34px; color: #fff; font-variant-numeric: tabular-nums; }
.pricebar-l { font-size: 12.5px; color: rgba(255,255,255,.75); }

/* ============ Options (question buttons) ============ */
.options { display: flex; flex-direction: column; gap: 10px; }
.option {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; text-align: left;
  padding: 18px 22px;
  font-family: inherit; font-size: 16.5px; font-weight: 500; color: var(--ink);
  background: #fff;
  border: 1px solid var(--hairline-2);
  border-radius: 20px;
  cursor: pointer;
  box-shadow: 0 10px 30px -22px rgba(24, 24, 74, 0.35);
  transition: transform .45s var(--ez), border-color .45s var(--ez), background .45s var(--ez), box-shadow .45s var(--ez);
}
.option small { font-size: 12.5px; color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; white-space: nowrap; }
.option:active { transform: scale(0.97); }
.option.picked {
  background: var(--ink); color: #fff; border-color: var(--ink);
  box-shadow: 0 18px 40px -18px rgba(24, 24, 74, 0.6);
}
.option.picked small { color: rgba(255, 255, 255, 0.65); }
.option.dimmed { opacity: 0.38; transform: scale(0.985); }

/* ============ Deal flow ============ */
.flow { display: flex; flex-direction: column; gap: 8px; }
.flow-row { display: flex; align-items: baseline; gap: 12px; }
.flow-n { font-family: 'Clash Display', sans-serif; font-weight: 600; font-size: 40px; letter-spacing: -0.01em; }
.flow-l { font-size: 13px; color: var(--muted); }
.flow-minus {
  font-size: 12.5px; color: var(--muted);
  padding-left: 14px; border-left: 2px solid var(--hairline-2);
  margin: 2px 0 2px 6px;
}
.flow-split { display: flex; gap: 10px; margin-top: 8px; }
.flow-split .shell { flex: 1; }
.split-card { display: flex; flex-direction: column; gap: 3px; padding: 16px; }
.split-n { font-family: 'Clash Display', sans-serif; font-weight: 600; font-size: 24px; }
.split-n.dim { color: var(--muted); }
.split-l { font-size: 11.5px; color: var(--muted); }

/* ============ Simulator ============ */
.simu-card { display: flex; flex-direction: column; gap: 16px; padding: 20px 18px; }
.simu-head { display: flex; align-items: center; justify-content: space-between; }
.simu-rate { font-family: 'Clash Display', sans-serif; font-weight: 600; font-size: 44px; line-height: 1; }
.simu-badge {
  font-size: 10px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  padding: 6px 11px; border-radius: 999px;
  background: var(--paper-2); color: var(--ink-soft);
  transition: background .5s var(--ez), color .5s var(--ez);
}
.simu-badge.hot { background: var(--mint); color: #1D5C3C; }

#simuSlider {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px; border-radius: 999px;
  background: linear-gradient(90deg, var(--ink) 40%, rgba(24,24,74,.12) 40%);
  outline: none;
}
#simuSlider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--ink);
  border: 4px solid #fff;
  box-shadow: 0 6px 18px -4px rgba(24, 24, 74, 0.5);
  cursor: grab;
  transition: transform .3s var(--ez);
}
#simuSlider:active::-webkit-slider-thumb { transform: scale(1.15); cursor: grabbing; }
#simuSlider::-moz-range-thumb {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--ink); border: 4px solid #fff;
  box-shadow: 0 6px 18px -4px rgba(24, 24, 74, 0.5);
}

.simu-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.simu-cell { display: flex; flex-direction: column; gap: 2px; }
.simu-n { font-family: 'Clash Display', sans-serif; font-weight: 600; font-size: 19px; letter-spacing: -0.01em; }
.simu-n.accent { color: #1D7A4C; }
.simu-l { font-size: 10.5px; color: var(--muted); letter-spacing: 0.04em; }
.simu-foot { font-size: 12px; color: var(--ink-soft); padding-top: 10px; border-top: 1px solid var(--hairline); }

/* ============ Charts ============ */
.chart-card { display: flex; flex-direction: column; gap: 10px; padding: 20px 16px 14px; }
.bars {
  position: relative;
  display: flex; align-items: flex-end; gap: 5px;
  height: 150px;
}
.bar {
  flex: 1; border-radius: 6px 6px 3px 3px;
  background: var(--sky);
  transform-origin: bottom;
  transform: scaleY(0.02);
  transition: transform 1s var(--ez);
}
.bar.peak { background: var(--tang); }
.bars.on .bar { transform: scaleY(1); }
.avg-line {
  position: absolute; left: 0; right: 0; bottom: 55%;
  border-top: 1.5px dashed var(--hairline-2);
  z-index: 2; pointer-events: none;
}
.avg-line span {
  position: absolute; right: 0; top: -20px;
  font-size: 10px; font-weight: 600; color: var(--ink-soft);
  background: rgba(255,255,255,.85); padding: 2px 7px; border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.bar-labels { display: flex; gap: 5px; }
.bar-labels span { flex: 1; text-align: center; font-size: 9px; color: var(--muted); letter-spacing: 0.05em; }
.chart-foot { font-size: 12px; color: var(--muted); padding-top: 8px; border-top: 1px solid var(--hairline); }
.chart-foot .num { color: var(--ink); font-weight: 600; }

/* Payback curve */
.curve { width: 100%; height: auto; display: block; }
.curve-dash { stroke: var(--hairline-2); stroke-width: 1.5; stroke-dasharray: 4 5; }
.curve-tag { font-size: 9px; fill: var(--muted); letter-spacing: 0.06em; }
.curve-line { stroke-width: 2.5; stroke-linecap: round; }
.curve-line.main { stroke: var(--ink); }
.curve-line.prudent { stroke: var(--hairline-2); stroke-width: 2; }
.curve-dot { fill: var(--tang); opacity: 0; transition: opacity .5s var(--ez) 1.6s; }
.curve-label { font-size: 10px; font-weight: 600; fill: var(--tang); opacity: 0; transition: opacity .5s var(--ez) 1.7s; }
.chart-card.on .curve-dot, .chart-card.on .curve-label { opacity: 1; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; }
.leg { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.leg::before { content: ''; width: 14px; height: 2.5px; border-radius: 2px; background: var(--hairline-2); }
.leg.main::before { background: var(--ink); }

.years { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.year { display: flex; flex-direction: column; gap: 2px; padding: 14px 4px; border-top: 1px solid var(--hairline-2); }
.year-n { font-family: 'Clash Display', sans-serif; font-weight: 600; font-size: 19.5px; letter-spacing: -0.02em; }
.year-n.accent { color: var(--tang); }
.year-l { font-size: 10.5px; color: var(--muted); }

/* ============ Who pays what ============ */
.who-card { display: flex; flex-direction: column; gap: 12px; }
.who-head { display: flex; justify-content: space-between; align-items: baseline; }
.who-head span:first-child { font-family: 'Clash Display', sans-serif; font-weight: 600; font-size: 19px; }
.who-total { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.who-card ul { list-style: none; display: flex; flex-direction: column; }
.who-card li {
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 13px; color: var(--ink-soft);
  padding: 9px 0; border-top: 1px solid var(--hairline);
}
.who-card li .num { color: var(--ink); font-weight: 500; white-space: nowrap; }

/* ============ Batch dots ============ */
.batch-dots { display: flex; gap: 9px; }
.batch-dots span {
  width: 26px; height: 26px; border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.batch-dots span:nth-child(1) { background: var(--tang); border-color: transparent; }
.batch-dots span:nth-child(2) { background: var(--blush); border-color: transparent; }
.batch-dots span:nth-child(3) { background: var(--mint); border-color: transparent; }
.batch-dots span:nth-child(4) { background: var(--sky); border-color: transparent; }
.batch-dots span:nth-child(5) { background: var(--lilac); border-color: transparent; }
.batch-dots span:nth-child(6) { background: var(--butter); border-color: transparent; }
.batch-dots span:nth-child(7) { background: #F2B8A0; border-color: transparent; }
.batch-dots span:nth-child(8) { background: #9FC9E8; border-color: transparent; }

/* ============ Final ============ */
.recap { display: flex; flex-direction: column; }
.recap-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 12px 2px; border-top: 1px solid var(--hairline);
  font-size: 14px;
}
.recap-row:first-child { border-top: none; }
.recap-row span { color: var(--muted); }
.recap-row strong { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }

.field input {
  width: 100%;
  font-family: inherit; font-size: 16px; color: var(--ink);
  padding: 16px 20px;
  background: #fff;
  border: 1px solid var(--hairline-2);
  border-radius: 18px;
  outline: none;
  transition: border-color .4s var(--ez), box-shadow .4s var(--ez);
}
.field input:focus { border-color: var(--ink-soft); box-shadow: 0 0 0 4px rgba(24, 24, 74, 0.06); }
.field input::placeholder { color: var(--muted); }

.legal {
  font-size: 10px; line-height: 1.6; color: var(--muted);
  text-align: center;
  padding-top: 18px; margin-top: auto;
  border-top: 1px solid var(--hairline);
}

/* ============ Car crossing ============ */
.car-layer {
  position: absolute; left: 0; right: 0; bottom: 9%;
  z-index: 30; pointer-events: none;
  opacity: 0;
}
.car {
  width: 140px; height: auto;
  transform: translateX(-180px);
}
.car-layer.drive { opacity: 1; }
.car-layer.drive .car {
  animation: drive 1.35s cubic-bezier(0.45, 0.05, 0.3, 0.95) forwards;
}
@keyframes drive {
  0%   { transform: translateX(-180px) translateY(0); }
  20%  { transform: translateX(15vw) translateY(-2px); }
  45%  { transform: translateX(45vw) translateY(1px); }
  70%  { transform: translateX(75vw) translateY(-2px); }
  100% { transform: translateX(120vw) translateY(0); }
}
.car-layer.drive .wheel { animation: spin 0.5s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ Reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
  .slide, [data-build], .bar, .progress-fill, .option, .cta { transition-duration: 0.01s !important; }
  .car-layer.drive .car, .car-layer.drive .wheel { animation: none; }
  .car-layer { display: none; }
  .hero-video { display: none; }
}
