@font-face {
    font-family: 'Frank Ruhl Libre';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/FrankRuhlLibre-Bold.woff2') format('woff2');
  }
  @font-face {
    font-family: 'Public Sans';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../fonts/PublicSans-Variable.woff2') format('woff2');
  }

  :root {
    /* brand tokens (light) */
    --paper: #E9EDE7;
    --paper-elevated: #DFE5DB;
    --ink: #12192A;
    --ink-soft: #3B4658;
    --brass: #B8873E;
    --brass-strong: #9C6F2C;
    --chart-blue: #375070;
    --sage: #4F7A5B;
    --rust: #B5544A;
    --line: #C4CCC0;

    /* semantic tokens */
    --bg: var(--paper);
    --bg-elevated: var(--paper-elevated);
    --text: var(--ink);
    --text-muted: var(--ink-soft);
    --accent: var(--brass);
    --accent-hover: var(--brass-strong);
    --accent-2: var(--chart-blue);
    --positive: var(--sage);
    --negative: var(--rust);
    --border: var(--line);
    --focus-ring: var(--brass);

    --font-display: 'Frank Ruhl Libre', Georgia, 'Times New Roman', serif;
    --font-body: 'Public Sans', ui-sans-serif, -apple-system, 'Segoe UI', system-ui, sans-serif;
    --font-mono: ui-monospace, 'SF Mono', 'Cascadia Code', Menlo, Consolas, monospace;

    --container: 72rem;
    --radius: 3px;
  }

  @media (prefers-color-scheme: dark) {
    :root {
      --paper: #0E1420;
      --paper-elevated: #161E2E;
      --ink: #ECEFE7;
      --ink-soft: #A9B3C2;
      --brass: #D9A24E;
      --brass-strong: #EFBA6A;
      --chart-blue: #85A6CC;
      --sage: #7FAE8C;
      --rust: #D97C70;
      --line: #2A3346;
    }
  }
  :root[data-theme="dark"] {
    --paper: #0E1420;
    --paper-elevated: #161E2E;
    --ink: #ECEFE7;
    --ink-soft: #A9B3C2;
    --brass: #D9A24E;
    --brass-strong: #EFBA6A;
    --chart-blue: #85A6CC;
    --sage: #7FAE8C;
    --rust: #D97C70;
    --line: #2A3346;
  }
  :root[data-theme="light"] {
    --paper: #E9EDE7;
    --paper-elevated: #DFE5DB;
    --ink: #12192A;
    --ink-soft: #3B4658;
    --brass: #B8873E;
    --brass-strong: #9C6F2C;
    --chart-blue: #375070;
    --sage: #4F7A5B;
    --rust: #B5544A;
    --line: #C4CCC0;
  }

  *, *::before, *::after { box-sizing: border-box; }
  html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  }

  body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
  }

  h1, h2, h3 { font-family: var(--font-display); font-weight: 700; margin: 0; text-wrap: balance; color: var(--text); }
  p { margin: 0; max-width: 42rem; }
  a { color: inherit; }
  img, svg, canvas { display: block; max-width: 100%; }

  :focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: 3px;
    border-radius: 2px;
  }

  .wrap {
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: clamp(1.25rem, 4vw, 2.5rem);
  }

  .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
  }
  .eyebrow::before {
    content: "";
    width: 0.9rem;
    height: 1px;
    background: var(--accent);
  }

  /* ---------- Header ---------- */
  .site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
  }
  .site-header .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 10.4rem;
  }
  .wordmark {
    text-decoration: none;
    display: flex;
    align-items: center;
  }
  .brand-mark {
    display: block;
    height: 7.2rem;
    width: auto;
    transition: opacity 0.15s ease, filter 0.15s ease;
  }
  footer .brand-mark { height: 2rem; }
  .wordmark:hover .brand-mark { opacity: 0.8; }
  @media (prefers-color-scheme: dark) {
    .brand-mark { filter: invert(1); }
  }
  :root[data-theme="dark"] .brand-mark { filter: invert(1); }
  :root[data-theme="light"] .brand-mark { filter: none; }

  .nav-links {
    display: flex;
    align-items: center;
    gap: clamp(1.25rem, 2vw, 2.25rem);
    list-style: none;
    margin: 0;
    padding: 0;
  }
  .nav-links a {
    text-decoration: none;
    font-weight: 600;
    font-size: 1.02rem;
    color: var(--text-muted);
    transition: color 0.15s ease;
    padding: 0.25rem 0;
    border-bottom: 1px solid transparent;
  }
  .nav-links a:hover { color: var(--text); border-color: var(--accent); }

  .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    padding: 0.7rem 1.35rem;
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  }
  .btn-primary { background: var(--accent); color: var(--paper); border-color: var(--accent); }
  .btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); transform: translateY(-1px); }
  .btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
  .btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

  .nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 2.5rem;
    height: 2.5rem;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }
  .nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
    content: "";
    display: block;
    width: 1.1rem;
    height: 2px;
    background: var(--text);
    position: relative;
    transition: transform 0.2s ease, opacity 0.2s ease;
  }
  .nav-toggle span::before { position: absolute; top: -6px; }
  .nav-toggle span::after { position: absolute; top: 6px; }

  /* Wraps nav + header-cta so the mobile dropdown can position them as one
     panel (see the max-width:900px block below) without disturbing desktop
     at all: display:contents removes this element from the box tree
     entirely, so on desktop its children (nav, header-cta) behave exactly
     as if this wrapper didn't exist -- same flex participants of .wrap,
     same order, same spacing as before this wrapper was introduced. */
  .mobile-nav-panel { display: contents; }

  /* ---------- Hero ---------- */
  .hero {
    position: relative;
    overflow: hidden;
    padding-block: clamp(3rem, 8vw, 6rem) clamp(4.5rem, 10vw, 8rem);
    border-bottom: 1px solid var(--border);
  }
  .hero-bg {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.14;
    pointer-events: none;
    z-index: 0;
  }
  .hero-bg .chart-panel {
    width: min(64vw, 820px);
    border: none;
    background: none;
    padding: 0;
  }
  .hero-content {
    position: relative;
    z-index: 1;
  }
  .hero .wrap {
    max-width: 110rem;
  }
  .hero-copy {
    max-width: 106rem;
    margin-inline: auto;
    text-align: center;
  }
  .hero h1 {
    font-family: var(--font-body);
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-size: clamp(2rem, 4.1vw, 3.3rem);
    line-height: 1.18;
    margin-block: 1rem 1.5rem;
  }
  .hero-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    max-width: 40rem;
    margin: 0 auto 2rem;
  }
  .hero-divider-line {
    flex: 1;
    height: 1px;
    background: var(--text-muted);
  }
  .hero-divider-icon {
    width: 20px;
    height: 20px;
    color: var(--accent);
    flex-shrink: 0;
  }
  .hero p.lede {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 58rem;
    margin-inline: auto;
    text-wrap: balance;
  }
  .hero-eyebrow {
    margin-top: 2rem;
  }
  .hero-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-top: 1.25rem;
  }
  .trust-line {
    margin-top: 1.75rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-left: 2px solid var(--accent);
    padding-left: 0.85rem;
    max-width: 30rem;
    margin-inline: auto;
  }

  .chart-panel {
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    border-radius: var(--radius);
    padding: 1rem;
    position: relative;
  }
  .chart-panel .chart-label {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    font-variant-numeric: tabular-nums;
  }
  .chart-panel canvas { width: 100%; height: auto; aspect-ratio: 4 / 3; }

  /* ---------- Sections ---------- */
  section { padding-block: clamp(3.5rem, 8vw, 6rem); }
  .section-alt { background: var(--bg-elevated); border-block: 1px solid var(--border); }
  .section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: clamp(2.25rem, 5vw, 3.25rem);
  }
  .section-head h2 { font-size: clamp(1.9rem, 3.6vw, 2.5rem); margin-top: 0.6rem; max-width: 30rem; }
  .section-head .section-note { max-width: 22rem; color: var(--text-muted); font-size: 0.95rem; padding-bottom: 0.3rem; }

  /* ---------- Client logos ---------- */
  .logos-strip {
    padding-block: clamp(2.25rem, 5vw, 3rem);
    border-block: 1px solid var(--border);
  }
  .logos-label {
    display: flex;
    justify-content: center;
    margin-bottom: 1.75rem;
  }
  .logos-marquee {
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  }
  .logos-track {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    width: max-content;
  }
  .logos-track.is-marquee { animation: logos-scroll linear infinite; animation-duration: var(--marquee-duration, 32s); }
  .logos-marquee:hover .logos-track.is-marquee { animation-play-state: paused; }
  .logo-card {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: clamp(9rem, 14vw, 11rem);
    height: 5.5rem;
    padding: 1rem 1.25rem;
    background: #F4F1E9;
    border: 1px solid var(--border);
    border-radius: var(--radius);
  }
  .logo-card img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
  @keyframes logos-scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
  }
  @media (prefers-reduced-motion: reduce) {
    .logos-track.is-marquee { animation: none; }
    .logos-marquee { overflow-x: auto; }
  }

  /* ---------- Services ---------- */
  .services-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
  .service-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: clamp(1.5rem, 3vw, 2.25rem);
    background: var(--bg);
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }
  .service-card .tag {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--accent-2);
    letter-spacing: 0.04em;
  }
  .service-card h3 { font-size: 1.4rem; }
  .service-card p { color: var(--text-muted); font-size: 0.98rem; }
  .service-card ul {
    list-style: none;
    margin: 0.25rem 0 0;
    padding: 0;
    display: grid;
    gap: 0.55rem;
    border-top: 1px solid var(--border);
    padding-top: 1rem;
  }
  .service-card li {
    font-size: 0.92rem;
    color: var(--text);
    display: flex;
    gap: 0.6rem;
  }
  .service-card li::before {
    content: "";
    width: 5px;
    height: 5px;
    margin-top: 0.55rem;
    background: var(--accent);
    flex-shrink: 0;
  }
  .services-note {
    margin-top: 2rem;
    font-size: 0.95rem;
    color: var(--text-muted);
    max-width: 40rem;
    font-style: italic;
  }

  /* ---------- Technology ---------- */
  .tech-intro {
    font-size: 1.05rem;
    color: var(--text-muted);
    max-width: 46rem;
    margin-bottom: clamp(2rem, 4vw, 2.75rem);
  }
  .tech-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }
  .tech-item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: clamp(1.35rem, 2.5vw, 1.75rem);
    background: var(--bg);
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
  }
  .tech-item .tag { display: block; }
  .tech-item h3 { font-size: 1.1rem; }
  .tech-item p { color: var(--text-muted); font-size: 0.92rem; }

  /* ---------- Process / waypoints ---------- */
  .waypoints {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    border-top: 1px solid var(--border);
  }
  .waypoint {
    padding: 1.75rem 1.5rem 1.75rem 0;
    border-right: 1px solid var(--border);
    position: relative;
  }
  .waypoint:last-child { border-right: none; padding-right: 0; }
  .waypoint::before {
    content: "";
    position: absolute;
    top: -1px;
    left: 0;
    width: 2.25rem;
    height: 2px;
    background: var(--accent);
  }
  .waypoint .wp-id {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--accent);
    letter-spacing: 0.04em;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-variant-numeric: tabular-nums;
  }
  .waypoint h3 { font-size: 1.15rem; margin-bottom: 0.6rem; }
  .waypoint p { color: var(--text-muted); font-size: 0.92rem; }

  /* ---------- Why us ---------- */
  .why-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem 3rem;
  }
  .why-item { display: flex; gap: 1.1rem; }
  .why-item .glyph {
    flex-shrink: 0;
    width: 2.4rem;
    height: 2.4rem;
    border: 1px solid var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
  }
  .why-item h3 { font-size: 1.05rem; font-family: var(--font-body); font-weight: 700; margin-bottom: 0.4rem; }
  .why-item p { color: var(--text-muted); font-size: 0.94rem; }

  /* ---------- About ---------- */
  .about-grid {
    display: grid;
    grid-template-columns: 0.85fr 1.15fr;
    gap: clamp(2rem, 5vw, 4rem);
    align-items: start;
  }
  .about-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }
  .founder-icon {
    display: block;
    width: 78%;
    height: auto;
    transition: filter 0.15s ease;
  }
  @media (prefers-color-scheme: dark) {
    .founder-icon { filter: invert(1); }
  }
  :root[data-theme="dark"] .founder-icon { filter: invert(1); }
  :root[data-theme="light"] .founder-icon { filter: none; }
  .mission-panel {
    border: 1px solid var(--border);
    border-left: 2px solid var(--accent);
    background: var(--bg);
    padding: 1.5rem 1.75rem;
    border-radius: var(--radius);
  }
  .mission-panel p {
    margin-top: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.96rem;
  }

  .about-copy p + p { margin-top: 1.1rem; }
  .about-copy p { color: var(--text-muted); }

  /* ---------- Contact ---------- */
  .contact-grid {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: clamp(2rem, 5vw, 4rem);
  }
  .contact-detail { margin-bottom: 1.5rem; }
  .contact-detail .k {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
    display: block;
    margin-bottom: 0.3rem;
  }
  .contact-detail a {
    text-decoration: none;
    font-size: 1.15rem;
    font-weight: 700;
    border-bottom: 1px solid var(--border);
    transition: border-color 0.15s ease, color 0.15s ease;
  }
  .contact-detail a:hover { color: var(--accent); border-color: var(--accent); }

  form.contact-form {
    display: grid;
    gap: 1.1rem;
  }
  .field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
  label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
  }
  input, textarea {
    width: 100%;
    font-family: var(--font-body);
    font-size: 0.98rem;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.7rem 0.85rem;
  }
  input:focus, textarea:focus { border-color: var(--accent); }
  textarea { resize: vertical; min-height: 7rem; }
  .btn[disabled] { opacity: 0.6; cursor: not-allowed; }

  .form-status {
    margin: 0;
    font-size: 0.92rem;
    max-width: none;
  }
  .form-status:empty { display: none; }
  .form-status.is-error { color: var(--negative); }
  .form-status.is-success {
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--positive);
    border-left: 2px solid var(--positive);
    border-radius: var(--radius);
    background: var(--bg-elevated);
    color: var(--text);
    font-size: 1rem;
  }

  /* ---------- Footer ---------- */
  footer {
    border-top: 1px solid var(--border);
    padding-block: 2.5rem;
  }
  footer .wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.25rem;
  }
  .footer-links { display: flex; gap: 1.5rem; list-style: none; margin: 0; padding: 0; }
  .footer-links a { text-decoration: none; font-size: 0.85rem; color: var(--text-muted); }
  .footer-links a:hover { color: var(--accent); }
  .footer-meta { font-size: 0.82rem; color: var(--text-muted); }

  /* ---------- reveal-on-scroll ---------- */
  .reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.6s ease, transform 0.6s ease; }
  .reveal.in { opacity: 1; transform: translateY(0); }

  /* ---------- hero entrance ---------- */
  @keyframes hero-zoom-in {
    0% { opacity: 0; transform: scale(0.3); }
    50% { opacity: 1; }
    100% { opacity: 1; transform: scale(1); }
  }
  .hero .wrap { animation: hero-zoom-in 0.9s ease-out both; }
  @media (prefers-reduced-motion: reduce) {
    .hero .wrap { animation: none; }
  }

  /* ---------- responsive ---------- */
  @media (max-width: 900px) {
    .nav-links, .header-cta { display: none; }
    .nav-toggle { display: flex; }
    .hero-bg .chart-panel { width: 88vw; }
    .services-grid, .tech-grid, .why-grid, .about-grid, .contact-grid { grid-template-columns: 1fr; }
    .waypoints { grid-template-columns: repeat(2, 1fr); }
    .waypoint { border-right: 1px solid var(--border); }
    .waypoint:nth-child(2n) { border-right: none; }
    .field-row { grid-template-columns: 1fr; }
  }
  @media (max-width: 560px) {
    .waypoints { grid-template-columns: 1fr; }
    .waypoint { border-right: none !important; padding-right: 0; }
  }

  /* Bug fixed 2026-08-08: the CTA button used to reappear (display:none ->
     inline-flex) as its own separate item back in the header's normal flex
     row when the mobile menu opened, overlapping the logo (a fixed-height
     image that can't shrink to make room) and sitting behind/against the
     hamburger button. Fix: the dropdown positioning below now lives on the
     shared .mobile-nav-panel wrapper (nav + CTA together, stacked in one
     column), not on .nav-links alone -- so the CTA opens as part of the
     same panel instead of popping back into the header row by itself. */
  .mobile-nav-panel.open {
    display: flex;
    position: absolute;
    top: 4.5rem;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    padding: 1.25rem clamp(1.25rem, 4vw, 2.5rem) 1.75rem;
    gap: 1.25rem;
  }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  .header-cta.open { display: inline-flex; }
