/* =====================================================================
   IBC Partners — shared site stylesheet
   Single source of truth for the design system: tokens, navigation,
   footer, badges, and common marketing components. Linked first on every
   page; a page may add a small inline <style> AFTER this link to override
   or extend with page-unique components (it wins by cascade order).
   ===================================================================== */

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --accent-color: #8b5cf6;
    --text-color: #1f2937;
    --text-muted: #6b7280;
    --bg-page: #ffffff;
    --bg-surface: #ffffff;
    --bg-light: #f9fafb;
    --bg-section: #f3f4f6;
    --bg-footer: #1f2937;
    --footer-text: #ffffff;
    --footer-link: #93c5fd;
    --border-color: #e5e7eb;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --hero-fade: 255, 255, 255;
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --max-width: 1200px;
    --reading-width: 72ch;
}

@media (prefers-color-scheme: dark) {
    :root {
        --primary-color: #3b82f6;
        --primary-dark: #2563eb;
        --text-color: #e5e7eb;
        --text-muted: #9ca3af;
        --bg-page: #0f1115;
        --bg-surface: #1a1d23;
        --bg-light: #242830;
        --bg-section: #1e2228;
        --bg-footer: #0a0c0f;
        --footer-text: #e5e7eb;
        --footer-link: #93c5fd;
        --border-color: #2d3138;
        --hero-fade: 15, 17, 21;
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    color: var(--text-color);
    line-height: 1.6;
    background: var(--bg-page);
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
}

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

a:hover {
    text-decoration: underline;
}

/* Skip-to-content link — visible only on keyboard focus */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--primary-color);
    color: #fff;
    padding: 0.75rem 1rem;
    text-decoration: none;
    font-weight: 600;
    z-index: 1000;
    border-radius: 0 0 6px 0;
}

.skip-link:focus {
    left: 0;
    outline: 2px solid #fff;
    outline-offset: -2px;
}

/* Keyboard focus — visible across nav, links, buttons, details */
a:focus-visible,
button:focus-visible,
summary:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: 3px;
}

/* =====================================================================
   Hero header banner (shared site image strip)
   ===================================================================== */
.hero-header {
    position: relative;
    height: clamp(140px, 22vw, 320px);
    overflow: hidden;
}

.hero-header picture,
.hero-header img {
    display: block;
    width: 100%;
    height: 100%;
}

.hero-header img {
    object-fit: cover;
    object-position: center top;
}

.hero-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(to bottom,
        rgba(var(--hero-fade), 0) 0%,
        rgba(var(--hero-fade), 0.3) 30%,
        rgba(var(--hero-fade), 0.7) 60%,
        rgba(var(--hero-fade), 1) 100%);
    pointer-events: none;
}

/* =====================================================================
   Navigation — unified across the site, with Products ▾ dropdown
   ===================================================================== */
.main-nav {
    background: linear-gradient(to bottom, #5a5a5a, #3a3a3a);
    border-bottom: 1px solid #222;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0;
}

.nav-brand {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: #ffffff;
    padding: 10px 16px;
    text-decoration: none;
    white-space: nowrap;
}

.nav-brand:hover {
    color: #ffffff;
    text-decoration: none;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: var(--spacing-sm);
    color: #fff;
}

.nav-list {
    list-style: none;
    display: flex;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0;
    padding: 0;
    margin: 0;
}

.nav-list > li {
    position: relative;
}

.nav-list a,
.dropdown-toggle {
    display: block;
    padding: 12px 18px;
    color: #ccc;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    transition: background 0.2s, color 0.2s;
    background: none;
    border: none;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
}

.nav-list a:hover,
.dropdown-toggle:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
    text-decoration: none;
}

.nav-list a.current,
.dropdown-toggle.current {
    color: #fff;
}

.nav-list a:focus-visible,
.dropdown-toggle:focus-visible {
    outline-color: #fff;
    outline-offset: -2px;
}

/* Products ▾ dropdown menu */
.dropdown-menu {
    list-style: none;
    margin: 0;
    padding: var(--spacing-xs) 0;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: #3a3a3a;
    border: 1px solid #222;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
    display: none;
    z-index: 200;
}

.has-dropdown:hover .dropdown-menu,
.has-dropdown:focus-within .dropdown-menu,
.dropdown-menu.open {
    display: block;
}

.dropdown-menu a {
    padding: 10px 18px;
    font-size: 0.85rem;
}

.dropdown-toggle::after {
    content: " ▾";
    font-size: 0.75em;
}

/* =====================================================================
   Buttons / CTAs
   ===================================================================== */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 2px solid transparent;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.btn-primary {
    background: var(--primary-color);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: #fff;
    text-decoration: none;
}

.btn-ghost {
    background: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-ghost:hover {
    background: var(--primary-color);
    color: #fff;
    text-decoration: none;
}

/* App Store / Mac App Store badge — Apple guidelines: min 40pt height */
.app-store-badge {
    height: 56px;
    width: auto;
    margin: 0.25rem 0;
}

/* =====================================================================
   Status / platform / price badges (consistent site-wide)
   ===================================================================== */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    background: var(--success-color);
}

.status-released { background: var(--success-color); }
.status-beta     { background: var(--warning-color); }
.status-alpha    { background: var(--danger-color); }
.status-coming   { background: var(--accent-color); }
.status-free     { background: #0ea5e9; }

.os-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    background: var(--bg-section);
    color: var(--text-color);
}

.os-badge.os-macos   { background: #374151; color: #fff; }
.os-badge.os-ios     { background: #007aff; color: #fff; }
.os-badge.os-ipados  { background: #5856d6; color: #fff; }
.os-badge.os-windows { background: #0078d4; color: #fff; }
.os-badge.os-linux   { background: #fcc624; color: #1f2937; }

.price-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 700;
    background: var(--bg-section);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

/* =====================================================================
   Sections + common typography for content pages
   ===================================================================== */
.section {
    padding: var(--spacing-lg) 0;
}

.section:nth-child(even) {
    background: var(--bg-section);
}

.section h2 {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    margin-bottom: var(--spacing-md);
    color: var(--text-color);
}

.section h3 {
    font-size: 1.125rem;
    margin: var(--spacing-md) 0 var(--spacing-sm);
    color: var(--text-color);
}

.lead {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: var(--reading-width);
    margin-bottom: var(--spacing-md);
}

/* Default feature list — checkmark style. Pages needing a plain/disc list
   override .feature-list in their own inline <style> (cascade order). */
.feature-list {
    list-style: none;
}

.feature-list li {
    padding: var(--spacing-xs) 0;
    padding-left: 1.5rem;
    position: relative;
}

.feature-list li::before {
    content: "\2713";
    position: absolute;
    left: 0;
    color: var(--success-color);
    font-weight: bold;
}

.feature-list li strong {
    color: var(--text-color);
}

/* Card grids reused by several pages */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-md);
    margin: var(--spacing-md) 0;
    align-items: stretch;
}

.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: var(--spacing-md);
}

.card h3 {
    margin-top: 0;
    color: var(--primary-color);
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.stat-card {
    background: var(--bg-surface);
    padding: var(--spacing-md);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.stat-card strong {
    display: block;
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.stat-card span {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Pillars band (3 brand promises) */
.pillars {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
    margin: var(--spacing-md) 0;
}

.pillar {
    text-align: center;
    padding: var(--spacing-md);
}

.pillar .pillar-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: var(--spacing-xs);
}

.pillar h3 {
    margin: 0 0 0.25rem;
    color: var(--text-color);
}

.pillar p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin: 0;
}

/* Coming-soon banner used on beta product pages */
.coming-soon-banner {
    background: var(--bg-section);
    border: 1px dashed var(--accent-color);
    border-radius: 12px;
    padding: var(--spacing-md);
    text-align: center;
    margin: var(--spacing-md) 0;
    color: var(--text-muted);
}

.coming-soon-banner strong {
    color: var(--text-color);
}

/* FAQ */
details {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: var(--spacing-sm);
}

details summary {
    padding: var(--spacing-sm);
    cursor: pointer;
    font-weight: 600;
}

details summary:hover {
    background: var(--bg-light);
}

details p {
    padding: 0 var(--spacing-sm) var(--spacing-sm);
    color: var(--text-muted);
}

.back-link {
    display: inline-block;
    margin: var(--spacing-md) 0;
    color: var(--text-muted);
}

/* =====================================================================
   Footer
   ===================================================================== */
.site-footer {
    background: var(--bg-footer);
    color: var(--footer-text);
    padding: var(--spacing-md) 0;
    text-align: center;
}

.site-footer p {
    margin: var(--spacing-xs) 0;
}

.site-footer a {
    color: var(--footer-link);
    text-decoration: none;
}

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

.footer-fine {
    opacity: 0.6;
    font-size: 0.85rem;
}

/* =====================================================================
   Responsive — hamburger nav up to 899px
   ===================================================================== */
@media (max-width: 899px) {
    .nav-container {
        flex-wrap: wrap;
    }

    .nav-brand {
        font-size: 1.1rem;
        padding: 12px 16px;
    }

    .nav-toggle {
        display: block;
        padding: 12px 16px;
        margin-left: auto;
        min-height: 44px;
        min-width: 44px;
    }

    .nav-list {
        display: none;
        flex-direction: column;
        width: 100%;
        order: 3;
    }

    .nav-list.open {
        display: flex;
    }

    .nav-list a,
    .dropdown-toggle {
        width: 100%;
        text-align: left;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        padding: 14px 16px;
        min-height: 44px;
    }

    .nav-list a.current,
    .dropdown-toggle.current {
        background: rgba(255,255,255,0.15);
        color: #fff;
    }

    /* On mobile the dropdown is a static, indented sub-list */
    .dropdown-menu {
        position: static;
        display: block;
        min-width: 0;
        width: 100%;
        background: rgba(0,0,0,0.2);
        border: none;
        border-radius: 0;
        box-shadow: none;
        padding: 0;
    }

    .dropdown-menu a {
        padding-left: 32px;
    }

    .dropdown-toggle::after {
        content: "";
    }
}

@media (min-width: 768px) {
    .container {
        padding: 0 var(--spacing-md);
    }

    .pillars {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .section {
        padding: var(--spacing-xl) 0;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Support section (app pages). Pages may override the framing; these are the
   shared bits every #support target needs. */
.support-section {
    /* Clears the sticky nav so #support doesn't land underneath it */
    scroll-margin-top: 60px;
}

.support-section button {
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.support-section button:hover {
    background: var(--primary-dark);
}

/* Print */
@media print {
    .hero-header, .main-nav, .site-footer, .support-section button {
        display: none;
    }
    body { color: #000; background: #fff; }
    a { color: #000; text-decoration: underline; }
}
