/* ============================================================
   CodeQuill Landing — dark-only theme, ported from React source
   ============================================================ */

/* ── Base override for landing body ──────────────────────── */
.landing-body {
    background: #000000;
    color: #F8FAFC;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

/* GridOverlay — port of site-old/src/components/ui/GridOverlay.tsx */
.grid-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.3;
    background-image:
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 40px 40px;
}
.grid-guides {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    max-width: 1400px;
    margin: 0 auto;
}
.grid-guide {
    position: absolute;
    top: 0;
    height: 100%;
    width: 1px;
    background: rgba(255, 255, 255, 0.02);
}

.landing-body :focus-visible {
    outline: 2px solid #7879F6;
    outline-offset: 2px;
    border-radius: 2px;
}

/* ── Container ───────────────────────────────────────────── */
.landing-body .container {
    max-width: 72rem;
    margin: 0 auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}
@media (min-width: 768px) {
    .landing-body .container { padding-left: 2rem; padding-right: 2rem; }
}

/* ── Section labels (e.g., "01 — Why CodeQuill Exists") ──── */
.section-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #94A3B8;
    margin-bottom: 1.5rem;
}
.section-label-number {
    color: #7879F6;
}

/* ── Headings ────────────────────────────────────────────── */
.gradient-text {
    background-image: linear-gradient(to bottom, #FFFFFF 0%, #E5E5E5 55%, #737373 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.section-heading {
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.1;
    letter-spacing: -0.025em;
    font-weight: 600;
    margin-bottom: 1rem;
}
.section-lede {
    font-size: 1.125rem;
    line-height: 1.7;
    color: #94A3B8;
    max-width: 48rem;
}

/* ── Buttons (port of site-old/src/components/ui/Button.tsx) ── */
@property --angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    border: 0;
    transition: all 0.3s ease;
}
.btn:active { transform: scale(0.98); }
.btn .btn-arrow {
    width: 1rem;
    height: 1rem;
    transition: transform 0.3s ease;
}
.btn:hover .btn-arrow { transform: translateX(0.25rem); }

/* primary — white pill, black text */
.btn-primary {
    background: #FFFFFF;
    color: #000000;
    padding: 1rem 2rem;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    border-radius: 9999px;
}
.btn-primary:hover {
    background: rgba(255, 255, 255, 0.9);
    color: #000000;
    box-shadow: 0 0 30px rgba(120, 121, 246, 0.25);
}

/* ghost — mono, white/70, no border, just text + arrow */
.btn-ghost {
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.6875rem;
    letter-spacing: 0.05em;
    padding: 1rem 0.5rem;
}
.btn-ghost:hover { color: #FFFFFF; }

/* shiny — animated conic-gradient border ring */
.btn-shiny,
.shiny-border {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    overflow: hidden;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #FFFFFF;
    padding: 1rem 2.5rem;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    background: transparent;
    text-decoration: none;
    transition: box-shadow 0.3s ease;
    isolation: isolate;
}
.btn-shiny::before,
.shiny-border::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: conic-gradient(from var(--angle, 0deg), transparent 0%, rgba(120, 121, 246, 0.7) 10%, transparent 20%);
    border-radius: 9999px;
    animation: border-spin 3s linear infinite;
    z-index: -2;
}
.btn-shiny::after,
.shiny-border::after {
    content: '';
    position: absolute;
    inset: 1px;
    background: #000000;
    border-radius: 9999px;
    z-index: -1;
}
.btn-shiny > *,
.shiny-border > * { position: relative; z-index: 1; }
.btn-shiny:hover,
.shiny-border:hover {
    color: #FFFFFF;
    box-shadow: 0 0 40px rgba(255, 255, 255, 0.1);
}

/* ── Video background (full-page, behind everything) ─────── */
.video-bg {
    position: fixed;
    inset: 0;
    z-index: -10;
    overflow: hidden;
    pointer-events: none;
}
.video-bg-media {
    display: none;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.2;
}
.video-bg-fallback {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.6;
}
@media (min-width: 768px) {
    .video-bg-media { display: block; }
    .video-bg-fallback { display: none; }
}
.video-bg-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8) 0%, transparent 30%, transparent 70%, rgba(0, 0, 0, 0.8) 100%);
}

/* ── Hero ───────────────────────────────────────────────── */
.hero-section { isolation: isolate; }

/* StatusPill — diamond ETH icon + label + separator + version + dot */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 9999px;
    padding: 0.5rem 1rem;
    width: fit-content;
}
.status-pill-eth {
    width: 0.75rem;
    height: 0.75rem;
    color: rgba(255, 255, 255, 0.50);
}
.status-pill-label {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.60);
}
.status-pill-sep {
    display: inline-block;
    width: 1px;
    height: 0.75rem;
    background: rgba(255, 255, 255, 0.20);
}
.status-pill-version-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}
.status-pill-version {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.625rem;
    color: #7879F6;
}
.status-pill-dot {
    position: relative;
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
    background: #22C55E;
}
.status-pill-dot::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 9999px;
    background: rgba(34, 197, 94, 0.75);
    animation: ping-slow 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}
.status-pill[data-status="degraded"] .status-pill-dot { background: #F59F0A; }
.status-pill[data-status="degraded"] .status-pill-dot::before { background: rgba(245, 159, 10, 0.75); }
.status-pill[data-status="down"] .status-pill-dot { background: #EF4444; }
.status-pill[data-status="down"] .status-pill-dot::before { background: rgba(239, 68, 68, 0.75); }
.status-pill[data-status="loading"] .status-pill-dot,
.status-pill[data-status="error"] .status-pill-dot { display: none; }

/* Hero h1 — port of GradientHeading size=hero */
.hero-h1 {
    font-weight: 500;
    font-size: 3rem;
    line-height: 0.9;
    letter-spacing: -0.05em;
    max-width: 56rem;
}
@media (min-width: 640px) { .hero-h1 { font-size: 4.5rem; } }
@media (min-width: 1024px) { .hero-h1 { font-size: 7rem; } }

.hero-body {
    font-size: 1.125rem;
    line-height: 1.625;
    color: rgba(255, 255, 255, 0.60);
    max-width: 32rem;
}

@keyframes pulse-slow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ── Strip bundled Leaf code/pre chrome on landing ────────
   The bundled app.css adds bg + border + padding to <code> and <pre> for
   docs prose. Reset those on the landing so install lines and CLI commands
   render as plain mono text (matching the live React source). */
.landing-body code,
.landing-body code:not(pre code) {
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    padding: 0 !important;
    color: inherit;
    font-size: inherit;
}
.landing-body pre:not(.wf-ascii) {
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0;
    overflow: visible;
    font-size: inherit;
    line-height: inherit;
}

/* ── Workflow terminal ───────────────────────────────────── */
.wf-terminal {
    background: #0a0a0a;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 0.5rem;
    overflow: hidden;
}
.wf-term-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.wf-term-dots { display: flex; align-items: center; gap: 0.375rem; }
.wf-term-dot {
    display: inline-block;
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 9999px;
}
.wf-term-dot-red { background: #FF5F56; }
.wf-term-dot-yellow { background: #FFBD2E; }
.wf-term-dot-green { background: #27C93F; }
.wf-term-title {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.6875rem;
    color: rgba(255, 255, 255, 0.50);
    margin-left: 0.5rem;
}
.wf-term-body {
    padding: 1.5rem;
}
@media (min-width: 1024px) {
    .wf-term-body { padding: 2rem; }
}
.wf-ascii {
    margin: 0 auto 1.25rem !important;
    display: block !important;
    user-select: none;
    font-family: 'JetBrains Mono', 'Fira Code', monospace !important;
    font-size: 2px !important;
    line-height: 1 !important;
    letter-spacing: 0.01em !important;
    width: max-content !important;
    max-width: 100% !important;
    color: transparent !important;
    background-color: transparent !important;
    background-image: linear-gradient(to right, #d7b7ff, #8ea2ff, #caa8ff) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    border: 0 !important;
    border-radius: 0 !important;
    padding: 0 !important;
    opacity: 0.9 !important;
    filter: drop-shadow(0 0 14px rgba(142, 162, 255, 0.14));
    white-space: pre !important;
    overflow: visible !important;
}
@media (min-width: 640px) { .wf-ascii { font-size: 2.5px !important; } }
@media (min-width: 768px) { .wf-ascii { font-size: 3px !important; } }
@media (min-width: 1024px) { .wf-ascii { font-size: 3.5px !important; } }

/* CLI step rows in workflow terminal */
.wf-terminal .group {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.5rem 0;
}
.wf-terminal .group code,
.wf-terminal .group span {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 13px;
    line-height: 1.4;
}
.wf-terminal .group .text-\[11px\] { font-size: 11px; }

/* ── Landing nav — port of site-old/Navigation.tsx ───────── */
.ld-nav {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    width: 100%;
    pointer-events: none;
}
.ld-nav > * { pointer-events: auto; }

/* spread state (at rest) */
.ld-nav-spread {
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.ld-nav-spread-row {
    max-width: 64rem;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}
.ld-nav-logo-link { display: inline-flex; align-items: center; flex-shrink: 0; }
.ld-nav-logo-img { height: 2rem !important; width: auto !important; max-width: none !important; display: block; }
.ld-nav-logo-img-mobile { height: 1.75rem !important; width: auto !important; max-width: none !important; display: block; }
.ld-nav-icon-img { width: 1.25rem !important; height: 1.25rem !important; max-width: none !important; display: block; }
.status-pill-eth { width: 0.75rem !important; height: 0.75rem !important; max-width: none !important; }

/* shared pill (nav-link group) */
.ld-nav-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 9999px;
    background: transparent;
}
.ld-nav-link {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.60);
    transition: color 0.2s ease, background 0.2s ease;
    white-space: nowrap;
}
.ld-nav-link:hover {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.06);
}
/* active section highlight */
.ld-nav[data-active-section="why"] .ld-nav-link[data-section="why"],
.ld-nav[data-active-section="scope"] .ld-nav-link[data-also~="scope"],
.ld-nav[data-active-section="primitives"] .ld-nav-link[data-section="primitives"],
.ld-nav[data-active-section="use-cases"] .ld-nav-link[data-also~="use-cases"],
.ld-nav[data-active-section="workflow"] .ld-nav-link[data-section="workflow"],
.ld-nav[data-active-section="ecosystem"] .ld-nav-link[data-section="ecosystem"],
.ld-nav[data-active-section="threat-model"] .ld-nav-link[data-also~="threat-model"],
.ld-nav[data-active-section="on-chain"] .ld-nav-link[data-also~="on-chain"],
.ld-nav[data-active-section="collaborators"] .ld-nav-link[data-also~="collaborators"] {
    color: #FFFFFF;
    background: rgba(120, 121, 246, 0.12);
}

/* launch app — gradient violet pill with glow */
.ld-launch {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    padding: 0.5rem 1rem;
    background: linear-gradient(to bottom right, #7879F6, #A07AF6);
    color: #FFFFFF;
    font-size: 0.6875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-decoration: none;
    border-radius: 9999px;
    box-shadow: 0 0 24px rgba(120, 121, 246, 0.5), 0 0 8px rgba(120, 121, 246, 0.3);
    transition: box-shadow 0.3s ease;
}
.ld-launch:hover {
    color: #FFFFFF;
    box-shadow: 0 0 32px rgba(120, 121, 246, 0.65), 0 0 12px rgba(120, 121, 246, 0.4);
}
.ld-launch-icon { width: 0.875rem; height: 0.875rem; flex-shrink: 0; }

/* pill state (on scroll) — absolute over the spread, cross-fade */
.ld-nav-pill-wrap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    opacity: 0;
    transform: translateY(0.5rem);
    pointer-events: none;
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.ld-nav-pill-scrolled {
    margin-top: 1rem;
    padding: 0.375rem 0.5rem;
    background: rgba(255, 255, 255, 0.02);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.2);
    border-radius: 9999px;
}
.ld-nav-icon-link {
    display: inline-flex;
    align-items: center;
    padding: 0 0.75rem 0 0.5rem;
    margin-right: 0.25rem;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}
.ld-nav-icon-img { width: 1.25rem; height: 1.25rem; display: block; }
.ld-nav-sep {
    width: 1px;
    height: 1.5rem;
    background: rgba(255, 255, 255, 0.08);
    margin: 0 0.25rem 0 0.25rem;
}
.ld-nav-login { padding: 0.5rem 1rem; }

/* cross-fade between spread and pill */
.ld-nav.is-scrolled .ld-nav-spread {
    opacity: 0;
    transform: translateY(-0.5rem);
    pointer-events: none;
}
.ld-nav.is-scrolled .ld-nav-pill-wrap {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.ld-nav.is-scrolled .ld-nav-pill-wrap { aria-hidden: false; }

/* mobile bar (md and below) */
.ld-nav-mobile {
    display: none;
    align-items: center;
    justify-content: space-between;
    max-width: 64rem;
    margin: 0 auto;
    padding: 1rem 1.5rem;
}
.ld-nav-mobile-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 9999px;
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    cursor: pointer;
}
.ld-nav-mobile-menu {
    position: absolute;
    top: 100%;
    right: 1rem;
    margin-top: 0.25rem;
    width: 16rem;
    max-width: calc(100vw - 3rem);
    padding: 1rem;
    background: rgba(0, 0, 0, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.ld-nav-mobile-link {
    padding: 0.75rem 1rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.875rem;
    border-radius: 0.5rem;
}
.ld-nav-mobile-link:hover { background: rgba(255, 255, 255, 0.05); }
.ld-nav-mobile-sep { height: 1px; background: rgba(255, 255, 255, 0.05); margin: 0.5rem 0; }
.ld-nav-mobile-launch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(to bottom right, #7879F6, #A07AF6);
    color: #FFFFFF;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-decoration: none;
    border-radius: 9999px;
    box-shadow: 0 0 24px rgba(120, 121, 246, 0.5), 0 0 8px rgba(120, 121, 246, 0.3);
}
@media (max-width: 767px) {
    .ld-nav-spread, .ld-nav-pill-wrap { display: none; }
    .ld-nav-mobile { display: flex; }
}

/* ── Skip link ───────────────────────────────────────────── */
.landing-body .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;
}
.landing-body .sr-only.focus\:not-sr-only:focus,
.landing-body .focus\:not-sr-only:focus {
    position: fixed;
    top: 1rem;
    left: 1rem;
    width: auto;
    height: auto;
    padding: 0.5rem 1rem;
    background: #7879F6;
    color: #FFFFFF;
    border-radius: 0.5rem;
    z-index: 100;
    clip: auto;
    white-space: normal;
}

/* ── Reveal-on-scroll (progressive enhancement) ──────────── */
/* Default: fully visible (no-JS / pre-JS / Playwright full-page screenshots). */
.reveal-on-scroll {
    opacity: 1;
    transform: none;
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}
/* Only when landing.js marks the doc as ready do we start hidden. */
.js-anim .reveal-on-scroll:not(.is-visible) {
    opacity: 0;
    transform: translateY(1.5rem);
}
.js-anim .reveal-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ── Trust marquee ────────────────────────────────────────── */
.trust-marquee-track {
    animation: marquee 40s linear infinite;
    will-change: transform;
}

/* ── Keyframes ───────────────────────────────────────────── */
@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
@keyframes marquee-reverse {
    0% { transform: translateX(-50%); }
    100% { transform: translateX(0); }
}
@keyframes border-spin {
    0% { --angle: 0deg; }
    100% { --angle: 360deg; }
}
@keyframes ping-slow {
    0% { transform: scale(1); opacity: 0.75; }
    75%, 100% { transform: scale(2); opacity: 0; }
}
@keyframes hero-drift {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-30px, 20px) scale(1.08); }
}

/* ── Reduced motion ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    video { display: none; }
    .reveal-on-scroll {
        opacity: 1;
        transform: none;
    }
}
