/* zaile.app home page: live mockups, sticky story, rolling digits. */

:root {
  --bezel: #121013;
  --map-land: #efe9e4;
  --map-park: #dfe8d6;
  --map-water: #d6e4ee;
  --map-road: #ffffff;
  --you: #3a6ea5;
  --shadow: 0 30px 60px -30px rgba(42, 26, 32, 0.35), 0 8px 20px -12px rgba(42, 26, 32, 0.18);
  --ease: cubic-bezier(.2, .8, .2, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bezel: #050405;
    --map-land: #221c1f;
    --map-park: #1f2a1f;
    --map-water: #1a2530;
    --map-road: #3a3135;
    --you: #7fa8d6;
    --shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.06);
  }
}

body { overflow-x: clip; }
.site-header { position: sticky; top: 0; z-index: 50; transition: border-color .3s; }
.site-header:not(.scrolled) { border-bottom-color: transparent; }

/* ---------- Rolling digits ---------- */
.roll { display: inline-flex; font-variant-numeric: tabular-nums; }
.roll .slot { display: inline-block; height: 1em; line-height: 1em; overflow: hidden; }
.roll .col { display: flex; flex-direction: column; transition: transform .65s var(--ease); will-change: transform; }
.roll .col span { height: 1em; line-height: 1em; text-align: center; }
.roll .sep { display: inline-block; line-height: 1em; }
.no-motion .roll .col { transition: none; }

/* ---------- Fit: scale fixed-size compositions into their box ---------- */
.fit { position: relative; width: 100%; height: 100%; }
.fit > .fit-inner { position: absolute; left: 50%; top: 50%; transform-origin: 50% 50%; }

/* ---------- Device ---------- */
.device {
  position: relative; width: 300px; height: 620px; border-radius: 54px; background: var(--bezel);
  padding: 10px; box-shadow: var(--shadow);
}
.device .screen {
  position: relative; width: 100%; height: 100%; border-radius: 44px; overflow: hidden;
  background: var(--bg); color: var(--ink); font-family: var(--sans);
}
.island {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 5;
  width: 96px; height: 28px; border-radius: 20px; background: #000; color: #fff; overflow: hidden;
  transition: width .55s var(--ease), height .55s var(--ease), border-radius .55s var(--ease);
}
.island .la { opacity: 0; transition: opacity .25s; padding: 12px 16px; font-size: 11px; }
.island.open { width: 266px; height: 74px; border-radius: 30px; }
.island.open .la { opacity: 1; transition-delay: .25s; }
.la-row { display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; }
.la-row b { font-family: var(--rounded); font-size: 15px; font-weight: 700; }
.la-row .k { color: #f2a7b8; }
.la-bar { position: relative; height: 5px; margin-top: 9px; border-radius: 3px; background: rgba(255,255,255,.18); }
.la-bar i { position: absolute; top: 0; bottom: 0; border-radius: 3px; }
.la-bar .a { left: 0; background: #8fb4dc; }
.la-bar .b { right: 0; background: #e0607f; }
.statusbar {
  display: flex; justify-content: space-between; align-items: center; height: 48px; padding: 0 26px 0 30px;
  font-size: 13px; font-weight: 600;
}
.statusbar .icons { display: flex; gap: 5px; align-items: center; }
.statusbar .icons i { display: block; background: currentColor; border-radius: 2px; }

/* App screen (matches the app's refreshed design) */
.app { padding: 6px 18px 18px; display: flex; flex-direction: column; height: calc(100% - 48px); }
.app-top { display: flex; justify-content: space-between; align-items: center; height: 34px; color: var(--muted); }
.app-top .t { font-size: 15px; font-weight: 650; color: var(--ink); }
.app-top svg { width: 20px; height: 20px; }
.hero-days { text-align: center; margin-top: 36px; }
.hero-days .n { font-family: var(--rounded); font-weight: 800; font-size: 112px; letter-spacing: -0.04em; line-height: 1; display: inline-flex; }
.hero-days .l { margin-top: 6px; font-size: 17px; font-weight: 600; color: var(--muted); }
.units { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 30px; }
.unit { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px 0 10px; text-align: center; }
.unit .v { font-family: var(--rounded); font-size: 26px; font-weight: 700; line-height: 1; display: inline-flex; }
.unit .l { margin-top: 6px; font-size: 11px; font-weight: 600; color: var(--muted); }
.when { margin-top: 18px; text-align: center; font-size: 13px; color: var(--muted); position: relative; }
.when b { display: block; color: var(--ink); font-weight: 600; font-size: 14px; margin-bottom: 2px; transition: color .3s; }
.when b.flash { color: var(--accent); }
.app-cta {
  margin-top: auto; height: 48px; border-radius: 14px; background: var(--accent); color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 650; font-size: 15px;
}
.app-cta svg { width: 16px; height: 16px; }
.tap {
  position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%;
  background: var(--accent); opacity: 0; transform: scale(.4); pointer-events: none;
}
.tap.go { animation: tap .7s var(--ease); }
@keyframes tap { 0% { opacity: .35; transform: scale(.4); } 100% { opacity: 0; transform: scale(1.6); } }
.toast {
  position: absolute; left: 14px; right: 14px; top: 50px; z-index: 4; background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; padding: 10px 12px; display: flex; gap: 10px; align-items: center; font-size: 12px;
  box-shadow: 0 10px 24px -14px rgba(0,0,0,.35); transform: translateY(-120%); opacity: 0;
  transition: transform .5s var(--ease), opacity .3s;
}
.toast.show { transform: none; opacity: 1; }
.toast img { width: 26px; height: 26px; border-radius: 6px; }
.toast b { display: block; font-size: 12px; }

/* ---------- Hero ---------- */
.hero2 { padding: 56px 0 24px; }
.hero2 .wrap { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 40px; align-items: center; }
.hero2 h1 { font-size: clamp(2.4rem, 5.6vw, 4.1rem); font-weight: 800; letter-spacing: -0.035em; line-height: 1.02; max-width: 12ch; }
.hero2 h1 .acc { color: var(--accent); }
.hero2 .lede { margin-top: 20px; font-size: clamp(1.05rem, 1.4vw, 1.2rem); max-width: 38ch; }
.hero-stage { height: min(640px, 78vh); min-height: 460px; }
.live-line {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 30px; padding: 8px 14px 8px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); font-size: 14px; color: var(--muted);
}
.live-line .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.live-line b { color: var(--ink); font-family: var(--rounded); font-weight: 700; display: inline-flex; }

/* Entrance */
.enter { opacity: 0; transform: translateY(14px); }
.ready .enter { opacity: 1; transform: none; transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: calc(var(--i, 0) * 80ms); }
.enter-device { opacity: 0; transform: translateY(30px) scale(.96); }
.ready .enter-device { opacity: 1; transform: none; transition: opacity .9s var(--ease) .15s, transform 1.1s var(--ease) .15s; }

/* ---------- Story (sticky) ---------- */
.story { position: relative; margin-top: 40px; }
.story-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 40px; }
.steps { position: relative; z-index: 1; }
.step { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 40px 0; }
.step .num { font-family: var(--rounded); font-weight: 700; font-size: 15px; color: var(--accent); }
.step h2 { margin-top: 10px; font-size: clamp(1.8rem, 3.4vw, 2.7rem); font-weight: 800; letter-spacing: -0.03em; max-width: 14ch; }
.step p { margin-top: 14px; color: var(--muted); font-size: 1.08rem; max-width: 38ch; }
.step ul { margin-top: 18px; list-style: none; display: grid; gap: 8px; }
.step li { padding-left: 22px; position: relative; color: var(--ink); }
.step li::before { content: ""; position: absolute; left: 2px; top: .6em; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); }
.step .copy { opacity: .25; transform: translateY(10px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.step.on .copy { opacity: 1; transform: none; }

.stage-col { position: relative; }
.stage { position: sticky; top: 64px; height: calc(100vh - 64px); }
.scene { position: absolute; inset: 0; opacity: 0; visibility: hidden; transform: scale(.97) translateY(16px);
  transition: opacity .6s var(--ease), transform .7s var(--ease), visibility 0s .7s; }
.scene.on { opacity: 1; visibility: visible; transform: none; transition: opacity .6s var(--ease), transform .7s var(--ease), visibility 0s; }

/* Scene: two phones */
.pair { position: relative; width: 620px; height: 640px; }
.pair .device { position: absolute; top: 10px; transform-origin: top center; }
.pair .device.a { left: 0; transform: rotate(-3deg) scale(.84); }
.pair .device.b { right: 0; transform: rotate(3deg) scale(.84); top: 44px; }
.sync-line { position: absolute; left: 50%; top: 300px; width: 80px; margin-left: -40px; height: 2px; z-index: 6; overflow: hidden; }
.sync-line i { position: absolute; top: 0; height: 2px; width: 40px; background: var(--accent); border-radius: 2px; left: -40px; }
.sync-line.go i { animation: sync .7s var(--ease); }
@keyframes sync { to { left: 80px; } }

/* Scene: home screen */
.home { padding: 0 16px; }
.wall { position: absolute; inset: 0; background: var(--accent-soft); }
.home .statusbar, .home .grid { position: relative; }
.w-med {
  position: relative; background: var(--surface); border-radius: 24px; padding: 16px 16px 14px; margin-top: 8px;
  box-shadow: 0 1px 0 var(--line);
}
.w-head { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 650; }
.w-head svg { width: 14px; height: 14px; color: var(--accent); }
.w-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.w-nums { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 12px; }
.w-nums > div { text-align: center; }
.w-nums .v { font-family: var(--rounded); font-weight: 800; font-size: 34px; line-height: 1; display: inline-flex; }
.w-nums .l { font-size: 10px; font-weight: 600; color: var(--muted); margin-top: 4px; }
.w-nums > div + div { border-left: 1px solid var(--line); }
.row2 { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 14px; margin-top: 14px; }
.w-small { background: var(--accent); color: var(--accent-ink); border-radius: 24px; padding: 14px; aspect-ratio: 1; display: flex; flex-direction: column; }
.w-small .w-head svg { color: currentColor; }
.w-small .v { font-family: var(--rounded); font-weight: 800; font-size: 54px; line-height: 1; margin-top: auto; display: inline-flex; }
.w-small .l { font-size: 12px; font-weight: 650; opacity: .85; }
.icons4 { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 14px; min-width: 0; }
.icons-row { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-top: 16px; }
.icons-row i { display: block; aspect-ratio: 1; border-radius: 16px; background: var(--surface); opacity: .6; }
.icons-row i:nth-child(odd) { opacity: .8; }
.icons4 i { display: block; aspect-ratio: 1; border-radius: 16px; background: var(--surface); opacity: .9; }
.icons4 i:nth-child(2) { opacity: .7; } .icons4 i:nth-child(3) { opacity: .55; } .icons4 i:nth-child(4) { opacity: .75; }
.lock-w { display: flex; gap: 10px; margin-top: 16px; }
.lock-w > div { flex: 1; background: var(--surface); border-radius: 18px; padding: 10px 12px; font-size: 11px; color: var(--muted); }
.lock-w b { display: inline-flex; font-family: var(--rounded); font-size: 20px; color: var(--ink); font-weight: 800; line-height: 1; }
.dock { position: absolute; left: 12px; right: 12px; bottom: 12px; height: 74px; border-radius: 28px; background: var(--surface); opacity: .65; }

/* Scene: meeting */
.meet .map { position: relative; height: 330px; margin: 0 12px; border-radius: 22px; overflow: hidden; background: var(--map-land); }
.map svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.pin { position: absolute; width: 30px; height: 30px; margin: -30px 0 0 -15px; }
.pin svg { width: 30px; height: 30px; color: var(--accent); }
.mdot { position: absolute; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.mdot.you { background: var(--you); }
.mdot.them { background: var(--accent); }
.meet-title { text-align: center; font-size: 13px; color: var(--muted); margin: 14px 0 10px; }
.dist { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 12px; }
.dist > div { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px; text-align: center; }
.dist .who { font-size: 12px; font-weight: 650; color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 6px; }
.dist .who i { width: 8px; height: 8px; border-radius: 50%; display: block; }
.dist .km { font-family: var(--rounded); font-weight: 800; font-size: 26px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.dist .km small { font-size: 14px; font-weight: 700; color: var(--muted); margin-left: 2px; }

/* Scene: watch */
.watchset { position: relative; width: 520px; height: 600px; display: flex; align-items: center; justify-content: center; gap: 40px; }
.watch {
  position: relative; width: 230px; height: 276px; border-radius: 64px; background: var(--bezel); padding: 14px; box-shadow: var(--shadow);
}
.watch::after { content: ""; position: absolute; right: -7px; top: 86px; width: 9px; height: 42px; border-radius: 5px; background: var(--bezel); }
.watch .face { width: 100%; height: 100%; border-radius: 50px; background: #000; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; }
.watch .time { position: absolute; top: 18px; right: 26px; font-size: 14px; font-weight: 600; }
.ring { position: relative; width: 150px; height: 150px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { stroke: rgba(255,255,255,.14); }
.ring .prog { stroke: #e0607f; transition: stroke-dashoffset 1.2s var(--ease); }
.ring .c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring .c b { font-family: var(--rounded); font-size: 52px; font-weight: 800; line-height: 1; display: inline-flex; }
.ring .c > span { font-size: 12px; color: #f2a7b8; font-weight: 600; margin-top: 4px; }
.comp { display: flex; flex-direction: column; gap: 14px; }
.comp > div { width: 200px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px; font-size: 12px; color: var(--muted); }
.comp b { display: block; color: var(--ink); font-size: 14px; margin-bottom: 6px; }
.comp .bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.comp .bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; width: 0; transition: width 1.2s var(--ease); }

/* ---------- Plans, closing ---------- */
.plans { padding: 88px 0 64px; }
.closing2 { padding: 96px 0 104px; text-align: center; border-top: 1px solid var(--line); }
.closing2 .big { font-family: var(--rounded); font-weight: 800; font-size: clamp(5rem, 16vw, 11rem); letter-spacing: -0.05em; line-height: .9; display: inline-flex; }
.closing2 .big-l { margin-top: 10px; color: var(--muted); font-weight: 600; }
.closing2 h2 { margin-top: 36px; font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; letter-spacing: -0.03em; }
.closing2 .store-badge { display: inline-block; margin-top: 24px; }

.rv { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.rv.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero2 { padding: 28px 0 0; }
  .hero2 .wrap { grid-template-columns: 1fr; gap: 8px; }
  .hero2 h1 { max-width: 13ch; }
  .hero-stage { height: 520px; min-height: 0; }
  .story { margin-top: 24px; }
  .story-grid { grid-template-columns: 1fr; gap: 0; }
  .stage-col { order: -1; position: sticky; top: 64px; z-index: 2; height: 54vh; background: var(--bg); }
  .stage { position: relative; top: 0; height: 100%; }
  .step { min-height: 70vh; justify-content: flex-start; padding: 28px 0 40px; }
  .step .copy { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .enter, .enter-device, .rv { opacity: 1 !important; transform: none !important; transition: none !important; }
  .scene, .island, .toast, .roll .col, .ring .prog, .comp .bar i { transition: none !important; }
  .live-line .dot, .tap.go, .sync-line.go i { animation: none !important; }
}
