/* NULLWARDEN — design system */

:root {
    --bg: #05070a;
    --bg-elev: #0a0e14;
    --surface: #111720;
    --surface-2: #1a2230;
    --surface-3: #24303f;
    --divider: rgba(120, 200, 255, 0.10);
    --text: #eef4fb;
    --text-2: #a9b8ca;
    --text-3: #6f8098;
    --primary: #22d3ee;
    --primary-strong: #06b6d4;
    --primary-soft: rgba(34, 211, 238, 0.13);
    --on-primary: #04121a;
    --ok: #4ade80;
    --warn: #fbbf24;
    --danger: #fb7185;
    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 12px;
    --radius-pill: 999px;
    --maxw: 70rem;
    --gutter: clamp(1.25rem, 4vw, 2.5rem);
    --inset: 1.5rem;
    --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
    --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
    font-size: clamp(15px, 0.85vw + 10px, 17px);
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    position: relative;
    overflow-x: hidden;
}

/* Ambient grid backdrop */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(900px 500px at 15% -8%, rgba(34, 211, 238, 0.10), transparent 65%),
        radial-gradient(700px 420px at 92% 4%, rgba(99, 102, 241, 0.09), transparent 60%);
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.35;
    background-image:
        linear-gradient(var(--divider) 1px, transparent 1px),
        linear-gradient(90deg, var(--divider) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 78%);
    -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 78%);
}

body > * { position: relative; z-index: 1; }

::selection { background: var(--primary); color: var(--on-primary); }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 0.18em; }

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

code, .mono { font-family: var(--font-mono); font-size: 0.92em; }

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

.skip-link {
    position: absolute;
    left: -999px;
    top: 0;
    background: var(--primary);
    color: var(--on-primary);
    padding: 0.6rem 1rem;
    border-radius: var(--radius-pill);
    z-index: 1000;
    font-weight: 600;
}
.skip-link:focus { left: 1rem; top: 1rem; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }

/* ---------------------------------------------------------------- Header */
.appbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(5, 7, 10, 0.82);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--divider);
}

.appbar-inner {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 var(--gutter);
    height: 3.9rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.02rem;
    letter-spacing: 0.14em;
    color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand-mark { width: 1.9rem; height: 1.9rem; color: var(--primary); flex: 0 0 auto; }

.topnav { display: flex; align-items: center; gap: 0.15rem; list-style: none; }
.topnav a {
    display: inline-flex;
    align-items: center;
    height: 2.4rem;
    padding: 0 0.9rem;
    border-radius: var(--radius-pill);
    color: var(--text-2);
    font-weight: 500;
    font-size: 0.9rem;
    transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.topnav a:hover { background: var(--surface); color: var(--text); text-decoration: none; }
.topnav a.active { color: var(--primary); background: var(--primary-soft); }

.nav-cta {
    margin-left: 0.6rem;
    display: inline-flex;
    align-items: center;
    height: 2.4rem;
    padding: 0 1.1rem;
    border-radius: var(--radius-pill);
    background: var(--primary);
    color: var(--on-primary);
    font-weight: 600;
    font-size: 0.9rem;
}
.nav-cta:hover { background: #67e8f9; color: var(--on-primary); text-decoration: none; }

/* ---------------------------------------------------------------- Hero */
.viewing {
    text-align: center;
    padding: clamp(3.5rem, 9vw, 7.5rem) 0 clamp(2rem, 5vw, 3.5rem);
}
.viewing .wrap { max-width: 52rem; }

.kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 1.25rem;
    padding: 0.35rem 0.9rem;
    border: 1px solid var(--divider);
    border-radius: var(--radius-pill);
    background: var(--primary-soft);
}
.kicker::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.22);
}

.viewing h1 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.2rem, 5.6vw, 4rem);
    line-height: 1.08;
    letter-spacing: -0.025em;
    margin-bottom: 1.3rem;
}
.viewing h1 .accent {
    color: var(--primary);
}
.viewing .sub {
    color: var(--text-2);
    font-size: clamp(1.02rem, 1.3vw, 1.18rem);
    max-width: 42rem;
    margin: 0 auto;
}

/* ---------------------------------------------------------------- Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 2.9rem;
    padding: 0 1.5rem;
    border-radius: var(--radius-pill);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.94rem;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s var(--ease), transform 0.15s var(--ease), color 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn svg { width: 1rem; height: 1rem; }

.btn-filled { background: var(--primary); color: var(--on-primary); }
.btn-filled:hover { background: #67e8f9; }
.btn-grey { background: var(--surface-2); color: var(--text); }
.btn-grey:hover { background: var(--surface-3); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--divider); }
.btn-ghost:hover { background: var(--surface); border-color: var(--text-3); }
.btn-flat { background: transparent; color: var(--primary); padding: 0 1rem; }
.btn-flat:hover { background: var(--primary-soft); }
.btn-block { width: 100%; }

.actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin: 2rem 0 clamp(2.5rem, 5vw, 3.5rem);
}

/* ---------------------------------------------------------------- Sections */
.section { padding: clamp(1.25rem, 2.5vw, 2.25rem) 0; }

.subheader {
    display: block;
    padding: 0 var(--inset);
    margin-bottom: 0.7rem;
    color: var(--primary);
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 0.76rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.section-title { padding: 0 var(--inset); margin-bottom: 1.25rem; }
.section-title h2 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.4rem, 2.7vw, 2rem);
    letter-spacing: -0.018em;
    line-height: 1.2;
}
.section-title p { color: var(--text-2); margin-top: 0.45rem; max-width: 46rem; }

/* ---------------------------------------------------------------- Cards */
.block {
    background: var(--surface);
    border: 1px solid var(--divider);
    border-radius: var(--radius-xl);
    padding: var(--inset);
}
.block + .block, .list + .block, .block + .list, .list + .list,
.cards + .block, .block + .cards, .cards + .list, .list + .cards { margin-top: 0.9rem; }

.block h3 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.12rem;
    letter-spacing: -0.012em;
    margin-bottom: 0.45rem;
}
.block p { color: var(--text-2); font-size: 0.97rem; }
.block p + p { margin-top: 0.8rem; }
.block .btn { margin-top: 1.2rem; }
.block-pad { padding: clamp(1.5rem, 3vw, 2.25rem); }
.block-accent { border-color: rgba(34, 211, 238, 0.28); background: linear-gradient(160deg, rgba(34,211,238,0.07), var(--surface) 55%); }

.icon-badge {
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 14px;
    background: var(--primary-soft);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}
.icon-badge svg { width: 1.25rem; height: 1.25rem; }
.icon-badge.ok { background: rgba(74, 222, 128, 0.13); color: var(--ok); }
.icon-badge.warn { background: rgba(251, 191, 36, 0.13); color: var(--warn); }
.icon-badge.danger { background: rgba(251, 113, 133, 0.13); color: var(--danger); }

.cards { display: grid; gap: 0.9rem; }
.cards-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cards > * { min-width: 0; }

.card-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 1rem;
    font-weight: 600;
    font-size: 0.92rem;
}
.card-link svg { width: 1rem; height: 1rem; transition: transform 0.2s var(--ease); }
.card-link:hover svg { transform: translateX(3px); }

/* ---------------------------------------------------------------- Rows */
.list {
    background: var(--surface);
    border: 1px solid var(--divider);
    border-radius: var(--radius-xl);
    overflow: hidden;
}
.row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem var(--inset);
    position: relative;
    color: inherit;
}
.row + .row::before {
    content: '';
    position: absolute;
    top: 0;
    left: var(--inset);
    right: var(--inset);
    height: 1px;
    background: var(--divider);
}
a.row { text-decoration: none; transition: background 0.15s var(--ease); }
a.row:hover { background: var(--surface-2); }

.row-lead {
    flex: 0 0 auto;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 12px;
    background: var(--primary-soft);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.row-lead svg { width: 1.15rem; height: 1.15rem; }
.row-lead.num {
    border-radius: 50%;
    background: var(--primary);
    color: var(--on-primary);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.92rem;
}

.row-body { flex: 1 1 auto; min-width: 0; }
.row-main { font-weight: 600; color: var(--text); font-size: 1rem; line-height: 1.35; }
.row-main code { color: var(--primary); font-weight: 500; }
.row-sub { color: var(--text-2); font-size: 0.9rem; margin-top: 0.18rem; line-height: 1.5; }
.row-end { flex: 0 0 auto; color: var(--text-3); display: inline-flex; align-items: center; gap: 0.5rem; }
.row-end svg { width: 1.1rem; height: 1.1rem; }
.row.stack { align-items: flex-start; }

.badge {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: var(--radius-pill);
    background: var(--surface-3);
    color: var(--text-2);
    font-size: 0.74rem;
    font-weight: 600;
    white-space: nowrap;
}
.badge.blue { background: var(--primary-soft); color: var(--primary); }
.badge.ok { background: rgba(74, 222, 128, 0.13); color: var(--ok); }
.badge.warn { background: rgba(251, 191, 36, 0.13); color: var(--warn); }

/* ---------------------------------------------------------------- Chips */
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
    display: inline-block;
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-pill);
    background: var(--surface-2);
    border: 1px solid var(--divider);
    color: var(--text-2);
    font-size: 0.84rem;
    font-weight: 500;
}
.chip.blue { background: var(--primary-soft); color: var(--primary); border-color: transparent; }

/* ---------------------------------------------------------------- Features */
.feature {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.9rem;
}
.feature > * { min-width: 0; }

/* ---------------------------------------------------------------- Facts */
.fact-v {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.35rem;
    letter-spacing: -0.015em;
    color: var(--text);
    margin-bottom: 0.2rem;
}
.fact-k {
    color: var(--primary);
    font-family: var(--font-mono);
    font-size: 0.76rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 0.55rem;
}

.stat-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.9rem;
}
.stat {
    background: var(--surface);
    border: 1px solid var(--divider);
    border-radius: var(--radius-lg);
    padding: 1.15rem var(--inset);
}
.stat .fact-v { font-size: 1.6rem; }
.stat p { color: var(--text-2); font-size: 0.88rem; margin-top: 0.25rem; }

/* ---------------------------------------------------------------- CTA */
.cta {
    background: linear-gradient(135deg, #0b3b48 0%, #072634 55%, #0a2f3d 100%);
    border: 1px solid rgba(34, 211, 238, 0.22);
    border-radius: var(--radius-xl);
    padding: clamp(1.75rem, 4vw, 3rem);
    text-align: center;
}
.cta h2 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.5rem, 3vw, 2.15rem);
    letter-spacing: -0.018em;
    margin-bottom: 0.65rem;
}
.cta p { color: rgba(238, 244, 251, 0.76); max-width: 38rem; margin: 0 auto 1.5rem; }
.cta .btn-filled { background: #fff; color: #072634; }
.cta .btn-filled:hover { background: #d9f6fd; }

/* ---------------------------------------------------------------- Prose */
.prose p { color: var(--text-2); font-size: 1.01rem; }
.prose p + p { margin-top: 0.9rem; }
.prose strong { color: var(--text); font-weight: 600; }
.prose ul { color: var(--text-2); padding-left: 1.15rem; margin-top: 0.8rem; }
.prose li + li { margin-top: 0.4rem; }
.prose h3 {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--text);
    margin: 1.6rem 0 0.5rem;
    font-size: 1.12rem;
}

/* ---------------------------------------------------------------- Code / terminal */
.terminal {
    background: #060a0f;
    border: 1px solid var(--divider);
    border-radius: var(--radius-lg);
    overflow: hidden;
    font-family: var(--font-mono);
    font-size: 0.84rem;
}
.terminal-head {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.7rem 0.95rem;
    border-bottom: 1px solid var(--divider);
    background: var(--bg-elev);
}
/* Only the traffic-light dots are fixed-size. The label must stay auto-sized,
   otherwise its text overflows the header and paints over the terminal body. */
.terminal-head > span:not(.label) {
    width: 10px;
    height: 10px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--surface-3);
}
.terminal-head > span:first-child:not(.label) { background: #fb7185; }
.terminal-head > span:nth-child(2):not(.label) { background: #fbbf24; }
.terminal-head > span:nth-child(3):not(.label) { background: #4ade80; }
.terminal-head .label {
    margin-left: 0.5rem;
    color: var(--text-3);
    font-size: 0.76rem;
    white-space: nowrap;
}
.terminal-body { padding: 1rem 0.95rem; line-height: 1.75; overflow-x: auto; }
/* Keep each transcript line on one line - long commands scroll horizontally
   instead of wrapping over the next line. */
.terminal-body > div { white-space: pre; }
.terminal-body .prompt { color: var(--primary); }
.terminal-body .cmd { color: var(--text); }
.terminal-body .out { color: var(--text-3); }
.terminal-body .good { color: var(--ok); }
.terminal-body .bad { color: var(--danger); }

/* ---------------------------------------------------------------- Footer */
.footer {
    padding: 3rem 0 2rem;
    text-align: center;
    color: var(--text-3);
    font-size: 0.84rem;
    border-top: 1px solid var(--divider);
    margin-top: 2rem;
}
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.25rem 0.5rem; margin-bottom: 1rem; }
.footer-links a { color: var(--text-2); padding: 0.35rem 0.75rem; border-radius: var(--radius-pill); font-weight: 500; }
.footer-links a:hover { background: var(--surface); text-decoration: none; }
.footer p { margin-top: 0.3rem; }
.footer .mono { color: var(--text-3); }

/* ---------------------------------------------------------------- Bottom nav (mobile) */
.bottomnav {
    display: none;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 100;
    background: rgba(10, 14, 20, 0.94);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--divider);
    padding: 0.4rem 0.25rem calc(0.4rem + env(safe-area-inset-bottom));
}
.bottomnav ul { display: flex; justify-content: space-around; list-style: none; }
.bottomnav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    min-width: 3.6rem;
    padding: 0.35rem 0.5rem;
    color: var(--text-3);
    font-size: 0.66rem;
    font-weight: 600;
    border-radius: var(--radius-md);
}
.bottomnav a:hover { text-decoration: none; }
.bottomnav a svg { width: 1.35rem; height: 1.35rem; }
.bottomnav a.active { color: var(--primary); }

/* ---------------------------------------------------------------- Reveal */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.55s var(--ease), transform 0.55s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .reveal { opacity: 1; transform: none; transition: none; }
    .btn:active { transform: none; }
}

/* ---------------------------------------------------------------- Responsive */
@media (max-width: 62rem) {
    .cards-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 48rem) {
    .topnav { display: none; }
    .bottomnav { display: block; }
    body { padding-bottom: 4.6rem; }
    .cards-2, .cards-3, .feature { grid-template-columns: 1fr; }
    .appbar-inner { height: 3.6rem; }
    :root { --inset: 1.15rem; --radius-xl: 20px; }
    .row { padding: 0.9rem var(--inset); }
    .stat-strip { grid-template-columns: 1fr; }
}

@media print {
    body { background: #fff; color: #000; }
    .appbar, .bottomnav { display: none; }
}
