/* Velo + Atlas IQ marketing site — shared foundation. Page CSS lives beside each page.
   Fonts: link this in each page <head> (before base.css):
   <link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
   <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Archivo:wght@500;800;900&family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,700&family=IBM+Plex+Mono:wght@400;500&family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,600;1,6..72,400;1,6..72,500&display=swap">
*/

:root {
  /* Velo — day */
  --paper: #f6f5f2;
  --panel: #ffffff;
  --inset: #fbfaf8;
  --line: #e6e3dc;
  --ink: #1b1a17;
  --ink-muted: #6f6b63;
  --accent: #2f7d6b;
  --accent-soft: #e3efeb;
  --warn: #b4572a;
  --warn-soft: #f7e7dd;

  /* Atlas IQ — night */
  --night: #131211;
  --night-surface: #1b1a18;
  --night-raised: #24221f;
  --night-line: #34312c;
  --night-text: #eeeae2;
  --night-muted: #a39e94;
  --glow: #5fb89f;
  --glow-soft: rgba(95, 184, 159, 0.16);

  /* Type */
  --font-body: "DM Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-velo: "Archivo", "Arial Black", "Helvetica Neue", Arial, sans-serif;
  --font-atlas: "Newsreader", Georgia, "Times New Roman", serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Scale: tiny steps + one huge step. Skip the middle on purpose. */
  --t-2xs: 0.6875rem;  /* 11 */
  --t-xs: 0.75rem;     /* 12 */
  --t-sm: 0.875rem;    /* 14 */
  --t-md: 1rem;        /* 16 */
  --t-lg: clamp(1.5rem, 1.1rem + 1.6vw, 2.25rem);
  --t-huge: clamp(4.5rem, 1rem + 21vw, 22rem);

  --radius: 10px;
  --radius-lg: 18px;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1240px;
  --nav-h: 60px;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--t-md)/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.theme-night :focus-visible { outline-color: var(--glow); }

/* Theme scopes — put on a <section> or <body>. */
.theme-day { background: var(--paper); color: var(--ink); --fg-muted: var(--ink-muted); --rule: var(--line); }
.theme-night { background: var(--night); color: var(--night-text); --fg-muted: var(--night-muted); --rule: var(--night-line); }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.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; }

/* Tiny labels */
.kicker { font: 500 var(--t-2xs)/1.3 var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-muted, var(--ink-muted)); }
.tiny { font-size: var(--t-xs); color: var(--fg-muted, var(--ink-muted)); }
.mono { font-family: var(--font-mono); }

/* Huge type */
.huge-velo { font: 900 var(--t-huge)/0.82 var(--font-velo); letter-spacing: -0.045em; text-transform: uppercase; margin: 0; }
.huge-atlas { font: 400 var(--t-huge)/0.86 var(--font-atlas); font-style: italic; letter-spacing: -0.035em; margin: 0; }
.huge-clip { overflow-x: clip; overflow-y: visible; }

/* The Velo CUT LINE: a thin diagonal slice across type. Wrap text in .cut */
.cut { position: relative; display: inline-block; }
.cut::after {
  content: ""; position: absolute; left: -4%; right: -4%; top: 54%;
  height: max(2px, 0.035em); background: var(--paper);
  transform: rotate(-4.5deg); transform-origin: center;
  box-shadow: 0 -0.012em 0 0 currentColor;
  pointer-events: none;
}
.theme-night .cut::after { background: var(--night); }

/* Brand marks as masks (color = currentColor). Size with width; aspect ratio is fixed. */
.mark { display: inline-block; background: currentColor; -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; flex: none; }
.mark-velo { --m: url("brand/velo-wordmark-light.png"); aspect-ratio: 345 / 126; width: 78px; }
.mark-velo-badge { --m: url("brand/velo-badge-light.png"); aspect-ratio: 1; width: 32px; }
.mark-atlasiq { --m: url("brand/atlas-iq-mask.png"); aspect-ratio: 284 / 116; width: 82px; }
.mark-atlas-lockup { --m: url("brand/atlas-lockup-mask.png"); aspect-ratio: 501 / 198; width: 140px; }
.mark-quill { --m: url("brand/atlas-mark-mask.png"); aspect-ratio: 133 / 257; width: 18px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid transparent;
  font: 500 var(--t-sm)/1 var(--font-body); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform 160ms var(--ease), background-color 160ms var(--ease), border-color 160ms var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: #000; }
.btn-ghost { background: transparent; color: inherit; border-color: currentColor; }
.btn-ghost:hover { background: rgba(127, 127, 127, 0.1); }
.theme-night .btn-primary { background: var(--glow); color: var(--night); }
.theme-night .btn-primary:hover { background: #79c9b2; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: var(--t-xs); }

/* Chips */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: 999px; font: 500 var(--t-2xs)/1.4 var(--font-mono); letter-spacing: 0.04em; border: 1px solid var(--rule, var(--line)); }
.chip-ok { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.chip-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.theme-night .chip-ok { background: var(--glow-soft); color: var(--glow); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* Product cards (generic shell; pages style the inside) */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: 0 1px 0 rgba(0,0,0,.02), 0 24px 60px -28px rgba(27,26,23,.28); }
.theme-night .card { background: var(--night-surface); border-color: var(--night-line); box-shadow: 0 30px 80px -30px rgba(0,0,0,.7), 0 0 0 1px rgba(95,184,159,.05); }

/* Nav shell */
.site-nav {
  position: sticky; top: 0; z-index: 50; height: var(--nav-h);
  display: flex; align-items: center;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
  transition: background-color 300ms var(--ease), color 300ms var(--ease), border-color 300ms var(--ease);
}
.site-nav[data-theme="night"] { background: color-mix(in srgb, var(--night) 84%, transparent); color: var(--night-text); border-color: var(--night-line); }
.site-nav .wrap { display: flex; align-items: center; gap: 20px; }
.site-nav .brands { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.site-nav .brands .slash { width: 1px; height: 22px; background: currentColor; opacity: .35; transform: rotate(18deg); }
.site-nav .links { display: flex; gap: 22px; margin-left: auto; font-size: var(--t-sm); }
.site-nav .links a { text-decoration: none; opacity: .75; }
.site-nav .links a:hover, .site-nav .links a[aria-current="true"] { opacity: 1; }
.site-nav .actions { display: flex; gap: 8px; }
.site-nav[data-theme="night"] .btn-primary { background: var(--glow); color: var(--night); }
@media (max-width: 760px) {
  .site-nav .links { display: none; }
  .site-nav .actions { margin-left: auto; }
  .site-nav .actions .btn-primary { display: none; }
}

/* Mobile sticky CTA bar (thumb zone). Pages add <div class="mobile-cta">…</div> before </body>. */
.mobile-cta { display: none; }
@media (max-width: 760px) {
  .mobile-cta {
    display: flex; gap: 8px; position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
    z-index: 60; padding: 8px; border-radius: 999px;
    background: color-mix(in srgb, var(--ink) 92%, transparent); color: var(--paper);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 12px 40px -12px rgba(0,0,0,.5);
  }
  .mobile-cta .btn { flex: 1; }
  .mobile-cta .btn-primary { background: var(--paper); color: var(--ink); }
  .mobile-cta .btn-ghost { border-color: rgba(255,255,255,.35); }
  .mobile-cta[data-theme="night"] .btn-primary { background: var(--glow); color: var(--night); }
  body { padding-bottom: 84px; }
}

/* Footer */
.site-footer { padding: 56px 0 40px; font-size: var(--t-xs); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 24px 48px; align-items: flex-end; justify-content: space-between; }

/* Reveal helper: add .reveal; JS adds .in when visible. */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 700ms var(--ease), transform 700ms var(--ease); }
.reveal.in { opacity: 1; transform: none; }

@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; }
  .reveal { opacity: 1; transform: none; }
}
