/* ===== Design System: Cal.com-inspired ===== */
/* Reference: design.md — clean, modern SaaS, white canvas + black primary CTAs */

/* ===== CSS Variables (from design.md tokens) ===== */
:root {
    /* Colors */
    --primary: #111111;
    --primary-active: #242424;
    --primary-disabled: #e5e7eb;
    --ink: #111111;
    --body: #374151;
    --muted: #6b7280;
    --muted-soft: #898989;
    --hairline: #e5e7eb;
    --hairline-soft: #f3f4f6;
    --canvas: #ffffff;
    --surface-soft: #f8f9fa;
    --surface-card: #f5f5f5;
    --surface-strong: #e5e7eb;
    --surface-dark: #101010;
    --surface-dark-elevated: #1a1a1a;
    --on-primary: #ffffff;
    --on-dark: #ffffff;
    --on-dark-soft: #a1a1aa;
    --brand-accent: #3b82f6;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --badge-orange: #fb923c;
    --badge-pink: #ec4899;
    --badge-violet: #8b5cf6;
    --badge-emerald: #34d399;

    /* Typography Tokens */
    --font-display: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", sans-serif;
    --font-code: "JetBrains Mono", "SF Mono", "Fira Code", ui-monospace, monospace;

    /* Rounded */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-pill: 9999px;
    --radius-full: 9999px;

    /* Spacing */
    --space-xxs: 4px;
    --space-xs: 8px;
    --space-sm: 12px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-xxl: 48px;
    --space-section: 96px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);

    /* Layout */
    --nav-height: 64px;
    --max-width: 1200px;
}

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--body);
    background: var(--canvas);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--ink); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

/* ===== Container ===== */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

/* ===== Top Navigation (top-nav token) ===== */
.navbar {
    position: sticky; top: 0; z-index: 100;
    background: var(--canvas);
    border-bottom: 1px solid var(--hairline-soft);
    height: var(--nav-height);
}
.navbar-inner {
    max-width: var(--max-width); margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 var(--space-lg); height: 100%;
}
.nav-logo {
    display: flex; align-items: center;
    text-decoration: none;
}
.nav-logo:hover { text-decoration: none; opacity: 0.85; }
.nav-logo-img {
    height: 40px; width: auto; display: block;
}

/* Nav-pill group (nav-pill-group token) */
.nav-pill-group {
    display: flex; align-items: center;
    background: var(--surface-soft); border-radius: var(--radius-pill);
    padding: 6px; gap: 2px;
}
.nav-links {
    display: flex; gap: var(--space-xl); list-style: none; align-items: center;
}
.nav-links a {
    color: var(--muted); font-size: 14px; font-weight: 500;
    line-height: 1.4; padding: var(--space-xs) 0;
    transition: color 0.15s; text-decoration: none;
}
.nav-links a:hover, .nav-links a.active { color: var(--ink); }

/* ===== Sections ===== */
.section { padding: var(--space-section) 0; }

/* ===== Typography ===== */
.display-xl {
    font-family: var(--font-display);
    font-size: 64px; font-weight: 600; line-height: 1.05;
    letter-spacing: -2px; color: var(--ink);
}
.display-lg {
    font-family: var(--font-display);
    font-size: 48px; font-weight: 600; line-height: 1.1;
    letter-spacing: -1.5px; color: var(--ink);
}
.display-md {
    font-family: var(--font-display);
    font-size: 36px; font-weight: 600; line-height: 1.15;
    letter-spacing: -1px; color: var(--ink);
}
.display-sm {
    font-family: var(--font-display);
    font-size: 28px; font-weight: 600; line-height: 1.2;
    letter-spacing: -0.5px; color: var(--ink);
}
.title-lg {
    font-family: var(--font-body);
    font-size: 22px; font-weight: 600; line-height: 1.3;
    letter-spacing: -0.3px;
}
.title-md {
    font-family: var(--font-body);
    font-size: 18px; font-weight: 600; line-height: 1.4;
}
.title-sm {
    font-family: var(--font-body);
    font-size: 16px; font-weight: 600; line-height: 1.4;
}
.section-title {
    font-family: var(--font-display);
    font-size: 36px; font-weight: 600; line-height: 1.15;
    letter-spacing: -1px; text-align: center;
    color: var(--ink); margin-bottom: var(--space-sm);
}
.section-subtitle {
    text-align: center; color: var(--muted);
    font-size: 18px; line-height: 1.5; margin-bottom: var(--space-xxl);
    max-width: 560px; margin-left: auto; margin-right: auto;
}

/* ===== Buttons (button-primary / button-secondary tokens) ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 12px 20px; height: 40px;
    border-radius: var(--radius-md);
    font-family: var(--font-body); font-size: 14px; font-weight: 600;
    line-height: 1; border: none;
    cursor: pointer; transition: background-color 0.15s, border-color 0.15s;
    gap: var(--space-xs); text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary {
    background: var(--primary); color: var(--on-primary);
}
.btn-primary:hover { background: var(--primary-active); }
.btn-primary:disabled {
    background: var(--primary-disabled); color: var(--muted); cursor: not-allowed;
}
.btn-secondary {
    background: var(--canvas); color: var(--ink);
    border: 1px solid var(--hairline);
}
.btn-secondary:hover { border-color: var(--ink); }

/* ===== Badge Pills (badge-pill token) ===== */
.badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--surface-card); color: var(--ink);
    padding: 4px 12px; border-radius: var(--radius-pill);
    font-family: var(--font-body); font-size: 13px; font-weight: 500;
    line-height: 1.4;
}
.badge-accent { background: var(--brand-accent); color: #fff; }

/* ===== Hero Band (hero-band token) ===== */
.hero {
    padding: var(--space-section) 0;
    text-align: center; background: var(--canvas);
}
.hero h1 {
    font-family: var(--font-display);
    font-size: 64px; font-weight: 600; line-height: 1.05;
    letter-spacing: -2px; color: var(--ink); margin-bottom: var(--space-lg);
}
.hero h1 span { color: var(--ink); }
.hero > .container > p {
    font-size: 18px; color: var(--muted); line-height: 1.5;
    max-width: 560px; margin: 0 auto var(--space-xl);
}
.hero-badges {
    display: flex; gap: var(--space-sm); justify-content: center;
    flex-wrap: wrap; margin-bottom: var(--space-xl);
}
.hero .btn-group {
    display: flex; gap: var(--space-sm); justify-content: center;
    align-items: center; margin-top: var(--space-xl);
}

/* ===== Feature Cards (feature-card token) ===== */
.features {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-lg);
}
.feature-card {
    background: var(--surface-card); border-radius: var(--radius-lg);
    padding: var(--space-xl); border: none;
    transition: box-shadow 0.2s;
}
.feature-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.feature-icon {
    width: 40px; height: 40px; border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.25rem; margin-bottom: var(--space-md);
}
.feature-icon.blue { background: #e8f0fe; }
.feature-icon.green { background: #e6f4ea; }
.feature-icon.orange { background: #fef7e0; }
.feature-card h3 {
    font-family: var(--font-body);
    font-size: 18px; font-weight: 600; line-height: 1.4;
    color: var(--ink); margin-bottom: var(--space-xs);
}
.feature-card p {
    font-size: 16px; color: var(--muted); line-height: 1.5;
}

/* ===== Compare Table ===== */
.compare-table {
    width: 100%; border-collapse: separate; border-spacing: 0;
    border: 1px solid var(--hairline); border-radius: var(--radius-lg);
    overflow: hidden;
}
.compare-table th, .compare-table td {
    padding: var(--space-md) var(--space-lg); text-align: center;
    font-size: 15px;
}
.compare-table th {
    background: var(--surface-soft); font-weight: 600; color: var(--ink);
    font-size: 14px;
}
.compare-table th:first-child, .compare-table td:first-child {
    text-align: left;
}
.compare-table td {
    border-top: 1px solid var(--hairline-soft); color: var(--body);
}
.compare-table .check { color: var(--success); font-weight: 600; }
.compare-table .cross { color: var(--muted-soft); }
.compare-table .highlight {
    background: #fafafa;
}
.compare-table .highlight td { font-weight: 500; }

/* ===== Product Cards ===== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: var(--space-lg);
}
.product-card {
    background: var(--canvas); border: 1px solid var(--hairline);
    border-radius: var(--radius-lg); overflow: hidden;
    transition: box-shadow 0.2s;
}
.product-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.product-card-header {
    background: var(--surface-card); padding: var(--space-lg);
    border-bottom: 1px solid var(--hairline-soft);
}
.product-card-header h3 {
    font-size: 18px; font-weight: 600; line-height: 1.4; color: var(--ink);
}
.product-card-body { padding: var(--space-lg); }
.product-card-body p {
    font-size: 16px; color: var(--muted); line-height: 1.5;
    margin-bottom: var(--space-md);
}
.product-card-body .feature-list {
    margin-top: var(--space-md);
    padding: var(--space-md);
    background: var(--surface-soft);
    border-radius: var(--radius-md);
}
.product-card-body .feature-list h4 {
    font-size: 14px; font-weight: 600; color: var(--ink);
    margin-bottom: var(--space-xs);
}
.product-card-body .feature-list ul {
    font-size: 14px; color: var(--muted); padding-left: 18px; line-height: 2;
    list-style: disc;
}
.product-tags { display: flex; gap: var(--space-xs); flex-wrap: wrap; }
.tag {
    background: var(--surface-card); color: var(--ink);
    padding: 4px 12px; border-radius: var(--radius-pill);
    font-size: 13px; font-weight: 500; line-height: 1.4;
}

/* ===== Pricing Card (pricing-tier-card token) ===== */
.pricing-card {
    max-width: 440px; margin: 0 auto;
    background: var(--canvas); border: 1px solid var(--hairline);
    border-radius: var(--radius-lg); text-align: center;
    padding: var(--space-xl);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.pricing-card h3 {
    font-size: 14px; font-weight: 500; color: var(--muted);
    text-transform: uppercase; letter-spacing: 0.5px;
}
.pricing-card .price {
    font-family: var(--font-display);
    font-size: 48px; font-weight: 600; line-height: 1.1;
    letter-spacing: -1.5px; color: var(--ink);
    margin: var(--space-md) 0 var(--space-xs);
}
.pricing-card .price small {
    font-size: 18px; font-weight: 400; color: var(--muted);
}
.pricing-card .lifetime {
    color: var(--success); font-weight: 600; font-size: 14px;
    margin-bottom: var(--space-lg);
}
.pricing-features {
    list-style: none; text-align: left; margin: var(--space-lg) 0;
}
.pricing-features li {
    padding: var(--space-xs) 0;
    font-size: 15px; color: var(--body); line-height: 1.5;
    display: flex; align-items: center; gap: var(--space-sm);
}
.pricing-features li::before {
    content: "✓"; color: var(--success); font-weight: 700; flex-shrink: 0;
}
.pricing-card .btn { width: 100%; height: 44px; font-size: 15px; border-radius: var(--radius-md); }

/* ===== Modal ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.5); z-index: 200;
    align-items: center; justify-content: center;
    backdrop-filter: blur(4px);
}
.modal-overlay.active { display: flex; }
.modal {
    background: var(--canvas); border-radius: var(--radius-lg);
    padding: var(--space-xl); max-width: 440px; width: 90%;
    box-shadow: var(--shadow-lg); position: relative;
}
.modal h2 {
    font-size: 20px; font-weight: 600; line-height: 1.3;
    color: var(--ink); margin-bottom: var(--space-xs);
}
.modal > p {
    font-size: 14px; color: var(--muted); margin-bottom: var(--space-lg);
}
.modal-close {
    position: absolute; top: var(--space-md); right: var(--space-md);
    background: none; border: none; font-size: 1.5rem;
    cursor: pointer; color: var(--muted); line-height: 1;
    width: 32px; height: 32px; display: flex; align-items: center;
    justify-content: center; border-radius: var(--radius-sm);
}
.modal-close:hover { background: var(--surface-card); }

/* ===== Form Elements (text-input token) ===== */
.form-group { margin-bottom: var(--space-md); }
.form-group label {
    display: block; font-size: 14px; font-weight: 500; line-height: 1.4;
    color: var(--ink); margin-bottom: var(--space-xxs);
}
.form-input {
    width: 100%; padding: 10px 14px; height: 40px;
    border: 1px solid var(--hairline); border-radius: var(--radius-md);
    font-family: var(--font-body); font-size: 16px; font-weight: 400;
    line-height: 1.5; color: var(--ink);
    background: var(--canvas); outline: none;
    transition: border-color 0.15s;
}
.form-input:focus {
    border-color: var(--ink);
}
.form-input.error { border-color: var(--error); }
.form-error {
    color: var(--error); font-size: 13px; font-weight: 500;
    line-height: 1.4; margin-top: var(--space-xxs); display: none;
}
.form-error.show { display: block; }

/* ===== Alerts ===== */
.alert {
    padding: var(--space-sm) var(--space-md); border-radius: var(--radius-md);
    font-size: 14px; font-weight: 500; margin-bottom: var(--space-md);
}
.alert-success { background: #d1fae5; color: #065f46; }
.alert-error { background: #fee2e2; color: #991b1b; }
.alert-info { background: #dbeafe; color: #1e40af; }

/* ===== Order / Query Page ===== */
.query-box {
    max-width: 480px; margin: 0 auto;
    background: var(--surface-card); border-radius: var(--radius-lg);
    padding: var(--space-xl); border: 1px solid var(--hairline-soft);
}
.query-box h2 { font-size: 20px; font-weight: 600; margin-bottom: var(--space-lg); color: var(--ink); }
.result-box {
    margin-top: var(--space-lg); padding: var(--space-md);
    background: #d1fae5; border-radius: var(--radius-md);
    display: none;
}
.result-box.show { display: block; }
.result-box p { font-size: 14px; color: var(--body); }
.result-box .code {
    font-family: var(--font-code); font-size: 1.3rem; font-weight: 700;
    color: var(--ink); letter-spacing: 2px; margin: var(--space-xs) 0;
}

/* ===== Toast ===== */
.toast {
    position: fixed; bottom: var(--space-lg); right: var(--space-lg); z-index: 300;
    padding: 14px 24px; border-radius: var(--radius-md);
    color: #fff; font-size: 14px; font-weight: 500;
    box-shadow: var(--shadow-lg);
    transform: translateY(100px); opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { background: var(--success); }
.toast.error { background: var(--error); }

/* ===== Tab Switch (category-tab tokens) ===== */
.tab-nav {
    display: flex; gap: 0; list-style: none;
    margin-bottom: var(--space-lg);
    border-bottom: 2px solid var(--hairline-soft);
}
.tab-nav li {
    padding: 10px 20px; cursor: pointer; font-size: 14px; font-weight: 500;
    color: var(--muted); line-height: 1.4;
    border-bottom: 2px solid transparent; margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s;
}
.tab-nav li.active {
    color: var(--ink); border-bottom-color: var(--ink);
}

/* ===== Footer (footer token) ===== */
.footer {
    background: var(--surface-dark); color: var(--on-dark-soft);
    padding: 64px 0;
}
.footer-inner {
    max-width: var(--max-width); margin: 0 auto;
    padding: 0 var(--space-lg);
    display: grid; grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--space-lg);
}
.footer-brand .footer-logo {
    display: flex; align-items: center;
    margin-bottom: var(--space-md); text-decoration: none;
}
.footer-brand .footer-logo:hover { text-decoration: none; }
.footer-logo-img {
    height: 32px; width: auto; display: block;
}
.footer-brand p {
    font-size: 14px; line-height: 1.5; color: var(--on-dark-soft);
}
.footer-col h4 {
    font-size: 13px; font-weight: 600; color: var(--on-dark);
    text-transform: uppercase; letter-spacing: 0.5px;
    margin-bottom: var(--space-md);
}
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: var(--space-xs); }
.footer-col ul li a {
    font-size: 14px; color: var(--on-dark-soft); text-decoration: none;
    line-height: 1.5; transition: color 0.15s;
}
.footer-col ul li a:hover { color: var(--on-dark); text-decoration: none; }
.footer-bottom {
    max-width: var(--max-width); margin: var(--space-xxl) auto 0;
    padding: var(--space-lg) var(--space-lg) 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    text-align: center; font-size: 13px; color: var(--muted-soft);
}
.footer-bottom a { color: var(--muted-soft); }
.footer-bottom a:hover { color: var(--on-dark); text-decoration: underline; }

/* ===== CTA Band (cta-band-light token) ===== */
.cta-band {
    background: var(--surface-card); border-radius: var(--radius-lg);
    padding: var(--space-xxl); text-align: center; max-width: var(--max-width);
    margin: 0 auto;
}
.cta-band h2 {
    font-family: var(--font-display);
    font-size: 28px; font-weight: 600; line-height: 1.2;
    letter-spacing: -0.5px; color: var(--ink);
    margin-bottom: var(--space-sm);
}
.cta-band p {
    font-size: 16px; color: var(--muted); margin-bottom: var(--space-lg);
}
.cta-band .btn-primary {
    background: var(--primary); color: var(--on-primary);
}
.cta-band .btn-primary:hover { background: var(--primary-active); }

/* ===== Spinner ===== */
.spinner {
    display: inline-block; width: 20px; height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%; border-top-color: #fff;
    animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Responsive (from design.md breakpoints) ===== */
@media (max-width: 1024px) {
    .features { grid-template-columns: repeat(2, 1fr); }
    .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    :root { --space-section: 64px; }
    .hero h1 { font-size: 36px; letter-spacing: -1px; }
    .section-title { font-size: 28px; letter-spacing: -0.5px; }
    .features { grid-template-columns: 1fr; }
    .product-grid { grid-template-columns: 1fr; }
    .footer-inner { grid-template-columns: 1fr; }
    .nav-links { gap: var(--space-md); }
    .compare-table th, .compare-table td { padding: var(--space-sm) var(--space-md); font-size: 13px; }
    .pricing-card { max-width: 100%; }
    .cta-band { padding: var(--space-xl); margin: 0 var(--space-md); }
}

/* ===== Install Video (download page) ===== */
.install-video {
    display: block;
    width: 100%;
    height: auto;
    background: #000;
}
