/* =============================================================================
   Marketing site shell (pearl) — shared by landing.html and the standalone
   public pages (/how-it-works/, /security/, /terms/, /cookie-policy/,
   /privacy-policy.html).
   Tokens, typography, nav, buttons, page cards, footer, cookie modal.
   Landing-only rules live in landing.css. The nav and footer markup lives in
   site-shell/ at the repo root; tests/site-shell.test.js checks every page
   carries it verbatim. Violet and cyan are decorative only: never text, never
   the only signal for a state.
   ============================================================================= */

*, *::before, *::after { box-sizing: border-box; }

:root {
    --pearl: #F3F1FF;
    --white: #FFFFFF;
    --ink: #1B1640;
    --ink-hover: #2E2860;
    --muted: #57527A;
    --lilac: #E4DFFF;
    --link: #5546E0;
    --violet: #7B6CFF;
    --cyan: #6FE3F0;
    --radius-card: clamp(20px, 3vw, 32px);
    --gutter: clamp(18px, 4vw, 40px);
    --frame: clamp(8px, 1.4vw, 16px);
    --mesh: linear-gradient(120deg, #E9E4FF, #C9F4F7 30%, #F1DAFF 60%, #DCD6FF);
}

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--pearl);
    color: var(--ink);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p { margin: 0; }

a { color: var(--link); }
a:hover { color: var(--ink); }

:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 3px;
}

/* PAGE FRAME — the pearl ground with rounded white cards sitting on it */
.site-frame {
    padding: var(--frame);
    display: flex;
    flex-direction: column;
    gap: var(--frame);
}

.card {
    position: relative;
    background: var(--white);
    border-radius: var(--radius-card);
}

.wrap {
    position: relative;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 var(--gutter);
}

/* NAV */
.site-nav {
    position: relative;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 22px;
}

.site-logo {
    font-weight: 600;
    font-size: 19px;
    letter-spacing: -0.03em;
    color: var(--ink);
    text-decoration: none;
    margin-right: 16px;
}

.site-logo:hover { color: var(--ink); }

.site-nav-menu {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.site-nav-links {
    display: flex;
    gap: 32px;
    margin: 0 auto;
    font-size: 14px;
    font-weight: 500;
}

.site-nav-links a {
    color: var(--ink);
    text-decoration: none;
}

.site-nav-links a:hover { color: var(--link); }

.site-nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: 0;
    background: var(--pearl);
    color: var(--ink);
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.site-nav-toggle .icon-close { display: none; }
.site-nav.is-open .site-nav-toggle .icon-open { display: none; }
.site-nav.is-open .site-nav-toggle .icon-close { display: block; }

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 999px;
    border: 0;
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.btn-ink { background: var(--ink); color: var(--white); }
.btn-ink:hover { background: var(--ink-hover); color: var(--white); }

.btn-soft { background: var(--pearl); color: var(--ink); }
.btn-soft:hover { background: var(--lilac); color: var(--ink); }

.btn-lg { font-size: 15px; padding: 0 22px; min-height: 48px; }

/* Primary CTA with the round arrow chip on the right */
.btn-arrow {
    gap: 14px;
    padding: 6px 6px 6px 22px;
    font-size: 15px;
    min-height: 48px;
}

.btn-arrow-chip {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--white);
    color: var(--ink);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* SHARED TYPE */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--pearl);
    color: var(--muted);
}

.pill-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--violet), var(--cyan));
}

.display-2 {
    font-weight: 500;
    font-size: clamp(32px, 4.6vw, 56px);
    line-height: 1.04;
    letter-spacing: -0.045em;
}

.lead {
    font-size: 16px;
    line-height: 1.6;
    color: var(--muted);
}

/* STANDALONE PAGES — header card (nav + title) followed by a content card */
.page-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 18px;
    padding: clamp(48px, 7vw, 88px) 0 clamp(40px, 6vw, 72px);
}

.page-title {
    max-width: 820px;
    font-weight: 500;
    font-size: clamp(36px, 5.6vw, 64px);
    line-height: 1.04;
    letter-spacing: -0.05em;
}

.page-head .lead { max-width: 560px; }

.page-body { padding: clamp(40px, 6vw, 80px) 0; }

.page-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding-top: clamp(28px, 4vw, 40px);
}

/* Step cards (landing How it works and /how-it-works/) */
.steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.step {
    background: var(--pearl);
    border-radius: 22px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.step-num {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    background: var(--white);
    color: var(--ink);
}

.step h2,
.step h3 {
    font-size: 19px;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.step p {
    font-size: 15px;
    line-height: 1.6;
    color: var(--muted);
}

/* /how-it-works/ — seven steps do not divide into the auto-fit grid (the last
   row orphans), so they run as one numbered column, number beside the text,
   stacking above it on phones. */
.steps-flow {
    grid-template-columns: 1fr;
    max-width: 780px;
    margin: 0 auto;
}

.steps-flow .step {
    display: grid;
    grid-template-columns: 40px 1fr;
    align-items: start;
    column-gap: 20px;
}

.steps-flow .step-text {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.page-signoff {
    max-width: 780px;
    margin: clamp(32px, 4vw, 44px) auto 0;
    text-align: center;
    font-size: 17px;
    font-weight: 600;
    color: var(--ink);
}

.page-cta-note {
    font-size: 15px;
    color: var(--muted);
}

/* Policy pages (cookie policy, privacy policy) */
.policy-updated {
    font-size: 14px;
    color: var(--muted);
}

.policy-body {
    max-width: 780px;
    margin: 0 auto;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.7;
}

.policy-body h2 {
    color: var(--ink);
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 2.25rem 0 0.75rem;
}

.policy-body h2:first-child { margin-top: 0; }
.policy-body p { margin: 0 0 1rem; }
.policy-body ul { padding-left: 1.4rem; margin: 0.5rem 0 1rem; }
.policy-body li { margin-bottom: 0.35rem; }
.policy-body strong { color: var(--ink); font-weight: 600; }
.policy-body a { color: var(--link); text-decoration: underline; overflow-wrap: anywhere; }
.policy-body code { font-size: 0.9em; background: var(--pearl); padding: 1px 6px; border-radius: 6px; }

.policy-table-wrap {
    overflow-x: auto;
    margin: 0.75rem 0 1.25rem;
    border-radius: 16px;
    border: 1px solid var(--lilac);
}

.policy-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.policy-table th,
.policy-table td {
    padding: 0.7rem 0.85rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--lilac);
}

.policy-table tr:last-child td { border-bottom: 0; }

.policy-table th {
    background: var(--pearl);
    color: var(--ink);
    font-weight: 600;
}

.policy-settings-btn {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: var(--link);
    text-decoration: underline;
    cursor: pointer;
}

/* FOOTER */
.site-footer {
    padding: 36px var(--gutter);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 16px;
    font-size: 14px;
    color: var(--muted);
}

.footer-brand a {
    color: var(--ink);
    font-weight: 600;
    text-decoration: none;
}

.footer-copyright,
.footer-legal {
    margin-top: 4px;
    font-size: 13px;
}

/* Companies Act disclosure — the width cap keeps the long line from pushing
   the links column across on desktop. */
.footer-legal {
    max-width: 30rem;
    line-height: 1.5;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 22px;
}

.footer-link {
    color: var(--muted);
    font-size: 14px;
}

.footer-link:hover { color: var(--ink); }

/* "Cookie settings" in the footer is a button (it opens the banner, it does
   not navigate) dressed as a footer link. */
.footer-link-button {
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    text-decoration: underline;
    cursor: pointer;
}

/* COOKIE CONSENT MODAL — built by /js/cookie-banner.js. */
#cookie-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(27, 22, 64, 0.45);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: cookie-fade-in 0.2s ease-out;
}

#cookie-modal {
    background: var(--white);
    border-radius: 24px;
    max-width: 440px;
    width: 100%;
    padding: 1.75rem;
    box-shadow: 0 24px 60px rgba(27, 22, 64, 0.22);
    font-family: inherit;
}

#cookie-modal h3 {
    font-family: inherit;
    font-size: 19px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--ink);
    margin: 0 0 0.6rem;
}

#cookie-modal p {
    font-size: 14px;
    line-height: 1.55;
    color: var(--muted);
    margin: 0 0 1.25rem;
}

#cookie-modal .cookie-modal-btn {
    background: var(--ink);
    color: var(--white);
    border: none;
    border-radius: 999px;
    min-height: 44px;
    padding: 0 20px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

#cookie-modal .cookie-modal-btn:hover { background: var(--ink-hover); }

/* Two choices of equal weight: same size, same style, side by side. */
#cookie-modal .cookie-modal-actions {
    display: flex;
    gap: 0.75rem;
}

#cookie-modal .cookie-modal-actions .cookie-modal-btn { flex: 1; }

#cookie-modal .cookie-modal-more { margin-top: -0.5rem; }

#cookie-modal .cookie-modal-more a { color: var(--link); text-decoration: underline; }

@keyframes cookie-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* PHONE — at 760px and below the nav links fold behind the menu button.
   site-nav.js adds .has-js; without JS the links wrap onto a second row. */
@media (max-width: 760px) {
    .site-nav { flex-wrap: wrap; }
    .site-logo { margin-right: auto; }
    .site-nav-menu { order: 3; flex-basis: 100%; flex-wrap: wrap; }
    .site-nav-links { margin: 0; gap: 8px 20px; flex-wrap: wrap; }

    .site-nav.has-js .site-nav-toggle { display: inline-flex; }
    .site-nav.has-js .site-nav-menu {
        display: none;
        position: absolute;
        top: calc(100% + 10px);
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        padding: 10px;
        background: var(--white);
        border-radius: 22px;
        box-shadow: 0 20px 50px rgba(27, 22, 64, 0.16);
    }
    .site-nav.has-js.is-open .site-nav-menu { display: flex; }
    .site-nav.has-js .site-nav-links { flex-direction: column; gap: 4px; }
    .site-nav.has-js .site-nav-links a,
    .site-nav.has-js .site-nav-signin {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        min-height: 44px;
        padding: 0 16px;
        border-radius: 14px;
        font-size: 15px;
    }
    .site-nav.has-js .site-nav-links a:hover { background: var(--pearl); color: var(--ink); }

    .steps-flow .step { grid-template-columns: 1fr; row-gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}
