/*
 * ENS Solutions product site.
 *
 * One stylesheet for the whole site: no build step, no CDN, no runtime
 * dependencies. Everything is served straight out of nginx, so the only
 * things the browser fetches are this file and the HTML.
 *
 * Colours are declared once as tokens on :root and re-declared for dark
 * mode. Nothing below the token blocks hard-codes a colour.
 */

/* ---------------------------------------------------------------- *
 * Tokens
 * ---------------------------------------------------------------- */
:root {
    color-scheme: light dark;

    --bg:            #f6f7f9;
    --surface:       #ffffff;
    --surface-alt:   #f0f2f6;
    --text:          #0f1520;
    --text-muted:    #56607a;
    --border:        #e0e4ed;

    --accent:        #14509c;
    --accent-hover:  #0f3f7d;
    --accent-soft:   #e8f0fb;
    --accent-text:   #ffffff;

    --pending:       #8a5a00;
    --pending-soft:  #fdf3e0;

    --shadow: 0 1px 2px rgba(15, 21, 32, .06), 0 4px 16px rgba(15, 21, 32, .05);
    --radius: 10px;
    --maxw: 1080px;

    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg:           #0d1117;
        --surface:      #151b24;
        --surface-alt:  #1b222d;
        --text:         #e7edf5;
        --text-muted:   #9aa6b8;
        --border:       #262e3b;

        --accent:       #5b9bff;
        --accent-hover: #7cb0ff;
        --accent-soft:  #16263f;
        --accent-text:  #0d1117;

        --pending:      #e0b055;
        --pending-soft: #2a2113;

        --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .3);
    }
}

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin: 0 0 .5em;
    font-weight: 650;
}

h1 { font-size: clamp(2rem, 5vw, 2.9rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.75rem); }
h3 { font-size: 1.05rem; font-weight: 620; }

p { margin: 0 0 1rem; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }

code {
    font-family: var(--mono);
    font-size: .875em;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: .1em .35em;
}

.wrap {
    max-width: var(--maxw);
    margin: 0 auto;
    padding-inline: 20px;
}

.lede {
    font-size: 1.125rem;
    color: var(--text-muted);
    max-width: 62ch;
}

/* Available to assistive tech, absent from the visual layout. */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* Skip link — visible only when focused. */
.skip {
    position: absolute;
    left: -9999px;
}
.skip:focus {
    left: 20px;
    top: 12px;
    z-index: 10;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: .5rem .9rem;
}

/* ---------------------------------------------------------------- *
 * Header / footer
 * ---------------------------------------------------------------- */
.site-header {
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    position: sticky;
    top: 0;
    z-index: 5;
}

.site-header .wrap {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    min-height: 62px;
    flex-wrap: wrap;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    font-weight: 680;
    letter-spacing: -0.02em;
    color: var(--text);
    text-decoration: none;
    font-size: 1.05rem;
}

.brand:hover { color: var(--text); }

.brand-mark {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: var(--accent);
    color: var(--accent-text);
    display: grid;
    place-items: center;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .02em;
    flex: none;
}

.site-nav {
    margin-left: auto;
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.site-nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: .925rem;
    font-weight: 500;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] { color: var(--text); }

.site-footer {
    border-top: 1px solid var(--border);
    margin-top: 5rem;
    padding-block: 2rem;
    color: var(--text-muted);
    font-size: .875rem;
}

.site-footer .wrap {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ---------------------------------------------------------------- *
 * Hero
 * ---------------------------------------------------------------- */
.hero {
    padding-block: clamp(3rem, 8vw, 5.5rem) 1rem;
}

.hero h1 { max-width: 20ch; }

.eyebrow {
    text-transform: uppercase;
    letter-spacing: .09em;
    font-size: .75rem;
    font-weight: 650;
    color: var(--accent);
    margin-bottom: .75rem;
}

/* ---------------------------------------------------------------- *
 * Cards
 * ---------------------------------------------------------------- */
.section { padding-block: 2.5rem; }

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr));
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}

/* The whole product card is one click target, via a stretched link. */
.card--link { position: relative; transition: border-color .15s, transform .15s; }
.card--link:hover { border-color: var(--accent); transform: translateY(-2px); }

.card h3 { margin-bottom: .35rem; }

.card h3 a {
    text-decoration: none;
    color: var(--text);
}

.card h3 a::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
}

.card p {
    color: var(--text-muted);
    font-size: .95rem;
    margin-bottom: 1rem;
}

.card .card-cta {
    margin-top: auto;
    font-size: .9rem;
    font-weight: 600;
    color: var(--accent);
}

/* ---------------------------------------------------------------- *
 * Badges
 * ---------------------------------------------------------------- */
.badge {
    display: inline-block;
    font-size: .7rem;
    font-weight: 680;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: .2rem .55rem;
    border-radius: 999px;
    vertical-align: middle;
    white-space: nowrap;
}

.badge--live    { background: var(--accent-soft);  color: var(--accent); }
.badge--pending { background: var(--pending-soft); color: var(--pending); }

/* ---------------------------------------------------------------- *
 * Buttons
 * ---------------------------------------------------------------- */
.btn-row {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 1.75rem;
}

.btn {
    display: inline-block;
    padding: .65rem 1.35rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: .95rem;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
}

.btn--primary {
    background: var(--accent);
    color: var(--accent-text);
}
.btn--primary:hover {
    background: var(--accent-hover);
    color: var(--accent-text);
}

.btn--ghost {
    border-color: var(--border);
    background: var(--surface);
    color: var(--text);
}
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }

/* Not a link: there is no demo to point at yet. */
.btn--disabled {
    background: var(--surface-alt);
    color: var(--text-muted);
    border-color: var(--border);
    cursor: not-allowed;
}

.btn-note {
    font-size: .85rem;
    color: var(--text-muted);
}

/* ---------------------------------------------------------------- *
 * Feature list
 * ---------------------------------------------------------------- */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
    gap: 1.75rem 2rem;
    margin-top: 1.5rem;
}

.feature h3 { margin-bottom: .3rem; }

.feature p {
    color: var(--text-muted);
    font-size: .95rem;
    margin: 0;
}

/* ---------------------------------------------------------------- *
 * Spec table
 * ---------------------------------------------------------------- */
.table-scroll {
    overflow-x: auto;
    margin-top: 1.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

table {
    border-collapse: collapse;
    width: 100%;
    font-size: .925rem;
}

th, td {
    text-align: left;
    padding: .8rem 1.1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

thead th {
    background: var(--surface-alt);
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
}

tbody tr:last-child td { border-bottom: none; }

th[scope="row"] {
    font-weight: 600;
    white-space: nowrap;
}

/* ---------------------------------------------------------------- *
 * Callout
 * ---------------------------------------------------------------- */
.callout {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-top: 2rem;
}

.callout p:last-child { margin-bottom: 0; }

/* ---------------------------------------------------------------- *
 * Product page furniture
 * ---------------------------------------------------------------- */
.backlink {
    display: inline-block;
    font-size: .875rem;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 1.25rem;
}
.backlink:hover { color: var(--accent); }

.title-row {
    display: flex;
    align-items: center;
    gap: .85rem;
    flex-wrap: wrap;
    margin-bottom: .5rem;
}

.title-row h1 { margin: 0; }

.flow-steps {
    list-style: none;
    counter-reset: step;
    padding: 0;
    margin: 1.5rem 0 0;
    display: grid;
    gap: 1rem;
}

.flow-steps li {
    counter-increment: step;
    position: relative;
    padding-left: 2.75rem;
    color: var(--text-muted);
}

.flow-steps li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: .1rem;
    width: 1.85rem;
    height: 1.85rem;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    display: grid;
    place-items: center;
    font-size: .8rem;
    font-weight: 700;
}

.flow-steps strong { color: var(--text); }

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}
