/* Visably homepage */

@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@300..700&display=swap");

:root {
    --bg: #f4f5fa;
    --surface: #ffffff;
    --ink: #1b1838;
    --ink-2: #57556f;
    --ink-3: #77758e;
    --rule: #dcdde9;
    --rule-soft: #ebecf4;

    /* Sky */
    --sky-top: #cfe0ff;
    --sky-mid: #e6e0ff;
    --cloud: rgba(255, 255, 255, 0.85);
    --flight: #6a3bff;
    --glass: rgba(255, 255, 255, 0.72);
    --glass-edge: rgba(255, 255, 255, 0.9);

    /* Tile tints */
    --tint-sky-a: #e3edff;
    --tint-sky-b: #f1f5ff;
    --tint-lilac-a: #ece5ff;
    --tint-lilac-b: #f6f2ff;
    --tint-mint-a: #dff3ea;
    --tint-mint-b: #f1faf5;

    /* Night panel (same in both modes) */
    --night: #17152e;
    --night-ink: #efeefa;
    --night-ink-2: #b4b2cc;

    /* Chart marks. Violet, sky and red pass a colour-blindness check as a set. */
    --violet: #6a3bff;
    --sky: #3f8cff;
    --red: #d9354a;
    --green: #1e9e5a;
    --focus: #6a3bff;

    --font: "Outfit", system-ui, -apple-system, sans-serif;
    --t-sm: 0.875rem;
    --t-base: 1.0625rem;
    --t-md: 1.25rem;
    --t-lg: 1.75rem;
    --t-xl: clamp(2rem, 4.2vw, 3.25rem);
    --t-hero: clamp(2.75rem, 7vw, 5.5rem);

    --radius: 28px;
    --edge: 8px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #100f1c;
        --surface: #1c1b2e;
        --ink: #ecebf7;
        --ink-2: #b2b0c9;
        --ink-3: #8f8daa;
        --rule: #34324d;
        --rule-soft: #28273d;

        --sky-top: #1b2550;
        --sky-mid: #251c4a;
        --cloud: rgba(140, 150, 255, 0.12);
        --flight: #b392ff;
        --glass: rgba(28, 27, 46, 0.72);
        --glass-edge: rgba(255, 255, 255, 0.08);

        --tint-sky-a: #1a2444;
        --tint-sky-b: #191d33;
        --tint-lilac-a: #251d47;
        --tint-lilac-b: #1c1932;
        --tint-mint-a: #15302a;
        --tint-mint-b: #171f26;

        --night: #0b0a16;

        --violet: #9b66ff;
        --sky: #2a93dd;
        --red: #ee4458;
        --green: #3cc47c;
        --focus: #b896ff;
    }
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
ul { list-style: none; }

body {
    font-family: var(--font);
    font-size: var(--t-base);
    line-height: 1.6;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 3px;
    border-radius: 6px;
}
main:focus { outline: none; }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: -3rem;
    z-index: 20;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    background: var(--ink);
    color: var(--bg);
}
.skip-link:focus { top: 1rem; }

/* ---- Pill nav ---- */
.topbar {
    position: fixed;
    top: 18px;
    left: 0;
    right: 0;
    z-index: 10;
    display: flex;
    justify-content: center;
    padding: 0 1rem;
    pointer-events: none;
}

.pill-nav {
    display: flex;
    align-items: center;
    gap: 1.75rem;
    padding: 6px 6px 6px 16px;
    border-radius: 999px;
    background: var(--glass);
    border: 1px solid var(--glass-edge);
    backdrop-filter: blur(18px) saturate(1.4);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    box-shadow: 0 8px 30px -12px rgba(30, 20, 90, 0.25);
    pointer-events: auto;
}

.pill-nav__brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    text-decoration: none;
}
.pill-nav__brand img { width: 28px; height: 28px; }

.pill-nav__link {
    color: var(--ink-2);
    font-weight: 500;
    font-size: 0.95rem;
    text-decoration: none;
}
.pill-nav__link:hover { color: var(--ink); }

/* ---- Buttons ---- */
.button {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.85rem 1.5rem;
    border-radius: 999px;
    background: var(--ink);
    color: var(--bg);
    font-weight: 500;
    font-size: 1.05rem;
    text-decoration: none;
    transition: transform 0.15s ease;
}
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button--small { padding: 0.55rem 1.1rem; font-size: 0.95rem; }
.button__apple { width: 1em; height: 1.15em; margin-top: -0.15em; }

/* ---- Sky sections (hero, closing) ---- */
.sky {
    position: relative;
    margin: var(--edge);
    border-radius: var(--radius);
    overflow: hidden;
    text-align: center;
    background:
        radial-gradient(ellipse 38% 26% at 14% 18%, var(--cloud), transparent 70%),
        radial-gradient(ellipse 30% 20% at 86% 12%, var(--cloud), transparent 70%),
        radial-gradient(ellipse 50% 30% at 70% 70%, var(--cloud), transparent 70%),
        linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 60%, var(--bg) 100%);
}

.flight { position: absolute; left: 0; width: 100%; pointer-events: none; }
.flight__path {
    fill: none;
    stroke: var(--flight);
    stroke-width: 2;
    stroke-dasharray: 2 10;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
    opacity: 0.55;
}

/* Hero */
.hero { padding: clamp(7rem, 14vw, 9.5rem) 1rem 0; }

.flight--hero { top: 54%; height: 46%; animation: fly 1.8s cubic-bezier(0.5, 0, 0.2, 1) 0.2s both; }

@keyframes fly {
    from { clip-path: inset(0 100% 0 0); }
    to { clip-path: inset(0 0 0 0); }
}

.hero__inner { position: relative; max-width: 880px; margin: 0 auto; }

.hero__title {
    font-size: var(--t-hero);
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.035em;
    text-wrap: balance;
}

.hero__lede {
    max-width: 32ch;
    margin: 1.25rem auto 2rem;
    font-size: clamp(1.15rem, 1.8vw, 1.45rem);
    line-height: 1.4;
    color: var(--ink-2);
}

.quote { margin-top: 1.25rem; font-size: var(--t-sm); color: var(--ink-2); }
.quote blockquote { display: inline; color: var(--ink); font-weight: 500; }
.quote figcaption { display: inline; margin-left: 0.4rem; }

/* Crop boxes are wider than the phone so its shadow isn't cut into a rectangle */
.hero__phone {
    position: relative;
    max-width: 600px;
    height: calc(clamp(300px, 34vw, 430px) + 40px);
    margin: calc(clamp(2.5rem, 5vw, 3.5rem) - 40px) auto 0;
    padding-top: 40px;
    overflow: hidden;
}
.hero__phone .phone { width: min(340px, 74vw); margin: 0 auto; }

/* ---- Phone crop ----
   The source PNGs are 1000×1000 with the phone at x 213–639, y 64–936.
   This box crops to the phone. Margins in % resolve against the box width. */
.phone {
    aspect-ratio: 426 / 872;
    overflow: hidden;
    filter: drop-shadow(0 30px 40px rgba(30, 20, 90, 0.22));
}
.phone img {
    width: calc(100% * 1000 / 426);
    max-width: none;
    height: auto;
    margin-left: calc(-100% * 213 / 426);
    margin-top: calc(-100% * 64 / 426);
}

/* ---- Countries ---- */
.countries {
    max-width: 860px;
    margin: 0 auto;
    padding: clamp(3.5rem, 7vw, 5rem) 1.25rem;
    text-align: center;
}
.countries__title { font-size: var(--t-md); font-weight: 600; margin-bottom: 0.9rem; }
.countries__list { color: var(--ink-3); line-height: 1.8; text-wrap: balance; }

/* ---- Sections ---- */
.section {
    max-width: 1240px;
    margin: 0 auto;
    padding: clamp(3rem, 7vw, 5.5rem) 1.25rem;
}
.section--tight { padding-top: 0; padding-bottom: clamp(1rem, 2vw, 1.5rem); }

.section__head { text-align: center; max-width: 720px; margin: 0 auto clamp(2rem, 4vw, 3rem); }
.section__head--in-panel { margin-bottom: clamp(2rem, 4vw, 2.75rem); }

.section__title {
    font-size: var(--t-xl);
    font-weight: 600;
    line-height: 1.05;
    letter-spacing: -0.03em;
    text-wrap: balance;
}

.section__lede {
    margin-top: 0.9rem;
    font-size: var(--t-md);
    line-height: 1.45;
    color: var(--ink-2);
    text-wrap: pretty;
}
.section__head .section__lede { max-width: 46ch; margin-left: auto; margin-right: auto; }

/* ---- Tiles ---- */
.tiles {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.tile {
    display: flex;
    flex-direction: column;
    min-height: 600px;
    padding: 2.25rem 2rem 0;
    border-radius: var(--radius);
    overflow: hidden;
}
.tile--sky { background: linear-gradient(180deg, var(--tint-sky-b), var(--tint-sky-a)); }
.tile--lilac { background: linear-gradient(180deg, var(--tint-lilac-b), var(--tint-lilac-a)); }
.tile--mint { background: linear-gradient(180deg, var(--tint-mint-b), var(--tint-mint-a)); }

.tile__title { font-size: var(--t-lg); font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
.tile__text p { margin-top: 0.5rem; color: var(--ink-2); max-width: 30ch; }

.tile__phone {
    height: 380px;
    margin-top: auto;
    padding-top: 2rem;
    overflow: hidden;
    box-sizing: content-box;
}
.tile__phone .phone { width: min(270px, 80%); margin: 0 auto; }

/* ---- Panels ---- */
.panel { border-radius: var(--radius); padding: clamp(1.75rem, 4vw, 3.5rem); }
.panel--demo { background: var(--surface); box-shadow: 0 1px 0 var(--rule); }

.panel--night {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    align-items: center;
    gap: 2rem 3rem;
    padding-bottom: 0;
    color: var(--night-ink);
    background:
        radial-gradient(ellipse 60% 70% at 75% 100%, rgba(124, 82, 255, 0.35), transparent 70%),
        radial-gradient(ellipse 40% 50% at 10% 0%, rgba(63, 140, 255, 0.18), transparent 70%),
        var(--night);
    overflow: hidden;
}
.panel--night .section__lede { color: var(--night-ink-2); max-width: 36ch; }
.night__text { padding-bottom: clamp(1.75rem, 4vw, 3.5rem); }

.night__phones {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    height: 460px;
    overflow: hidden;
    padding: 0.5rem 2rem 0;
}
.night__phones .phone:nth-child(2) { margin-top: 3rem; }

/* ---- Demo (calculator) ---- */
.demo {
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
    gap: 2.5rem 3.5rem;
}

.demo__question { font-size: var(--t-lg); font-weight: 500; line-height: 1.2; letter-spacing: -0.02em; }
.demo__len { display: inline-block; min-width: 2ch; font-weight: 700; font-variant-numeric: tabular-nums; text-align: center; }
.demo__dates { margin-top: 0.35rem; color: var(--ink-2); font-size: var(--t-sm); }
.demo__slider-label { display: block; margin: 1.75rem 0 0.5rem; font-size: var(--t-sm); color: var(--ink-2); }

.demo__slider {
    --fill: 50%;
    width: 100%;
    height: 28px;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}
.demo__slider::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, var(--sky) var(--fill), var(--rule-soft) var(--fill));
}
.demo__slider::-moz-range-track {
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, var(--sky) var(--fill), var(--rule-soft) var(--fill));
}
.demo__slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    margin-top: -9px;
    border-radius: 50%;
    background: var(--surface);
    border: 2px solid var(--sky);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}
.demo__slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--surface);
    border: 2px solid var(--sky);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

.demo__answer { margin-top: 1.75rem; padding-top: 1.5rem; border-top: 1px solid var(--rule-soft); }
.demo__verdict { display: flex; gap: 0.6rem; align-items: flex-start; font-size: var(--t-md); font-weight: 600; line-height: 1.3; }
.demo__status {
    flex: none;
    display: grid;
    place-items: center;
    width: 1.5rem;
    height: 1.5rem;
    margin-top: 0.05rem;
    border-radius: 50%;
    color: #fff;
    background: var(--green);
}
.demo__status svg { width: 0.9rem; height: 0.9rem; }
.demo--over .demo__status { background: var(--red); }
.demo__detail { margin-top: 0.6rem; color: var(--ink-2); font-size: 0.98rem; line-height: 1.55; max-width: 40ch; }
.demo__note { margin-top: 1.5rem; color: var(--ink-3); font-size: var(--t-sm); }

.demo__chart { min-width: 0; }
.demo__caption { font-size: var(--t-sm); color: var(--ink-2); margin-bottom: 0.75rem; }

.chart { position: relative; }
.chart__svg { width: 100%; height: 300px; overflow: visible; touch-action: pan-y; }
.chart__grid { stroke: var(--rule-soft); stroke-width: 1; }
.chart__limit { stroke: var(--ink-3); stroke-width: 1; }
.chart__axis-text { fill: var(--ink-3); font-size: 12px; font-family: var(--font); }
.chart__limit-text { fill: var(--ink-2); font-size: 12px; font-weight: 500; font-family: var(--font); }
.chart__today { stroke: var(--ink); stroke-width: 1; }
.chart__today-text { fill: var(--ink); font-size: 12px; font-weight: 600; font-family: var(--font); }
.chart__area { fill: var(--violet); opacity: 0.1; }
.chart__line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart__line--past { stroke: var(--violet); }
.chart__line--plan { stroke: var(--sky); }
.chart__line--over { stroke: var(--red); }
.chart__trip--past { fill: var(--violet); }
.chart__trip--plan { fill: var(--sky); }
.chart__trip--over { fill: var(--red); }
.chart__trip-text { fill: var(--ink); font-size: 12px; font-weight: 500; font-family: var(--font); }
.chart__cross { stroke: var(--ink-3); stroke-width: 1; }
.chart__dot { stroke: var(--surface); stroke-width: 2; }

.chart__tip {
    position: absolute;
    top: 0;
    left: 0;
    padding: 0.5rem 0.7rem;
    border-radius: 10px;
    background: var(--ink);
    color: var(--bg);
    font-size: var(--t-sm);
    line-height: 1.35;
    white-space: nowrap;
    pointer-events: none;
}
.chart__tip strong { display: block; font-weight: 600; }

.legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; margin-top: 0.75rem; font-size: var(--t-sm); color: var(--ink-2); }
.legend li { display: flex; align-items: center; gap: 0.45rem; }
.legend__key { width: 14px; height: 8px; border-radius: 2px; }
.legend__key--past { background: var(--violet); }
.legend__key--plan { background: var(--sky); }
.legend__key--over { background: var(--red); }

/* ---- Rule ---- */
.rule {
    display: grid;
    grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
    gap: 3rem 5rem;
    align-items: start;
    max-width: 1100px;
    margin: 0 auto;
}
.rule__text .section__title { margin-bottom: 1.5rem; max-width: 14ch; }
.rule__text p { max-width: 54ch; margin-bottom: 1rem; color: var(--ink-2); }
.rule__text .rule__lead { color: var(--ink); font-size: var(--t-md); line-height: 1.45; }

.faq { border-top: 1px solid var(--rule); }
.faq__item { border-bottom: 1px solid var(--rule); }
.faq__item summary {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.15rem 0;
    font-weight: 500;
    font-size: 1.1rem;
    cursor: pointer;
    list-style: none;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after {
    content: "+";
    flex: none;
    font-weight: 300;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--ink-3);
    transition: transform 0.2s ease;
}
.faq__item[open] summary::after { transform: rotate(45deg); }
.faq__item p { padding-bottom: 1.25rem; color: var(--ink-2); max-width: 56ch; }

/* ---- Closing ---- */
.closing { padding: 0 1.25rem clamp(4rem, 8vw, 6rem); }
.flight--closing { top: 0; height: 160px; }
.closing__pin { width: 64px; height: 64px; margin: 150px auto 1.5rem; }
.closing__title {
    font-size: var(--t-xl);
    font-weight: 600;
    line-height: 1.05;
    letter-spacing: -0.03em;
    margin-bottom: 2rem;
    text-wrap: balance;
}

/* ---- Footer ---- */
.site-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 2rem;
    max-width: 1240px;
    margin: 0 auto;
    padding: 3rem 1.25rem 4rem;
    font-size: var(--t-sm);
    color: var(--ink-3);
}
.site-footer__brand p { margin-top: 0.6rem; }
.site-footer__cols { display: flex; gap: 4rem; }
.site-footer__cols div { display: flex; flex-direction: column; gap: 0.5rem; }
.site-footer__head { font-size: var(--t-sm); font-weight: 500; color: var(--ink-3); margin-bottom: 0.25rem; }
.site-footer__cols a { color: var(--ink); font-weight: 500; text-decoration: none; }
.site-footer__cols a:hover { color: var(--violet); }

/* ---- Responsive ---- */
@media (max-width: 1020px) {
    .tiles { grid-template-columns: 1fr; }
    .tile { min-height: 0; }
    .tile__phone { height: 320px; }
    .demo { grid-template-columns: 1fr; }
    .panel--night { grid-template-columns: 1fr; }
    .rule { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
    :root { --radius: 22px; --edge: 6px; }
    .pill-nav { gap: 1rem; }
    .pill-nav__link { display: none; }
    .tile { padding: 1.75rem 1.5rem 0; }
    .chart__svg { height: 250px; }
    .night__phones { height: 360px; gap: 0.75rem; }
    .site-footer__cols { gap: 2.5rem; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .flight--hero { animation: none; }
    .button { transition: none; }
    .faq__item summary::after { transition: none; }
}
