/* Vistro: marketing site. Plain CSS, no dependencies, no external requests. */

:root {
  --bg: #0a1020;
  --bg-2: #0e1730;
  --surface: #131d38;
  --line: rgba(160, 175, 215, 0.16);
  --text: #eef0f8;
  --muted: #9aa5c2;
  --indigo: #8a82ff;
  --indigo-deep: #5b4fe0;
  --gold: #ffd98a;
  --pink: #ff7ea3;
  --green: #4ade80;

  --serif: ui-serif, "New York", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;

  --wrap: 1120px;
  --nav-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 12px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: -0.02em; margin: 0; }
p { margin: 0 0 1em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.wrap.narrow { max-width: 760px; }
.center { text-align: center; }
.center-row { justify-content: center; }

/* ---------- Type ---------- */
.eyebrow {
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--indigo); margin-bottom: 1rem;
}
h1 { font-size: clamp(2.6rem, 6.4vw, 4.6rem); line-height: 1.02; }
h2 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); line-height: 1.06; margin-bottom: 1.1rem; }
h3 { font-size: 1.25rem; line-height: 1.2; margin-bottom: 0.5rem; }
em { font-style: italic; color: var(--gold); }
.lede { font-size: clamp(1.1rem, 2vw, 1.3rem); color: #cdd3ea; max-width: 34rem; margin: 1.4rem 0 1.8rem; }
.sub { color: var(--muted); font-size: 1.15rem; max-width: 34rem; margin-left: auto; margin-right: auto; }
.fine { font-size: 0.875rem; color: var(--muted); }
.hero-ticks { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 0.875rem; color: var(--muted); }
.hero-ticks li::before { content: "✓"; margin-right: 7px; color: var(--indigo); font-weight: 700; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50; height: var(--nav-h);
  background: rgba(10, 16, 32, 0.72);
  -webkit-backdrop-filter: saturate(1.4) blur(18px); backdrop-filter: saturate(1.4) blur(18px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; height: 100%; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--serif); font-size: 1.35rem; letter-spacing: -0.01em; }
.brand img { border-radius: 22.5%; }
.nav-links { display: flex; gap: 26px; margin-left: auto; font-size: 0.95rem; color: var(--muted); }
.nav-links a { text-decoration: none; transition: color .2s; }
.nav-links a:hover { color: var(--text); }
.pill {
  text-decoration: none; font-size: 0.9rem; font-weight: 600; color: #0a1020;
  background: linear-gradient(135deg, var(--gold), #f6b45e); padding: 8px 16px; border-radius: 999px;
  transition: transform .2s, box-shadow .2s;
}
.pill:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(246, 180, 94, 0.35); }

/* ---------- Hero ---------- */
.hero { position: relative; padding: clamp(48px, 8vw, 96px) 0 clamp(8px, 2vw, 24px); overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -20% -10% auto -10%; height: 90%;
  background:
    radial-gradient(60% 50% at 75% 20%, rgba(124, 108, 255, 0.28), transparent 70%),
    radial-gradient(40% 40% at 15% 10%, rgba(255, 126, 163, 0.12), transparent 70%);
  pointer-events: none;
}
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center; }
.hero-device { display: flex; justify-content: center; }

/* Device switcher. One choice (iPhone or iPad) swaps every screenshot on the page: each slot holds both
   images and the page's data-mode picks which shows. Without JavaScript the pill stays hidden and the iPhone shows. */
/* Some copy differs by device: the Runway is a screen on iPhone but only a tile on iPad, which shows Compare plans. */
.for-wide { display: none; }
html[data-mode] .for-wide { display: block; }
html[data-mode] .for-phone { display: none; }
img[data-device="ipad"], img[data-device="mac"] { display: none; }
html[data-mode="ipad"] img[data-device="iphone"], html[data-mode="mac"] img[data-device="iphone"] { display: none; }
html[data-mode="ipad"] img[data-device="ipad"], html[data-mode="mac"] img[data-device="mac"] { display: block; }
.framed.wide { width: min(100%, 520px); }
.duo .framed.wide { width: min(100%, 520px); margin: 0 auto; }
/* iPad shots are wide, so on bigger screens give the picture more of the row than the phone gets. */
@media (min-width: 901px) {
  html[data-mode] .hero-grid { grid-template-columns: 0.85fr 1.15fr; }
  html[data-mode] .split { grid-template-columns: 0.8fr 1.2fr; }
  html[data-mode] .split.reverse { grid-template-columns: 1.2fr 0.8fr; }
  html[data-mode] .stage { max-width: 760px; }
  html[data-mode] .framed.wide, html[data-mode] .duo .framed.wide { width: min(100%, 760px); }
}
html[data-mode] .duo { justify-content: center; }
html[data-mode] .framed { animation: shotIn 0.35s ease both; }
@keyframes shotIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { html[data-mode] .framed { animation: none; } }

.stage { width: 100%; max-width: 520px; display: flex; flex-direction: column; align-items: center; gap: 18px; container-type: inline-size; }
.device-switch { display: none; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: rgba(19, 29, 56, 0.7); backdrop-filter: blur(8px); }
.js .device-switch { display: inline-flex; }
.device-switch button {
  appearance: none; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 0.9rem; font-weight: 600;
  padding: 7px 18px; border-radius: 999px; cursor: pointer; transition: background 0.2s ease, color 0.2s ease;
}
.device-switch button:hover { color: var(--text); }
.device-switch button[aria-pressed="true"] { background: var(--gold); color: #1a1405; }
.device-switch button:focus-visible { outline: 2px solid var(--indigo); outline-offset: 2px; }
/* iPad hero: a big landscape shot that runs off the right edge of the page (but shows in full top to bottom), rather than a small framed one. */
@media (min-width: 901px) {
  html:is([data-mode="ipad"], [data-mode="mac"]) .hero-grid { grid-template-columns: 0.8fr 1.2fr; }
  html:is([data-mode="ipad"], [data-mode="mac"]) .stage { max-width: none; }
  html:is([data-mode="ipad"], [data-mode="mac"]) .stage-shots { height: auto; min-height: 0; align-items: flex-start; justify-content: flex-start; }
  html:is([data-mode="ipad"], [data-mode="mac"]) .stage-shots .framed.wide { flex: none; width: calc(100cqw * 1.55); max-width: none; max-height: none; }
}
@media (max-width: 900px) {
  html:is([data-mode="ipad"], [data-mode="mac"]) .stage-shots { height: auto; min-height: 0; justify-content: flex-start; }
  html:is([data-mode="ipad"], [data-mode="mac"]) .stage-shots .framed.wide { flex: none; width: 135%; max-width: none; }
}
/* A second copy follows you down the page once the one in the hero has scrolled away. */
.js .device-switch.floating {
  position: fixed; z-index: 40; left: 50%; bottom: max(16px, env(safe-area-inset-bottom));
  transform: translate(-50%, 24px); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
  background: rgba(14, 23, 48, 0.88); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}
.js .device-switch.floating.show { visibility: visible; opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
/* The hero stage keeps the iPhone's height so the top of the page doesn't jump when a wider shot is chosen. */
.stage-shots { width: 100%; display: flex; align-items: center; justify-content: center; min-height: 560px; }
@supports (height: 1cqw) { .stage-shots { min-height: 0; height: calc(min(100cqw, 360px) * 2.07); } }
.stage-shots .framed { max-height: 100%; object-fit: contain; }

.cta-row { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; margin-bottom: 1.2rem; }
.link-arrow { text-decoration: none; font-weight: 600; color: var(--text); border-bottom: 1px solid var(--line); padding-bottom: 2px; transition: border-color .2s; }
.link-arrow::after { content: " \2192"; }
.link-arrow:hover { border-color: var(--gold); }

/* A neutral stand-in for Apple's official badge: swap it for the real artwork (see README). */
.store {
  display: inline-flex; flex-direction: column; justify-content: center; text-decoration: none;
  background: #000; color: #fff; border: 1px solid #6b6f80; border-radius: 12px; padding: 8px 22px 9px; min-width: 168px;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.store:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45); border-color: #aeb2c4; }
.store-small { font-size: 0.7rem; line-height: 1.1; letter-spacing: 0.02em; }
.store-big { font-size: 1.45rem; line-height: 1.1; font-weight: 600; letter-spacing: -0.01em; }

/* ---------- Phone frame (pure CSS) ---------- */
.phone {
  position: relative; margin: 0; width: min(100%, 300px);
  aspect-ratio: 1206 / 2622;
  border-radius: 15% / 6.9%;
  padding: 2.4%;
  background: linear-gradient(150deg, #353a4d 0%, #10121a 38%, #232738 100%);
  box-shadow:
    inset 0 0 0 1.5px rgba(255, 255, 255, 0.12),
    0 50px 90px -30px rgba(0, 0, 0, 0.8),
    0 0 90px -10px rgba(120, 108, 255, 0.28);
}
.phone::before, .phone::after { /* side buttons */
  content: ""; position: absolute; width: 3px; background: #2a2e40; border-radius: 2px;
}
.phone::before { left: -3px; top: 17%; height: 7%; box-shadow: 0 60px 0 #2a2e40, 0 110px 0 #2a2e40; }
.phone::after { right: -3px; top: 25%; height: 12%; }
.phone img {
  width: 100%; height: 100%; object-fit: cover; background: #05070e;
  border-radius: 12.4% / 5.7%;
}
.phone-lg { width: min(100%, 330px); }
.phone-sm { width: min(46%, 230px); }

.device-col { display: flex; justify-content: center; }
.device-col.duo { gap: clamp(8px, 3vw, 28px); align-items: center; }
.tilt-l { transform: rotate(-4deg); }
.tilt-r { transform: rotate(3.5deg); }
.raise { margin-top: 12%; }

/* ---------- Sections ---------- */
.section { padding: clamp(72px, 10vw, 140px) 0; position: relative; }
.section.tint { background: linear-gradient(180deg, var(--bg-2), var(--bg)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 7vw, 96px); align-items: center; }
.split.reverse .copy { order: 2; }
.copy p { color: #c9cfe6; max-width: 32rem; }

.ticks { list-style: none; padding: 0; margin: 1.6rem 0 0; max-width: 32rem; }
.ticks li { position: relative; padding: 0 0 0.85rem 1.8rem; color: #dfe3f4; font-size: 1rem; }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: 0.5em; width: 0.7rem; height: 0.7rem; border-radius: 50%;
  background: linear-gradient(135deg, var(--indigo), var(--pink)); box-shadow: 0 0 14px rgba(138, 130, 255, 0.55);
}

/* ---------- Tiles ---------- */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: clamp(32px, 5vw, 56px); }
.grid.four { grid-template-columns: repeat(4, 1fr); }
.tile {
  background: linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.015));
  border: 1px solid var(--line); border-radius: 20px; padding: 26px 24px 20px;
  transition: transform .25s, border-color .25s, background .25s;
}
.tile:hover { transform: translateY(-3px); border-color: rgba(138, 130, 255, 0.45); }
.tile svg { width: 28px; height: 28px; color: var(--indigo); fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 14px; }
.tile h3 { font-size: 1.15rem; }
.tile p { color: var(--muted); font-size: 0.97rem; margin: 0; }
.tile.plain { padding-top: 24px; }

/* ---------- FAQ ---------- */
.faq { margin-top: 36px; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); padding: 20px 4px; }
.faq summary { cursor: pointer; font-family: var(--serif); font-size: 1.3rem; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--indigo); font-size: 1.5rem; line-height: 1; transition: transform .25s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq p { color: #c9cfe6; margin: 12px 0 0; max-width: 40rem; }

/* ---------- Final CTA ---------- */
.final { text-align: center; background: radial-gradient(60% 60% at 50% 100%, rgba(124, 108, 255, 0.28), transparent 70%); }
.final-icon { margin: 0 auto 24px; border-radius: 22.5%; box-shadow: 0 20px 50px -10px rgba(124, 108, 255, 0.55); }
.final .cta-row { margin-top: 2rem; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 40px 0 56px; color: var(--muted); font-size: 0.9rem; }
.foot { display: grid; gap: 14px; }
.foot-brand { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 1.15rem; color: var(--text); }
.foot-brand img { border-radius: 22.5%; }
.foot-links { display: flex; gap: 22px; }
.foot-links a { text-decoration: none; }
.foot-links a:hover { color: var(--text); }
.legal { max-width: 46rem; font-size: 0.8rem; margin: 0; color: #7f8aa8; }

/* ---------- Motion ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s cubic-bezier(.2,.7,.2,1), transform .8s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .12s; }
.reveal.d2 { transition-delay: .24s; }

/* The top of the page never waits for the scroll observer: the hero (text, device pill and first screenshot) fades
   in on load, so it is always there. Only things further down reveal as you scroll. */
.hero .reveal, .hero .reveal.in { opacity: 1; transform: none; transition: none; animation: heroFade .8s cubic-bezier(.2, .7, .2, 1) both; }
.hero .reveal.d1 { animation-delay: .12s; }
@keyframes heroFade { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .hero .reveal, .hero .reveal.in { animation: none; } }

/* Screenshots drift at their own pace: they rise further, settle a beat after the text, and (via script.js) travel
   a little slower than the page as you scroll. */
.device-col.reveal { transform: translateY(56px); transition-duration: .8s, 1.15s; transition-delay: .2s; }
.device-col.reveal.in { transform: none; }
.device-col { translate: 0 calc(var(--py, 0) * 1px); will-change: translate; }
.device-col.duo .framed:nth-of-type(2) { translate: 0 calc(var(--py, 0) * -0.45px); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .device-col, .device-col.duo .framed:nth-of-type(2) { translate: none; will-change: auto; }
  }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-inner { justify-content: space-between; }
  .hero-grid, .split { grid-template-columns: 1fr; }
  .split.reverse .copy { order: 0; }
  .hero-copy, .copy { text-align: left; }
  .hero-device, .device-col { margin-top: 12px; }
  .grid, .grid.four { grid-template-columns: 1fr 1fr; }
  .phone-sm { width: min(44%, 220px); }
  }
@media (max-width: 560px) {
  body { font-size: 1rem; }
  .wrap { padding: 0 20px; }
  .grid, .grid.four { grid-template-columns: 1fr; }
  .phone-lg { width: min(86%, 300px); }
  .phone { width: min(78%, 280px); }
  .phone-sm { width: min(46%, 200px); }
  .cta-row { gap: 16px; }
}

/* Pigeon mascot artwork */
.mascot { display: block; margin: 0 auto 10px; width: 132px; height: auto; }
.final-mascot { width: 120px; margin-bottom: 20px; }

/* Pre-framed device artwork (transparent PNG/WebP that already includes the iPhone). */
.framed { display: block; height: auto; width: min(100%, 300px); filter: drop-shadow(0 40px 50px rgba(0, 0, 0, 0.6)); }
.framed-lg { width: min(100%, 360px); }
.duo .framed-sm { width: min(48%, 250px); }
@media (max-width: 560px) { .framed-lg { width: min(86%, 320px); } }

/* Apple's official "Download on the App Store" badge: keep its proportions and clear space, no recolouring. */
.store-badge { display: inline-block; line-height: 0; transition: transform 0.2s ease; }
.store-badge:hover { transform: translateY(-2px); }
.store-badge img { display: block; height: 50px; width: auto; }


/* Retirement: the lead section, a centred intro then alternating rows */
.duo .framed-md { width: min(48%, 300px); }
.retirement .ret-intro { max-width: 760px; margin-bottom: clamp(36px, 6vw, 72px); }
.stack-split + .stack-split { margin-top: clamp(64px, 9vw, 120px); }
.stack-split .copy h3 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); line-height: 1.12; margin: 0 0 14px; }
.stack-split .copy h3 em { font-style: italic; }
.sub-h { font-size: 1.25rem; margin: 28px 0 8px; }

/* Privacy policy page */
.prose-page { padding-top: clamp(48px, 8vw, 96px); }
.prose { max-width: 46rem; }
.prose h1 { margin-bottom: 0.4rem; }
.prose h2 { font-size: clamp(1.35rem, 2.4vw, 1.7rem); margin: 2.2rem 0 0.6rem; }
.prose p, .prose li { color: #c9cfe6; line-height: 1.65; }
.prose ul { padding-left: 1.2rem; margin: 0.6rem 0 0; }
.prose li { margin-bottom: 0.6rem; }
.prose strong { color: var(--text); }
.prose a { color: var(--gold); }
.policy-link { margin-top: 1rem; }
.policy-link a { color: var(--gold); }


/* iPhone Duo: the closed and open phone side by side, bottoms aligned so they read as one device. */
.duo-intro { max-width: 720px; margin-bottom: clamp(28px, 5vw, 56px); }
.duo-pair { display: grid; grid-template-columns: minmax(0, 0.5fr) minmax(0, 1fr); gap: clamp(20px, 5vw, 64px); align-items: end; max-width: 980px; }
.duo-fig { margin: 0; }
.duo-pair .framed { width: 100%; }
.duo-pair figcaption { margin-top: 14px; text-align: center; color: var(--muted); font-size: 0.9rem; letter-spacing: 0.04em; }
@media (max-width: 560px) { .duo-pair { grid-template-columns: 1fr; gap: 28px; } .duo-fig:first-child { width: 62%; margin: 0 auto; } }
