/* Theme and shared building blocks. Section-specific styles live in the components' .razor.css files. */

:root {
    --ink: #07080f;
    --ink-2: #0d0f1c;
    --surface: rgba(255, 255, 255, 0.04);
    --surface-strong: rgba(255, 255, 255, 0.07);
    --line: rgba(255, 255, 255, 0.09);
    --line-strong: rgba(255, 255, 255, 0.18);
    --text: #e9ebf5;
    --text-soft: #a3a8c3;
    --violet: #7c5cff;
    --cyan: #22d3ee;
    --mint: #34f5a8;
    --pink: #ff5ca8;
    --gradient: linear-gradient(110deg, var(--violet) 0%, var(--cyan) 55%, var(--mint) 100%);
    --radius: 1.25rem;
    --font-sans: "Inter", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
    --font-mono: "Cascadia Code", "JetBrains Mono", Consolas, "SF Mono", Menlo, monospace;
    --bs-body-bg: var(--ink);
    --bs-body-color: var(--text);
    --bs-body-font-family: var(--font-sans);
    --bs-link-color-rgb: 34, 211, 238;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 5rem;
}

body {
    background: var(--ink);
    color: var(--text);
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

::selection {
    background: rgba(124, 92, 255, 0.45);
    color: #fff;
}

a {
    color: var(--cyan);
}

code, pre {
    font-family: var(--font-mono);
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: -4rem;
    z-index: 2000;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    background: var(--cyan);
    color: var(--ink);
    font-weight: 600;
}

.skip-link:focus {
    top: 1rem;
}

.text-gradient {
    background: var(--gradient);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: gradient-shift 8s ease-in-out infinite alternate;
}

.text-muted-soft {
    color: var(--text-soft);
}

@keyframes gradient-shift {
    to { background-position: 100% center; }
}

/* Glass panels */
.glass {
    position: relative;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 20px 60px -30px rgba(0, 0, 0, 0.8);
}

/* Buttons */
.btn-glow {
    --bs-btn-color: var(--ink);
    --bs-btn-hover-color: var(--ink);
    --bs-btn-active-color: var(--ink);
    position: relative;
    border: 0;
    border-radius: 999px;
    background: var(--gradient);
    background-size: 160% auto;
    font-weight: 600;
    box-shadow: 0 8px 30px -8px rgba(34, 211, 238, 0.55);
    transition: background-position 0.4s ease, transform 0.2s ease, box-shadow 0.3s ease;
}

.btn-glow:hover,
.btn-glow:focus-visible {
    background-position: right center;
    transform: translateY(-2px);
    box-shadow: 0 14px 40px -8px rgba(124, 92, 255, 0.7);
}

.btn-ghost {
    --bs-btn-color: var(--text);
    --bs-btn-hover-color: #fff;
    --bs-btn-active-color: #fff;
    --bs-btn-hover-bg: var(--surface-strong);
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    font-weight: 500;
}

.btn .icon {
    width: 1.1em;
    height: 1.1em;
    vertical-align: -0.15em;
}

/* Sections */
.section {
    position: relative;
    padding: 7rem 0;
}

.section-head {
    max-width: 46rem;
    margin: 0 auto 3.5rem;
    text-align: center;
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 1rem;
}

.section-lead {
    color: var(--text-soft);
    font-size: 1.15rem;
    max-width: 40rem;
}

.section-head .section-lead {
    margin-inline: auto;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: var(--cyan);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.pulse-dot {
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--mint);
    box-shadow: 0 0 0 0 rgba(52, 245, 168, 0.6);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    70% { box-shadow: 0 0 0 0.6rem rgba(52, 245, 168, 0); }
    100% { box-shadow: 0 0 0 0 rgba(52, 245, 168, 0); }
}

/* Features (used in several sections) */
.feature {
    height: 100%;
    padding: 1.75rem;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.feature:hover {
    transform: translateY(-4px);
    border-color: var(--line-strong);
}

.feature-icon {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 2.75rem;
    height: 2.75rem;
    margin-bottom: 1rem;
    border-radius: 0.85rem;
    background: linear-gradient(140deg, rgba(124, 92, 255, 0.25), rgba(34, 211, 238, 0.12));
    border: 1px solid rgba(124, 92, 255, 0.35);
    color: var(--cyan);
}

.feature-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.feature-text {
    color: var(--text-soft);
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-list li {
    padding: 0.25rem 0.75rem;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    color: var(--text-soft);
    font-family: var(--font-mono);
    font-size: 0.75rem;
}

/* Terminal: the lines are rewritten by site.js, so the styles cannot be scoped to the component. */
.terminal {
    --term-bg: #0a0c0a;
    --term-fg: #c9d1c9;
    --term-green: #3ddc84;
    --term-amber: #f0b429;
    --term-blue: #5cc8ff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #2b302b;
    border-radius: 3px;
    background: var(--term-bg);
    box-shadow: 0 0 0 1px #000, 0 30px 80px -30px rgba(61, 220, 132, 0.25);
    font-family: var(--font-mono);
}

.terminal-bar {
    display: flex;
    gap: 1rem;
    padding: 0.35rem 0.75rem;
    border-bottom: 1px solid #2b302b;
    background: #141714;
    color: #8a948a;
    font-size: 0.72rem;
    white-space: nowrap;
}

.terminal-path {
    overflow: hidden;
    text-overflow: ellipsis;
}

.terminal-host {
    margin-left: auto;
    color: var(--term-green);
}

.terminal-body {
    height: 23rem;
    margin: 0;
    padding: 0.9rem 1rem;
    overflow: hidden;
    color: var(--term-fg);
    font-size: 0.78rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-all;
    text-shadow: 0 0 6px rgba(61, 220, 132, 0.12);
}

.terminal-body .t-line {
    display: block;
}

.t-prompt { color: var(--term-blue); font-weight: 700; }
.t-ok { color: var(--term-green); }
.t-dim { color: #6b746b; }
.t-key { color: var(--term-amber); }
.t-str { color: #9fe8b8; }

.terminal-status {
    display: flex;
    gap: 0.75rem;
    padding: 0.15rem 0.6rem;
    background: var(--term-green);
    color: #062010;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
}

.ts-session { font-weight: 800; }
.ts-dim { opacity: 0.65; }
.ts-right { margin-left: auto; }

.t-badge {
    display: inline-block;
    padding: 0 0.5rem;
    border-radius: 0.4rem;
    background: var(--mint);
    color: var(--ink);
    font-family: var(--font-mono);
    font-size: 0.8em;
    font-weight: 800;
}

/* Block cursor */
.t-caret {
    display: inline-block;
    width: 0.6em;
    height: 1.15em;
    vertical-align: -0.2em;
    background: var(--term-green);
    animation: blink 1s steps(1) infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

/* Tilt (set by site.js through CSS variables) */
[data-tilt] {
    transform: perspective(900px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
    transition: transform 0.25s ease-out;
    will-change: transform;
}

/* Reveal on scroll. Without JS (no .js class) everything is visible. */
.js .reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.8s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.js .reveal.is-visible {
    opacity: 1;
    transform: none;
}

.js .reveal.is-visible[data-tilt] {
    transform: perspective(900px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
}

/* site.js marks the agent's steps one at a time once the card is visible */
.js [data-agent-steps] li {
    opacity: 0.15;
    transform: translateX(-6px);
}

.js [data-agent-steps] li.is-done {
    opacity: 1;
    transform: none;
    color: var(--text);
}

.delay-1 { transition-delay: 0.08s !important; }
.delay-2 { transition-delay: 0.16s !important; }
.delay-3 { transition-delay: 0.24s !important; }
.delay-4 { transition-delay: 0.32s !important; }

/* Status pages (404/500) */
.status-page {
    min-height: 80vh;
    display: grid;
    place-items: center;
    padding-top: 9rem;
}

.status-code {
    font-size: clamp(5rem, 18vw, 10rem);
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.05em;
    margin-bottom: 1rem;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }

    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .js .reveal { opacity: 1; transform: none; }
    [data-tilt] { transform: none !important; }
}

@media (max-width: 767.98px) {
    .section { padding: 4.5rem 0; }
}
