/* ============================================================================
   CATIA Smart — cax-smart.com
   Style: technical dark — engineering catalog meets developer tool
   Palette:
     bg          #0a0e14   very dark blue-black
     surface     #131820   elevated cards
     surface-2   #1c2330   nav, code blocks
     border      #232c3d   1px lines
     accent      #4a9eff   technical blue (CAD selection)
     accent-2    #ff9540   warm orange (CAD active)
     text        #e8e8e8   primary
     muted       #8892a0   secondary
     dim         #5a6478   tertiary
   No purple-indigo gradients. No 0.1-opacity shadows. No three-cards-row.
   ============================================================================ */

:root {
    --bg: #0a0e14;
    --surface: #131820;
    --surface-2: #1c2330;
    --border: #232c3d;
    --accent: #4a9eff;
    --accent-2: #ff9540;
    --text: #e8e8e8;
    --muted: #8892a0;
    --dim: #5a6478;

    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue",
        Arial, "Noto Sans", sans-serif;
    --font-mono: "JetBrains Mono", "SF Mono", Consolas, "Liberation Mono",
        monospace;

    --container: 1200px;
    --content: 880px;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
ul { list-style: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }

/* ---------- container ---------- */
.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------- nav ---------- */
.nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(10, 14, 20, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}
.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 600;
    font-size: 16px;
    letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }
.brand-mark {
    width: 28px;
    height: 28px;
    border: 1.5px solid var(--accent);
    border-radius: 6px;
    display: grid;
    place-items: center;
    color: var(--accent);
    font-weight: 700;
    font-family: var(--font-mono);
    font-size: 13px;
}
.brand-sub {
    color: var(--muted);
    font-weight: 400;
    font-size: 13px;
    border-left: 1px solid var(--border);
    padding-left: 10px;
    margin-left: 4px;
}
.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}
.nav-links a {
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
}
.nav-links a:hover {
    color: var(--text);
    text-decoration: none;
}
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
    border: 1px solid transparent;
    line-height: 1;
}
.btn-primary {
    background: var(--accent);
    color: #0a0e14;
}
.btn-primary:hover {
    background: #6db4ff;
    text-decoration: none;
}
.btn-ghost {
    background: transparent;
    border-color: var(--border);
    color: var(--text);
}
.btn-ghost:hover {
    background: var(--surface);
    border-color: var(--dim);
    text-decoration: none;
}
.btn-lg { padding: 12px 22px; font-size: 15px; }

/* ---------- hero ---------- */
.hero {
    padding: 88px 0 72px;
    border-bottom: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        var(--accent) 30%,
        var(--accent-2) 70%,
        transparent 100%
    );
    opacity: 0.4;
}
.hero-grid {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    gap: 64px;
    align-items: center;
}
@media (max-width: 900px) {
    .hero { padding: 56px 0 48px; }
    .hero-grid { grid-template-columns: 1fr; gap: 40px; }
}
.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 24px;
    font-family: var(--font-mono);
}
.hero-eyebrow .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-2);
    box-shadow: 0 0 8px var(--accent-2);
}
h1.hero-title {
    font-size: clamp(36px, 5vw, 56px);
    font-weight: 600;
    line-height: 1.08;
    letter-spacing: -0.025em;
    margin-bottom: 20px;
    color: var(--text);
}
.hero-title .accent { color: var(--accent); }
.hero-sub {
    font-size: 18px;
    color: var(--muted);
    margin-bottom: 36px;
    max-width: 540px;
    line-height: 1.55;
}
.hero-cta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ---------- code card ---------- */
.codecard {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.65;
}
.codecard-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
}
.codecard-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--dim);
}
.codecard-dot.red { background: #e85d68; }
.codecard-dot.yellow { background: #f0b132; }
.codecard-dot.green { background: #4ec27a; }
.codecard-name {
    margin-left: 8px;
    color: var(--muted);
    font-size: 12px;
}
.codecard-body {
    padding: 18px 20px;
    overflow-x: auto;
}
.codecard-body pre { font: inherit; color: var(--text); }
.codecard-body .ln {
    display: inline-block;
    width: 1.5em;
    color: var(--dim);
    user-select: none;
}
.tk-kw  { color: #c792ea; }
.tk-fn  { color: var(--accent); }
.tk-str { color: #ecc48d; }
.tk-num { color: #f78c6c; }
.tk-com { color: var(--dim); font-style: italic; }
.tk-mod { color: var(--accent-2); }

/* ---------- section base ---------- */
section { padding: 80px 0; border-bottom: 1px solid var(--border); }
@media (max-width: 900px) { section { padding: 56px 0; } }
.section-eyebrow {
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 12px;
}
.section-title {
    font-size: clamp(28px, 3.5vw, 38px);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
    color: var(--text);
    max-width: 720px;
}
.section-lead {
    font-size: 17px;
    color: var(--muted);
    max-width: 640px;
    margin-bottom: 48px;
}

/* ---------- stats ---------- */
.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}
.stats > div {
    background: var(--bg);
    padding: 28px 24px;
}
.stat-num {
    font-family: var(--font-mono);
    font-size: 32px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.02em;
    line-height: 1;
}
.stat-label {
    color: var(--muted);
    font-size: 13px;
    margin-top: 8px;
    line-height: 1.4;
}
@media (max-width: 900px) {
    .stats { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- features (NOT a 3-card row — list with diff weights) ---------- */
.features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
}
@media (max-width: 900px) { .features { grid-template-columns: 1fr; gap: 32px; } }
.feature {
    padding-top: 20px;
    border-top: 1px solid var(--border);
}
.feature-icon {
    color: var(--accent);
    margin-bottom: 14px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.feature h3 {
    font-size: 19px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}
.feature p { color: var(--muted); font-size: 15px; line-height: 1.6; }
.feature code {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent-2);
}

/* ---------- code tabs ---------- */
.tabs-wrap {
    margin-top: 32px;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: var(--surface);
}
.tabs-bar {
    display: flex;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
}
.tab-btn {
    background: transparent;
    border: none;
    color: var(--muted);
    padding: 14px 22px;
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font-mono);
    border-bottom: 2px solid transparent;
    transition: color 0.12s, border-color 0.12s;
}
.tab-btn[aria-selected="true"] {
    color: var(--text);
    border-bottom-color: var(--accent);
}
.tab-btn:hover { color: var(--text); }
.tab-meta {
    margin-left: auto;
    align-self: center;
    padding-right: 18px;
    color: var(--dim);
    font-size: 12px;
    font-family: var(--font-mono);
}
.tab-panel { display: none; padding: 22px 24px; overflow-x: auto; }
.tab-panel[aria-hidden="false"] { display: block; }
.tab-panel pre {
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.7;
    color: var(--text);
}

/* ---------- steps ---------- */
.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 32px;
}
.steps > div { background: var(--bg); padding: 28px 24px; }
.step-num {
    font-family: var(--font-mono);
    color: var(--accent);
    font-size: 13px;
    margin-bottom: 16px;
}
.step h4 {
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}
.step p { color: var(--muted); font-size: 14px; line-height: 1.55; }
@media (max-width: 900px) { .steps { grid-template-columns: 1fr; } }

/* ---------- showcase (bumper story) ---------- */
.showcase-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
}
@media (max-width: 900px) { .showcase-grid { grid-template-columns: 1fr; gap: 32px; } }
.showcase-fig {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 24px;
}
.showcase-fig .figcap {
    color: var(--muted);
    font-size: 12px;
    font-family: var(--font-mono);
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
}
.showcase-fig .figcap span:last-child { color: var(--text); }
.metric-list {
    list-style: none;
    padding: 0;
    margin-top: 18px;
}
.metric-list li {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    color: var(--muted);
    font-size: 14px;
}
.metric-list li:last-child { border: none; }
.metric-list li strong {
    color: var(--text);
    font-family: var(--font-mono);
    font-weight: 500;
}

/* ---------- cta band ---------- */
.cta-band {
    padding: 80px 0;
    text-align: center;
    border-bottom: 1px solid var(--border);
}
.cta-band h2 {
    font-size: clamp(28px, 3.5vw, 36px);
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
}
.cta-band p { color: var(--muted); margin-bottom: 28px; }
.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* ---------- footer ---------- */
footer {
    padding: 48px 0;
    color: var(--muted);
    font-size: 14px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 32px;
}
@media (max-width: 700px) {
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}
.footer-col h5 {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 14px;
}
.footer-col ul li { margin-bottom: 8px; }
.footer-col a { color: var(--muted); }
.footer-col a:hover { color: var(--text); text-decoration: none; }
.footer-tag {
    color: var(--muted);
    font-size: 14px;
    margin-top: 12px;
    line-height: 1.55;
    max-width: 340px;
}
.footer-bottom {
    padding-top: 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
    color: var(--dim);
}
.footer-bottom .domain {
    color: var(--accent);
    font-family: var(--font-mono);
}

/* ---------- small ---------- */
.hide-sm { }
@media (max-width: 700px) { .hide-sm { display: none !important; } }

/* ============================================================
   Added 2026-06-26 — chat-style hero + trial modal
   ============================================================ */

/* ---------- chat (replaces code-snippet hero) ---------- */
.chat {
    font-family: var(--font-sans);
    font-size: 14px;
    padding: 18px 22px;
    line-height: 1.6;
}
.chat-line {
    margin-top: 14px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.chat-line:first-child { margin-top: 0; }
.chat-who {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.chat-line.you::before {
    content: "▍";
    color: var(--accent);
    font-size: 14px;
    line-height: 1;
}
.chat-line.ai::before {
    content: "✦";
    color: var(--accent-2);
    font-size: 14px;
    line-height: 1;
}
.chat-msg {
    color: var(--text);
    margin-left: 18px;
    padding-bottom: 4px;
}
.chat-msg .ok { color: var(--accent-2); font-weight: 600; }
.chat-msg .path {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent);
}

/* code tab panels can also use chat layout */
.tab-panel.chat { font-family: var(--font-sans); font-size: 14px; padding: 22px 24px; }

/* ---------- modal ---------- */
.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 24px;
}
.modal[hidden] { display: none !important; }
.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 7, 11, 0.7);
    backdrop-filter: blur(6px);
    animation: modal-fade 0.18s ease-out;
}
.modal-card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 40px 36px 32px;
    max-width: 460px;
    width: 100%;
    text-align: center;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
    animation: modal-pop 0.22s ease-out;
}
.modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--muted);
    font-size: 18px;
    line-height: 1;
    display: grid;
    place-items: center;
    transition: color 0.12s, border-color 0.12s, background 0.12s;
}
.modal-close:hover { color: var(--text); border-color: var(--dim); background: var(--surface-2); }
.modal-icon {
    color: var(--accent-2);
    font-size: 22px;
    margin-bottom: 12px;
    line-height: 1;
}
.modal-card h3 {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 12px;
    color: var(--text);
}
.modal-card p {
    color: var(--muted);
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 24px;
}
.modal-foot {
    margin-top: 18px;
    margin-bottom: 0;
    font-size: 13px;
    color: var(--dim);
}
.modal-foot code {
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent);
}

@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-pop {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* prompt line under feature description */
.feature .prompt {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--border);
    color: var(--accent-2);
    font-size: 13px;
    line-height: 1.5;
}
.feature .prompt em {
    color: var(--text);
    font-style: italic;
}

/* product logo in nav/footer brand */
.brand-logo {
    width: 32px;
    height: 32px;
    display: block;
    image-rendering: -webkit-optimize-contrast;
}
.brand:hover .brand-logo { opacity: 0.85; }

/* modal logo image */
.modal-icon img { display: block; margin: 0 auto 4px; }

/* ============================================================
   Mobile fine-tuning (added 2026-06-26)
   Existing 900/700px breakpoints handle hero+features+stats fold-down.
   This block addresses ≤600px (phone portrait) specifically:
     - Nav: drop non-essential links, keep brand + Apply-for-Trial
     - Hero card / tree / code: prevent horizontal overflow
     - Stats: 4 → 1 column (instead of 2)
     - Touch targets ≥ 44px per HIG / Material
   ============================================================ */

/* ≤ 600px — phones */
@media (max-width: 600px) {
    .container { padding: 0 18px; }
    .nav-inner { height: 56px; }

    /* Nav: hide the 3 anchor links; keep brand on left + only Apply-for-Trial on right */
    .nav-links a { display: none; }
    .nav-links { gap: 0; }
    .btn { min-height: 40px; padding: 10px 14px; font-size: 13px; }
    .btn-lg { min-height: 44px; padding: 12px 18px; font-size: 14px; }

    /* Brand — slightly smaller logo */
    .brand-logo { width: 28px; height: 28px; }
    .brand { gap: 8px; font-size: 15px; }

    /* Hero — tighten spacing */
    .hero { padding: 40px 0 36px; }
    .hero-eyebrow { font-size: 11px; padding: 4px 8px; margin-bottom: 18px; }
    h1.hero-title { font-size: 30px; line-height: 1.1; }
    .hero-sub { font-size: 15px; margin-bottom: 24px; }
    .hero-cta { flex-direction: column; align-items: stretch; gap: 8px; }
    .hero-cta .btn { justify-content: center; }

    /* Cards / panels — allow horizontal scroll instead of overflow */
    .codecard-body, .tab-panel, .showcase-fig > div:first-child {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .chat { padding: 14px 16px; font-size: 13px; }
    .chat-msg { font-size: 13px; }
    .codecard-name { font-size: 11px; }

    /* Section paddings */
    section { padding: 44px 0; }
    .section-title { font-size: 24px; }
    .section-lead { font-size: 15px; margin-bottom: 32px; }

    /* Stats: 4 → 1 col on phone (2-col was set at ≤900, override) */
    .stats { grid-template-columns: 1fr; }
    .stat-num { font-size: 26px; }

    /* Steps: each step's nested codecard should fit */
    .step { padding: 22px 18px; }
    .step h4 { font-size: 16px; }
    .step p { font-size: 13px; }

    /* Showcase fig — smaller tree font + horizontal scroll */
    .showcase-fig > div:first-child {
        font-size: 11px !important;
        padding: 18px !important;
        line-height: 1.6 !important;
        white-space: nowrap;
    }
    .showcase-fig .figcap {
        flex-direction: column;
        gap: 6px;
        font-size: 11px;
    }

    /* Metric list — tighter */
    .metric-list li { font-size: 13px; padding: 8px 0; }

    /* Tabs bar — let tab buttons wrap if needed */
    .tabs-bar { flex-wrap: wrap; }
    .tab-btn { padding: 12px 14px; font-size: 12px; }
    .tab-meta { display: none; }

    /* CTA band */
    .cta-band { padding: 56px 0; }
    .cta-band h2 { font-size: 24px; }
    .cta-buttons { flex-direction: column; align-items: stretch; }
    .cta-buttons .btn { justify-content: center; }

    /* Footer — single column */
    .footer-grid { grid-template-columns: 1fr; gap: 28px; }
    .footer-bottom { flex-direction: column; align-items: flex-start; gap: 8px; }

    /* Modal — tighter */
    .modal { padding: 16px; }
    .modal-card { padding: 32px 24px 24px; max-width: none; }
    .modal-card h3 { font-size: 19px; }
    .modal-card p { font-size: 14px; }
    .modal-card .btn { width: 100%; justify-content: center; }
    .modal-foot { font-size: 12px; }
}

/* Improve touch targets even on tablet */
@media (hover: none) and (pointer: coarse) {
    .nav-links a { padding: 8px 0; }
    .feature .prompt { padding-top: 14px; }
}
