:root {
    color-scheme: dark;
    --bg:          #02050b;
    --bg-surface:  #07101d;
    --bg-card:     #0b1728;
    --bg-card-hi:  #10223a;
    --cyan:        #199cff;
    --cyan-soft:   #1767ca;
    --cyan-dim:    rgba(25, 156, 255, 0.11);
    --cyan-border: rgba(68, 162, 255, 0.22);
    --cyan-hi:     rgba(55, 161, 255, 0.44);
    --red:         #7658ff;
    --red-soft:    #4630a8;
    --red-dim:     rgba(118, 88, 255, 0.13);
    --red-border:  rgba(126, 99, 255, 0.30);
    --gold:        #d7b06a;
    --ink:         #e7eef9;
    --muted:       #8b9bb3;
    --glow-sm:     0 0 20px rgba(25, 156, 255, 0.22);
    --glow-md:     0 0 55px rgba(25, 156, 255, 0.17), 0 0 110px rgba(118, 88, 255, 0.09);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    color: var(--ink);
    background: var(--bg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

a { color: inherit; }

/* ── Header ─────────────────────────────────────────── */

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 14px clamp(18px, 4vw, 56px);
    border-bottom: 1px solid var(--cyan-border);
    background: rgba(6, 12, 19, 0.88);
    backdrop-filter: blur(20px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-weight: 700;
}

.brand-mark {
    display: block;
    width: 30px;
    height: 30px;
    border-radius: 7px;
    box-shadow:
        0 0 0 1px rgba(25, 156, 255, 0.32),
        0 0 18px rgba(25, 156, 255, 0.22),
        0 0 22px rgba(118, 88, 255, 0.16);
}

.header-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 20px;
    color: var(--muted);
    font-size: 0.95rem;
}

.header-nav a {
    text-decoration: none;
    transition: color 0.15s;
}

.header-nav a:hover { color: var(--cyan); }

/* ── Type ────────────────────────────────────────────── */

h1, h2, h3, p { overflow-wrap: anywhere; }

h1 {
    margin: 0;
    max-width: 900px;
    font-size: clamp(3.1rem, 6.8vw, 6.8rem);
    line-height: 0.94;
    letter-spacing: -0.055em;
}

h2 {
    margin: 0;
    max-width: 760px;
    font-size: clamp(2rem, 3.55rem, 3.8rem);
    line-height: 1.02;
    letter-spacing: 0;
}

h3 {
    margin: 0 0 8px;
    font-size: 1.05rem;
    color: var(--ink);
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--cyan);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
    opacity: 0.82;
}

.title-accent {
    color: var(--cyan);
    text-shadow:
        0 0 34px rgba(25, 156, 255, 0.42),
        0 0 58px rgba(118, 88, 255, 0.18);
}

/* ── Hero ─────────────────────────────────────────────── */

.hero {
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
    min-height: calc(100vh - 60px);
    padding: clamp(56px, 8vw, 100px) clamp(18px, 5vw, 72px);
    background:
        radial-gradient(circle at 78% 54%, rgba(42, 112, 255, 0.14), transparent 34%),
        radial-gradient(circle at 87% 72%, rgba(118, 88, 255, 0.14), transparent 26%),
        linear-gradient(rgba(25, 156, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(25, 156, 255, 0.025) 1px, transparent 1px),
        var(--bg);
    background-size: 52px 52px, 52px 52px;
}

.hero-copy {
    position: relative;
    z-index: 1;
    max-width: 850px;
}

.lede {
    max-width: 690px;
    margin: 24px 0 0;
    color: var(--muted);
    font-size: 1.2rem;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 34px;
}

.hero-proof {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

.hero-proof span {
    padding: 6px 10px;
    border: 1px solid var(--cyan-border);
    border-radius: 6px;
    color: var(--ink);
    background: rgba(25, 156, 255, 0.055);
    font-size: 0.78rem;
    font-weight: 700;
}

.hero-proof span:nth-child(even) {
    border-color: var(--red-border);
    background: var(--red-dim);
}

/* ── App icon graphic ────────────────────────────────── */

.hero-graphic {
    position: absolute;
    right: clamp(18px, 5vw, 72px);
    bottom: clamp(32px, 7vw, 92px);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.app-icon {
    display: block;
    width: clamp(260px, 34rem, 460px);
    height: clamp(260px, 34rem, 460px);
    border-radius: clamp(40px, 4.5vw, 66px);
    opacity: 0.9;
    box-shadow:
        0 0 0 1px rgba(25, 156, 255, 0.28),
        0 0 55px rgba(25, 156, 255, 0.20),
        0 0 85px rgba(118, 88, 255, 0.18),
        0 0 120px rgba(25, 156, 255, 0.09),
        0 48px 100px rgba(0, 0, 0, 0.68);
}

/* ── Buttons ─────────────────────────────────────────── */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 22px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    transition: background 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.button.primary {
    color: var(--bg);
    background: var(--cyan);
    border-color: var(--cyan);
}

.button.primary:hover {
    background: #42b0ff;
    box-shadow: 0 0 28px rgba(25, 156, 255, 0.5);
}

.button.secondary {
    color: var(--cyan);
    border-color: rgba(25, 156, 255, 0.32);
    background: rgba(25, 156, 255, 0.06);
}

.button.secondary:hover {
    background: rgba(25, 156, 255, 0.12);
    border-color: rgba(25, 156, 255, 0.5);
}

.button.disabled {
    pointer-events: none;
    opacity: 0.4;
}

/* ── Features ─────────────────────────────────────────── */

.feature-band {
    padding: clamp(60px, 8vw, 104px) clamp(18px, 5vw, 72px);
    background: var(--bg-surface);
    border-top: 1px solid var(--cyan-border);
}

.section-heading { margin-bottom: 40px; }

.section-heading h2 { color: var(--ink); }

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.feature-grid article {
    padding: 24px;
    border: 1px solid var(--cyan-border);
    border-top: 2px solid var(--cyan-soft);
    border-radius: 8px;
    background: var(--bg-card);
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s, border-top-color 0.2s;
}

.feature-grid article:nth-child(3n + 2) {
    border-top-color: var(--red-soft);
}

.feature-grid article:hover {
    border-color: var(--cyan-hi);
    border-top-color: var(--cyan);
    background: var(--bg-card-hi);
    box-shadow: var(--glow-sm);
}

.feature-grid article:nth-child(3n + 2):hover {
    border-color: var(--red-border);
    border-top-color: var(--red);
    background: var(--bg-card-hi);
    box-shadow: 0 0 20px rgba(118, 88, 255, 0.16);
}

.feature-grid p {
    margin: 0;
    color: var(--muted);
    font-size: 0.94rem;
    line-height: 1.68;
}

/* ── Service ─────────────────────────────────────────── */

.service-band {
    padding: clamp(60px, 8vw, 104px) clamp(18px, 5vw, 72px);
    background: var(--bg);
    border-top: 1px solid var(--cyan-border);
}

.service-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
    gap: clamp(32px, 5vw, 72px);
    align-items: start;
}

.service-layout p {
    margin: 0;
    color: var(--muted);
    line-height: 1.72;
}

.service-layout p + p { margin-top: 16px; }

.service-list {
    margin: 0;
    padding: 22px 22px 22px 22px;
    list-style: none;
    border: 1px solid var(--cyan-border);
    border-radius: 8px;
    background: var(--bg-card);
}

.service-list li {
    position: relative;
    padding-left: 18px;
    color: var(--muted);
    line-height: 1.65;
    font-size: 0.95rem;
}

.service-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.62em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--cyan-soft);
    box-shadow: 0 0 6px rgba(25, 156, 255, 0.5);
}

.service-list li + li { margin-top: 11px; }

code {
    padding: 2px 6px;
    border-radius: 5px;
    background: rgba(25, 156, 255, 0.08);
    border: 1px solid rgba(25, 156, 255, 0.16);
    font-size: 0.89em;
    color: var(--cyan);
}

/* ── Release ─────────────────────────────────────────── */

.release-band {
    padding: clamp(60px, 8vw, 104px) clamp(18px, 5vw, 72px);
    background:
        linear-gradient(135deg, rgba(118, 88, 255, 0.055), transparent 42%),
        var(--bg);
    border-top: 1px solid var(--cyan-border);
}

.release-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.release-grid article {
    padding: 22px;
    min-height: 220px;
    border: 1px solid var(--cyan-border);
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(18, 37, 56, 0.82), rgba(10, 22, 32, 0.92));
}

.release-grid article:nth-child(even) {
    border-color: var(--red-border);
}

.release-number {
    display: inline-block;
    margin-bottom: 28px;
    color: var(--cyan);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0;
}

.release-grid article:nth-child(even) .release-number {
    color: var(--red);
}

.release-grid p {
    margin: 0;
    color: var(--muted);
    font-size: 0.94rem;
    line-height: 1.68;
}

/* ── Download ─────────────────────────────────────────── */

.download-band {
    padding: clamp(60px, 8vw, 104px) clamp(18px, 5vw, 72px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
    gap: clamp(32px, 5vw, 72px);
    align-items: start;
    background: var(--bg-surface);
    border-top: 1px solid var(--cyan-border);
}

.download-band > div > p,
.download-panel p {
    margin: 0;
    color: var(--muted);
}

.download-band > div > p {
    margin-top: 16px;
    line-height: 1.72;
    max-width: 520px;
}

.download-panel {
    padding: 24px;
    border: 1px solid var(--cyan-border);
    border-radius: 8px;
    background: var(--bg-card);
}

.download-panel h3 {
    margin: 0 0 8px;
    color: var(--ink);
}

.download-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.download-panel .button { margin-top: 0; }

/* ── Account portal promotion ───────────────────────── */

.account-band {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
    gap: clamp(28px, 6vw, 72px);
    padding: clamp(60px, 8vw, 104px) clamp(18px, 5vw, 72px);
    border-top: 1px solid var(--cyan-border);
    background: var(--bg);
}

.account-band > div > p:last-child,
.account-actions-panel p {
    max-width: 680px;
    margin: 18px 0 0;
    color: var(--muted);
    line-height: 1.72;
}

.account-actions-panel {
    padding: 26px;
    border: 1px solid var(--red-border);
    border-radius: 10px;
    background: linear-gradient(145deg, var(--bg-card), rgba(118, 88, 255, 0.065));
}

/* ── Updates ─────────────────────────────────────────── */

.update-band {
    padding: clamp(60px, 8vw, 104px) clamp(18px, 5vw, 72px);
    background: var(--bg);
    border-top: 1px solid var(--cyan-border);
}

.update-layout {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 30px;
}

.update-layout article {
    padding: 22px;
    border: 1px solid var(--cyan-border);
    border-radius: 8px;
    background: var(--bg-card);
}

.update-layout h3 {
    margin: 0 0 10px;
    color: var(--ink);
}

.update-layout p {
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
}

.update-layout p + p {
    margin-top: 12px;
}

/* ── Footer ──────────────────────────────────────────── */

.site-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 22px clamp(18px, 5vw, 72px);
    color: var(--muted);
    background: var(--bg);
    border-top: 1px solid var(--cyan-border);
    font-size: 0.9rem;
}

.footer-nav {
    display: flex;
    gap: 18px;
}

.footer-nav a {
    color: var(--muted);
    text-decoration: none;
    transition: color 0.15s;
}

.footer-nav a:hover { color: var(--cyan); }

/* ── Prose / Privacy ─────────────────────────────────── */

.prose-page {
    padding: clamp(48px, 8vw, 96px) clamp(18px, 5vw, 72px);
    background: var(--bg-surface);
    min-height: calc(100vh - 120px);
    border-top: 1px solid var(--cyan-border);
}

.prose-content { max-width: 720px; }

.prose-title {
    margin: 0;
    font-size: clamp(2.2rem, 3.4rem, 3.6rem);
    line-height: 1.08;
    letter-spacing: 0;
}

.prose-meta {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.prose-section { margin-top: 44px; }

.prose-section h2 {
    font-size: 1.2rem;
    margin: 0 0 12px;
    line-height: 1.35;
    color: var(--ink);
    padding-bottom: 8px;
    border-bottom: 1px solid var(--cyan-border);
}

.prose-section p {
    margin: 0 0 14px;
    color: var(--muted);
    line-height: 1.75;
    max-width: 680px;
}

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

.prose-section ul {
    margin: 10px 0 14px;
    padding-left: 22px;
    color: var(--muted);
    line-height: 1.75;
    max-width: 680px;
}

.prose-section li + li { margin-top: 7px; }

.prose-section a {
    color: var(--cyan);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.prose-section strong {
    color: var(--ink);
    font-weight: 600;
}

/* ── Customer and administrator portals ─────────────── */

.portal-shell {
    min-height: calc(100vh - 120px);
    max-width: 1180px;
    margin: 0 auto;
    padding: clamp(48px, 7vw, 88px) clamp(18px, 5vw, 56px);
}

.portal-shell.wide { max-width: 1420px; }

.portal-heading { max-width: 780px; }

.portal-heading h1 {
    font-size: clamp(2.6rem, 6vw, 5rem);
    line-height: 1;
}

.portal-heading > p:last-child {
    max-width: 720px;
    margin: 20px 0 0;
    color: var(--muted);
    font-size: 1.08rem;
}

.auth-grid,
.admin-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-top: 38px;
}

.auth-grid.single { grid-template-columns: minmax(280px, 540px); }

.portal-panel,
.license-card,
.admin-row {
    border: 1px solid var(--cyan-border);
    border-radius: 10px;
    background: var(--bg-card);
}

.portal-panel {
    display: grid;
    align-content: start;
    gap: 16px;
    padding: clamp(20px, 3vw, 30px);
}

.portal-panel h2 {
    font-size: 1.45rem;
    line-height: 1.2;
}

.portal-panel p,
.muted {
    margin: 0;
    color: var(--muted);
}

.portal-note { margin: 14px 0 0; padding: 9px 11px; border-radius: 6px; }
.error-note { color: #ff8aa6; background: var(--red-dim); }

.portal-panel label {
    display: grid;
    gap: 7px;
    color: var(--ink);
    font-size: 0.88rem;
    font-weight: 700;
}

input,
select {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid rgba(83, 120, 136, 0.52);
    border-radius: 7px;
    color: var(--ink);
    background: #07121c;
    font: inherit;
}

input:focus,
select:focus {
    outline: 2px solid var(--cyan);
    outline-offset: 1px;
    border-color: transparent;
}

.portal-status {
    margin: 24px 0 0;
    padding: 12px 14px;
    border: 1px solid var(--cyan-border);
    border-radius: 7px;
    background: var(--cyan-dim);
}

.portal-status.success { border-color: rgba(41, 206, 139, 0.36); color: #74e6b6; background: rgba(41, 206, 139, 0.08); }
.portal-status.error { border-color: var(--red-border); color: #ff8aa6; background: var(--red-dim); }

.portal-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 34px;
    padding: 15px 18px;
    border: 1px solid var(--cyan-border);
    border-radius: 8px;
    background: var(--bg-surface);
}

.toolbar-actions,
.row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.account-meta { margin-top: 4px; font-size: 0.78rem; }

.button.compact { min-height: 36px; padding: 7px 12px; font-size: 0.82rem; }

.button.danger {
    color: #ff8aa6;
    border-color: var(--red-border);
    background: var(--red-dim);
}

.button.danger:hover { border-color: var(--red); background: rgba(118, 88, 255, 0.2); }

.portal-section { margin-top: 52px; }
.compact-heading h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); }

.license-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 24px;
}

.license-card { padding: 22px; }

.license-card-heading,
.admin-row-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.license-key,
.copy-value {
    color: var(--cyan);
    overflow-wrap: anywhere;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border: 1px solid var(--cyan-border);
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.status-chip.active { color: #74e6b6; border-color: rgba(41, 206, 139, 0.36); }
.status-chip.inactive { color: #ff8aa6; border-color: var(--red-border); }

.fact-grid {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 7px 16px;
    margin: 20px 0;
}

.fact-grid dt { color: var(--muted); }
.fact-grid dd { margin: 0; text-align: right; }

.machine-list {
    display: grid;
    gap: 9px;
    margin: 20px 0;
    padding-top: 18px;
    border-top: 1px solid var(--cyan-border);
}

.machine-row {
    display: grid;
    gap: 3px;
    padding: 10px;
    border-radius: 6px;
    background: rgba(25, 156, 255, 0.045);
}

.machine-row code { overflow-wrap: anywhere; }
.machine-row span { font-size: 0.78rem; }

.empty-state {
    padding: 30px;
    border: 1px dashed var(--cyan-border);
    color: var(--muted);
    text-align: center;
}

.account-tools { margin-top: 52px; }

.search-bar {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto auto;
    gap: 10px;
}

.admin-list { display: grid; gap: 12px; margin-top: 24px; }

.admin-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    padding: 18px;
}

.admin-row-body { min-width: 0; }
.admin-row-body p { margin: 6px 0 0; }
.admin-row-body code { display: inline-block; margin-top: 7px; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ── Responsive ──────────────────────────────────────── */

@media (max-width: 980px) {
    .hero {
        min-height: auto;
        text-align: left;
    }

    .hero-graphic {
        right: 18px;
        bottom: 28px;
        opacity: 0.36;
    }

    .service-layout,
    .download-band,
    .account-band,
    .update-layout,
    .auth-grid,
    .admin-form-grid,
    .license-grid {
        grid-template-columns: 1fr;
    }

    .feature-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .release-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .site-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .header-nav { justify-content: flex-start; }

    h1 { font-size: 3.55rem; }

    h2 { font-size: 2.25rem; }

    .lede { font-size: 1.05rem; }

    .feature-grid { grid-template-columns: 1fr; }

    .release-grid { grid-template-columns: 1fr; }

    .app-icon {
        width: 160px !important;
        height: 160px !important;
    }

    .admin-row { grid-template-columns: 1fr; }

    .search-bar { grid-template-columns: 1fr 1fr; }
    .search-bar label { grid-column: 1 / -1; }
}
