/* Hirundo website. Colours and type come from the app's design tokens (src/ui/tokens.ts).
   Order: tokens · base · shared parts · page sections (top to bottom) · legal pages · motion · small screens. */

/* ---------- Tokens ---------- */

:root {
  --night: #1b2a4a;
  --night-deep: #142038;
  --cream: #f6e7c8;
  --sky: #c9d6e8;
  --ink: #1b2430;
  --muted: #4a5260;
  --navy: #23497f;
  --navy-deep: #1c3a66;
  --focus: #2c5ba0;
  --rust: #a8461f;
  --line: #dde3ec;
  --tint: #e6eef8;
  --page: #f7f9fc;
  --white: #ffffff;
  --store-edge: #3a4152;
  --display: 'Fredoka', system-ui, sans-serif;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
}

/* ---------- Base ---------- */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font: 400 17px/1.6 var(--sans); }
img { max-width: 100%; display: block; }
a { color: var(--navy); }
a:hover { color: var(--focus); }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.1; margin: 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ---------- Shared parts ---------- */

/* Brand: the app icon and name, in the header of every page */
.brand { display: flex; align-items: center; gap: 10px; color: var(--cream); text-decoration: none; font: 700 22px var(--display); }
.brand img { width: 36px; height: 36px; border-radius: 9px; }
.brand:hover { color: var(--white); }

/* Sections: one rhythm for all. Single-column sections open with a centred .section-head. */
section { padding: 96px 0; }
section h2 { font-size: clamp(30px, 4vw, 42px); color: var(--night); }
section .intro { max-width: 36em; color: var(--muted); margin: 14px 0 0; }
.section-head { max-width: 720px; margin: 0 auto 48px; text-align: center; }
.section-head .intro { margin: 14px auto 0; }
.eyebrow { font: 600 13px var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--rust); margin: 0 0 10px; }

/* Phone frame around a screenshot */
.phone { position: relative; width: 100%; max-width: 300px; margin: 0 auto; padding: 10px; border-radius: 48px; background: #0e1628; border: 3px solid #a8aeba; box-shadow: 0 30px 60px rgba(0, 0, 0, 0.35); }
.phone > img { border-radius: 38px; width: 100%; height: auto; aspect-ratio: 600 / 1304; }
.phone::before { content: ''; position: absolute; top: 20px; left: 50%; width: 30%; height: 26px; margin-left: -15%; border-radius: 13px; background: #000; z-index: 1; }
/* Side buttons, as on iPhone 17 Pro: Action and volume on the left, side button and Camera Control on the right.
   Each is a rounded pill (an SVG layer), 3 px proud of the frame. */
.phone::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: -6px; right: -6px; pointer-events: none;
  --pill: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 3 100' preserveAspectRatio='none'%3E%3Crect width='3' height='100' rx='1.5' ry='12' fill='%2397a0ae'/%3E%3C/svg%3E");
  background:
    var(--pill) left 0 top 19% / 3px 4.5% no-repeat,
    var(--pill) left 0 top 28% / 3px 7.5% no-repeat,
    var(--pill) left 0 top 38% / 3px 7.5% no-repeat,
    var(--pill) right 0 top 32% / 3px 11% no-repeat,
    var(--pill) right 0 top 61% / 3px 5.5% no-repeat;
}

/* App Store button: black, chunky like the app's buttons. "soon" until the app is live (site.js). */
.store { display: inline-flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 24px 8px 18px; border-radius: 16px; background: #000; color: var(--white); text-decoration: none; box-shadow: 0 5px 0 var(--store-edge); transition: transform .15s ease, box-shadow .15s ease; }
.store:hover { color: var(--white); transform: translateY(-2px) rotate(-1deg); box-shadow: 0 7px 0 var(--store-edge); }
.store:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--store-edge); }
.store .apple { width: 30px; height: 30px; }
.store span { display: flex; flex-direction: column; font: 600 24px/1.05 var(--sans); letter-spacing: -0.01em; }
.store small { font: 500 12px/1.2 var(--sans); letter-spacing: 0.02em; }
.store.soon { cursor: default; }
.store.soon:hover { transform: none; box-shadow: 0 5px 0 var(--store-edge); }

/* ---------- Header ---------- */

.top { position: absolute; inset: 0 0 auto; z-index: 2; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.top nav { display: flex; gap: 20px; }
.top nav a { color: var(--sky); text-decoration: none; font-weight: 500; font-size: 15px; }
.top nav a:hover { color: var(--white); }

/* ---------- Hero ---------- */

.hero { position: relative; overflow: hidden; background: var(--night); color: var(--white); padding: 112px 0 72px; }
.hero::after { content: ''; position: absolute; left: 50%; bottom: -380px; width: 1100px; height: 520px; margin-left: -550px; border-radius: 50%; background: var(--night-deep); }
.hero .wrap { position: relative; z-index: 2; display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(40px, 6vw, 64px); color: var(--cream); letter-spacing: -0.01em; }
.hero .lead { margin: 20px 0 32px; font-size: 19px; color: var(--sky); max-width: 30em; }
.hero .small { margin-top: 14px; font-size: 14px; color: var(--sky); }
.hero .phone { transform: rotate(3deg); animation: hover 6s ease-in-out infinite; }

/* Live moment: the app's new-country screen, rebuilt in the hero phone and played on a loop.
   Sized in cqw (1% of the screen's width), measured from the app's screenshot. */
.moment { position: relative; overflow: hidden; container-type: inline-size; aspect-ratio: 600 / 1304; border-radius: 38px; background: var(--night); color: var(--white); text-align: center; }
.m-status { position: absolute; top: 2.6cqw; left: 13cqw; right: 9cqw; display: flex; justify-content: space-between; align-items: center; font: 600 3.8cqw var(--sans); }
.m-status i { width: 7cqw; height: 3.4cqw; border-radius: 1cqw; background: var(--white); }
.m-chip { position: absolute; top: 19cqw; left: 50%; transform: translateX(-50%); padding: 1.4cqw 3.4cqw; border-radius: 99px; background: rgba(255, 255, 255, .12); font: 500 2.9cqw var(--sans); white-space: nowrap; }
.m-card { position: absolute; left: 16cqw; top: 32cqw; width: 68cqw; height: 71cqw; border-radius: 4.6cqw; background: #eef3fa; box-shadow: 0 3cqw 6cqw rgba(0, 0, 0, .3); transform: rotate(-3deg); }
.m-page { position: absolute; left: 5.5cqw; top: 4.5cqw; font: 600 2.6cqw var(--sans); color: #3e5578; }
.m-stamp { position: absolute; left: 9cqw; top: 13cqw; width: 44cqw; height: 44cqw; transform: rotate(-8deg); }
.m-bird { position: absolute; right: -4cqw; top: 20cqw; width: 22cqw; height: 22cqw; }
.m-title { position: absolute; top: 106cqw; left: 0; right: 0; margin: 0; font: 700 8.6cqw var(--display); }
.m-sub { position: absolute; top: 122cqw; left: 0; right: 0; margin: 0; font: 400 3.4cqw var(--sans); color: var(--sky); }
.m-next { position: absolute; left: 5.5cqw; right: 5.5cqw; top: 181cqw; padding: 3.6cqw 0; border-radius: 4.4cqw; background: var(--white); color: var(--ink); font: 600 3.4cqw var(--display); box-shadow: 0 1.4cqw 0 var(--line-strong, #cdd5e0); }
.m-done { position: absolute; left: 0; right: 0; top: 197cqw; font: 600 3cqw var(--sans); }
.moment .confetti i { width: 1.6cqw; height: 2.8cqw; }

/* One 7-second loop: chip, card drops in, stamp thunks, Hirundo pops up, then the words and the button. */
.m-chip, .m-card, .m-stamp, .m-bird, .m-title, .m-sub, .m-next, .m-done { animation: 7s cubic-bezier(.2, 1.3, .4, 1) infinite both; }
.m-chip { animation-name: m-chip; }
.m-card { animation-name: m-card; }
.m-stamp { animation-name: m-stamp; }
.m-bird { animation-name: m-bird; }
.m-title, .m-sub { animation-name: m-words; }
.m-next, .m-done { animation-name: m-button; }
@keyframes m-chip { 0% { opacity: 0; transform: translate(-50%, -2cqw); } 6%, 92% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, 0); } }
@keyframes m-card { 0%, 4% { opacity: 0; transform: translateY(-14cqw) rotate(-10deg) scale(.92); } 16%, 92% { opacity: 1; transform: rotate(-3deg); } 100% { opacity: 0; transform: rotate(-3deg); } }
@keyframes m-stamp { 0%, 18% { opacity: 0; transform: rotate(-14deg) scale(1.7); } 26% { opacity: 1; transform: rotate(-6deg) scale(.94); } 30%, 100% { opacity: 1; transform: rotate(-8deg) scale(1); } }
@keyframes m-bird { 0%, 28% { opacity: 0; transform: translateY(8cqw) scale(.6); } 36% { opacity: 1; transform: translateY(-2cqw) scale(1.05); } 40%, 100% { opacity: 1; transform: none; } }
@keyframes m-words { 0%, 34% { opacity: 0; transform: translateY(3cqw); } 42%, 92% { opacity: 1; transform: none; } 100% { opacity: 0; transform: none; } }
@keyframes m-button { 0%, 42% { opacity: 0; transform: translateY(6cqw); } 50%, 92% { opacity: 1; transform: none; } 100% { opacity: 0; transform: none; } }


/* Every kind of stamp, scattered behind the hero like stamps tossed on a page: varied size and angle, spread
   around the headline and the phone without covering them (drawn by scripts/build-website-stamps.ts) */
.stamp-bg { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.stamp { position: absolute; width: var(--size, 86px); height: var(--size, 86px); filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .3)); animation: bob 6s ease-in-out infinite; }
.stamp:nth-child(1) { left: 3%; top: 11%; --size: 88px; --tilt: -12deg; }
.stamp:nth-child(2) { left: 41%; top: 7%; --size: 76px; --tilt: 9deg; animation-delay: -1s; }
.stamp:nth-child(3) { right: 4%; top: 13%; --size: 92px; --tilt: -6deg; animation-delay: -2s; }
.stamp:nth-child(4) { left: 4.5%; top: 60%; --size: 80px; --tilt: 11deg; animation-delay: -3s; }
.stamp:nth-child(5) { left: 30%; bottom: 4%; --size: 84px; --tilt: -9deg; animation-delay: -1.5s; }
.stamp:nth-child(6) { right: 3%; top: 54%; --size: 86px; --tilt: 13deg; animation-delay: -2.5s; }
.stamp:nth-child(7) { left: 49%; bottom: 9%; --size: 74px; --tilt: -4deg; animation-delay: -3.5s; }

/* ---------- Features ---------- */

.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.feature { background: var(--white); border: 1px solid var(--line); border-radius: 22px; padding: 26px 22px; box-shadow: 0 4px 0 var(--line); }
.feature h3 { font-size: 21px; color: var(--night); margin-bottom: 10px; }
.feature p { margin: 0; font-size: 15px; color: var(--muted); }
.feature-head { display: flex; align-items: center; gap: 10px; }
.feature-head svg { flex: none; width: 36px; height: 36px; }
.feature:hover .feature-head svg { animation: wiggle .5s ease; }

/* ---------- Screenshots ---------- */

.shots { background: var(--tint); }
.strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.strip figure { margin: 0; }
.strip .phone { max-width: 240px; padding: 8px; border-radius: 40px; }
.strip .phone > img { border-radius: 32px; }
.strip .phone::before { top: 16px; height: 20px; }
.strip .phone::after { left: -5px; right: -5px; background-size: 2px 4.5%, 2px 7.5%, 2px 7.5%, 2px 11%, 2px 5.5%; }
.strip figcaption { text-align: center; margin-top: 16px; font: 600 16px var(--display); color: var(--night); }

/* The phones float in a slow wave, a glass shine sweeps their screens in turn, and the one under the pointer lifts
   towards you. Float uses transform; the hover uses scale and rotate, so the two add up. */
.strip .phone, .phone.lively { animation: float-y 6s ease-in-out infinite; transition: scale .35s ease, rotate .35s ease, box-shadow .35s ease; }
.strip figure:nth-child(2) .phone { animation-delay: -1.5s; }
.strip figure:nth-child(3) .phone { animation-delay: -3s; }
.strip figure:nth-child(4) .phone { animation-delay: -4.5s; }
.strip figure:hover .phone, .phone.lively:hover { scale: 1.04; rotate: -2deg; box-shadow: 0 40px 70px rgba(0, 0, 0, 0.4); }
.phone.lively .shine { inset: 10px; border-radius: 38px; }
.phone.lively .shine::before { animation-delay: 1s; }
/* The hero phone keeps its own tilted float; it only gains the shine and the hover lift. */
.hero .phone.hero-phone { animation: hover 6s ease-in-out infinite; }
.hero-phone .shine { z-index: 3; }
.hero-phone .shine::before { animation-delay: 3s; }
.shine { position: absolute; inset: 8px; z-index: 2; overflow: hidden; border-radius: 32px; pointer-events: none; }
.shine::before { content: ''; position: absolute; top: -20%; bottom: -20%; left: -60%; width: 45%; background: linear-gradient(100deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, .35) 50%, rgba(255, 255, 255, 0) 100%); transform: translateX(0) skewX(-12deg); animation: shine 8s ease-in-out infinite; }
.strip figure:nth-child(2) .shine::before { animation-delay: 2s; }
.strip figure:nth-child(3) .shine::before { animation-delay: 4s; }
.strip figure:nth-child(4) .shine::before { animation-delay: 6s; }

/* ---------- Privacy ---------- */

.privacy { background: var(--night); color: var(--sky); }
.privacy h2 { color: var(--cream); }
.privacy .eyebrow { color: var(--cream); }
.privacy .intro { color: var(--sky); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 32px; }
.stat { background: rgba(255, 255, 255, 0.08); border-radius: 18px; padding: 18px; text-align: center; }
.stat b { display: block; font: 700 30px var(--display); color: var(--white); }
.stat span { font-size: 14px; }
.points { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 14px; }
.points li { display: flex; gap: 12px; }
.points li::before { content: ''; flex: none; width: 22px; height: 22px; margin-top: 3px; border-radius: 50%; background: #e6f2ea url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4L18 8' fill='none' stroke='%232f6b4f' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 16px no-repeat; }

/* ---------- Price ---------- */

.price { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; max-width: 860px; margin: 0 auto; }
.plan { background: var(--white); border: 1px solid var(--line); border-radius: 22px; padding: 28px; box-shadow: 0 4px 0 var(--line); }
.plan.forever { border: 2px solid var(--focus); box-shadow: 0 5px 0 var(--navy-deep); }
.plan h3 { font-size: 24px; color: var(--night); }
.plan .cost { font: 700 34px var(--display); color: var(--focus); margin: 8px 0 4px; }
.plan .note { color: var(--muted); font-size: 15px; margin: 0; }

/* ---------- Support ---------- */

.faq { display: grid; gap: 12px; max-width: 760px; margin: 0 auto; }
.faq details { background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 4px 20px; }
.faq summary { cursor: pointer; padding: 14px 0; font: 600 18px var(--display); color: var(--night); }
.faq details p { margin: 0 0 16px; color: var(--muted); }
.contact { margin-top: 20px; padding: 20px 24px; border-radius: 16px; background: var(--white); border: 1px solid var(--line); text-align: center; }
.contact p { margin: 0; }

/* ---------- Closing call to action ---------- */

.cta { position: relative; overflow: hidden; background: var(--night); color: var(--sky); text-align: center; }
.cta .wrap { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; }
.cta h2 { color: var(--cream); margin-top: 40px; }

/* The closed passport book (app/onboarding/book.tsx), 80% size */
.book { position: relative; width: 210px; height: 282px; margin-top: 40px; perspective: 900px; }
.book-page { position: absolute; left: 8px; top: 6px; width: 198px; height: 275px; border-radius: 5px 14px 14px 5px; background: #eef3fa; border: 1px solid var(--sky); }
.book-cover { position: absolute; inset: 0 12px 7px 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; border-radius: 5px 14px 14px 5px; background: linear-gradient(to right, #1a3760 11px, var(--navy) 11px); color: var(--cream); box-shadow: 0 14px 30px rgba(0, 0, 0, .35); transform-origin: left center; transition: transform .5s cubic-bezier(.2, .9, .3, 1); }
.book:hover .book-cover { transform: rotateY(-28deg); }
.book-title { font: 600 10px var(--sans); letter-spacing: 2.3px; }
.book-emblem { width: 77px; height: 77px; }
.book-name { font: 700 27px var(--display); letter-spacing: 1.6px; }
.book-sub { font: 500 10px var(--sans); letter-spacing: 1.1px; }
.book .bird { position: absolute; right: -30px; top: -58px; width: 96px; height: 96px; animation: hop 1.8s ease-in-out infinite; }
.cta .intro { color: var(--sky); margin: 10px 0 28px; }
.cta .small { color: var(--sky); font-size: 14px; margin: 14px 0 0; }
.confetti { position: absolute; inset: 0; pointer-events: none; }
.confetti i { position: absolute; top: -20px; width: 8px; height: 14px; border-radius: 2px; animation: fall linear infinite; }

/* ---------- Footer ---------- */

footer { padding: 36px 0 48px; color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); }
footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; }
footer nav { display: flex; gap: 20px; }
footer p { margin: 0; }

/* ---------- Legal pages (privacy.html, terms.html) ---------- */

.legal-top { background: var(--night); padding: 0; }
.legal-top .wrap { display: flex; align-items: center; height: 72px; }
.legal { max-width: 760px; padding: 48px 20px 72px; }
.legal h1 { font-size: clamp(32px, 5vw, 44px); color: var(--night); margin-bottom: 8px; }
.legal h2 { font-size: 24px; color: var(--night); margin: 36px 0 8px; }
.legal p, .legal li { color: var(--ink); }
.legal ul, .legal ol { padding-left: 22px; }
.legal li { margin: 6px 0; }

/* ---------- Motion ---------- */

/* Things stamp in as they scroll into view (site.js adds .in) */
[data-reveal] { opacity: 0; transform: scale(1.12) rotate(-3deg); }
[data-reveal].in { animation: thunk .5s cubic-bezier(.2, 1.4, .4, 1) forwards; }

@keyframes thunk { 0% { opacity: 0; transform: scale(1.12) rotate(-3deg); } 60% { opacity: 1; transform: scale(.97) rotate(1deg); } 100% { opacity: 1; transform: none; } }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(var(--tilt, 0deg)); } 50% { transform: translateY(-8px) rotate(var(--tilt, 0deg)); } }
@keyframes hover { 0%, 100% { transform: rotate(3deg) translateY(0); } 50% { transform: rotate(1.5deg) translateY(-10px); } }
@keyframes wiggle { 25% { transform: rotate(-10deg); } 75% { transform: rotate(8deg); } }
@keyframes hop { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-16px) rotate(-4deg); } }
@keyframes float-y { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes shine { 0%, 12% { transform: translateX(0) skewX(-12deg); } 30%, 100% { transform: translateX(420%) skewX(-12deg); } }
@keyframes fall { to { transform: translateY(560px) rotate(540deg); } }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* Reduce Motion: everything still, shown in its final place. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  [data-reveal] { opacity: 1; transform: none; }
  .confetti { display: none; }
  .moment * { animation: none !important; }
  .shine { display: none; }
  .stamp { transform: rotate(var(--tilt, 0deg)); }
}

/* ---------- Small screens ---------- */

@media (max-width: 1240px) {
  .stamp { opacity: .22; }
}

@media (max-width: 900px) {
  .hero { padding-top: 100px; }
  .hero .wrap, .split, .price { grid-template-columns: 1fr; }
  .hero .phone { max-width: 260px; }
  .features, .strip { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  section { padding: 64px 0; }
  .section-head { margin-bottom: 32px; }
  .top nav { display: none; }
  .stamp { width: 64px; height: 64px; }
  .features { grid-template-columns: 1fr; }
  .stat { padding: 14px 8px; }
  .stat b { font-size: 24px; }
  .strip { gap: 16px; }
  .strip figcaption { font-size: 14px; }
}
