/* ============================================
   NeedTo.Host — Shared Theme System v2
   Design tokens + dark/light mode
   ============================================ */

/* ── Theme: Dark (default) ── */
:root {
    /* Surfaces */
    --bg:           #0f0f0f;
    --surface:      #181818;
    --surface-h:    #222222;
    --surface-a:    #2a2a2a;

    /* Borders */
    --border:       rgba(255, 255, 255, 0.07);
    --border-h:     rgba(255, 255, 255, 0.15);

    /* Text */
    --text:         #ffffff;
    --text-muted:   rgba(255, 255, 255, 0.5);
    --text-subtle:  rgba(255, 255, 255, 0.28);

    /* Accent (inverted for dark: white bg, black text) */
    --accent:       #ffffff;
    --accent-fg:    #0f0f0f;

    /* Shadows */
    --shadow:       0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-sm:    0 2px 8px rgba(0, 0, 0, 0.3);

    /* Semantic aliases for hardcoded values in pages */
    --t1: #ffffff;
    --t2: rgba(255, 255, 255, 0.52);
    --t3: rgba(255, 255, 255, 0.28);
    --t4: rgba(255, 255, 255, 0.12);
    --b:  rgba(255, 255, 255, 0.07);
    --b2: rgba(255, 255, 255, 0.13);
    --b3: rgba(255, 255, 255, 0.22);

    /* Typography */
    --font:    'Space Grotesk', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;
    --ease: cubic-bezier(0.16, 1, 0.3, 1);

    color-scheme: dark;
}

/* ── Theme: Light ── */
[data-theme="light"] {
    --bg:           #f7f7f7;
    --surface:      #ffffff;
    --surface-h:    #f0f0f0;
    --surface-a:    #e8e8e8;
    --border:       rgba(0, 0, 0, 0.09);
    --border-h:     rgba(0, 0, 0, 0.18);
    --text:         #0a0a0a;
    --text-muted:   rgba(0, 0, 0, 0.48);
    --text-subtle:  rgba(0, 0, 0, 0.28);
    --accent:       #0a0a0a;
    --accent-fg:    #f7f7f7;
    --shadow:       0 4px 24px rgba(0, 0, 0, 0.08);
    --shadow-sm:    0 2px 8px rgba(0, 0, 0, 0.06);

    --t1: #0a0a0a;
    --t2: rgba(0, 0, 0, 0.5);
    --t3: rgba(0, 0, 0, 0.28);
    --t4: rgba(0, 0, 0, 0.12);
    --b:  rgba(0, 0, 0, 0.07);
    --b2: rgba(0, 0, 0, 0.13);
    --b3: rgba(0, 0, 0, 0.22);
    --b4: rgba(0, 0, 0, 0.04);

    /* Light theme specific */
    --surface-2:  rgba(0, 0, 0, 0.025);
    --surface-3:  rgba(0, 0, 0, 0.035);
    --surface-4:  rgba(0, 0, 0, 0.045);
    --surface-5:  rgba(0, 0, 0, 0.055);
    --surface-o:  rgba(240, 240, 240, 0.96);
    --surface-a2: rgba(255, 255, 255, 0.9);
    --glow-s:     rgba(0, 0, 0, 0.04);
    --glow-m:     rgba(0, 0, 0, 0.06);
    --glow-l:     rgba(0, 0, 0, 0.09);

    color-scheme: light;
}

/* ── Reset ── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background 0.3s ease, color 0.3s ease;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-h); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-subtle); }

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: var(--text);
}
p { line-height: 1.75; }
a { color: inherit; text-decoration: none; }
code, pre { font-family: var(--font-mono); }

/* ── Navbar ── */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    height: 64px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: background 0.3s ease, border-color 0.3s ease;
}
.navbar-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 1rem;
}
.nav-logo {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.02em;
    flex-shrink: 0;
}
.nav-logo-mark {
    width: 28px; height: 28px;
    border-radius: 8px;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-fg);
    flex-shrink: 0;
}
.nav-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
}
.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    padding: 0.45rem 0.9rem;
    border-radius: 8px;
    transition: color 0.2s, background 0.2s;
}
.nav-links a:hover { color: var(--text); background: var(--surface); }
.nav-sep { width: 1px; height: 16px; background: var(--border); margin: 0 0.3rem; }
.nav-login { border: 1px solid var(--border-h) !important; }
.nav-login:hover { border-color: var(--border-h) !important; color: var(--text) !important; background: var(--surface) !important; }
.nav-cta {
    background: var(--accent) !important;
    color: var(--accent-fg) !important;
    font-weight: 700 !important;
    padding: 0.45rem 1.1rem !important;
    border-radius: 8px;
    transition: opacity 0.2s !important;
}
.nav-cta:hover { opacity: 0.82 !important; }

/* ── Theme Toggle ── */
.theme-toggle {
    width: 36px; height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.theme-toggle:hover { border-color: var(--border-h); color: var(--text); background: var(--surface-h); }
.theme-toggle svg { display: block; }

/* ── Hamburger (mobile) ── */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 8px;
    background: none;
    border: none;
    flex-shrink: 0;
}
.hamburger span {
    width: 22px; height: 1.5px;
    background: var(--text);
    border-radius: 2px;
    display: block;
    transition: all 0.2s;
}

/* ── Mobile Menu ── */
#mobile-menu {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999;
    background: var(--bg);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}
#mobile-menu.open { display: flex; }
#mobile-menu a {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.9rem 2.5rem;
    border-radius: 12px;
    transition: all 0.15s;
    width: 100%;
    max-width: 300px;
    text-align: center;
}
#mobile-menu a:hover { color: var(--text); background: var(--surface); }
.menu-close {
    position: absolute;
    top: 1.2rem; right: 1.2rem;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}
.menu-close:hover { color: var(--text); border-color: var(--border-h); }

/* ── Section wrapper ── */
.section {
    padding: 8rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}
.section-eyebrow {
    font-family: var(--font-mono);
    font-size: 0.58rem;
    color: var(--text-subtle);
    text-transform: uppercase;
    letter-spacing: 3px;
    display: block;
    margin-bottom: 0.75rem;
}
.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.035em;
    color: var(--text);
    line-height: 1.05;
    margin-bottom: 1rem;
}

/* ── Cards ── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.75rem;
    transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.card:hover { border-color: var(--border-h); box-shadow: var(--shadow); }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.72rem 1.5rem;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.875rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-family: var(--font);
    letter-spacing: -0.01em;
    transition: all 0.2s ease;
}
.btn-primary {
    background: var(--accent);
    color: var(--accent-fg);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), var(--shadow-sm);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2), var(--shadow); }
.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--text); border-color: var(--border-h); background: var(--surface); transform: translateY(-1px); }
.btn-full { width: 100%; justify-content: center; }

/* ── Form Inputs ── */
.input {
    width: 100%;
    padding: 0.82rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-family: var(--font);
    font-size: 0.9rem;
    transition: border-color 0.2s, background 0.3s;
}
.input:focus { outline: none; border-color: var(--border-h); background: var(--surface-h); }
.input::placeholder { color: var(--text-subtle); }
.label { display: block; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.45rem; font-weight: 500; }

/* ── Alert / Notice ── */
.notice {
    padding: 0.8rem 1rem;
    border-radius: 10px;
    font-size: 0.82rem;
    line-height: 1.55;
    border: 1px solid var(--border);
    color: var(--text-muted);
    background: var(--surface);
}
.notice.error   { border-color: rgba(255, 80, 80, 0.3); color: #ff5050; }
.notice.success { border-color: rgba(50, 255, 100, 0.3); color: #32ff64; }
.notice.info    { border-color: rgba(80, 180, 255, 0.3); color: #50b4ff; }

/* ── Divider ── */
.divider { height: 1px; background: var(--border); margin: 1.5rem 0; }

/* ── Footer ── */
footer {
    border-top: 1px solid var(--border);
    padding: 3rem 2rem 2rem;
    margin-top: 4rem;
    transition: border-color 0.3s;
}
.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.8fr 1fr 1fr 1fr;
    gap: 2.5rem;
    margin-bottom: 2rem;
}
.footer-brand p { font-size: 0.78rem; color: var(--text-muted); line-height: 1.72; margin-top: 0.65rem; max-width: 240px; }
.footer-col h4 { font-size: 0.68rem; font-weight: 700; color: var(--text-subtle); text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 0.9rem; font-family: var(--font-mono); }
.footer-col a { display: block; font-size: 0.79rem; color: var(--text-muted); text-decoration: none; margin-bottom: 0.5rem; transition: color 0.15s; }
.footer-col a:hover { color: var(--text); }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 1.5rem; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.75rem; }
.footer-bottom span { font-size: 0.73rem; color: var(--text-subtle); }
.footer-bottom a { color: var(--text-subtle); text-decoration: none; transition: color 0.15s; }
.footer-bottom a:hover { color: var(--text-muted); }

/* ── Animations ── */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}
.fade-up { animation: fadeUp 0.5s var(--ease) both; }

/* ── Scroll reveal ── */
.reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.65s var(--ease), transform 0.65s var(--ease);
}
.reveal.in { opacity: 1; transform: none; }
.reveal-2 { transition-delay: 0.1s; }
.reveal-3 { transition-delay: 0.2s; }
.reveal-4 { transition-delay: 0.3s; }

/* ── Status dot ── */
.status-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}
.status-dot.online  { background: #2ecc71; box-shadow: 0 0 0 3px rgba(46, 204, 113, 02); }
.status-dot.warning  { background: #f39c12; }
.status-dot.offline { background: #e74c3c; }

/* ── Cookie Banner ── */
#cookie-banner {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 9999;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 1.25rem 1.5rem;
    display: none;
    align-items: flex-start;
    gap: 1rem;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}
#cookie-banner.show { display: flex; }
.cookie-text { font-size: 0.82rem; color: var(--text-muted); line-height: 1.6; flex: 1; }
.cookie-text a { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }
.cookie-actions { display: flex; gap: 0.5rem; flex-shrink: 0; flex-wrap: wrap; }

/* ── Newsletter ── */
.newsletter-form { display: flex; gap: 0.5rem; max-width: 420px; margin-top: 1rem; }
.newsletter-form .input { flex: 1; }

/* ── Responsive ── */
@media (max-width: 1024px) {
    .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
    .nav-links    { display: none; }
    .hamburger    { display: flex; }
    .navbar-inner { padding: 0 1.25rem; }
    .section      { padding: 5rem 1.25rem; }
    .footer-inner { grid-template-columns: 1fr 1fr; gap: 2rem; }
    .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
    .footer-inner { grid-template-columns: 1fr; }
    .newsletter-form { flex-direction: column; }
    .cookie-actions { flex-direction: column; width: 100%; }
}
