/* e661e.io front door — landing page styles.
   Builds on theme.css (tokens, buttons, forms, glass, reveal).
   This file styles only the landing page: nav, WebGL hero, sections,
   platform cards, architecture diagram, auth card. */

/* ---------- Top nav ---------- */

.topnav {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.7rem 1.5rem;
    background: rgba(3, 6, 9, 0.72);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-dim);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: var(--text);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
}

/* Nav-scale overrides for the theme.css brand lockup */
.brand .brand-mark {
    width: 26px;
    height: 26px;
}

.brand .brand-word {
    font-size: 1.05rem;
    letter-spacing: -0.01em;
    text-shadow: none;
}

.brand:hover .brand-word,
.brand:focus-visible .brand-word {
    text-shadow: 0 0 14px rgba(25, 214, 154, 0.35);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

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

.nav-links a:hover {
    color: var(--text);
}

.nav-links .nav-cta {
    color: var(--accent);
    border: 1px solid var(--border-strong);
    padding: 0.35rem 0.95rem;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    transition: box-shadow 0.25s ease, background 0.25s ease;
}

.nav-links .nav-cta:hover {
    background: var(--accent-dim);
    color: var(--accent);
    box-shadow: var(--glow-sm);
}

/* ---------- Hero (WebGL canvas behind copy) ---------- */

.hero {
    position: relative;
    overflow: hidden;
    min-height: min(92vh, 860px);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 5rem 1.5rem 6rem;
    border-bottom: 1px solid var(--border-dim);
    /* CSS fallback scene — visible under the canvas and whenever WebGL is off */
    background-image:
        radial-gradient(ellipse 55% 45% at 50% 8%, rgba(25, 214, 154, 0.10), transparent 70%),
        radial-gradient(ellipse 40% 35% at 70% 80%, rgba(58, 210, 255, 0.07), transparent 70%);
}

#hero-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    z-index: 0;
}

/* scanline sheen over the 3D scene */
.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background:
        repeating-linear-gradient(0deg,
            rgba(0, 0, 0, 0) 0 2px,
            rgba(0, 0, 0, 0.12) 2px 4px);
    opacity: 0.35;
}

/* bottom fade so the scene melts into the page */
.hero::before {
    content: '';
    position: absolute;
    inset: auto 0 0 0;
    height: 30%;
    pointer-events: none;
    z-index: 1;
    background: linear-gradient(180deg, transparent, var(--bg-0));
}

.hero-inner {
    position: relative;
    z-index: 2;
    max-width: 760px;
    margin: 0 auto;
}

.hero-kicker {
    font-family: var(--font-mono);
    color: var(--accent);
    font-size: 0.9rem;
    letter-spacing: 0.06em;
    margin-bottom: 1.1rem;
    text-shadow: 0 0 12px rgba(25, 214, 154, 0.5);
}

.hero h1 {
    font-size: clamp(2.3rem, 6vw, 4rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.08;
    margin-bottom: 1.4rem;
    text-shadow: 0 4px 30px rgba(0, 0, 0, 0.6);
}

.hero-sub {
    color: var(--muted);
    font-size: 1.1rem;
    max-width: 640px;
    margin: 0 auto 2.2rem;
    text-shadow: 0 2px 12px rgba(3, 6, 9, 0.9);
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 0.85rem;
    flex-wrap: wrap;
}

/* ---------- Sections ---------- */

.section {
    max-width: 1020px;
    margin: 0 auto;
    padding: 5rem 1.5rem 1.5rem;
}

.section h2 {
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.8rem;
}

.section-num {
    font-family: var(--font-mono);
    color: var(--accent);
    font-size: 1rem;
    font-weight: 600;
    margin-right: 0.6rem;
    vertical-align: 0.12em;
    text-shadow: 0 0 10px rgba(25, 214, 154, 0.5);
}

.section-lead {
    color: var(--muted);
    max-width: 700px;
    margin-bottom: 2.5rem;
}

/* ---------- Platform cards (glass + tilt + glow sweep) ---------- */

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

.card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius);
    padding: 1.6rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
    will-change: transform;
    overflow: hidden;
}

/* corner circuit-trace accent */
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 46px;
    height: 46px;
    border-top: 2px solid rgba(25, 214, 154, 0.35);
    border-left: 2px solid rgba(25, 214, 154, 0.35);
    border-top-left-radius: var(--radius);
    transition: width 0.35s ease, height 0.35s ease, border-color 0.35s ease;
    pointer-events: none;
}

.card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--glow-sm), 0 18px 44px rgba(0, 0, 0, 0.5);
}

.card:hover::before {
    width: 100%;
    height: 100%;
    border-color: rgba(25, 214, 154, 0.18);
}

.card h3 {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 1.06rem;
    font-weight: 600;
    margin-bottom: 0.65rem;
    color: var(--accent);
}

.card h3 .card-icon {
    width: 20px;
    height: 20px;
    stroke: var(--accent-2);
    filter: drop-shadow(0 0 5px rgba(58, 210, 255, 0.6));
    flex-shrink: 0;
}

.card p {
    color: var(--muted);
    font-size: 0.92rem;
}

/* ---------- Architecture diagram ---------- */

.diagram-wrap {
    background: var(--surface);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius);
    padding: 1.4rem;
    margin-bottom: 1.6rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.arch-diagram {
    width: 100%;
    height: auto;
    display: block;
}

.arch-diagram .tier-label {
    fill: var(--muted);
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 2px;
}

.arch-diagram .tier-label-accent {
    fill: var(--accent);
}

.arch-diagram .node-label {
    fill: var(--text);
    font-family: var(--font-body);
    font-size: 14px;
}

.diagram-wrap figcaption {
    color: var(--faint);
    font-size: 0.82rem;
    text-align: center;
    margin-top: 0.85rem;
    font-family: var(--font-mono);
}

/* ---------- Badges ---------- */

.badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.55rem;
}

.badge {
    background: rgba(11, 20, 32, 0.8);
    border: 1px solid var(--border-dim);
    color: var(--muted);
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 500;
    font-family: var(--font-mono);
    transition: border-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

.badge:hover {
    border-color: var(--border-strong);
    color: var(--accent);
    box-shadow: var(--glow-sm);
}

/* ---------- Auth card ---------- */

.auth-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.2rem;
    max-width: 460px;
    margin: 0 auto;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow:
        inset 0 1px 0 rgba(233, 242, 247, 0.05),
        0 0 40px rgba(25, 214, 154, 0.05),
        0 16px 48px rgba(0, 0, 0, 0.5);
}

.auth-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    text-align: center;
}

.oauth-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.email-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.email-buttons .btn {
    width: 100%;
}

/* Signed-in state (rendered by auth.js on silent OIDC success) */

#signedin-panel {
    text-align: center;
}

#signedin-panel .btn {
    width: 100%;
}

.signedin-status {
    color: var(--muted);
    margin-bottom: 1.25rem;
}

.signedin-status strong {
    color: var(--text);
}

/* ---------- Responsive ---------- */

@media (max-width: 560px) {
    .topnav {
        padding: 0.65rem 1rem;
    }

    .nav-links {
        gap: 0.9rem;
    }

    .hero {
        min-height: 78vh;
        padding: 4rem 1rem 4.5rem;
    }

    .section {
        padding: 3.2rem 1rem 1rem;
    }

    .auth-section {
        padding: 1.6rem;
    }
}
