/* Visably homepage. Colours and type follow the app (Visably/Design/Theme.swift):
   colour means state, not country. Vermillion counts, peach stops counting
   next, marigold hatch is booked. */

@import url("https://fonts.googleapis.com/css2?family=Familjen+Grotesk:wght@600;700&display=swap");

:root {
    --bg: #f2f3f1;
    --sheet: #ffffff;
    --paper: #f4f1e7;
    --ink: #15171a;
    --ink-2: #4c5157;
    --ink-3: #6a7076;
    --line: rgba(21, 23, 26, 0.12);

    /* The map */
    --sea: #d7e4ea;
    --edge: #b6c3c9;

    /* States */
    --used: #e4572e;
    --back: #f7b98a;
    --book: #e9a100;
    --book-ink: #a87400;
    --book-bg: #fff4d6;
    --fits: #1b6e46;

    /* Chart marks */
    --past: var(--ink-2);
    --plan: var(--book-ink);
    --over: var(--used);

    /* Always dark, like the app in dark mode */
    --night: #0b0e0f;
    --night-ink: #f1f3f4;
    --night-ink-2: #aeb5ba;

    --display: "Familjen Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, 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.6rem, 4.6vw, 4.25rem);

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

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0b0e0f;
        --sheet: #15191b;
        --paper: #22201a;
        --ink: #f1f3f4;
        --ink-2: #aeb5ba;
        --ink-3: #8e959a;
        --line: rgba(255, 255, 255, 0.12);

        --sea: #0d1519;
        --edge: #3b474e;

        --used: #ff6b3d;
        --back: #c47b52;
        --book-ink: #e9a100;
        --book-bg: #3a3020;
        --fits: #5ed394;

        --night: #15191b;
    }
}

/* 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(--ink);
    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: 10px;
    background: var(--ink);
    color: var(--bg);
}
.skip-link:focus { top: 1rem; }

/* ---- Top bar, over the map ---- */
.topbar {
    position: absolute;
    top: var(--edge-gap);
    left: 50%;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: min(1600px, calc(100% - 2 * var(--edge-gap)));
    padding: 18px clamp(16px, 3vw, 28px);
    transform: translateX(-50%);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--display);
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    text-decoration: none;
}
.brand img {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.12);
}

.topbar__nav { display: flex; align-items: center; gap: 1.5rem; }
.topbar__link {
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
}
.topbar__link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---- Buttons ---- */
.button {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.85rem 1.4rem;
    border-radius: 14px;
    background: var(--ink);
    color: var(--bg);
    font-weight: 600;
    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 1rem; border-radius: 12px; font-size: 0.95rem; }
.button__apple { width: 1em; height: 1.15em; margin-top: -0.15em; }

/* ---- The map ----
   The SVG frame is 562 x 588 map units starting at (-20, -68), the app's
   EuropeMap.json. Each map sets which units show across its width (--cx,
   --cw) and which height to centre on (--fy). Beyond the frame is plain sea. */
.map {
    --cx: -20;
    --cw: 562;
    --fy: 290;
    container-type: inline-size;
    position: relative;
    overflow: hidden;
    background: var(--sea);
}

.map__frame {
    position: absolute;
    left: calc((-20 - var(--cx)) / var(--cw) * 100cqw);
    top: calc(50% - (var(--fy) + 68) / var(--cw) * 100cqw);
    width: calc(562 / var(--cw) * 100cqw);
    aspect-ratio: 562 / 588;
}
.map__frame img { width: 100%; height: 100%; }

/* A label above (or below) a point given in map units */
.map__pin {
    position: absolute;
    left: calc((var(--x) + 20) / 562 * 100%);
    top: calc((var(--y) + 68) / 588 * 100%);
}

.map__pin {
    display: flex;
    flex-direction: column;
    padding: 5px 11px 6px;
    border-radius: 12px;
    background: #fff;
    color: #15171a;
    font-size: 13px;
    line-height: 1.25;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
    transform: translate(-50%, calc(-100% - 4px));
}
.map__pin b { font-size: 14px; font-weight: 600; }
.map__pin--below { transform: translate(-50%, 4px); }

/* The light and dark Today screenshots show different trips, so each map
   labels its own. */
.map__pin--dark { display: none; }

@media (prefers-color-scheme: dark) {
    .map__pin { background: #262d31; color: #aeb5ba; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5); }
    .map__pin b { color: #f1f3f4; }
    .map__pin--light { display: none; }
    .map__pin--dark { display: flex; }
}

/* ---- Hero ---- */
.hero {
    position: relative;
    width: min(1600px, calc(100% - 2 * var(--edge-gap)));
    margin: var(--edge-gap) auto 0;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--sheet);
}

.hero__map {
    --cx: -100;
    --cw: 760;
    --fy: 212;
    height: clamp(320px, 46vh, 520px);
}

/* Zoomed out, the frame's east edge shows. Fade it into the sea. */
.hero__map::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, transparent 74%, var(--sea) 84%);
}

/* The app's white sheet, sliding up over the map */
.hero__sheet {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2rem 4rem;
    margin-top: -34px;
    padding: clamp(2rem, 4vw, 3.25rem) max(clamp(1.5rem, 5vw, 4.5rem), (100% - 1240px) / 2) clamp(2.5rem, 5vw, 4rem);
    border-radius: 34px 34px 0 0;
    background: var(--sheet);
    box-shadow: 0 -14px 34px -18px rgba(20, 40, 50, 0.35);
}

.hero__title {
    max-width: 14ch;
    font-family: var(--display);
    font-size: var(--t-hero);
    font-weight: 700;
    line-height: 0.98;
    letter-spacing: -0.035em;
    text-wrap: balance;
}

.hero__lede {
    max-width: 34ch;
    margin-top: 1.1rem;
    font-size: clamp(1.15rem, 1.6vw, 1.35rem);
    line-height: 1.45;
    color: var(--ink-2);
}

.key {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.1rem;
    margin: 1.1rem 0 2rem;
    font-size: var(--t-sm);
    color: var(--ink-2);
}
.key li { display: flex; align-items: center; gap: 0.4rem; }
.key__swatch { width: 12px; height: 12px; border-radius: 3px; }
.key__swatch--used { background: var(--used); }
.key__swatch--back { background: var(--back); }
.key__swatch--book {
    background: repeating-linear-gradient(45deg, var(--book) 0 2px, var(--book-bg) 2px 4.5px);
    box-shadow: inset 0 0 0 1px var(--book);
}

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

/* The phone pokes up out of the sheet into the map */
.hero__phone { align-self: end; margin-top: -230px; }
.hero__phone .phone { width: clamp(240px, 22vw, 290px); }

/* ---- Phone frame ----
   Screenshots are 720 wide and square-cornered. The frame rounds them and
   draws a thin bezel. */
.phone {
    aspect-ratio: 720 / 1561;
    padding: 2.4%;
    border-radius: 15% / 7%;
    background: #15171a;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.14),
        0 30px 50px -20px rgba(20, 40, 50, 0.45);
}
.phone img {
    width: 100%;
    height: 100%;
    border-radius: 13% / 6%;
    object-fit: cover;
    object-position: top;
}

/* ---- Countries ---- */
.countries {
    max-width: 860px;
    margin: 0 auto;
    padding: clamp(3.5rem, 7vw, 5rem) 1.25rem;
    text-align: center;
}
.countries__title { font-family: var(--display); font-size: var(--t-md); font-weight: 700; 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-family: var(--display);
    font-size: var(--t-xl);
    font-weight: 700;
    line-height: 1.02;
    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--sea { background: var(--sea); }
.tile--white { background: var(--sheet); box-shadow: 0 0 0 1px var(--line); }
.tile--paper { background: var(--paper); }

.tile__title { font-family: var(--display); font-size: var(--t-lg); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.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(--sheet); box-shadow: 0 0 0 1px var(--line); }

.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: 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;
    align-items: start;
    gap: 1.25rem;
    height: 460px;
    overflow: hidden;
    padding: 0.5rem 2rem 0;
}
.night__phones .phone { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18), 0 30px 50px -20px rgba(0, 0, 0, 0.8); }
.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-family: var(--display); font-size: var(--t-lg); font-weight: 600; 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(--ink) var(--fill), var(--line) var(--fill));
}
.demo__slider::-moz-range-track {
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, var(--ink) var(--fill), var(--line) var(--fill));
}
.demo__slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    margin-top: -9px;
    border-radius: 50%;
    background: var(--sheet);
    border: 2px solid var(--ink);
    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(--sheet);
    border: 2px solid var(--ink);
    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(--line); }
.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(--fits);
}
.demo__status svg { width: 0.9rem; height: 0.9rem; }
.demo--over .demo__status { background: var(--over); }
.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(--line); 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(--ink); opacity: 0.06; }
.chart__line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart__line--past { stroke: var(--past); }
.chart__line--plan { stroke: var(--plan); }
.chart__line--over { stroke: var(--over); }
.chart__trip--past { fill: var(--past); }
.chart__trip--plan { fill: var(--book); }
.chart__trip--over { fill: var(--over); }
.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(--sheet); 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(--past); }
.legend__key--plan { background: var(--book); }
.legend__key--over { background: var(--over); }

/* ---- 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(--line); }
.faq__item { border-bottom: 1px solid var(--line); }
.faq__item summary {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.15rem 0;
    font-weight: 600;
    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: a passport page with the stamp ---- */
.closing {
    width: min(1600px, calc(100% - 2 * var(--edge-gap)));
    margin: 0 auto;
    padding: clamp(4rem, 8vw, 6rem) 1.25rem;
    border-radius: var(--radius);
    background: var(--paper);
    text-align: center;
}
.closing__stamp {
    width: 96px;
    height: 96px;
    margin: 0 auto 1.5rem;
    border-radius: 22px;
    box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.12), 0 10px 24px -10px rgba(0, 0, 0, 0.35);
}
.closing__title {
    font-family: var(--display);
    font-size: var(--t-xl);
    font-weight: 700;
    line-height: 1.02;
    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: 600; text-decoration: none; }
.site-footer__cols a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---- 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: 760px) {
    .hero__map { --cx: 40; --cw: 330; --fy: 228; height: 340px; }
    .hero__map::after { content: none; }
    .hero__sheet { grid-template-columns: 1fr; }
    .hero__phone { justify-self: center; height: 360px; margin: 0 0 calc(-1 * clamp(2.5rem, 5vw, 4rem)); overflow: hidden; }
    .hero__phone .phone { width: 250px; }
}

@media (max-width: 560px) {
    :root { --radius: 22px; --edge-gap: 6px; }
    .topbar__link { display: none; }
    .map__pin { font-size: 12px; padding: 4px 9px 5px; }
    .map__pin b { font-size: 13px; }
    .tile { padding: 1.75rem 1.5rem 0; }
    .chart__svg { height: 250px; }
    .night__phones { height: 360px; gap: 0.75rem; padding: 0.5rem 0.5rem 0; }
    .site-footer__cols { gap: 2.5rem; }
}

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