/* ============================================================
   Landing page — bespoke styling
   ============================================================ */

/* ---------- HERO ---------- */
.hero {
    position: relative;
    padding: 80px 0 120px;
    overflow: hidden;
}

.hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--line-soft) 1px, transparent 1px),
        linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
    background-size: 80px 80px;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black 0%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black 0%, transparent 80%);
    opacity: 0.5;
    pointer-events: none;
}

.hero-inner {
    position: relative;
    text-align: center;
}

.hero-eyebrow {
    display: inline-block;
    margin-bottom: 32px;
    color: var(--accent);
    animation: fade-up 0.7s 0.1s both;
}

.hero-title {
    font-size: clamp(56px, 9vw, 144px);
    margin-bottom: 28px;
}
.hero-line {
    display: block;
    overflow: hidden;
}
.hero-line span {
    display: inline-block;
    animation: line-rise 0.9s cubic-bezier(.2,.8,.2,1) both;
}
.line-1 span { animation-delay: 0.15s; }
.line-2 span { animation-delay: 0.3s; font-style: italic; color: var(--text-dim); }
.line-3 span { animation-delay: 0.45s; }

.hero-blink {
    color: var(--accent);
    font-style: normal;
    animation: blink 1.1s steps(2) infinite;
    margin-left: 4px;
    font-weight: 300;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-sub {
    font-size: 19px;
    color: var(--text-dim);
    max-width: 640px;
    margin: 0 auto 40px;
    line-height: 1.6;
    animation: fade-up 0.8s 0.6s both;
}

.hero-cta {
    display: flex;
    gap: 14px;
    justify-content: center;
    margin-bottom: 80px;
    animation: fade-up 0.8s 0.75s both;
}

/* terminal card */
.hero-terminal {
    max-width: 720px;
    margin: 0 auto;
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    text-align: left;
    box-shadow: var(--shadow), 0 0 80px -20px var(--accent-glow);
    animation: fade-up 0.9s 0.9s both;
    position: relative;
}

.term-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-elev-2);
    border-bottom: 1px solid var(--line);
}
.term-dot {
    width: 11px; height: 11px;
    border-radius: 50%;
    background: var(--line);
}
.term-dot.d-r { background: #FF5F57; }
.term-dot.d-y { background: #FEBC2E; }
.term-dot.d-g { background: #28C840; }
.term-label {
    margin-left: 10px;
    font-size: 12px;
    color: var(--text-faint);
}
[dir="rtl"] .term-label { margin-left: 0; margin-right: 10px; }

.term-body {
    padding: 24px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    line-height: 1.7;
    min-height: 220px;
}

.term-line {
    display: flex;
    align-items: baseline;
    gap: 10px;
    color: var(--text);
}
.term-prompt {
    color: var(--accent);
    font-weight: 500;
}
.term-prompt::after { content: ' ›'; }
.term-cursor {
    color: var(--accent);
    animation: blink 1s steps(2) infinite;
}
.term-typed { color: var(--text); }

.term-reply {
    margin-top: 16px;
    color: var(--text-dim);
    white-space: pre-wrap;
    min-height: 24px;
}

.term-metrics {
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    animation: fade-up 0.6s both;
}
.term-metric {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.m-label {
    font-size: 10px;
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.m-value {
    color: var(--accent);
    font-size: 18px;
    font-weight: 500;
}

/* floating tags */
.float-tag {
    position: absolute;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--bg-elev);
    font-size: 11px;
    color: var(--text-dim);
    box-shadow: var(--shadow);
}
.float-tag.t-a { top: 35%; left: 4%; animation: float 6s ease-in-out infinite; }
.float-tag.t-b { top: 45%; right: 6%; animation: float 7s ease-in-out infinite 1s; }
.float-tag.t-c { top: 70%; left: 8%; animation: float 8s ease-in-out infinite 0.5s; }

@media (max-width: 900px) {
    .float-tag { display: none; }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-14px); }
}

@keyframes line-rise {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
@keyframes fade-up {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- MARQUEE ---------- */
.marquee-wrap {
    padding: 24px 0;
    border-top: 1px solid var(--line-soft);
    border-bottom: 1px solid var(--line-soft);
    background: var(--bg-elev);
    overflow: hidden;
}
.marquee {
    overflow: hidden;
    mask-image: linear-gradient(90deg, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(90deg, transparent, black 10%, black 90%, transparent);
}
.marquee-track {
    display: flex;
    gap: 28px;
    white-space: nowrap;
    animation: marquee 38s linear infinite;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    color: var(--text-faint);
}
.marquee-track span { flex-shrink: 0; }
@keyframes marquee {
    to { transform: translateX(-50%); }
}

/* ---------- STATS ---------- */
.stats { padding: 96px 0; }
.stat-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
}
.stat {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-top: 1px solid var(--line);
    padding-top: 20px;
}
.stat-num {
    font-size: clamp(48px, 6vw, 72px);
    color: var(--text);
    letter-spacing: -0.04em;
}
.stat-num .prefix, .stat-num .suffix {
    color: var(--text-dim);
    font-size: 0.6em;
}
.stat-label {
    font-size: 11px;
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

@media (max-width: 900px) {
    .stat-row { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- SECTIONS ---------- */
.section { padding: 120px 0; position: relative; }

.section-head {
    margin-bottom: 64px;
    max-width: 720px;
}
.section-title {
    font-size: clamp(40px, 5vw, 72px);
    margin-top: 12px;
}
.section-title em {
    font-style: italic;
    color: var(--accent);
}

/* features */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    border-top: 1px solid var(--line);
}
.feature {
    padding: 40px 28px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    transition: background 0.3s;
    position: relative;
}
.feature:nth-child(3n) { border-right: none; }
.feature:hover {
    background: var(--bg-elev);
}
.feature:hover .feature-num { color: var(--accent); }

.feature-num {
    font-size: 12px;
    color: var(--text-faint);
    letter-spacing: 0.08em;
    margin-bottom: 60px;
    display: block;
    transition: color 0.3s;
}
.feature-title {
    font-size: 28px;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}
.feature p {
    color: var(--text-dim);
    font-size: 15px;
    line-height: 1.6;
}

@media (max-width: 900px) {
    .features-grid { grid-template-columns: 1fr; }
    .feature, .feature:nth-child(3n) { border-right: none; }
}

/* workflow */
.workflow {
    background: var(--bg-elev);
    border-top: 1px solid var(--line-soft);
    border-bottom: 1px solid var(--line-soft);
}
.workflow-list {
    list-style: none;
    counter-reset: step;
    position: relative;
}
.workflow-step {
    position: relative;
    padding: 48px 0 48px 80px;
    border-top: 1px solid var(--line);
}
.workflow-step:last-child { border-bottom: 1px solid var(--line); }
[dir="rtl"] .workflow-step { padding: 48px 80px 48px 0; }

.step-rail {
    position: absolute;
    left: 30px;
    top: 0;
    bottom: -1px;
    width: 1px;
    background: var(--line);
}
.workflow-step:last-child .step-rail { display: none; }
[dir="rtl"] .step-rail { left: auto; right: 30px; }

.workflow-step::before {
    content: '';
    position: absolute;
    left: 24px;
    top: 60px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--bg-elev);
    border: 2px solid var(--accent);
    box-shadow: 0 0 0 4px var(--bg-elev), 0 0 20px var(--accent-glow);
}
[dir="rtl"] .workflow-step::before { left: auto; right: 24px; }

.step-num {
    font-size: 11px;
    color: var(--accent);
    letter-spacing: 0.1em;
    margin-bottom: 8px;
    display: block;
}
.step-title {
    font-size: clamp(28px, 3.5vw, 42px);
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}
.workflow-step p {
    color: var(--text-dim);
    font-size: 16px;
    max-width: 600px;
}

/* demo strip */
.demo-strip .demo-inner {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 80px;
    align-items: center;
}
@media (max-width: 900px) {
    .demo-strip .demo-inner { grid-template-columns: 1fr; gap: 40px; }
}
.demo-copy {
    color: var(--text-dim);
    margin: 24px 0 32px;
    font-size: 16px;
    line-height: 1.7;
    max-width: 520px;
}
.demo-chip {
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 28px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    line-height: 1.8;
    color: var(--text);
    position: relative;
}
.demo-chip::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 16px;
    background: var(--grad-edge);
    opacity: 0.4;
    z-index: -1;
    filter: blur(20px);
}
.chip-line { color: var(--text-dim); }
.chip-line strong { color: var(--accent); }
.c-dim { color: var(--text-faint); }
.chip-bar {
    height: 4px;
    background: var(--bg-elev-2);
    border-radius: 4px;
    margin: 12px 0;
    overflow: hidden;
}
.chip-fill {
    height: 100%;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
    animation: fill-grow 2s ease-out;
}
@keyframes fill-grow { from { width: 0 !important; } }

/* testimonials */
.testimonials {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
@media (max-width: 900px) {
    .testimonials { grid-template-columns: 1fr; }
}
.testimonial {
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 32px;
    position: relative;
}
.testimonial blockquote {
    font-family: 'Fraunces', serif;
    font-size: 20px;
    line-height: 1.5;
    color: var(--text);
    margin-bottom: 20px;
    letter-spacing: -0.01em;
}
.testimonial blockquote em { color: var(--accent); }
.testimonial figcaption {
    color: var(--text-faint);
    font-size: 12px;
}

/* faq */
.faq {
    display: flex;
    flex-direction: column;
    gap: 0;
    border-top: 1px solid var(--line);
}
.faq-item {
    border-bottom: 1px solid var(--line);
    padding: 24px 0;
}
.faq-item summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Fraunces', serif;
    font-size: 22px;
    letter-spacing: -0.01em;
    color: var(--text);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: '+';
    color: var(--accent);
    font-size: 24px;
    transition: transform 0.3s;
    font-weight: 300;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p {
    color: var(--text-dim);
    margin-top: 14px;
    line-height: 1.6;
    max-width: 700px;
}

/* CTA card */
.cta-card {
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.cta-card::before {
    content: '';
    position: absolute;
    inset: -50%;
    background: radial-gradient(circle at center, var(--accent-glow), transparent 60%);
    opacity: 0.2;
    pointer-events: none;
}
.cta-title {
    font-size: clamp(48px, 6vw, 96px);
    margin-bottom: 16px;
    position: relative;
}
.cta-sub {
    color: var(--text-dim);
    margin-bottom: 32px;
    font-size: 17px;
    position: relative;
}
.cta-card .btn { position: relative; }
@media (max-width: 900px) {
    .cta-card { padding: 48px 24px; }
}

/* footer */
.footer {
    border-top: 1px solid var(--line);
    padding: 64px 0 40px;
}
.footer-inner {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 48px;
}
.footer-tag {
    color: var(--text-faint);
    font-size: 13px;
    margin-top: 12px;
}
.footer-nav {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}
.footer-nav .eyebrow {
    margin-bottom: 16px;
    display: block;
}
.footer-nav a {
    display: block;
    color: var(--text-dim);
    font-size: 14px;
    padding: 4px 0;
    transition: color 0.15s;
}
.footer-nav a:hover { color: var(--text); }
.footer-copy {
    grid-column: 1 / -1;
    color: var(--text-faint);
    font-size: 11px;
    text-align: center;
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--line-soft);
    letter-spacing: 0.08em;
}
@media (max-width: 900px) {
    .footer-inner { grid-template-columns: 1fr; }
    .footer-nav { grid-template-columns: repeat(2, 1fr); }
}

/* ── Mobile fixes ─────────────────────────────────────────── */
@media (max-width: 640px) {
    .stat-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
        padding: 0 4px;
    }
    .stat-num {
        font-size: 36px !important;
        letter-spacing: -0.03em;
    }
    .stat-label {
        font-size: 10px;
    }
    .section { padding: 60px 0; }
    .section-title { font-size: 32px !important; }
    .features-grid { grid-template-columns: 1fr !important; gap: 20px; }
    .workflow-step { padding-left: 20px; }
    .demo-inner { flex-direction: column; gap: 40px; }
    .testimonials { flex-direction: column; gap: 20px; }
    .cta-card { padding: 40px 24px; }
    .cta-title { font-size: 36px !important; }
    .footer-inner { flex-direction: column; gap: 32px; }
    .footer-nav { grid-template-columns: 1fr 1fr; gap: 24px; }
    .hero-terminal { display: none; }
}
@media (max-width: 640px) {
    .stats { padding: 40px 16px; overflow: visible; }
    .stat-row { grid-template-columns: 1fr 1fr; gap: 16px; overflow: visible; }
    .stat-num { font-size: 32px !important; }
    .hero { overflow: visible !important; }
    .hero-inner { overflow: visible !important; }
}

@media (max-width: 640px) {
    .hero-terminal { display: block !important; margin: 0 8px; font-size: 12px; }
    .term-body { padding: 16px; }
}
