/* ============================================================
   BALANZA LANDING — dark-only CRT theme
   Adapted from the Kuatsiru retro-terminal site.
   ============================================================ */

:root {
    --bg: #0b0b0b;
    --card: #1a120d;
    --text: #F4E5CF;
    --muted: #b8a387;
    --accent: #E08934;
    --accent-contrast: #000000;
    --border: #E08934;
}

/* ============================================================
   BASE
   ============================================================ */
html {
    height: 100%;
    background: #000;
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: "Courier New", monospace;
    margin: 0;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    clip-path: inset(0 round 2%);
}

a { color: var(--accent); }

h1, h2, h3 { color: var(--accent); margin: 0 0 0.75rem; }
h1 { font-size: 2.5rem; letter-spacing: 0.04em; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.1rem; }

p { line-height: 1.55; color: var(--text); }

/* ============================================================
   HEADER
   ============================================================ */
.header-inner {
    height: 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 0.75rem;
}

.header-nav {
    display: flex;
    gap: 36px;
    align-items: center;
}

.header-nav a {
    color: var(--accent);
    text-decoration: none;
    font-size: 1.05rem;
    text-shadow: 0 0 3px var(--accent), 0 0 6px var(--accent);
}

.header-nav a:hover { text-decoration: underline; }

.header-controls {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-shrink: 0;
}

.crt-btn-icon {
    background: transparent;
    border: 2px solid var(--accent);
    color: var(--accent);
    font-family: "Courier New", monospace;
    font-size: 0.9rem;
    padding: 2px 6px;
    cursor: pointer;
    text-shadow: 0 0 3px var(--accent), 0 0 6px var(--accent);
    min-width: 36px;
}

/* ============================================================
   CRT FRAME + EFFECTS
   ============================================================ */
.crt-frame {
    transform: perspective(800px) translateZ(30px);
    transform-style: preserve-3d;
    border: 4px solid var(--border);
    padding: 1rem;
    margin: 1rem 72px;
    box-sizing: border-box;
}

main#terminal {
    border: none;
    transform: none;
    flex: 1;
}

/* Scanlines — softer than the original */
#crt-overlay::before {
    content: "";
    pointer-events: none;
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    background: repeating-linear-gradient(
        to bottom,
        rgba(0,0,0,0.06) 0px,
        rgba(0,0,0,0.06) 2px,
        rgba(0,0,0,0.03) 3px,
        rgba(0,0,0,0.02) 4px
    );
    z-index: 2000;
}

/* Subtle pixel grid */
#crt-overlay::after {
    content: "";
    pointer-events: none;
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    background:
        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: 4px 4px;
    z-index: 1500;
}

/* Phosphor glow + chromatic aberration on text + interactive elements */
.crt-text, .crt-type, .crt-card, .crt-button {
    text-shadow:
        -1px 0 rgba(255, 80, 0, 0.12),
        1px 0 rgba(0, 200, 255, 0.08),
        0 0 3px var(--accent),
        0 0 6px var(--accent);
}

/* Slowed sweep — calmer for a finance pitch */
#crt-sweep {
    pointer-events: none;
    position: fixed;
    left: 0;
    width: 100vw;
    height: 30vh;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(255, 255, 255, 0.015) 35%,
        rgba(255, 255, 255, 0.03) 50%,
        rgba(255, 255, 255, 0.015) 65%,
        transparent 100%
    );
    z-index: 1800;
    animation: crt-sweep 20s linear infinite;
}

@keyframes crt-sweep {
    from { top: -30vh; }
    to   { top: 100vh; }
}

/* ============================================================
   TYPING ANIMATION
   ============================================================ */
.crt-type, .crt-type-delay {
    opacity: 0;
    animation: typewriter 2s steps(40) forwards;
}

.crt-type-delay { animation-delay: 0.4s; }

@keyframes typewriter {
    from { opacity: 0; }
    to   { opacity: 1; }
}

#cursor {
    display: inline-block;
    animation: blink 0.7s infinite alternate;
}

@keyframes blink {
    from { opacity: 1; }
    to   { opacity: 0; }
}

/* ============================================================
   BUTTONS
   ============================================================ */
.crt-button {
    align-content: center;
    background: transparent;
    border: 2px solid var(--accent);
    color: var(--accent);
    padding: 0.6rem 1rem;
    cursor: pointer;
    font-family: "Courier New", monospace;
    font-size: 1rem;
    text-decoration: none;
    display: inline-block;
}

.crt-button:hover {
    background: rgba(224, 137, 52, 0.1);
}

.crt-button.primary {
    background: var(--accent);
    color: var(--accent-contrast);
    text-shadow: none;
}

.crt-button.primary:hover {
    background: #f29944;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
    text-align: center;
    padding: 3rem 1rem 4rem;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: 1rem;
}

.hero p {
    max-width: 640px;
    margin: 0 auto 2rem;
    font-size: 1.1rem;
    color: var(--text);
}

.hero-ctas {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ============================================================
   SECTION TITLES + WRAPPERS
   ============================================================ */
.section {
    padding: 2.5rem 1rem;
}

.section h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.section-intro {
    text-align: center;
    max-width: 640px;
    margin: 0 auto 2rem;
    color: var(--muted);
}

/* ============================================================
   HOW IT WORKS
   ============================================================ */
.how-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    max-width: 960px;
    margin: 0 auto;
}

.step {
    border: 2px solid var(--border);
    background: var(--card);
    padding: 1.25rem;
    text-align: center;
}

.step-num {
    font-size: 2rem;
    color: var(--accent);
    font-weight: bold;
    margin-bottom: 0.5rem;
}

/* ============================================================
   FEATURES GRID
   ============================================================ */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    max-width: 1100px;
    margin: 0 auto;
}

.crt-card {
    border: 2px solid var(--border);
    background: var(--card);
    padding: 1.25rem;
    text-align: center;
}

.crt-card svg {
    fill: var(--accent);
    height: 36px;
    width: 36px;
    margin-bottom: 0.5rem;
}

.crt-card h3 { color: var(--accent); }

.crt-card .pill {
    display: inline-block;
    border: 1px solid var(--muted);
    color: var(--muted);
    font-size: 0.75rem;
    padding: 1px 6px;
    border-radius: 3px;
    margin-left: 0.4rem;
    vertical-align: middle;
}

/* ============================================================
   SCREENSHOTS
   ============================================================ */
.screenshots {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
    max-width: 1100px;
    margin: 0 auto;
}

.screenshot {
    border: 2px solid var(--border);
    background: var(--card);
    padding: 0.75rem;
    text-align: center;
}

.screenshot .placeholder {
    aspect-ratio: 9 / 16;
    background:
        repeating-linear-gradient(
            45deg,
            rgba(224, 137, 52, 0.06) 0,
            rgba(224, 137, 52, 0.06) 6px,
            transparent 6px,
            transparent 12px);
    border: 1px dashed var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.screenshot img {
    width: 100%;
    height: auto;
    display: block;
}

/* ============================================================
   FAQ
   ============================================================ */
.faq {
    max-width: 760px;
    margin: 0 auto;
}

.faq details {
    border: 2px solid var(--border);
    background: var(--card);
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
}

.faq summary {
    color: var(--accent);
    font-weight: bold;
    list-style: none;
    outline: none;
}

.faq summary::-webkit-details-marker { display: none; }
.faq summary::before {
    content: "▸ ";
    display: inline-block;
    transition: transform 0.2s ease;
}

.faq details[open] summary::before {
    content: "▾ ";
}

.faq details p {
    margin-top: 0.5rem;
    color: var(--text);
}

/* ============================================================
   FOOTER CTA
   ============================================================ */
.footer-cta {
    text-align: center;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 2.5rem 1rem;
    margin: 2rem 0 0;
}

.footer-cta h2 { margin-bottom: 0.75rem; }
.footer-cta p { max-width: 540px; margin: 0 auto 1.5rem; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
    text-align: center;
    padding: 1.5rem 1rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.footer a {
    color: var(--accent);
    margin: 0 0.5rem;
    text-decoration: none;
}

.footer a:hover { text-decoration: underline; }

/* ============================================================
   CONTACT PAGE (info.html)
   ============================================================ */
.contact {
    width: 100%;
    padding-bottom: 50px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.contact-card {
    border: 2px solid var(--border);
    background: var(--card);
    padding: 1rem;
    margin-top: 1rem;
    width: 320px;
    text-align: center;
}

.contact-card label { display: block; margin: 0.5rem 0 0.25rem; color: var(--muted); }
.contact-card input {
    width: 100%;
    box-sizing: border-box;
    background: none;
    border: 1px solid var(--accent);
    color: var(--text);
    padding: 0.4rem 0.5rem;
    font-family: "Courier New", monospace;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 720px) {
    .crt-frame { margin: 0.75rem 1rem; }
    .header-nav { gap: 16px; font-size: 0.9rem; }
    .header-nav a { font-size: 0.95rem; }
    h1 { font-size: 1.8rem; }
    .hero { padding: 1.5rem 0.5rem 2rem; }
    .section { padding: 1.5rem 0.5rem; }
}
