/* ==========================================================================
   SterlingPRIVATE.ai — Site Stylesheet
   Single source of truth for all pages. Drop into <head> with:
   <link rel="stylesheet" href="styles.css">
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */
:root {
    /* Color — dark, technical, calm */
    --bg:           #0b0d10;            /* page background */
    --bg-elev-1:    #111418;            /* cards, raised surfaces */
    --bg-elev-2:    #161a1f;            /* hover / inset */
    --bg-header:    rgba(11, 13, 16, 0.78);

    --fg:           #e8eaed;            /* primary text */
    --fg-muted:     #9aa0a6;            /* secondary text */
    --fg-subtle:    #6b7077;            /* tertiary text, captions */

    --line:         #1f242a;            /* hairlines / dividers */
    --line-strong:  #2a3038;            /* emphasized borders */

    --accent:       oklch(72% 0.11 175);   /* desaturated teal — AI / signal */
    --accent-soft:  oklch(72% 0.11 175 / 0.14);
    --accent-fg:    #06120f;            /* ink on accent buttons */

    --warn:         oklch(78% 0.10 75);
    --danger:       oklch(68% 0.14 25);

    /* Type */
    --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
                 Roboto, Helvetica, Arial, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo,
                 Consolas, monospace;

    --fs-xs:   0.75rem;     /* 12 */
    --fs-sm:   0.875rem;    /* 14 */
    --fs-base: 1rem;        /* 16 */
    --fs-md:   1.125rem;    /* 18 */
    --fs-lg:   1.375rem;    /* 22 */
    --fs-xl:   1.75rem;     /* 28 */
    --fs-2xl:  2.25rem;     /* 36 */
    --fs-3xl:  3rem;        /* 48 */
    --fs-4xl:  4rem;        /* 64 */

    --lh-tight:  1.1;
    --lh-snug:   1.25;
    --lh-normal: 1.5;
    --lh-loose:  1.7;

    --tracking-tight: -0.02em;
    --tracking-wide:  0.08em;

    /* Spacing — 4px base */
    --s-1:  0.25rem;
    --s-2:  0.5rem;
    --s-3:  0.75rem;
    --s-4:  1rem;
    --s-5:  1.5rem;
    --s-6:  2rem;
    --s-7:  3rem;
    --s-8:  4rem;
    --s-9:  6rem;
    --s-10: 8rem;

    /* Radii */
    --r-sm: 4px;
    --r-md: 8px;
    --r-lg: 12px;
    --r-xl: 20px;
    --r-pill: 999px;

    /* Layout */
    --container: 1200px;
    --container-narrow: 880px;

    /* Motion */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --dur-fast: 120ms;
    --dur:      200ms;
    --dur-slow: 400ms;

    /* Elevation (subtle — dark UI) */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow:    0 4px 12px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5), 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* --------------------------------------------------------------------------
   2. Reset / base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    background: var(--bg-header);
}

body {
    margin: 0;
    padding-top: 24px;
    background: var(--bg);
    color: var(--fg);
    font-family: var(--font-sans);
    font-size: var(--fs-base);
    line-height: var(--lh-normal);
    font-feature-settings: "ss01", "cv11";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

img, svg, video { max-width: 100%; height: auto; display: block; }

a {
    color: var(--fg);
    text-decoration: none;
    transition: color var(--dur) var(--ease);
}
a:hover { color: var(--accent); }

::selection { background: var(--accent-soft); color: var(--fg); }

/* --------------------------------------------------------------------------
   3. Typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
    margin: 0 0 var(--s-4);
    font-weight: 600;
    line-height: var(--lh-tight);
    letter-spacing: var(--tracking-tight);
    color: var(--fg);
    text-wrap: balance;
}
h1 { font-size: clamp(2.25rem, 5vw, var(--fs-4xl)); font-weight: 700; }
h2 { font-size: clamp(1.75rem, 3.5vw, var(--fs-3xl)); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); font-weight: 600; }
h5 { font-size: var(--fs-md); }
h6 { font-size: var(--fs-base); text-transform: uppercase; letter-spacing: var(--tracking-wide); color: var(--fg-muted); }

p { margin: 0 0 var(--s-4); text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

.lead {
    font-size: var(--fs-md);
    color: var(--fg-muted);
    line-height: var(--lh-loose);
    max-width: 60ch;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    color: var(--accent);
    margin-bottom: var(--s-4);
}
.eyebrow::before {
    content: "";
    width: 24px; height: 1px;
    background: var(--accent);
    display: inline-block;
}

.muted { color: var(--fg-muted); }
.subtle { color: var(--fg-subtle); }
.mono { font-family: var(--font-mono); }
.small { font-size: var(--fs-sm); }

em { color: var(--fg); font-style: normal; border-bottom: 1px dotted var(--accent); padding-bottom: 1px; }
strong { color: var(--fg); font-weight: 600; }

/* --------------------------------------------------------------------------
   3a. Brand mark — "SterlingPRIVATE.ai"
   -------------------------------------------------------------------------- */
/*
  Use anywhere in copy:
      <span class="brand"></span>                          (auto-fills correct text)
      <span class="brand">SterlingPRIVATE.ai</span>        (also fine — JS will normalize)

  The class enforces casing visually (PRIVATE is set to uppercase via styling
  on its own span, so even if someone types "sterlingprivate.ai" lowercase
  it'll still render correctly). The included script in includes.js / inline
  script auto-wraps the markup so authors don't have to nest spans by hand.
*/
.brand {
    font-weight: 600;
    color: var(--fg);
    white-space: nowrap;
    letter-spacing: 0;
}
.brand__sterling { font-weight: 500; }
.brand__private  { font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; }
.brand__tld      { font-weight: 500; color: var(--fg-muted); }

/* When inside a heading, inherit size/weight but keep the structural casing */
h1 .brand, h2 .brand, h3 .brand { font-weight: inherit; }
h1 .brand__private, h2 .brand__private, h3 .brand__private { font-weight: 800; }

/* --------------------------------------------------------------------------
   4. Layout primitives
   -------------------------------------------------------------------------- */
.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding-left: var(--s-5);
    padding-right: var(--s-5);
}
.container-narrow {
    width: 100%;
    max-width: var(--container-narrow);
    margin: 0 auto;
    padding-left: var(--s-5);
    padding-right: var(--s-5);
}

.section {
    padding: var(--s-9) 0;
    border-top: 1px solid var(--line);
}
.section:first-of-type { border-top: 0; }
.section-tight { padding: var(--s-7) 0; }

.stack > * + * { margin-top: var(--s-4); }
.stack-lg > * + * { margin-top: var(--s-6); }

.grid { display: grid; gap: var(--s-5); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-split {
    grid-template-columns: 1fr;
    gap: var(--s-7);
    align-items: center;
}
@media (min-width: 880px) {
    .grid-3 { grid-template-columns: repeat(3, 1fr); }
    .grid-split { grid-template-columns: 1.1fr 0.9fr; }
}

.flex { display: flex; gap: var(--s-4); }
.flex-center { display: flex; align-items: center; gap: var(--s-3); }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); }
.flex-wrap { flex-wrap: wrap; }

main { flex: 1; }

/* --------------------------------------------------------------------------
   5. Header / nav
   -------------------------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--bg-header);
    backdrop-filter: saturate(150%) blur(14px);
    -webkit-backdrop-filter: saturate(150%) blur(14px);
    border-bottom: 1px solid var(--line);
}
.site-header__inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: var(--s-3) var(--s-5);
    display: flex;
    align-items: center;
    gap: var(--s-5);
}
.site-header__brand {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    flex-shrink: 0;
    color: var(--fg);
}
.site-header__brand:hover { color: var(--fg); }
.site-header__logo {
    height: 83px;
    width: auto;
    /* Show the logo in its original colors. The teal + yellow read well on the dark header. */
}
.site-header__wordmark {
    font-family: var(--font-sans);
    font-size: var(--fs-md);
    letter-spacing: 0;
    text-transform: none;
    color: var(--fg);
    border-left: 1px solid var(--line-strong);
    padding-left: var(--s-3);
}
.site-header__wordmark strong { color: var(--fg); font-weight: 700; }

.site-nav {
    display: flex;
    align-items: center;
    gap: var(--s-1);
    margin-left: auto;
}
.site-nav__link {
    display: inline-flex;
    align-items: center;
    padding: var(--s-2) var(--s-3);
    font-size: var(--fs-sm);
    color: var(--fg-muted);
    border-radius: var(--r-sm);
    transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.site-nav__link:hover {
    color: var(--fg);
    background: var(--bg-elev-1);
}
.site-nav__link.is-active {
    color: var(--accent);
    background: var(--accent-soft);
}
.site-nav__link.is-active:hover {
    color: var(--accent);
    background: var(--accent-soft);
}

.site-nav__cta {
    margin-left: var(--s-3);
}

.site-nav__toggle {
    display: none;
    background: none;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    color: var(--fg);
    padding: var(--s-2);
    cursor: pointer;
}

@media (max-width: 880px) {
    .site-header__wordmark { display: none; }
    .site-nav__toggle { display: inline-flex; margin-left: auto; }
    .site-nav {
        display: none;
        position: absolute;
        top: 100%; left: 0; right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: var(--s-3);
        background: var(--bg);
        border-bottom: 1px solid var(--line);
    }
    .site-nav.is-open { display: flex; }
    .site-nav__link { padding: var(--s-3); border-radius: var(--r-md); }
    .site-nav__link.is-active { background: var(--accent-soft); color: var(--accent); }
    .site-nav__cta { margin: var(--s-2) 0 0; }
}

/* --------------------------------------------------------------------------
   6. Footer
   -------------------------------------------------------------------------- */
.site-footer {
    margin-top: var(--s-10);
    border-top: 1px solid var(--line);
    background: var(--bg);
    padding: var(--s-7) 0 var(--s-6);
    font-size: var(--fs-sm);
    color: var(--fg-muted);
}
.site-footer__top {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: var(--s-6);
    margin-bottom: var(--s-7);
}
@media (max-width: 880px) {
    .site-footer__top { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
    .site-footer__top { grid-template-columns: 1fr; }
}

.site-footer h4 {
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    color: var(--fg-subtle);
    margin-bottom: var(--s-4);
    font-weight: 500;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: var(--s-2); }
.site-footer a { color: var(--fg-muted); }
.site-footer a:hover { color: var(--accent); }

.site-footer__brand {
    display: flex; align-items: center; gap: var(--s-3);
    margin-bottom: var(--s-4);
}
.site-footer__brand img { height: 32px; opacity: 0.95; }
.site-footer__tagline {
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    color: var(--fg-subtle);
    letter-spacing: 0.02em;
    line-height: var(--lh-loose);
    max-width: 32ch;
}

.site-footer__bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--s-3);
    padding-top: var(--s-5);
    border-top: 1px solid var(--line);
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    color: var(--fg-subtle);
}
.site-footer__legal { display: flex; gap: var(--s-4); flex-wrap: wrap; }

/* --------------------------------------------------------------------------
   7. Buttons
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    padding: var(--s-3) var(--s-5);
    font-family: var(--font-sans);
    font-size: var(--fs-sm);
    font-weight: 500;
    line-height: 1;
    border-radius: var(--r-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--dur) var(--ease);
    text-decoration: none;
    white-space: nowrap;
}
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn--primary {
    background: var(--accent);
    color: var(--accent-fg);
    border-color: var(--accent);
}
.btn--primary:hover {
    background: oklch(78% 0.11 175);
    color: var(--accent-fg);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn--secondary {
    background: transparent;
    color: var(--fg);
    border-color: var(--line-strong);
}
.btn--secondary:hover {
    background: var(--bg-elev-1);
    border-color: var(--accent);
    color: var(--fg);
}

.btn--ghost {
    background: transparent;
    color: var(--fg-muted);
    padding-left: var(--s-3); padding-right: var(--s-3);
}
.btn--ghost:hover { color: var(--fg); background: var(--bg-elev-1); }

.btn--lg { padding: var(--s-4) var(--s-6); font-size: var(--fs-base); }
.btn--sm { padding: var(--s-2) var(--s-3); font-size: var(--fs-xs); }

.btn .arrow { transition: transform var(--dur) var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

/* --------------------------------------------------------------------------
   8. Cards & surfaces
   -------------------------------------------------------------------------- */
.card {
    background: var(--bg-elev-1);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: var(--s-6);
    transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.card:hover { border-color: var(--line-strong); }

.card--feature .card__icon {
    width: 40px; height: 40px;
    border-radius: var(--r-md);
    background: var(--accent-soft);
    color: var(--accent);
    display: inline-flex; align-items: center; justify-content: center;
    margin-bottom: var(--s-4);
    border: 1px solid color-mix(in oklch, var(--accent), transparent 70%);
}

.card h3 { font-size: var(--fs-md); margin-bottom: var(--s-2); }
.card p { color: var(--fg-muted); font-size: var(--fs-sm); line-height: var(--lh-loose); }

/* Pill / badge */
.pill {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    padding: var(--s-1) var(--s-3);
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    color: var(--fg-muted);
    background: var(--bg-elev-1);
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
}
.pill__dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

/* --------------------------------------------------------------------------
   9. Hero
   -------------------------------------------------------------------------- */
.hero {
    position: relative;
    overflow: hidden;
    padding: var(--s-3) 0 var(--s-8);
}
.hero::before {
    /* subtle technical grid backdrop */
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--line) 1px, transparent 1px),
        linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 64px 64px;
    background-position: -1px -1px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 30%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 30%, transparent 75%);
    opacity: 0.6;
    pointer-events: none;
}
.hero::after {
    /* faint accent glow */
    content: "";
    position: absolute;
    top: -20%; right: -10%;
    width: 60vw; height: 60vw;
    background: radial-gradient(circle, var(--accent-soft) 0%, transparent 60%);
    opacity: 0.5;
    pointer-events: none;
}
.hero__inner {
    position: relative;
    z-index: 1;
}
.hero h1 {
    max-width: 18ch;
    margin-bottom: var(--s-5);
}
.hero .lead {
    font-size: var(--fs-lg);
    max-width: 56ch;
    margin-bottom: var(--s-6);
}
.hero__actions { display: flex; gap: var(--s-3); flex-wrap: wrap; }

.hero__visual {
    position: relative;
    background: var(--bg-elev-1);
    border: 1px solid var(--line);
    border-radius: var(--r-xl);
    padding: var(--s-5);
    aspect-ratio: 4 / 3;
    overflow: hidden;
}
.hero__visual img {
    width: 100%; height: 100%;
    object-fit: contain;
}
.hero__illustration {
    width: 100%; height: 100%;
    display: block;
}

/* --------------------------------------------------------------------------
   10. Image placeholder (when real assets aren't ready)
   -------------------------------------------------------------------------- */
.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background:
        repeating-linear-gradient(
            135deg,
            var(--bg-elev-1) 0 12px,
            var(--bg-elev-2) 12px 24px
        );
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    color: var(--fg-subtle);
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    padding: var(--s-6);
    aspect-ratio: 16 / 10;
}

/* --------------------------------------------------------------------------
   11. Stats / number rows
   -------------------------------------------------------------------------- */
.stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--s-5);
    padding: var(--s-6) 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}
.stat__value {
    font-family: var(--font-mono);
    font-size: var(--fs-2xl);
    font-weight: 500;
    color: var(--fg);
    letter-spacing: var(--tracking-tight);
    line-height: 1;
    margin-bottom: var(--s-2);
}
.stat__label {
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    color: var(--fg-subtle);
    font-family: var(--font-mono);
}

/* --------------------------------------------------------------------------
   12. CTA banner
   -------------------------------------------------------------------------- */
.cta-banner {
    background: var(--bg-elev-1);
    border: 1px solid var(--line);
    border-radius: var(--r-xl);
    padding: var(--s-8) var(--s-6);
    text-align: center;
    position: relative;
    overflow: hidden;
}
.cta-banner::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 60% 80% at 50% 0%, var(--accent-soft) 0%, transparent 60%);
    pointer-events: none;
}
.cta-banner > * { position: relative; }
.cta-banner h2 { margin-bottom: var(--s-3); }
.cta-banner .lead { margin: 0 auto var(--s-6); }

/* --------------------------------------------------------------------------
   13. Utility
   -------------------------------------------------------------------------- */
.text-center { text-align: center; }
.center { margin-left: auto; margin-right: auto; }
.hidden { display: none !important; }
.sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.divider {
    height: 1px;
    background: var(--line);
    border: 0;
    margin: var(--s-6) 0;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
