/* ==========================================================================
   04 · COMPONENTS — buttons, badges, cards, cookie banner, seals, legal
   ========================================================================== */

/* ---------- Buttons ---------- */
.btn {
    --btn-bg: transparent; --btn-fg: currentColor; --btn-bd: transparent;
    position: relative; isolation: isolate; overflow: hidden;
    display: inline-flex; align-items: center; justify-content: center; gap: .55em;
    padding: .85rem 1.4rem;
    font-weight: 600; font-size: var(--fs-sm); letter-spacing: .01em; white-space: nowrap;
    color: var(--btn-fg); background: var(--btn-bg);
    border: 1px solid var(--btn-bd); border-radius: 999px;
    transition: color .3s, border-color .3s, box-shadow .3s, transform .3s var(--ease-out);
}
/* Fill sweep on hover */
.btn::before {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background: var(--btn-hover, var(--accent));
    transform: translateY(101%); border-radius: inherit;
    transition: transform .45s var(--ease-out);
}
.btn:hover::before { transform: none; }
.btn .icon { width: 1.1em; height: 1.1em; transition: transform .3s var(--ease-out); }
.btn:hover .icon { transform: translateX(3px); }

.btn-sm { padding: .55rem 1.05rem; font-size: var(--fs-xs); }
.btn-lg { padding: 1.05rem 1.8rem; font-size: var(--fs-base); }

.btn-primary { --btn-bg: var(--brand); --btn-fg: var(--black); --btn-hover: var(--white); }
.btn-primary:hover { box-shadow: 0 12px 30px -10px var(--brand-glow); }
.btn-accent  { --btn-bg: var(--accent); --btn-fg: var(--black); --btn-hover: var(--white); }
.btn-accent:hover { box-shadow: 0 12px 30px -10px var(--accent-glow); }
.btn-ghost   { --btn-bd: color-mix(in srgb, currentColor 30%, transparent); --btn-hover: var(--white); }
.btn-ghost:hover { --btn-fg: var(--black); color: var(--black); border-color: var(--white); }
.btn-ghost-dark { --btn-bd: var(--border-strong); --btn-hover: var(--surface-2); }

/* ---------- Small atoms ---------- */
.eyebrow {
    display: inline-flex; align-items: center; gap: .7em;
    padding: .45rem 1rem .45rem .8rem; margin-bottom: 1.8rem;
    font-family: var(--font-mono); font-size: var(--fs-xs); letter-spacing: .08em;
    border: 1px solid rgb(255 255 255 / .16); border-radius: 999px;
    background: rgb(255 255 255 / .04);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.pulse-dot {
    position: relative; display: inline-block; width: 8px; height: 8px; border-radius: 50%;
    background: var(--accent);
}
.pulse-dot::after {
    content: ""; position: absolute; inset: -4px; border-radius: 50%;
    border: 1px solid var(--accent); animation: pulse-ring 2s var(--ease-out) infinite;
}

.check-list { display: grid; gap: .7rem; margin: 1.6rem 0 2rem; }
.check-list li { display: flex; align-items: center; gap: .7em; font-weight: 500; }
.check-list .icon { color: var(--brand-text); }

.link-arrow {
    display: inline-flex; align-items: center; gap: .4em;
    font-size: var(--fs-sm); font-weight: 600; color: var(--brand-text);
}
.link-arrow .icon { transition: transform .3s var(--ease-out); }
.link-arrow:hover .icon { transform: translateX(4px); }
.link-arrow--back .icon { transform: rotate(180deg); }
.link-arrow--back:hover .icon { transform: rotate(180deg) translateX(4px); }

/* ---------- Spotlight cards (glow follows cursor; see spotlight.js) ---------- */
[data-spotlight] > * {
    --mx: 50%; --my: 50%;
    position: relative; isolation: isolate;
}
[data-spotlight] > *::after {
    content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
    background: radial-gradient(420px circle at var(--mx) var(--my), color-mix(in srgb, var(--brand) 18%, transparent), transparent 45%);
    opacity: 0; transition: opacity .4s;
    pointer-events: none;
}
[data-spotlight] > *:hover::after { opacity: 1; }

/* ---------- Toggle switch ---------- */
.switch { position: relative; flex-shrink: 0; }
.switch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; z-index: 1; }
.switch-ui {
    display: block; width: 44px; height: 24px; border-radius: 999px;
    background: var(--border-strong); transition: background-color .25s;
}
.switch-ui::after {
    content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
    border-radius: 50%; background: var(--white); box-shadow: var(--shadow-sm);
    transition: transform .3s var(--ease-out);
}
.switch input:checked + .switch-ui { background: var(--brand); }
.switch input:checked + .switch-ui::after { transform: translateX(20px); }
.switch input:focus-visible + .switch-ui { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Cookie banner ---------- */
.cookie-banner {
    position: fixed; left: 20px; bottom: calc(var(--footer-bar-h, 44px) + 16px); z-index: 200;
    width: min(440px, calc(100vw - 40px));
    max-height: calc(100vh - var(--footer-bar-h, 44px) - 40px); overflow-y: auto;
    padding: 24px;
    background: var(--surface); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    font-size: var(--fs-sm);
    animation: slide-up .6s var(--ease-out) both;
}
.cookie-banner[hidden] { display: none; }
.cookie-head { display: flex; align-items: center; gap: 12px; margin-bottom: .7rem; }
.cookie-head h2 { margin: 0; font-size: var(--fs-md); }
.cookie-icon {
    display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
    background: var(--accent-soft); color: var(--accent);
}
.cookie-banner p { color: var(--text-muted); }
.cookie-banner a { color: var(--brand-text); text-decoration: underline; text-underline-offset: 3px; }
.cookie-prefs { display: grid; gap: 10px; margin-bottom: 18px; }
.cookie-prefs[hidden] { display: none; }
.cookie-cat {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 12px 14px; border-radius: 12px; background: var(--bg-alt); border: 1px solid var(--border);
}
.cookie-cat strong { display: block; font-size: var(--fs-sm); }
.cookie-cat small { display: block; color: var(--text-muted); line-height: 1.45; }
.cookie-always { font-size: var(--fs-xs); font-weight: 600; color: var(--brand-text); white-space: nowrap; }
.cookie-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.cookie-actions .btn { flex: 1 1 auto; }
.cookie-actions [hidden] { display: none; }

/* ---------- Rotating seals (sustainability) ---------- */
.seals { display: flex; justify-content: center; gap: clamp(16px, 4vw, 40px); }
.seal { position: relative; width: clamp(118px, 18vw, 200px); aspect-ratio: 1; }
.seal-ring { display: block; width: 100%; height: 100%; max-width: 100%; animation: spin 22s linear infinite; }
.seal--accent .seal-ring { animation-direction: reverse; animation-duration: 28s; }
.seal-ring text {
    font-family: var(--font-mono); font-size: 12.5px; font-weight: 600; letter-spacing: .12em;
    fill: var(--brand-text);
}
.seal--accent .seal-ring text { fill: var(--accent); }
.seal-core {
    position: absolute; inset: 26%;
    display: grid; place-items: center; border-radius: 50%;
    background: var(--brand); color: var(--black);
    box-shadow: 0 0 0 8px color-mix(in srgb, var(--brand) 18%, transparent), 0 20px 40px -12px var(--brand-glow);
}
.seal--accent .seal-core {
    background: var(--accent);
    box-shadow: 0 0 0 8px var(--accent-soft), 0 20px 40px -12px var(--accent-glow);
}
.seal-core .icon { width: 38%; height: 38%; }

/* ---------- Legal pages ---------- */
.legal-page { padding: calc(var(--header-h) + 60px) 0 var(--section-y); }
.legal-layout { display: grid; grid-template-columns: 240px 1fr; gap: 64px; align-items: start; }
.legal-nav { position: sticky; top: calc(var(--header-h) + 24px); }
.legal-nav ul { margin-top: 28px; display: grid; gap: 4px; border-left: 1px solid var(--border); }
.legal-nav li a {
    display: block; padding: .5rem 1rem; margin-left: -1px;
    color: var(--text-muted); border-left: 2px solid transparent; transition: .2s;
}
.legal-nav li a:hover { color: var(--text); }
.legal-nav li a.is-active { color: var(--text); border-left-color: var(--accent); font-weight: 600; }
.legal-content { max-width: 760px; }
.legal-content h1 { font-size: var(--fs-2xl); margin-bottom: .3em; }
.legal-content h2 { font-size: var(--fs-lg); margin: 2.2em 0 .6em; }
.legal-content p, .legal-content li { color: var(--text-muted); }
.legal-content ul { list-style: disc; padding-left: 1.3em; margin-bottom: 1.1em; }
.legal-content li { margin-bottom: .35em; }
.legal-content a { color: var(--brand-text); text-decoration: underline; text-underline-offset: 3px; }
.legal-content table { width: 100%; border-collapse: collapse; margin: 1em 0 1.6em; font-size: var(--fs-sm); }
.legal-content th, .legal-content td { text-align: left; padding: .7em .8em; border-bottom: 1px solid var(--border); vertical-align: top; }
.legal-content th { font-family: var(--font-mono); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--text); }
.legal-meta { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--brand-text) !important; }
@media (max-width: 860px) {
    .legal-layout { grid-template-columns: 1fr; gap: 32px; }
    .legal-nav { position: static; }
}
