:root {
    --bg:          #FFFFFF;
    --surface:     #F7F8FA;
    --surface-2:   #F0F2F5;
    --text:        #0F1419;
    --text-2:      #4B5563;
    --text-3:      #6B7280;
    --border:      #E5E7EB;
    --border-2:    #D1D5DB;
    --accent:      #50B040;     /* brand green, sampled from logo */
    --accent-dark: #3F8C32;     /* darker green for small text contrast on white */
    --accent-soft: #50B0400D;

    --font: Arial, Helvetica, "Helvetica Neue", sans-serif;
    --font-heading: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;

    --pad-x: clamp(20px, 4vw, 56px);
    --section-py: clamp(72px, 8vw, 120px);
    --max-w: 1200px;
    --prose-w: 760px;
  }

  * { box-sizing: border-box; margin: 0; padding: 0; }
  html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
  body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
  }
  a { color: inherit; text-decoration: none; }
  img { max-width: 100%; display: block; }

  .shell {
    max-width: var(--max-w);
    margin: 0 auto;
    padding-left: var(--pad-x);
    padding-right: var(--pad-x);
  }

  /* ——— Brand logo (header + footer) ————————————— */
  .brand {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    color: var(--text);
  }
  .brand-mark {
    width: 80px;
    height: 80px;
    background: transparent;
    display: block;
    flex-shrink: 0;
  }
  .brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
  }
  /* The brand wordmark text — size up to match the larger mark */
  .brand .brand-name {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 300;
    letter-spacing: -0.015em;
    color: var(--text);
    line-height: 1.05;
    display: block;
  }
  .footer-brand-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
  }
  .footer-brand-row .brand-mark { width: 56px; height: 56px; }
  .footer-brand-row .name {
    font-family: var(--font-heading);
    font-weight: 300;
    color: var(--text);
    font-size: 20px;
    letter-spacing: -0.01em;
  }

  /* ——— Header ———————————————————————— */
  header.site {
    position: sticky;
    top: 0;
    z-index: 60;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
  }
  .nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100px;
  }

  .nav-links { display: flex; align-items: center; gap: clamp(16px, 2.4vw, 32px); }
  .nav-links a {
    font-size: 14px;
    color: var(--text-2);
    transition: color .2s ease;
  }
  .nav-links a:hover { color: var(--text); }
  .nav-links .cta {
    background: var(--text);
    color: var(--bg);
    padding: 9px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    transition: background .2s ease;
  }
  .nav-links .cta:hover { background: var(--accent); }
  @media (max-width: 760px) {
    .nav-links a:not(.cta):not(.support) { display: none; }
  }

  /* ——— Hero ———————————————————————— */
  .hero {
    padding-top: clamp(64px, 9vw, 120px);
    padding-bottom: clamp(64px, 8vw, 112px);
  }
  .hero .kicker {
    display: inline-block;
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 500;
    color: var(--accent-dark);
    letter-spacing: 0.02em;
    margin-bottom: 24px;
  }
  .hero h1 {
    font-family: var(--font-heading);
    font-weight: 200;
    font-size: clamp(28px, 6.8vw, 84px);
    line-height: 1.1;
    letter-spacing: -0.035em;
    color: var(--text);
    margin-bottom: 28px;
  }
  .hero h1 .nobreak { white-space: nowrap; }
  /* Edge-case fallback: on very narrow phones (<400px CSS width) allow the
     first phrase to wrap so it doesn't overflow the viewport. */
  @media (max-width: 400px) {
    .hero h1 .nobreak { white-space: normal; }
  }
  .hero p.sub {
    font-size: clamp(17px, 1.6vw, 20px);
    line-height: 1.5;
    color: var(--text-2);
    max-width: 60ch;
    margin-bottom: 36px;
  }
  .actions { display: flex; gap: 12px; flex-wrap: wrap; }
  .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 22px;
    border-radius: 8px;
    background: var(--text);
    color: var(--bg);
    font-size: 15px;
    font-weight: 600;
    border: 1px solid var(--text);
    transition: background .2s ease, border-color .2s ease, color .2s ease;
    cursor: pointer;
  }
  .btn:hover { background: var(--accent); border-color: var(--accent); }
  .btn.secondary {
    background: var(--bg);
    color: var(--text);
    border-color: var(--border-2);
  }
  .btn.secondary:hover { background: var(--surface); border-color: var(--text); color: var(--text); }

  /* ——— Sections ———————————————————————— */
  /* Top-level page sections (hero, services, customers, etc.) get generous
     vertical padding. Excludes .aup-section, which is used inside the legal
     pages' article body and manages its own spacing. */
  section:not(.aup-section) {
    padding-top: var(--section-py);
    padding-bottom: var(--section-py);
    scroll-margin-top: 100px; /* clears the sticky header on anchor jumps */
  }
  /* Belt-and-suspenders: ensure aup-section has no inherited section padding */
  .aup-section {
    padding-top: 0;
    padding-bottom: 0;
  }
  /* #top anchor (the brand link in nav) should land at the absolute top */
  #top { scroll-margin-top: 0; }
  @media (max-width: 600px) {
    section:not(.aup-section) { scroll-margin-top: 76px; }
  }
  .section-divider { border-top: 1px solid var(--border); }

  .section-head { margin-bottom: clamp(40px, 5vw, 64px); max-width: 720px; }
  .section-head h2 {
    font-family: var(--font-heading);
    font-weight: 200;
    font-size: clamp(32px, 3.8vw, 48px);
    line-height: 1.15;
    letter-spacing: -0.03em;
    color: var(--text);
    margin-bottom: 16px;
  }
  .section-head p {
    font-size: 17px;
    color: var(--text-2);
    line-height: 1.55;
  }

  /* ——— Services ———————————————————————— */
  .services {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  .service {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: clamp(24px, 2.6vw, 36px);
    transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
  }
  .service:hover {
    border-color: var(--border-2);
    box-shadow: 0 4px 14px rgba(15, 20, 25, 0.04);
  }
  .service h3 {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 300;
    letter-spacing: -0.015em;
    color: var(--text);
    margin-bottom: 12px;
  }
  .service p {
    font-size: 15px;
    color: var(--text-2);
    line-height: 1.6;
    margin-bottom: 20px;
  }
  .service ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .service ul li {
    font-size: 12px;
    color: var(--text-2);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 4px 10px;
  }
  @media (max-width: 760px) {
    .services { grid-template-columns: 1fr; }
  }

  /* ——— Logo Grids (customers / partners) ———————————— */
  .logo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
  .logo-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: border-color .2s ease, background .2s ease, transform .2s ease;
    min-height: 96px;
  }
  .logo-card:hover {
    border-color: var(--text);
    background: var(--surface);
  }
  .logo-card .logo {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 6px;
  }
  .logo-card .logo img { width: 100%; height: 100%; object-fit: contain; }
  .logo-card .meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .logo-card .name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.005em;
  }
  .logo-card .domain {
    font-size: 13px;
    color: var(--text-3);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  @media (max-width: 900px) {
    .logo-grid { grid-template-columns: repeat(2, 1fr); }
  }
  @media (max-width: 520px) {
    .logo-grid { grid-template-columns: 1fr; }
  }

  /* ——— Principals ———————————————————————— */
  .principals {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(32px, 4vw, 56px);
  }
  .principal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: clamp(24px, 2.8vw, 36px);
  }
  .principal h3 {
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 300;
    color: var(--text);
    letter-spacing: -0.015em;
    margin-bottom: 4px;
  }
  .principal .role {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-dark);
    margin-bottom: 18px;
  }
  .principal p {
    font-size: 15px;
    color: var(--text-2);
    line-height: 1.65;
  }
  .principal p + p { margin-top: 12px; }
  @media (max-width: 800px) {
    .principals { grid-template-columns: 1fr; }
  }

  /* ——— Contact ———————————————————————— */
  .contact-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: clamp(32px, 4vw, 56px);
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: clamp(32px, 4vw, 56px);
  }
  .contact-wrap h3 {
    font-family: var(--font-heading);
    font-size: clamp(28px, 3.2vw, 40px);
    font-weight: 200;
    letter-spacing: -0.025em;
    color: var(--text);
    line-height: 1.15;
    margin-bottom: 16px;
  }
  .contact-wrap .lede {
    font-size: 16px;
    color: var(--text-2);
    line-height: 1.55;
  }
  .contact-details { display: flex; flex-direction: column; gap: 22px; }
  .contact-block .lab {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
  }
  .contact-block .val {
    font-size: 15px;
    color: var(--text);
    line-height: 1.5;
  }
  .contact-block a {
    color: var(--text);
    border-bottom: 1px solid var(--border-2);
    transition: color .2s ease, border-color .2s ease;
  }
  .contact-block a:hover { color: var(--accent-dark); border-color: var(--accent-dark); }
  @media (max-width: 800px) {
    .contact-wrap { grid-template-columns: 1fr; }
  }

  /* ——— Footer ———————————————————————— */
  footer.site {
    border-top: 1px solid var(--border);
    padding: clamp(48px, 5vw, 72px) var(--pad-x) 28px;
    background: var(--bg);
  }
  .footer-grid {
    max-width: var(--max-w);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1fr;
    gap: clamp(24px, 4vw, 48px);
    padding-bottom: 36px;
    border-bottom: 1px solid var(--border);
  }
  .footer-grid .col h4 {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 14px;
  }
  .footer-grid .col p {
    font-size: 14px;
    color: var(--text-2);
    line-height: 1.55;
    max-width: 38ch;
  }
  .footer-grid .col ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
  .footer-grid .col ul li a {
    font-size: 14px;
    color: var(--text-2);
    transition: color .2s ease;
  }
  .footer-grid .col ul li a:hover { color: var(--accent-dark); }
  .footer-bottom {
    max-width: var(--max-w);
    margin: 0 auto;
    padding-top: 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
    color: var(--text-3);
  }
  @media (max-width: 720px) {
    /* Brand block spans full width across the top; link columns flow into 2 columns below. */
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .footer-grid > .col:first-child {
      grid-column: 1 / -1;
      margin-bottom: 12px;
    }
  }

  @media (max-width: 600px) {
    .nav { height: 76px; }
    .brand-mark { width: 56px; height: 56px; }
    .brand .brand-name { font-size: 16px; }
    /* On phone-sized viewports, hide the footer brand/tagline column entirely
       to save vertical space. The header still shows the logo and brand name,
       so identity isn't lost. */
    .footer-grid > .col:first-child { display: none; }
  }

  /* ============================================
     Legal / document-style page styles
     (used by aup.html, privacy.html, trust.html)
     ============================================ */

  @media (max-width: 600px) {
    .nav { height: 76px; }
    .brand-mark { width: 56px; height: 56px; }
    .brand .brand-name { font-size: 16px; }
  }

  /* AUP-specific */
  .aup-hero {
    padding: clamp(48px, 6vw, 88px) 0 clamp(40px, 5vw, 64px);
    border-bottom: 1px solid var(--border);
  }

  .aup-hero .kicker {
    display: inline-block;
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 500;
    color: var(--accent-dark);
    letter-spacing: 0.02em;
    margin-bottom: 20px;
  }

  .aup-hero h1 {
    font-family: var(--font-heading);
    font-weight: 200;
    font-size: clamp(36px, 5.6vw, 64px);
    line-height: 1.05;
    letter-spacing: -0.035em;
    color: var(--text);
    margin-bottom: 20px;
    max-width: 18ch;
  }

  .aup-hero .meta {
    font-size: 15px;
    color: var(--text-3);
  }

  .aup-hero .meta strong {
    color: var(--text-2);
    font-weight: 600;
  }

  /* Layout: TOC + prose, side-by-side on desktop, stacked on mobile */
  .aup-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, var(--prose-w));
    gap: clamp(40px, 6vw, 80px);
    padding: clamp(48px, 6vw, 80px) 0 clamp(72px, 8vw, 120px);
    align-items: start;
  }

  @media (max-width: 980px) {
    .aup-layout { grid-template-columns: 1fr; gap: 40px; }
  }

  /* Table of contents — sticky on desktop */
  .aup-toc {
    position: sticky;
    top: 120px;
    align-self: start;
  }

  @media (max-width: 980px) {
    .aup-toc { position: static; }
  }

  .aup-toc h4 {
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-3);
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
  }

  .aup-toc ol { list-style: none; display: flex; flex-direction: column; gap: 8px; }

  .aup-toc ol li a {
    font-size: 14px;
    color: var(--text-2);
    line-height: 1.4;
    display: block;
    padding: 4px 0 4px 30px;
    text-indent: -30px;
    transition: color .2s ease;
  }

  .aup-toc ol li a:hover { color: var(--accent-dark); }

  .aup-toc .toc-num {
    color: var(--accent);
    font-weight: 600;
    margin-right: 6px;
    display: inline-block;
    min-width: 24px;
    text-indent: 0;
  }

  /* Prose body */
  .aup-body {
    max-width: var(--prose-w);
    font-size: 17px;
    line-height: 1.7;
    color: var(--text);
  }

  .aup-body p {
    margin-bottom: 18px;
    color: var(--text-2);
  }

  .aup-section {
    margin-bottom: 32px;
    scroll-margin-top: 120px;
  }

  /* Whatever the section ends with (ul, p, subsection), don't add its own
     bottom margin to the section's bottom margin — let .aup-section dictate
     the space between sections. */
  .aup-section > *:last-child,
  .aup-section > *:last-child > *:last-child {
    margin-bottom: 0;
  }

  .aup-section h2 {
    font-family: var(--font-heading);
    font-size: clamp(26px, 2.6vw, 32px);
    font-weight: 300;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
  }

  .aup-section h2 .sec-num {
    color: var(--accent);
    font-weight: 400;
    margin-right: 6px;
  }

  .aup-subsection {
    margin-top: 32px;
    scroll-margin-top: 120px;
  }

  .aup-subsection h3 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 500;
    color: var(--text);
    letter-spacing: -0.01em;
    margin-bottom: 14px;
  }

  .aup-body ul {
    list-style: none;
    margin: 8px 0 22px;
    padding-left: 0;
  }

  .aup-body ul li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 10px;
    color: var(--text-2);
  }

  .aup-body ul li::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 12px;
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
  }

  .aup-body a {
    color: var(--accent-dark);
    border-bottom: 1px solid var(--accent-dark);
    transition: color .2s ease, border-color .2s ease;
  }

  .aup-body a:hover {
    color: var(--text);
    border-color: var(--text);
  }

  .aup-body .contact-list {
    margin-top: 12px;
    padding: 20px 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
  }

  .aup-body .contact-list li {
    padding-left: 0;
    margin-bottom: 8px;
  }

  .aup-body .contact-list li:last-child { margin-bottom: 0; }

  .aup-body .contact-list li::before { display: none; }

  .aup-body .contact-list .contact-label {
    font-weight: 600;
    color: var(--text);
    margin-right: 8px;
  }

  /* "Back to top" link at the very end */
  .aup-footer-actions {
    margin-top: 56px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
  }

  .aup-footer-actions a {
    font-size: 14px;
    color: var(--text-2);
    transition: color .2s ease;
  }

  .aup-footer-actions a:hover { color: var(--accent-dark); }

  /* h4 — sub-subsections within a legal section (e.g. "CCPA Disclosures",
     "Breach Notification", "Operating principles"). Smaller than h3, used
     when h3 is already in use for numbered subsections. */
  .aup-body h4 {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.005em;
    margin-top: 26px;
    margin-bottom: 12px;
  }

  /* Pandoc-style horizontal rules inside legal prose — we use section borders
     instead, so hide them rather than render a double divider. */
  .aup-body hr {
    border: 0;
    height: 0;
    margin: 0;
    display: none;
  }

  /* Tables in legal prose — used by the privacy policy for the use-of-data
     matrix, retention schedule, CCPA disclosures; by the trust page for the
     data retention summary. Wide tables overflow horizontally on narrow
     viewports instead of squishing. */
  .aup-body .table-wrap {
    overflow-x: auto;
    margin: 8px 0 24px;
    border: 1px solid var(--border);
    border-radius: 10px;
  }
  .aup-body table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    line-height: 1.5;
  }
  .aup-body table th,
  .aup-body table td {
    text-align: left;
    vertical-align: top;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-2);
  }
  .aup-body table thead th {
    background: var(--surface);
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--border-2);
  }
  .aup-body table tbody tr:last-child td { border-bottom: 0; }
  .aup-body table strong { color: var(--text); font-weight: 600; }

  /* Subprocessor cards — used by trust.html §16. Each subprocessor lives
     inside an .aup-subsection; the dl renders as a label/value grid. */
  .subprocessor-category {
    display: inline-block;
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-dark);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 14px;
  }
  .subprocessor-fields {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 10px 24px;
    margin: 16px 0 0;
    padding: 18px 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
  }
  .subprocessor-fields dt {
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding-top: 3px;
  }
  .subprocessor-fields dd {
    color: var(--text-2);
    line-height: 1.55;
    margin: 0;
  }
  @media (max-width: 600px) {
    .subprocessor-fields {
      grid-template-columns: 1fr;
      gap: 4px 0;
      padding: 16px 18px;
    }
    .subprocessor-fields dd { margin-bottom: 10px; }
    .subprocessor-fields dd:last-of-type { margin-bottom: 0; }
  }

  @media (max-width: 720px) {
    .footer-brand-row .brand-mark { width: 44px; height: 44px; }
    .footer-brand-row .name { font-size: 16px; }
  }
