/* ==========================================================================
   AI Humanizer — stylesheet

   Organised as: tokens, reset, primitives, layout, then components in the
   order they appear down the page.

   Two theme rules worth knowing before editing:
     - Every colour is defined on bare :root as a light value first. The dark
       overrides only redefine tokens, never add new ones, so a component
       written against the tokens works in both themes for free.
     - The dark palette is applied both by media query (system preference) and
       by [data-theme="dark"] (explicit toggle), which is why each block is
       duplicated. The :not() guard stops the media query from overriding an
       explicit light choice.
   ========================================================================== */

:root {
    /* Surfaces, from the page backdrop inwards. */
    --bg:            #f7f7fb;
    --bg-elevated:   #ffffff;
    --surface:       #ffffff;
    --surface-2:     #f1f1f7;
    --surface-3:     #e7e7f0;

    /* Text, from loudest to quietest. */
    --text:          #14141f;
    --text-muted:    #55556b;
    --text-subtle:   #8686a0;

    --border:        #e2e2ec;
    --border-strong: #cfcfdd;

    /* One accent, used as a pair so gradients have somewhere to go. */
    --accent:        #6d4aff;
    --accent-2:      #00b4d8;
    --accent-soft:   rgba(109, 74, 255, 0.10);
    --accent-text:   #5a37e8;

    --good:          #0f9d6e;
    --warn:          #c77700;
    --bad:           #d63d3d;

    --on-accent:     #ffffff;

    /* A wash behind the hero. Kept as a token so the dark theme can swap it
       for something with more contrast without touching the markup. */
    --glow-1: rgba(109, 74, 255, 0.18);
    --glow-2: rgba(0, 180, 216, 0.14);

    --shadow-sm: 0 1px 2px rgba(20, 20, 31, 0.05);
    --shadow-md: 0 4px 16px rgba(20, 20, 31, 0.07);
    --shadow-lg: 0 16px 48px rgba(20, 20, 31, 0.10);

    --radius-sm: 8px;
    --radius:    14px;
    --radius-lg: 22px;
    --radius-pill: 999px;

    /* A single type scale. Sizes clamp so nothing needs a media query. */
    --step--1: clamp(0.80rem, 0.78rem + 0.10vw, 0.86rem);
    --step-0:  clamp(0.94rem, 0.91rem + 0.14vw, 1.02rem);
    --step-1:  clamp(1.08rem, 1.02rem + 0.28vw, 1.24rem);
    --step-2:  clamp(1.32rem, 1.20rem + 0.58vw, 1.70rem);
    --step-3:  clamp(1.70rem, 1.44rem + 1.20vw, 2.50rem);
    --step-4:  clamp(2.20rem, 1.68rem + 2.40vw, 3.90rem);

    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
            "Helvetica Neue", "Noto Sans", Arial, sans-serif;
    --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono",
                 Menlo, Consolas, monospace;

    --container: 1180px;
    --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* System preference. Guarded so an explicit light choice still wins. */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg:            #08080d;
        --bg-elevated:   #0f0f17;
        --surface:       #12121c;
        --surface-2:     #1a1a26;
        --surface-3:     #232331;

        --text:          #ecebf5;
        --text-muted:    #a3a3bd;
        --text-subtle:   #6f6f8c;

        --border:        #24243250;
        --border-strong: #35354a;

        --accent:        #8b6cff;
        --accent-2:      #22d3ee;
        --accent-soft:   rgba(139, 108, 255, 0.14);
        --accent-text:   #a68cff;

        --good:          #34d399;
        --warn:          #fbbf24;
        --bad:           #f87171;

        --glow-1: rgba(139, 108, 255, 0.22);
        --glow-2: rgba(34, 211, 238, 0.16);

        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
        --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.45);
        --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.55);
    }
}

/* Explicit choice. Repeats the dark block so the toggle wins in both
   directions, including on a system set to light. */
:root[data-theme="dark"] {
    --bg:            #08080d;
    --bg-elevated:   #0f0f17;
    --surface:       #12121c;
    --surface-2:     #1a1a26;
    --surface-3:     #232331;

    --text:          #ecebf5;
    --text-muted:    #a3a3bd;
    --text-subtle:   #6f6f8c;

    --border:        #24243250;
    --border-strong: #35354a;

    --accent:        #8b6cff;
    --accent-2:      #22d3ee;
    --accent-soft:   rgba(139, 108, 255, 0.14);
    --accent-text:   #a68cff;

    --good:          #34d399;
    --warn:          #fbbf24;
    --bad:           #f87171;

    --glow-1: rgba(139, 108, 255, 0.22);
    --glow-2: rgba(34, 211, 238, 0.16);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.55);
}

/* ==========================================================================
   Reset
   ========================================================================== */

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

* { margin: 0; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: 84px;
}

body {
    font-family: var(--font);
    font-size: var(--step-0);
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }

button, input, textarea, select {
    font: inherit;
    color: inherit;
}

button { cursor: pointer; background: none; border: none; }

a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.15; font-weight: 700; letter-spacing: -0.022em; }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==========================================================================
   Primitives
   ========================================================================== */

.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: clamp(1rem, 4vw, 2rem);
}

.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.skip-link {
    position: absolute;
    top: -60px; left: 1rem;
    z-index: 200;
    padding: 0.7rem 1.2rem;
    background: var(--accent);
    color: var(--on-accent);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    font-weight: 600;
    transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 0; text-decoration: none; }

.gradient-text {
    background: linear-gradient(100deg, var(--accent) 10%, var(--accent-2) 90%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--border);
}

.header-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    height: 64px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    font-size: var(--step-1);
    letter-spacing: -0.03em;
    color: var(--text);
    margin-right: auto;
}
.logo:hover { text-decoration: none; }

.logo-mark {
    width: 30px; height: 30px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    flex-shrink: 0;
}

.nav-list {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    list-style: none;
    padding: 0;
}

.nav-link {
    display: block;
    padding: 0.45rem 0.8rem;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: var(--step--1);
    font-weight: 550;
    transition: color 0.15s var(--ease), background 0.15s var(--ease);
}
.nav-link:hover {
    color: var(--text);
    background: var(--surface-2);
    text-decoration: none;
}

.icon-btn {
    display: grid;
    place-items: center;
    width: 36px; height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    color: var(--text-muted);
    background: var(--surface);
    transition: color 0.15s var(--ease), border-color 0.15s var(--ease);
    flex-shrink: 0;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }

/* Only one of the two icons is shown, chosen by the active theme. */
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: none; }
    :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: block; }
}

.menu-toggle { display: none; }

@media (max-width: 860px) {
    .menu-toggle {
        display: grid;
        place-items: center;
        gap: 4px;
        width: 36px; height: 36px;
        border-radius: var(--radius-sm);
        border: 1px solid var(--border);
        background: var(--surface);
    }
    .menu-bar {
        display: block;
        width: 16px; height: 1.5px;
        background: var(--text);
        border-radius: 2px;
        transition: transform 0.2s var(--ease), opacity 0.2s var(--ease);
    }
    .menu-toggle[aria-expanded="true"] .menu-bar:nth-child(1) {
        transform: translateY(5.5px) rotate(45deg);
    }
    .menu-toggle[aria-expanded="true"] .menu-bar:nth-child(2) { opacity: 0; }
    .menu-toggle[aria-expanded="true"] .menu-bar:nth-child(3) {
        transform: translateY(-5.5px) rotate(-45deg);
    }

    .primary-nav {
        position: absolute;
        top: 64px; left: 0; right: 0;
        background: var(--bg-elevated);
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-lg);
        display: none;
        padding: 0.6rem clamp(1rem, 4vw, 2rem) 1rem;
    }
    .primary-nav.is-open { display: block; }
    .nav-list { flex-direction: column; align-items: stretch; gap: 0; }
    .nav-link { padding: 0.75rem 0.5rem; font-size: var(--step-0); }
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
    position: relative;
    padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(2rem, 5vw, 3.5rem);
}

/* Two soft radial washes behind the hero. Painted on a pseudo-element so the
   blur never triggers layout on the content above it. */
.hero::before {
    content: "";
    position: absolute;
    inset: -20% -10% auto -10%;
    height: 620px;
    background:
        radial-gradient(52% 60% at 22% 12%, var(--glow-1), transparent 70%),
        radial-gradient(46% 55% at 82% 5%, var(--glow-2), transparent 72%);
    pointer-events: none;
    z-index: -1;
}

.hero-intro {
    text-align: center;
    max-width: 760px;
    margin: 0 auto clamp(1.8rem, 4vw, 2.75rem);
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.32rem 0.85rem 0.32rem 0.5rem;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    font-size: var(--step--1);
    font-weight: 550;
    margin-bottom: 1.4rem;
    box-shadow: var(--shadow-sm);
}

.badge-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--good);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 22%, transparent);
}

.hero-heading {
    font-size: var(--step-4);
    letter-spacing: -0.038em;
    margin-bottom: 1.1rem;
}

.hero-subheading {
    font-size: var(--step-1);
    color: var(--text-muted);
    max-width: 58ch;
    margin-inline: auto;
    text-wrap: pretty;
}

/* ==========================================================================
   Tool
   ========================================================================== */

.tool {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.tool-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.4rem;
    padding: 0.9rem 1.1rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
}

.control-group {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
}

.control-label {
    font-size: var(--step--1);
    font-weight: 600;
    color: var(--text-subtle);
    white-space: nowrap;
}

/* Horizontal scroll rather than wrapping, so the control keeps one row on a
   narrow screen instead of reflowing the whole bar. */
.chip-row {
    display: flex;
    gap: 0.3rem;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 1px;
}
.chip-row::-webkit-scrollbar { display: none; }

.chip {
    padding: 0.34rem 0.75rem;
    border-radius: var(--radius-pill);
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted);
    font-size: var(--step--1);
    font-weight: 550;
    white-space: nowrap;
    transition: color 0.15s var(--ease), background 0.15s var(--ease);
}
.chip:hover { color: var(--text); background: var(--surface-3); }

.chip[aria-pressed="true"] {
    background: var(--surface);
    border-color: var(--border-strong);
    color: var(--text);
    box-shadow: var(--shadow-sm);
}

.tool-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: stretch;
}

.panel {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.panel + .panel { border-left: 1px solid var(--border); }

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.8rem 1.1rem 0.5rem;
}

.panel-label {
    font-size: var(--step--1);
    font-weight: 650;
    letter-spacing: 0.01em;
    color: var(--text);
}

.char-counter {
    font-size: var(--step--1);
    font-variant-numeric: tabular-nums;
    color: var(--text-subtle);
}
.char-counter.is-over { color: var(--bad); font-weight: 600; }

/* A fixed min-height keeps the tool from resizing when text arrives, which is
   what would otherwise cause a layout shift on first result. */
.editor {
    width: 100%;
    flex: 1;
    min-height: 300px;
    padding: 0.4rem 1.1rem 0.8rem;
    border: none;
    background: transparent;
    color: var(--text);
    font-size: var(--step-0);
    line-height: 1.7;
    resize: vertical;
    font-family: inherit;
}
.editor::placeholder { color: var(--text-subtle); }
.editor:focus { outline: none; }
.editor:focus-visible { outline: none; }

.panel:focus-within { background: color-mix(in srgb, var(--accent) 2.5%, transparent); }

.panel-footer {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.8rem 0.7rem;
    border-top: 1px solid var(--border);
    min-height: 46px;
}

.btn-text {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.6rem;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: var(--step--1);
    font-weight: 550;
    transition: color 0.15s var(--ease), background 0.15s var(--ease);
}
.btn-text:hover { color: var(--text); background: var(--surface-2); }
.btn-text:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-text svg { width: 15px; height: 15px; flex-shrink: 0; }

.panel-footer .spacer { margin-left: auto; }

/* --- The action column between the two panels --- */

.action-bridge {
    display: grid;
    place-items: center;
    padding: 1rem 0.9rem;
    border-inline: 1px solid var(--border);
    background: var(--surface-2);
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 0.85rem 1.5rem;
    border-radius: var(--radius-pill);
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: var(--on-accent);
    font-weight: 650;
    font-size: var(--step-0);
    letter-spacing: -0.01em;
    white-space: nowrap;
    box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 32%, transparent);
    transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease),
                opacity 0.15s var(--ease);
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 28px color-mix(in srgb, var(--accent) 42%, transparent);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.65; cursor: wait; transform: none; }
.btn-primary svg { width: 17px; height: 17px; }

/* The spinner replaces the icon in place, so the button never changes width
   and the layout stays still while a request is running. */
.btn-primary .spinner { display: none; }
.btn-primary.is-loading .icon-default { display: none; }
.btn-primary.is-loading .spinner { display: block; }

.spinner {
    width: 17px; height: 17px;
    border: 2px solid color-mix(in srgb, var(--on-accent) 35%, transparent);
    border-top-color: var(--on-accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.shortcut-hint {
    margin-top: 0.7rem;
    font-size: 0.72rem;
    color: var(--text-subtle);
    text-align: center;
}
.shortcut-hint kbd {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    padding: 0.1rem 0.3rem;
    border: 1px solid var(--border-strong);
    border-bottom-width: 2px;
    border-radius: 4px;
    background: var(--surface);
}

@media (max-width: 900px) {
    .tool-grid { grid-template-columns: 1fr; }
    .panel + .panel { border-left: none; border-top: 1px solid var(--border); }
    .action-bridge {
        border-inline: none;
        border-block: 1px solid var(--border);
        padding: 0.9rem;
    }
    .btn-primary { width: 100%; }
    .editor { min-height: 210px; }
}

/* --- Result readout --- */

.readout {
    display: none;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.6rem;
    padding: 0.9rem 1.1rem;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
}
.readout.is-visible { display: flex; }

.score-shift {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.score-pill {
    display: inline-grid;
    place-items: center;
    min-width: 46px;
    padding: 0.28rem 0.6rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: var(--step-1);
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
    border: 1px solid var(--border-strong);
    background: var(--surface);
}
.score-pill.is-low  { color: var(--bad);  border-color: color-mix(in srgb, var(--bad) 40%, var(--border)); }
.score-pill.is-mid  { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, var(--border)); }
.score-pill.is-high { color: var(--good); border-color: color-mix(in srgb, var(--good) 40%, var(--border)); }

.score-arrow { color: var(--text-subtle); }

.readout-label {
    font-size: var(--step--1);
    color: var(--text-subtle);
    font-weight: 550;
}

.stat-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.2rem;
    margin-left: auto;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
}
.stat-value {
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    font-size: var(--step-0);
}
.stat-name {
    font-size: 0.72rem;
    color: var(--text-subtle);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Words and phrases the analyser flagged in the input. */
.tells {
    display: none;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    padding: 0.75rem 1.1rem;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
}
.tells.is-visible { display: flex; }

.tells-label {
    font-size: var(--step--1);
    color: var(--text-subtle);
    margin-right: 0.3rem;
}

.tell {
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--bad) 12%, transparent);
    color: var(--bad);
    font-size: 0.76rem;
    font-weight: 550;
    font-family: var(--font-mono);
}

/* ==========================================================================
   Sections
   ========================================================================== */

.section { padding: clamp(3rem, 8vw, 5.5rem) 0; }
.section.alt { background: var(--bg-elevated); border-block: 1px solid var(--border); }

.section-intro {
    max-width: 680px;
    margin: 0 auto clamp(2rem, 5vw, 3rem);
    text-align: center;
}

.section-tag {
    display: inline-block;
    padding: 0.25rem 0.7rem;
    border-radius: var(--radius-pill);
    background: var(--accent-soft);
    color: var(--accent-text);
    font-size: 0.74rem;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 0.9rem;
}

.section-heading {
    font-size: var(--step-3);
    margin-bottom: 0.85rem;
}

.section-lead {
    color: var(--text-muted);
    font-size: var(--step-1);
    text-wrap: pretty;
}

.prose { max-width: 68ch; margin-inline: auto; }
.prose p + p { margin-top: 1.1rem; }
.prose p { color: var(--text-muted); }
.prose strong { color: var(--text); font-weight: 650; }

/* --- Feature grid --- */

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr));
    gap: 1.1rem;
}

.card {
    padding: 1.6rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.card:hover { border-color: var(--border-strong); transform: translateY(-2px); }

.card-icon {
    display: grid;
    place-items: center;
    width: 38px; height: 38px;
    border-radius: 11px;
    background: var(--accent-soft);
    color: var(--accent-text);
    margin-bottom: 1rem;
}
.card-icon svg { width: 19px; height: 19px; }

.card-title { font-size: var(--step-1); margin-bottom: 0.45rem; }
.card-body { color: var(--text-muted); font-size: var(--step-0); }

/* --- Steps --- */

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
    gap: 1.5rem;
    counter-reset: step;
}

.step { position: relative; padding-top: 3rem; }

.step::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    top: 0; left: 0;
    display: grid;
    place-items: center;
    width: 38px; height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    font-weight: 700;
    font-size: var(--step-0);
}

.step-title { font-size: var(--step-1); margin-bottom: 0.4rem; }
.step-body { color: var(--text-muted); }

/* --- Modes reference table --- */

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

table { border-collapse: collapse; width: 100%; min-width: 520px; }

th, td {
    padding: 0.85rem 1.1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: var(--step-0);
}
th {
    font-weight: 650;
    font-size: var(--step--1);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-subtle);
    background: var(--surface-2);
}
tbody tr:last-child td { border-bottom: none; }
td:first-child { font-weight: 600; white-space: nowrap; }
td:last-child { color: var(--text-muted); }

/* --- FAQ --- */

.faq { max-width: 760px; margin-inline: auto; }

.faq-item {
    border-bottom: 1px solid var(--border);
}

.faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    padding: 1.25rem 0.25rem;
    text-align: left;
    font-size: var(--step-1);
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.015em;
}
.faq-question:hover { color: var(--accent-text); }

.faq-icon {
    flex-shrink: 0;
    width: 18px; height: 18px;
    color: var(--text-subtle);
    transition: transform 0.25s var(--ease);
}
.faq-question[aria-expanded="true"] .faq-icon { transform: rotate(45deg); }

/* Animating grid-template-rows is what lets the panel open to its natural
   height without JavaScript measuring anything. */
.faq-answer {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.28s var(--ease);
}
.faq-question[aria-expanded="true"] + .faq-answer { grid-template-rows: 1fr; }

.faq-answer > div { overflow: hidden; }
.faq-answer p {
    padding: 0 0.25rem 1.35rem;
    color: var(--text-muted);
    max-width: 62ch;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
    padding: clamp(2.5rem, 6vw, 3.5rem) 0 2rem;
    border-top: 1px solid var(--border);
    background: var(--bg-elevated);
}

.footer-grid {
    display: grid;
    grid-template-columns: minmax(240px, 1.6fr) repeat(auto-fit, minmax(140px, 1fr));
    gap: 2.5rem;
    margin-bottom: 2.5rem;
}

.footer-tagline {
    color: var(--text-muted);
    font-size: var(--step--1);
    max-width: 42ch;
    margin-top: 0.8rem;
}

.footer-heading {
    font-size: var(--step--1);
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-subtle);
    margin-bottom: 0.9rem;
}

.footer-list { list-style: none; padding: 0; display: grid; gap: 0.55rem; }
.footer-list a { color: var(--text-muted); font-size: var(--step--1); }
.footer-list a:hover { color: var(--text); }

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 1.6rem;
    border-top: 1px solid var(--border);
    font-size: var(--step--1);
    color: var(--text-subtle);
}

/* ==========================================================================
   Toast
   ========================================================================== */

.toast {
    position: fixed;
    left: 50%;
    bottom: 1.5rem;
    z-index: 300;
    transform: translate(-50%, 150%);
    max-width: min(90vw, 440px);
    padding: 0.8rem 1.2rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-lg);
    font-size: var(--step-0);
    font-weight: 550;
    text-align: center;
    transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
    opacity: 0;
}
.toast.is-visible { transform: translate(-50%, 0); opacity: 1; }
.toast.is-success { border-color: color-mix(in srgb, var(--good) 55%, var(--border)); }
.toast.is-error   { border-color: color-mix(in srgb, var(--bad) 55%, var(--border)); }
