/* Data 32 - P0 marketing site
   Design tokens derived from the official logo (ADR 0002 layer 3).
   Navy primary + amber sparing accent. Serif headings, system-sans body.
   No build step: plain CSS, no preprocessor. */

/* Self-hosted serif for headings (Source Serif 4, OFL, variable weight).
   font-display: swap so headings show in Georgia instantly, then upgrade. */
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("assets/fonts/source-serif-4-latin.woff2") format("woff2");
}

:root {
  /* Palette (CONTEXT.md / ADR 0002) */
  --navy: #065295;        /* primary - hero, headings, logo */
  --navy-deep: #043b6c;   /* hero gradient floor, hovers on navy */
  --amber: #fcb336;       /* sparing warm accent - links, CTA, rules */
  --amber-deep: #e09a16;  /* accent hover */
  --ink: #111827;         /* body text */
  --ink-soft: #475569;    /* secondary text */
  --surface: #ffffff;     /* default section background */
  --surface-alt: #f5f7fa; /* alternating band */
  --line: #e2e8f0;        /* hairlines, card borders */

  /* Type */
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Heading + hairline colours that flip in dark mode */
  --heading: var(--navy);
  --hero-from: var(--navy);
  --hero-to: var(--navy-deep);

  /* Header + logo. These flip in dark mode so the sticky header and the
     masked logo never get stuck on a white background. --logo-ink is the
     fill colour of the masked header logo (brand colour in light, white in dark). */
  --header-bg: rgba(255,255,255,0.92);
  --header-ink: var(--ink);
  --logo-ink: var(--navy);

  /* Rhythm */
  --maxw: 1080px;
  --gap: clamp(1rem, 2.5vw, 2rem);
  --section-y: clamp(3.5rem, 8vw, 6rem);
  --radius: 10px;
}

/* ---- Dark theme tokens ----
   Applied when the OS prefers dark AND no manual override, or when the user
   forces it via [data-theme="dark"]. Manual light override wins via
   [data-theme="light"]. Navy headings become a lighter blue for contrast. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --navy: #2f80d6;
    --navy-deep: #0a1b2e;
    --amber: #fcb336;
    --amber-deep: #f0a921;
    --ink: #e6edf5;
    --ink-soft: #9fb2c7;
    --surface: #0d1620;
    --surface-alt: #131f2c;
    --line: #243343;
    --heading: #cfe1f5;
    --hero-from: #0a3a66;
    --hero-to: #061626;
    --header-bg: rgba(13,22,32,0.92);
    --header-ink: #e6edf5;
    --logo-ink: #ffffff;
  }
}
:root[data-theme="dark"] {
  --navy: #2f80d6;
  --navy-deep: #0a1b2e;
  --amber: #fcb336;
  --amber-deep: #f0a921;
  --ink: #e6edf5;
  --ink-soft: #9fb2c7;
  --surface: #0d1620;
  --surface-alt: #131f2c;
  --line: #243343;
  --heading: #cfe1f5;
  --hero-from: #0a3a66;
  --hero-to: #061626;
  --header-bg: rgba(13,22,32,0.92);
  --header-ink: #e6edf5;
  --logo-ink: #ffffff;
}

html { color-scheme: light dark; }

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--surface);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.15;
  color: var(--heading);
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.6rem, 3.6vw, 2.4rem); }
h3 { font-size: 1.15rem; color: var(--ink); }

p { margin: 0 0 1rem; }

a { color: var(--navy); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--amber-deep); }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gap); }

.section { padding-block: var(--section-y); scroll-margin-top: 96px; }
.section--alt { background: var(--surface-alt); }
.section__lead { max-width: 60ch; color: var(--ink-soft); font-size: 1.05rem; }
/* Full-width lead: spans the whole container, matching the grid/card below it. */
.section__lead--wide { max-width: none; }
.eyebrow {
  font-family: var(--sans);
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--amber-deep); margin: 0 0 0.6rem;
}

/* ---- Header ---- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: var(--header-bg); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; min-height: 88px; gap: 1rem; }
.site-header__logo { display: block; line-height: 0; }
/* Masked logo: one SVG shape, filled with --logo-ink so it auto-recolours to
   the active brand colour (blue/green) in light mode and flips to white in dark. */
.site-header__mark {
  display: block; height: 64px; aspect-ratio: 513.81 / 268.29;
  background-color: var(--logo-ink);
  -webkit-mask: url("assets/logo/data32-mark-glyph.svg") center / contain no-repeat;
          mask: url("assets/logo/data32-mark-glyph.svg") center / contain no-repeat;
  transition: background-color .15s ease;
}
@media (max-width: 560px) { .site-header__mark { height: 52px; } .site-header .container { min-height: 72px; } }
.nav { display: flex; gap: 1.25rem; align-items: center; }
.nav a { text-decoration: none; font-size: 0.95rem; color: var(--header-ink); }
.nav a:hover { color: var(--navy); }
.nav .btn { color: #fff; }

/* Apps dropdown: a button toggle + a menu that opens on hover or click.
   Click + keyboard are wired in JS; hover is a CSS convenience on pointer devices. */
.nav__dropdown { position: relative; display: inline-flex; }
.nav__dropdown-toggle {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: var(--sans); font-size: 0.95rem; color: var(--header-ink);
  background: none; border: 0; padding: 0; cursor: pointer; line-height: 1.2;
}
.nav__dropdown-toggle:hover { color: var(--navy); }
.nav__caret {
  width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 5px solid currentColor; transition: transform .15s ease;
}
.nav__dropdown-toggle[aria-expanded="true"] .nav__caret { transform: rotate(180deg); }
.nav__menu {
  position: absolute; top: calc(100% + 0.6rem); right: 0; min-width: 180px;
  margin: 0; padding: 0.35rem; list-style: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0,0,0,0.18);
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity .15s ease, transform .15s ease, visibility .15s;
}
.nav__dropdown:hover .nav__menu,
.nav__dropdown-toggle[aria-expanded="true"] + .nav__menu {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.nav__menu a {
  display: block; padding: 0.5rem 0.7rem; border-radius: 7px;
  font-size: 0.95rem; color: var(--ink); text-decoration: none;
}
.nav__menu a:hover, .nav__menu a:focus-visible { background: var(--surface-alt); color: var(--navy); }

@media (max-width: 560px) {
  .nav a:not(.btn), .nav__dropdown { display: none; }
}

/* Colour toggle (blue / green). Same shell as the theme toggle; a paint-drop
   glyph tinted to the active brand colour is the standard "theme colour" symbol. */
.color-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0; border-radius: 999px; cursor: pointer;
  background: transparent; border: 1px solid var(--line); line-height: 0;
  color: var(--navy);
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.color-toggle:hover { background: var(--surface-alt); border-color: var(--navy); }
/* Swatch glyph: external SVG painted via mask so it takes the brand colour
   (currentColor = --navy) and recolours with the active theme. */
.color-toggle__swatch {
  display: block; width: 15px; height: 15px;
  background-color: currentColor;
  -webkit-mask: url("assets/icons/swatch.svg") center / contain no-repeat;
          mask: url("assets/icons/swatch.svg") center / contain no-repeat;
}

/* Theme toggle */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0; border-radius: 999px; cursor: pointer;
  background: transparent; border: 1px solid var(--line); color: var(--heading);
  line-height: 0; transition: background-color .15s ease, border-color .15s ease;
}
.theme-toggle:hover { background: var(--surface-alt); border-color: var(--navy); }
/* moon / sun: external SVGs painted via mask so they take currentColor and
   recolour with the theme. Show one at a time depending on the active mode. */
.theme-toggle__icon {
  width: 15px; height: 15px; background-color: currentColor;
  -webkit-mask-position: center; mask-position: center;
  -webkit-mask-size: contain; mask-size: contain;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
}
.icon-moon { -webkit-mask-image: url("assets/icons/moon.svg"); mask-image: url("assets/icons/moon.svg"); }
.icon-sun  { -webkit-mask-image: url("assets/icons/sun.svg");  mask-image: url("assets/icons/sun.svg"); }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-sun,
.theme-toggle[aria-pressed="true"] .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon,
.theme-toggle[aria-pressed="true"] .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

/* ---- Buttons ---- */
.btn {
  display: inline-block; font-family: var(--sans); font-weight: 600;
  padding: 0.7rem 1.25rem; border-radius: var(--radius);
  text-decoration: none; border: 2px solid transparent; cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn--primary { background: var(--navy); color: #fff; }
.btn--primary:hover { background: var(--navy-deep); color: #fff; }
.btn--accent { background: var(--amber); color: var(--ink); }
.btn--accent:hover { background: var(--amber-deep); color: var(--ink); }
.btn--ghost { border-color: rgba(255,255,255,0.5); color: #fff; }
.btn--ghost:hover { border-color: #fff; background: rgba(255,255,255,0.08); color: #fff; }

/* ---- Hero ---- */
.hero {
  background: linear-gradient(160deg, var(--hero-from) 0%, var(--hero-to) 100%);
  color: #fff; padding-block: clamp(4rem, 10vw, 7rem);
  position: relative; overflow: hidden;
}
.hero::after { /* subtle data-grid motif - proof-by-design, very faint */
  content: ""; position: absolute; inset: 0; opacity: 0.06; pointer-events: none;
  background-image: linear-gradient(#fff 1px, transparent 1px), linear-gradient(90deg, #fff 1px, transparent 1px);
  background-size: 40px 40px;
}
.hero > .container { position: relative; z-index: 1; max-width: 820px; }
.hero h1 { color: #fff; }
.hero .accent { color: var(--amber); }
.hero__lead { font-size: clamp(1.05rem, 2.2vw, 1.3rem); color: #dbe7f3; max-width: 52ch; margin-bottom: 2rem; }
.hero__cta { display: flex; gap: 0.9rem; flex-wrap: wrap; }
.hero__wordmark { height: 38px; width: auto; margin-bottom: 2rem; }

/* ---- Domains grid ----
   Fixed column counts (not auto-fit) so every row is evenly filled. Grid fills
   left-to-right, top-to-bottom, so any remainder naturally lands on the bottom
   row. 3 cols on wide, 2 on medium, 1 on narrow. */
.grid { display: grid; gap: var(--gap); }
.grid--domains { grid-template-columns: repeat(3, 1fr); margin-top: 2.5rem; }
@media (max-width: 900px) { .grid--domains { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid--domains { grid-template-columns: 1fr; } }
.domain {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.4rem 1.5rem; border-top: 3px solid var(--navy);
}
.section--alt .domain { background: var(--surface); }
.domain h3 { color: var(--navy); margin-bottom: 0.35rem; }
.domain p { color: var(--ink-soft); font-size: 0.97rem; margin-bottom: 0.8rem; }
.domain .clients { font-size: 0.82rem; color: var(--ink); }
.domain .clients strong { color: var(--amber-deep); font-weight: 700; letter-spacing: 0.03em;
  text-transform: uppercase; font-size: 0.72rem; display: block; margin-bottom: 0.2rem; }

/* ---- Capabilities strip ---- */
.caps { display: flex; flex-wrap: wrap; gap: 0.6rem 0.75rem; margin-top: 1.8rem; list-style: none; padding: 0; }
.caps li {
  font-size: 0.9rem; font-weight: 600; color: var(--navy);
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: 0.45rem 0.95rem;
}
.section--alt .caps li { background: var(--surface); }

/* ---- App card (P0: anonymised, no name/link) ---- */
.appcard {
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 0; margin-top: 2.5rem;
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  background: var(--surface);
}
@media (max-width: 720px) { .appcard { grid-template-columns: 1fr; } }
.appcard__shot {
  background: linear-gradient(140deg, var(--navy) 0%, var(--navy-deep) 100%);
  min-height: 240px; display: grid; place-items: center; padding: 1.5rem;
}
.appcard__shot svg { width: 100%; height: auto; max-width: 360px; }
.appcard__body { padding: 1.75rem; }
.appcard__body h3 { color: var(--navy); }
.appcard__tag {
  display: inline-block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--amber-deep); margin-bottom: 0.6rem;
}

/* ---- Contact ---- */
.contact { text-align: center; }
.contact .btn { margin-top: 0.5rem; }
.contact__email { font-size: 1.1rem; }

/* ---- Contact form ---- */
.contact-form {
  max-width: 640px; margin: 2rem auto 0; text-align: left;
  display: flex; flex-direction: column; gap: 1rem;
}
.contact-form__row { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .contact-form__row { grid-template-columns: 1fr; } }
.contact-form label { display: flex; flex-direction: column; gap: 0.35rem; }
.contact-form label > span { font-family: var(--sans); font-size: 0.9rem; color: var(--ink-soft); }
.contact-form input, .contact-form textarea {
  font: inherit; font-family: var(--sans);
  padding: 0.6rem 0.75rem; border: 1px solid var(--line); border-radius: 6px;
  background: var(--surface); color: var(--ink); width: 100%; box-sizing: border-box;
}
.contact-form textarea { resize: vertical; }
.contact-form input:focus, .contact-form textarea:focus {
  outline: 2px solid var(--amber); outline-offset: 1px; border-color: var(--amber);
}
/* Honeypot: visually + AT hidden, but present in the DOM for bots. */
.contact-form__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.contact-form__actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.contact-form__status { margin: 0; font-family: var(--sans); font-size: 0.9rem; color: var(--ink-soft); }

/* ---- Footer ---- */
.site-footer {
  background: var(--navy-deep); color: #cdddec; padding-block: 2.5rem; font-size: 0.9rem;
}
.site-footer .container { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; }
.site-footer a { color: #fff; }
.site-footer img { height: 26px; opacity: 0.95; }

/* ---- a11y ---- */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
a:focus-visible, .btn:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
