/* ==========================================================================
   recognyte.com — styles.css
   Design system v2 (27 Oct): film-first hero, deep-ink grounds, pictogram
   product cards. All tokens on :root; no frameworks, no build step.
   ========================================================================== */

:root {
  /* Colour tokens */
  --ink:   #16233A;  /* text on light grounds */
  --ink0:  #0D1726;  /* deep ground: hero scrim base, story band, footer */
  --navy:  #1B355D;  /* primary buttons, brand accents */
  --dark:  #1A4474;  /* secondary navy surface */
  --teal:  #0C98A9;  /* functional accent: underlines, focus, pictograms, data */
  --slate: #5B7693;  /* secondary text on light */
  --mist:  #8FA4C0;  /* secondary text on dark */
  --paper: #F5F7FA;  /* alternate section ground */
  --line:  #C4D3E2;  /* rules and borders */
  --white: #FFFFFF;

  /* Type */
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans:  "Montserrat", "Helvetica Neue", Helvetica, Arial, sans-serif;

  --t-caption: 0.875rem;
  --t-body:    1.0625rem;
  --t-lead:    1.3125rem;
  --t-h3:      1.6875rem;
  --t-h2:      2.125rem;

  --s-1: 8px;  --s-2: 16px; --s-3: 24px; --s-4: 32px;
  --s-5: 48px; --s-6: 64px; --s-7: 88px; --s-8: 112px;

  --radius: 6px;
  --wrap: 1200px;

  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

html { scroll-padding-top: calc(70px + env(safe-area-inset-top, 0px)); scroll-behavior: smooth; }
*, *::before, *::after { box-sizing: inherit; }

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--t-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed; inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  background: var(--white); z-index: 60;
}

img, svg, video { max-width: 100%; height: auto; display: block; }

/* ---------- Typography ---------- */

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 620;
  line-height: 1.12;
  margin: 0;
  letter-spacing: -0.005em;
}
h1 { font-size: clamp(2.25rem, 5vw, 3.75rem); line-height: 1.06; }
h2 { font-size: var(--t-h2); }
h3 { font-size: var(--t-h3); }

p { margin: 0; max-width: 72ch; }
.lead { font-size: var(--t-lead); line-height: 1.6; }
.kicker { font-size: var(--t-caption); font-weight: 600; color: var(--slate); letter-spacing: 0.02em; }
.num { font-variant-numeric: lining-nums tabular-nums; }

/* ---------- Links, buttons, focus ---------- */

a { color: inherit; }

.textlink {
  color: var(--ink); font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--teal);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}
.textlink:hover { text-decoration-thickness: 3px; }

.btn {
  display: inline-block; font-family: var(--sans);
  font-size: 1rem; font-weight: 600; line-height: 1;
  padding: 15px 26px; border-radius: var(--radius);
  border: 1px solid transparent; text-decoration: none; cursor: pointer;
}
.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: var(--dark); }
.btn-on-navy { background: var(--white); color: var(--navy); }
.btn-on-navy:hover { background: var(--paper); }
.btn-outline { background: transparent; color: var(--navy); border-color: var(--navy); padding: 12px 22px; font-size: 0.9375rem; }
.btn-outline:hover { background: var(--navy); color: var(--white); }

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

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--navy); color: var(--white);
  padding: 10px 16px; z-index: 100; font-weight: 600; text-decoration: none;
}
.skip-link:focus { left: 12px; top: calc(12px + env(safe-area-inset-top, 0px)); }

/* ---------- Layout ---------- */

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--s-4); }
.section { padding-block: var(--s-8); }
.ground-paper { background: var(--paper); }

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; gap: var(--s-4);
  padding-block: 16px;
  transition: padding-block 200ms ease-out;
}
.site-header.is-compact .wrap { padding-block: 9px; }
.wordmark { display: inline-flex; align-items: center; }
.wordmark img { height: 25px; width: auto; }

.site-nav { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3) var(--s-4); }
.site-nav a { font-size: 0.9375rem; font-weight: 600; text-decoration: none; }
.site-nav a:not(.btn):hover { text-decoration: underline; text-decoration-color: var(--teal); text-decoration-thickness: 2px; text-underline-offset: 4px; }

/* Mobile menu: the hamburger only exists below 760px; without JS the nav
   simply stays as the wrapped desktop row, so nothing is ever unreachable. */
.nav-toggle {
  font: inherit;
  display: none; margin-left: auto;
  width: 44px; height: 44px; padding: 0;
  background: none; border: 0; cursor: pointer;
  align-items: center; justify-content: center;
}
.nav-toggle-box { position: relative; display: block; width: 22px; height: 16px; }
.nav-toggle-box span {
  position: absolute; left: 0; width: 100%; height: 2px;
  background: var(--navy); border-radius: 2px;
  transition: transform 180ms ease-out, opacity 180ms ease-out, top 180ms ease-out;
}
.nav-toggle-box span:nth-child(1) { top: 0; }
.nav-toggle-box span:nth-child(2) { top: 7px; }
.nav-toggle-box span:nth-child(3) { top: 14px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-box span:nth-child(1) { top: 7px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-box span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-box span:nth-child(3) { top: 7px; transform: rotate(-45deg); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

@media (max-width: 760px) {
  html.js .nav-toggle { display: inline-flex; }
  html.js .site-nav {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    margin-left: 0; padding: var(--s-2) var(--s-4) var(--s-4);
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--white); border-bottom: 1px solid var(--line);
    box-shadow: 0 16px 28px rgba(13, 23, 38, 0.12);
  }
  html.js .site-nav.is-open { display: flex; }
  html.js .site-nav a:not(.btn) {
    padding: 14px 2px; font-size: 1.0625rem;
    border-bottom: 1px solid var(--paper);
  }
  html.js .site-nav .btn { align-self: flex-start; margin-top: var(--s-3); }
}

/* ---------- Hero: the title lives on the film ---------- */

.hero {
  position: relative;
  min-height: clamp(460px, 64vh, 680px);
  display: grid; align-items: end;
  overflow: hidden;
  background: var(--ink0);
  color: var(--white);
}
.hero-media { position: absolute; inset: 0; }
.hero-media .film-poster,
.hero-media video {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
}
/* Legibility scrim — bottom-weighted, where the title sits */
.hero-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(to top,
    rgba(13, 23, 38, 0.86) 0%,
    rgba(13, 23, 38, 0.38) 46%,
    rgba(13, 23, 38, 0.05) 100%);
}
.hero .wrap { position: relative; z-index: 1; width: 100%; padding-block: var(--s-6) var(--s-5); }
.hero h1 { max-width: 20ch; }
.film-note { position: absolute; right: 14px; top: 12px; z-index: 1; font-size: 0.8125rem; color: var(--mist); }

/* The page's one orchestrated motion */
.hero h1 { opacity: 0; transform: translateY(14px); }
.hero.is-ready h1 { opacity: 1; transform: none; transition: opacity 520ms ease-out 80ms, transform 520ms ease-out 80ms; }

/* ---------- Sub-line strip beneath the film ---------- */

.subline .wrap { padding-block: var(--s-5); }
.subline .lead { color: var(--slate); max-width: 64ch; }

/* ---------- Proof: stats + register ---------- */


.proof-inner { display: grid; gap: var(--s-5); justify-items: center; text-align: center; padding-block: var(--s-6); }
.stat-row { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-4) clamp(32px, 6vw, 96px); }
.stat { flex: 0 1 250px; min-width: 0; display: grid; gap: 6px; justify-items: center; }
.stat-icon { width: 34px; height: 34px; margin-bottom: 4px; }
.stat-figure {
  font-family: var(--serif);
  font-size: clamp(2rem, 3.6vw, 2.875rem);
  font-weight: 620; line-height: 1;
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--navy);
}
.stat-label { font-size: 0.9375rem; color: var(--slate); text-align: center; max-width: 20ch; }
.proof-line { font-size: 1.0625rem; font-weight: 600; margin-top: var(--s-4); }
.logo-marquee {
  width: 100%; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.logo-track {
  display: flex; width: max-content;
  animation: logo-scroll 34s linear infinite;
}
.logo-marquee:hover .logo-track { animation-play-state: paused; }
.logo-set { display: flex; align-items: center; gap: var(--s-7); padding-right: var(--s-7); }
.logo-set img { height: 32px; width: auto; filter: grayscale(1) brightness(0.55); opacity: 0.8; }
@keyframes logo-scroll { to { transform: translateX(-50%); } }

/* product stats rise in, staggered, then count up */
.pitch-strip .stat-block { opacity: 0; transform: translateY(10px); }
.pitch-strip.is-in .stat-block { opacity: 1; transform: none; transition: opacity 360ms ease-out, transform 360ms ease-out; }
.pitch-strip.is-in .stat-block:nth-child(2) { transition-delay: 130ms; }
.pitch-strip.is-in .stat-block:nth-child(3) { transition-delay: 260ms; }

.reveal { opacity: 0; transform: translateY(8px); }
.reveal.is-in { opacity: 1; transform: none; transition: opacity 220ms ease-out, transform 220ms ease-out; }

@media (min-width: 720px) { .stat-row { flex-wrap: nowrap; } }

/* ---------- Products: pitch sections — photo, horizontal stats, icon rows ---------- */

.products-intro .wrap { padding-block: var(--s-7) var(--s-5); display: grid; gap: var(--s-2); }
.products-intro p { max-width: 62ch; color: var(--slate); }

.pitch .wrap {
  padding-block: var(--s-7);
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: var(--s-5) var(--s-6);
  align-items: center;
}

@media (max-width: 1120px) {
  .pitch .wrap { grid-template-columns: 1fr; gap: var(--s-5); }
}

/* below 1120px the lead takes its own row; stats + photo keep their row */
.pitch-side {
  display: flex;
  gap: var(--s-5);
  align-items: stretch;
  justify-content: flex-end;
}
.pitch-side .pitch-strip { flex: 0 0 auto; align-content: center; }
.pitch-side .panel-cap { max-width: 18ch; }
.pitch-visual { flex: 1 1 auto; min-width: 0; display: grid; gap: var(--s-3); }
.pitch-visual .caps { max-width: none; margin-top: 0; }
.flip .pitch-side { flex-direction: row-reverse; justify-content: flex-start; }

.pitch-lead { display: grid; gap: var(--s-2); justify-items: start; }
.pitch-rule { width: 28px; height: 3px; background: var(--teal); }
.pitch-mark { display: flex; align-items: center; gap: 14px; }
.pitch-mark img { height: 44px; width: 44px; border-radius: 8px; border: 1px solid var(--line); background: var(--white); object-fit: cover; }
.pitch-name {
  font-family: var(--sans); font-weight: 700;
  font-size: clamp(1.5rem, 2.4vw, 1.875rem);
  letter-spacing: -0.01em; line-height: 1.1;
}
.pitch-for { display: grid; gap: 2px; }
.pitch-for .label { font-size: var(--t-caption); color: var(--slate); font-weight: 600; }
.pitch-for .value { font-weight: 700; }
.pitch-lead .narrative { max-width: 56ch; }
.pitch-lead .textlink { margin-top: var(--s-1); }

.pitch-media {
  position: relative; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line);
  min-height: 340px;
}
.pitch-media img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(0.55) contrast(1.02);
}
.pitch-media::after {
  content: ""; position: absolute; inset: 0;
  background: rgba(27, 53, 93, 0.22);
}

.pitch-strip {
  display: grid; gap: var(--s-4);
  justify-items: start;
}
.strip-stats { display: grid; gap: var(--s-4); }
.stat-block { display: grid; gap: 3px; }
.stat-block .panel-num {
  font-family: var(--serif);
  font-size: clamp(1.875rem, 2.8vw, 2.375rem);
  font-weight: 620; line-height: 1;
  color: var(--navy);
  font-variant-numeric: lining-nums tabular-nums;
}
.stat-block .panel-cap { font-size: 0.9375rem; color: var(--slate); max-width: 22ch; }

.caps { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: var(--s-1); max-width: 52ch; }
.cap { display: grid; grid-template-columns: 24px 1fr; gap: 12px; align-items: start; font-size: 0.9375rem; line-height: 1.55; }
.cap svg { width: 22px; height: 22px; margin-top: 2px; }

/* ---------- Constellation divider ---------- */

.rule-constellation { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--s-4); }
.rule-constellation svg { display: block; width: 100%; height: auto; }

/* ---------- Our story: deep ink, city silhouette ---------- */

.story { position: relative; background: var(--ink0); color: var(--white); overflow: hidden; }
.story .wrap { max-width: 880px; position: relative; z-index: 1; }
.story-inner { display: grid; gap: var(--s-3); }
.story .kicker { color: var(--mist); }
.story-text { font-family: var(--serif); font-weight: 620; font-size: var(--t-lead); line-height: 1.6; max-width: 60ch; }
.story .textlink { color: var(--white); justify-self: start; }
.story-skyline { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: auto; opacity: 0.5; }

/* ---------- Closing: translucent panel on ink ---------- */

.closing { background: var(--ink0); color: var(--white); }
.closing .wrap { padding-block: var(--s-7); }
.closing-panel {
  margin: 0 auto; max-width: 720px;
  display: grid; gap: var(--s-3); justify-items: center; text-align: center;
  background: rgba(255, 255, 255, 0.06);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(143, 164, 192, 0.25);
  border-radius: var(--radius);
  padding: var(--s-6) var(--s-5);
}
.closing-panel p { max-width: 48ch; color: var(--mist); }

/* ---------- Footer ---------- */

.site-footer { background: var(--ink0); color: var(--white); }
.site-footer .wrap {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--s-3) var(--s-4); padding-block: var(--s-4);
  font-size: 0.875rem;
}
.footer-brand img { height: 22px; width: auto; }
.footer-copy { color: var(--mist); }
.footer-links { display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-4); }
.footer-links a { color: var(--white); text-decoration: none; }
.footer-links a:hover { text-decoration: underline; text-decoration-color: var(--teal); text-decoration-thickness: 2px; text-underline-offset: 4px; }

/* ---------- Stub pages ---------- */

.stub-main { min-height: 52vh; display: grid; align-items: center; }
.stub-inner { display: grid; gap: var(--s-3); justify-items: start; }

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  .section { padding-block: var(--s-7); }
  .hero { min-height: 56vh; }
}

@media (max-width: 720px) {
  .pitch-side, .flip .pitch-side { flex-wrap: wrap; flex-direction: row; justify-content: flex-start; }
  .pitch-visual { flex: 1 1 100%; }
  .pitch-media { min-height: 0; }
  .pitch-media img { position: static; height: auto; aspect-ratio: 3 / 2; }
}

@media (max-width: 560px) {
  .wrap { padding-inline: var(--s-3); }
  .logo-row img { height: 26px; }
}

/* ---------- Motion preference ----------
   A tiny inline script in each page's <head> reads the saved choice
   (localStorage "recognyte-motion") before first paint and puts exactly one
   of .motion-on / .motion-off on <html>; with no saved choice it follows the
   OS prefers-reduced-motion setting. site.js renders the on-page toggle and
   flips the classes live. The media query below is only the no-JS fallback,
   so JS-off visitors with reduce-motion set still get the calm page. */

html.motion-off { scroll-behavior: auto; }
html.motion-off .hero h1,
html.motion-off .reveal,
html.motion-off .pitch-strip .stat-block { opacity: 1; transform: none; transition: none; }
html.motion-off .logo-track { animation: none !important; flex-wrap: wrap; justify-content: center; width: auto; }
html.motion-off .logo-set { flex-wrap: wrap; justify-content: center; padding-right: 0; row-gap: var(--s-3); }
html.motion-off .logo-set-dup { display: none; }
html.motion-off * { animation: none !important; }

@media (prefers-reduced-motion: reduce) {
  html:not(.motion-on) { scroll-behavior: auto; }
  html:not(.motion-on) .hero h1,
  html:not(.motion-on) .reveal,
  html:not(.motion-on) .pitch-strip .stat-block { opacity: 1; transform: none; transition: none; }
  html:not(.motion-on) .logo-track { animation: none !important; flex-wrap: wrap; justify-content: center; width: auto; }
  html:not(.motion-on) .logo-set { flex-wrap: wrap; justify-content: center; padding-right: 0; row-gap: var(--s-3); }
  html:not(.motion-on) .logo-set-dup { display: none; }
  html:not(.motion-on) * { animation: none !important; }
}

/* ---------- Motion toggle pill (rendered by site.js) ---------- */

.motion-toggle {
  position: fixed; right: 14px; bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  z-index: 70;
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--sans); font-size: 0.8125rem; font-weight: 600;
  color: var(--ink); background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 9px 14px; cursor: pointer;
  box-shadow: 0 4px 14px rgba(13, 23, 38, 0.14);
}
.motion-toggle:hover { border-color: var(--teal); }
.motion-toggle .mt-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--line);
}
html.motion-on .motion-toggle .mt-dot { background: var(--teal); }

/* ---------- Hero film: blocked-autoplay fallback (rendered by site.js) ---------- */

.hero-play {
  position: absolute; right: 14px; bottom: 14px; z-index: 2;
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--sans); font-size: 0.8125rem; font-weight: 600;
  color: var(--white); background: rgba(13, 23, 38, 0.55);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  border: 1px solid rgba(143, 164, 192, 0.45); border-radius: 999px;
  padding: 9px 14px; cursor: pointer;
}
.hero-play:hover { border-color: var(--teal); }
.hero-play svg { width: 12px; height: 12px; }
