/* ===== Design tokens (matches Third Origin / Lovable) ===== */
:root {
    --background: 0 0% 100%;
    --foreground: 0 0% 9%;
    --card: 0 0% 97%;
    --muted: 0 0% 96%;
    --muted-foreground: 0 0% 45%;
    --border: 0 0% 90%;

    --bg: hsl(var(--background));
    --fg: hsl(var(--foreground));
    --fg-muted: hsl(var(--muted-foreground));
    --card-bg: hsl(var(--card));
    --muted-bg: hsl(var(--muted));
    --border-c: hsl(var(--border));
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "cv11", "ss01";
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p { margin: 0; }

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== Nav ===== */
.nav {
    position: sticky; top: 0; z-index: 50;
    background: hsl(var(--background) / 0.8);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border-c);
}
.nav-inner {
    max-width: 1280px; margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex; align-items: center; justify-content: space-between;
    gap: 24px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-icon { height: 28px; width: auto; }
.brand-name { font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }

.nav-links { display: flex; align-items: center; gap: 32px; }
.nav-links a {
    font-size: 14px; font-weight: 500; color: var(--fg-muted);
    transition: color .2s;
}
.nav-links a:hover { color: var(--fg); }
.nav-links a.btn { color: hsl(var(--background)); }

.nav-toggle {
    display: none;
    background: transparent; border: 0; cursor: pointer;
    width: 32px; height: 32px; padding: 6px;
    flex-direction: column; justify-content: space-between;
}
.nav-toggle span { display: block; height: 2px; background: var(--fg); border-radius: 2px; transition: transform .25s, opacity .25s; }
.nav-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu {
    display: none;
    border-top: 1px solid var(--border-c);
    padding: 16px 24px 24px;
    flex-direction: column; gap: 16px;
    background: var(--bg);
}
.mobile-menu a {
    font-size: 15px; font-weight: 500; color: var(--fg-muted);
}
.mobile-menu.active { display: flex; }

@media (max-width: 767px) {
    .nav-links { display: none; }
    .nav-toggle { display: flex; }
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    height: 44px;
    padding: 0 32px;
    font-size: 14px; font-weight: 500;
    border-radius: 999px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all .2s;
    white-space: nowrap;
}
.btn-sm { height: 36px; padding: 0 20px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-primary {
    background: var(--fg); color: var(--bg);
}
.btn-primary:hover { background: hsl(var(--foreground) / 0.8); }
.btn-outline {
    background: transparent; color: var(--fg);
    border-color: var(--border-c);
}
.btn-outline:hover { background: var(--muted-bg); }

/* ===== Hero ===== */
.hero {
    padding: 96px 0;
    background: var(--bg);
    overflow: hidden;
}
@media (min-width: 768px) {
    .hero { padding: 128px 0; }
}
.hero-inner {
    display: flex; align-items: stretch; gap: 48px;
}
@media (min-width: 1024px) {
    .hero-inner { gap: 64px; }
}
.hero-copy { flex: 1; min-width: 0; max-width: 42rem; display: flex; flex-direction: column; }
.hero-title {
    font-size: 48px;
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.08;
}
@media (min-width: 768px) { .hero-title { font-size: 60px; } }
@media (min-width: 1024px) { .hero-title { font-size: 72px; } }

.hero-sub {
    margin-top: 20px;
    font-size: 18px;
    font-weight: 100;
    color: var(--fg-muted);
    line-height: 1.625;
}
.hero-bullets {
    margin-top: 32px;
    display: flex; flex-direction: column; gap: 10px;
}
.hero-bullets li {
    display: flex; align-items: center; gap: 10px;
    font-size: 15px; font-weight: 500; color: var(--fg);
}
@media (min-width: 768px) { .hero-bullets li { font-size: 16px; } }
.dot {
    display: inline-block;
    width: 8px; height: 8px; border-radius: 999px;
    background: var(--fg);
    flex-shrink: 0;
}
.hero-cta {
    margin-top: 40px;
    display: flex; flex-wrap: wrap; align-items: center; gap: 16px;
}
.hero-media {
    flex-shrink: 0;
    width: 52%;
    align-self: stretch;
    display: flex;
    overflow: hidden;
}
.hero-media img,
.hero-media video,
.hero-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: var(--muted-bg);
}

@media (max-width: 767px) {
    .hero { padding: 64px 0; }
    .hero-inner { flex-direction: column; align-items: stretch; gap: 48px; }
    .hero-media { width: 100%; aspect-ratio: 4 / 3; }
}

/* ===== Sections ===== */
.section {
    padding: 96px 0;
    border-top: 1px solid var(--border-c);
}
@media (min-width: 768px) {
    .section { padding: 128px 0; }
}
.section-muted { background: var(--muted-bg); }
.section-card { background: var(--card-bg); }

.section-title {
    font-size: 30px;
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.1;
}
@media (min-width: 768px) { .section-title { font-size: 36px; } }
@media (min-width: 1024px) { .section-title { font-size: 48px; } }

.section-sub {
    margin-top: 24px;
    font-size: 16px;
    color: var(--fg-muted);
    line-height: 1.625;
}
.heading-strong { color: var(--fg); }
.heading-muted { color: var(--fg-muted); }
/* Mission section: narrower paragraph (matches Lovable max-w-2xl). */
#mission .section-sub { max-width: 672px; }

/* ===== Grids ===== */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.mt-lg { margin-top: 56px; }
.mt-md { margin-top: 32px; }

@media (max-width: 1023px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 767px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ===== Feature / card / product ===== */
.feature h3, .card h3 {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.01em;
}
.feature p, .card p {
    margin-top: 10px;
    color: var(--fg-muted);
    font-size: 14px;
    line-height: 1.625;
}
.feature-icon {
    width: 44px; height: 44px;
    border-radius: 10px;
    background: var(--muted-bg);
    display: flex; align-items: center; justify-content: center;
    color: var(--fg);
    margin-bottom: 18px;
}
.feature-icon svg { width: 22px; height: 22px; }

/* Platform section: muted rounded cards with bordered icon box */
.feature-muted {
    background: var(--muted-bg);
    border-radius: 16px;
    padding: 32px;
}
.feature-muted h3 {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--fg);
}
.feature-muted p {
    margin-top: 8px;
    font-size: 14px;
    line-height: 1.625;
    color: var(--fg-muted);
}
.feature-icon-bordered {
    width: 48px; height: 48px;
    border-radius: 12px;
    background: var(--bg);
    border: 1px solid var(--border-c);
    margin-bottom: 24px;
}
.feature-icon-bordered svg { width: 20px; height: 20px; }

.card {
    padding: 28px;
    background: var(--bg);
    border: 1px solid var(--border-c);
    border-radius: 14px;
}

.product-card {
    padding: 32px;
    background: var(--card-bg);
    border: 1px solid var(--border-c);
    border-radius: 12px;
}
@media (min-width: 768px) { .product-card { padding: 40px; } }
.product-card h3 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--fg);
}
.product-card ul { margin-top: 24px; display: flex; flex-direction: column; gap: 12px; }
.product-card li {
    display: flex; align-items: flex-start; gap: 12px;
    font-size: 14px; color: var(--fg-muted); line-height: 1.625;
}
.product-card li svg {
    flex-shrink: 0;
    width: 16px; height: 16px;
    margin-top: 2px;
    color: var(--fg);
}

/* ===== Stats ===== */
.stats { gap: 32px; }
.stat-num {
    font-size: 36px;
    font-weight: 700;
    color: var(--fg);
}
@media (min-width: 768px) { .stat-num { font-size: 48px; } }
.stat-label {
    margin-top: 8px;
    color: var(--fg-muted);
    font-size: 14px;
    font-weight: 500;
}

/* Workflow Intelligence Layer cards */
.wil-card {
    border: 1px solid var(--border-c);
    border-radius: 16px;
    background: var(--card-bg);
    overflow: hidden;
    display: flex; flex-direction: column;
}
.wil-media {
    aspect-ratio: 16 / 9;
    width: 100%;
    background: #fafafa;
    overflow: hidden;
}
.wil-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.wil-media img.contain { object-fit: contain; }
.wil-media img.pos-bottom { object-position: 50% 100%; }
.wil-media img.pos-top { object-position: 50% 0%; }
.wil-body { padding: 32px; }
.wil-body h3 {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--fg);
}
.wil-body p {
    margin-top: 12px;
    color: var(--fg-muted);
    font-size: 14px;
    line-height: 1.625;
}

/* Grid gap overrides to match Lovable gap-8 / gap-y-14 */
#use-cases .grid-2 { gap: 32px; }
#products .grid-2 { gap: 32px; }
#network .stats { gap: 32px; }

/* Why Third Origin grid */
.why-grid { gap: 56px 48px; }
.why-icon {
    width: 40px; height: 40px;
    border-radius: 8px;
    background: var(--card-bg);
    border: 1px solid var(--border-c);
    display: flex; align-items: center; justify-content: center;
    color: var(--fg);
    margin-bottom: 20px;
}
.why-icon svg { width: 16px; height: 16px; }
.why-item h3 {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--fg);
}
.why-item p {
    margin-top: 12px;
    color: var(--fg-muted);
    font-size: 14px;
    line-height: 1.625;
}

/* Stats trailing note */
.network-note {
    margin-top: 56px;
    max-width: 768px;
    color: var(--fg-muted);
    font-size: 16px;
    line-height: 1.625;
}

/* ===== Footer ===== */
.footer {
    border-top: 1px solid var(--border-c);
    padding: 48px 0;
    background: var(--bg);
}
.footer-inner {
    display: flex; gap: 32px;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
}
@media
 (min-width: 768px) {
    .footer-inner { align-items: center; }
}
.footer .brand-icon { height: 24px; }
.footer-tag {
    margin-top: 4px;
    font-size: 14px; color: var(--fg-muted);
}
.footer-links { display: flex; gap: 24px; }
.footer-links a {
    font-size: 14px; color: var(--fg-muted);
    transition: color .2s;
}
.footer-links a:hover { color: var(--fg); }
/* ===== Fade in ===== */
.section-fade {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity .7s ease, transform .7s ease;
}
.section-fade.visible {
    opacity: 1;
    transform: translateY(0);
}
