@import url('tokens.css');
@import url('../fonts/fonts.css');

/* ==========================================================================
   QSnxt* — design system
   Positioning: "AI different." Apple's Think Different playbook, applied to a
   sovereign AI company: restraint over feature lists, one idea per screen,
   one confident sans (IBM Plex Sans, matching the QS Ecosystem) for the
   argument, mono for the record, and a signature lockup that closes every
   page the way an ad closes on the logo.
   ========================================================================== */

/* Brand values come from ../../../../shared/tokens.css (imported above as
   tokens.css — see the Dockerfile, which copies it in next to this file).
   Names below are this site's own vocabulary; only the app-specific ones
   carry a literal value. */
:root {
  /* Surfaces */
  --paper:      var(--qs-paper);
  --sand:       var(--qs-paper-alt);
  --ink:        var(--qs-ink);
  --ink-soft:   #1c1a17;

  /* Text */
  --text:       var(--qs-text);
  --text-muted: var(--qs-text-body);
  --text-faint: var(--qs-text-quiet);
  --on-ink:         var(--qs-on-ink);
  --on-ink-muted:   #b8b0a1;
  --on-ink-faint:   var(--qs-on-ink-quiet);

  /* Rules */
  --line:       var(--qs-hairline);
  --line-soft:  #e8e3d6;
  --line-faint: var(--qs-hairline-faint);
  --line-ink:   var(--qs-ink);
  --line-on-ink: #34302a;

  /* QS Ecosystem palette. The house accent doubles as QSai/manufacturing's
     line color — teal both ways, on purpose. Education and p3rf each carry
     their own dedicated accent below. The historical `.blue` / `.green`
     modifier classes in the markup stay as-is; only what they resolve to
     changes (manufacturing → teal, p3rf → blue). */
  --accent:        #4DA49C;
  --accent-light:  #6BC7BC;
  --accent-hover:  #3C8982;
  --accent-strong: #2d736d;
  --color-primary:      var(--accent);
  --color-primary-dark: var(--accent-strong);
  --color-primary-bg:   #eeeee4;

  --coral:       #D85A30;   /* QSnxt Education */
  --coral-light: #F1987A;
  --p3rf:        #0c447c;   /* p3rf.ai — sport */
  --p3rf-light:  #378ADD;

  /* Type — self-hosted, matching qsai.app's fonts */
  --sans:  'IBM Plex Sans', var(--qs-sans-fallback);
  --mono:  'IBM Plex Mono', var(--qs-mono-fallback);

  /* Rhythm */
  --pad-x: clamp(20px, 5vw, 56px);
  --pad-y: clamp(56px, 7vw, 96px);
  --max:   1320px;
}

/* --------------------------------------------------------------- reset -- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* height:auto is load-bearing — the artwork carries width/height attributes so
   the browser can reserve space, and without it the box keeps the attribute
   height while the width shrinks, letterboxing the drawing. */
img, svg, figure { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

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

::selection { background: var(--accent); color: var(--paper); }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--ink); color: var(--on-ink);
  padding: 12px 20px; font-family: var(--mono); font-size: 13px;
}
.skip:focus { left: 8px; top: 8px; }

/* ------------------------------------------------------- bilingual FR/EN --
   Both languages ship in the markup; CSS reveals one. No flash, no fetch,
   and every string is in the document for search engines in both languages. */

[data-lang='fr'] [lang='en'],
[data-lang='en'] [lang='fr'] { display: none; }

/* ------------------------------------------------------------- primitives */

.wrap { max-width: var(--max); margin-inline: auto; padding-inline: var(--pad-x); }
.section { padding-block: var(--pad-y); }
.rule-top { border-top: 1px solid var(--line); }
.rule-bottom { border-bottom: 1px solid var(--line); }
.hairline { border: 0; border-top: 1px solid var(--line); }

.sand { background: var(--sand); }
.dark {
  background: var(--ink);
  color: var(--on-ink);
  --text: var(--on-ink);
  --text-muted: var(--on-ink-muted);
  --text-faint: var(--on-ink-faint);
  --line: var(--line-on-ink);
  --line-soft: var(--line-on-ink);
  --line-faint: var(--line-on-ink);
  --paper: var(--ink);
}

/* Eyebrow — the mono label that files every section into the record */
.eyebrow {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 28px;
}
.eyebrow.accent { color: var(--color-primary-dark); }
.dark .eyebrow.accent { color: var(--accent); }

/* Display type */
.display {
  font-family: var(--sans);
  font-weight: 400;
  font-size: clamp(42px, 6.2vw, 88px);
  line-height: 1.02;
  letter-spacing: -.028em;
  text-wrap: balance;
  max-width: 18ch;
}
h2.title, .title {
  font-family: var(--sans);
  font-weight: 400;
  font-size: clamp(32px, 4.1vw, 54px);
  line-height: 1.08;
  letter-spacing: -.022em;
  text-wrap: balance;
  max-width: 24ch;
}
h3.sub, .sub {
  font-family: var(--sans);
  font-weight: 400;
  font-size: clamp(23px, 2.3vw, 30px);
  line-height: 1.2;
  letter-spacing: -.015em;
}

.lede {
  font-size: clamp(18px, 1.55vw, 21px);
  line-height: 1.62;
  color: var(--text-muted);
  max-width: 62ch;
  text-wrap: pretty;
}
.body { font-size: 17.5px; line-height: 1.68; color: var(--text-muted); max-width: 66ch; }
.body + .body { margin-top: 18px; }
.small { font-size: 15px; line-height: 1.6; color: var(--text-muted); }
.mono {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.mt-s { margin-top: 16px; }  .mt-m { margin-top: 28px; }
.mt-l { margin-top: 48px; }  .mt-xl { margin-top: 72px; }

/* The asterisk is load-bearing: it is the brand's footnote to itself */
.star { color: var(--accent); }

/* QSai lockup */
.qsai sup { font-size: .62em; letter-spacing: .02em; }

/* --------------------------------------------------------------- buttons */

.btn {
  display: inline-block;
  padding: 15px 30px;
  border-radius: 100px;
  font-weight: 500;
  font-size: 16.5px;
  line-height: 1;
  border: 1px solid transparent;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}
.btn-primary { background: var(--color-primary); color: #fffdf8; }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-ghost { border-color: var(--line-faint); color: var(--text); }
.btn-ghost:hover { border-color: var(--text); }
.dark .btn-ghost { border-color: #4a443c; color: var(--on-ink); }
.dark .btn-ghost:hover { border-color: var(--on-ink); }
.btn-sm { padding: 10px 20px; font-size: 15px; }

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* Underlined text link with an accent rule — used to leave for a product */
.link-out {
  display: inline-block;
  font-weight: 500;
  font-size: 16.5px;
  border-bottom: 2px solid var(--color-primary);
  padding-bottom: 2px;
  transition: border-color .18s ease, color .18s ease;
}
.link-out:hover { border-bottom-width: 3px; }
.link-out.blue  { border-color: var(--accent); }
.link-out.green { border-color: var(--p3rf); }
.link-out.coral { border-color: var(--coral); }

/* ----------------------------------------------------------------- chips */

.chip {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .13em;
  text-transform: uppercase;
  padding: 6px 13px;
  border-radius: 100px;
  background: var(--color-primary);
  color: #fffdf8;
  white-space: nowrap;
}
.chip.blue  { background: var(--accent); }
.chip.green { background: var(--p3rf); }
.chip.coral { background: var(--coral); }
.chip.quiet { background: transparent; color: var(--text-faint); border: 1px solid var(--line); }

/* ------------------------------------------------------------------- nav */

.nav {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 253, 248, .92);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--max); margin-inline: auto;
  padding: 16px var(--pad-x);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.brand { display: flex; align-items: baseline; gap: 12px; flex: none; }
.brand-mark {
  font-family: var(--sans); font-weight: 400;
  font-size: 25px; letter-spacing: -.015em; line-height: 1;
}
.brand-tag {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--text-faint);
  padding-left: 12px; border-left: 1px solid var(--line);
}
.nav-links { display: flex; align-items: center; gap: 26px; font-size: 15.5px; }
.nav-links a { padding-block: 4px; border-bottom: 1.5px solid transparent; }
.nav-links a:hover { border-bottom-color: var(--line-faint); }
.nav-links a[aria-current='page'] { border-bottom-color: var(--accent); }

.lang {
  display: flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 12px; letter-spacing: .08em;
  padding-left: 22px; border-left: 1px solid var(--line);
}
.lang button { color: var(--text-faint); transition: color .15s ease; }
.lang button:hover { color: var(--text); }
[data-lang='fr'] .lang button[data-set='fr'],
[data-lang='en'] .lang button[data-set='en'] { color: var(--text); font-weight: 500; }
.lang .sep { color: var(--line-faint); }

.nav-toggle { display: none; }

@media (max-width: 1000px) {
  .brand-tag { display: none; }
  .nav-links { gap: 18px; font-size: 15px; }
  .nav-cta { display: none; }
}
@media (max-width: 780px) {
  .nav-toggle {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  }
  .nav-links {
    position: absolute; inset: 100% 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line);
    padding: 8px var(--pad-x) 24px;
  }
  .nav-links[hidden] { display: none; }
  .nav-links a { padding: 14px 0; border-bottom: 1px solid var(--line-soft); font-size: 18px; }
  .nav-links a[aria-current='page'] { border-bottom-color: var(--accent); }
  .lang { padding-left: 0; border-left: 0; padding-top: 18px; }
}

/* ------------------------------------------------------------------ grid */

.grid { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.grid > * { background: var(--paper); padding: 30px 28px; }
.dark .grid { background: var(--line-on-ink); border-color: var(--line-on-ink); }
.dark .grid > * { background: var(--ink); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

/* Open grid — no boxes, just columns */
.cols { display: grid; gap: clamp(28px, 4vw, 56px); }
.cols-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.cols-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

/* Editorial split: sticky label column + running text */
.split { display: grid; gap: clamp(28px, 4vw, 64px); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .split { grid-template-columns: 300px minmax(0, 1fr); } }
.split-label { position: sticky; top: 108px; align-self: start; }

.step-n {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .16em;
  color: var(--color-primary-dark); margin-bottom: 16px;
}
.dark .step-n { color: var(--accent); }

/* --------------------------------------------------------------- the wall
   Apple ran a wall of portraits. We have no icons to borrow, so the wall is
   made of positions — each tile one thing the company will not compromise. */

.wall { display: grid; gap: 1px; background: var(--line-on-ink); grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.wall-tile {
  background: var(--ink); color: var(--on-ink);
  padding: 34px 30px 30px; min-height: 208px;
  display: flex; flex-direction: column; justify-content: space-between;
  transition: background-color .22s ease, color .22s ease;
}
.wall-tile:hover { background: var(--on-ink); color: var(--ink); }
.wall-tile .n {
  font-family: var(--mono); font-size: 11px; letter-spacing: .16em;
  color: var(--on-ink-faint); margin-bottom: 22px;
}
.wall-tile:hover .n { color: var(--color-primary-dark); }
.wall-tile .t {
  font-family: var(--sans); font-weight: 400;
  font-size: clamp(21px, 2vw, 26px); line-height: 1.18; letter-spacing: -.015em;
}

/* ------------------------------------------------------------- manifesto */

.manifesto {
  font-family: var(--sans);
  font-weight: 400;
  font-size: clamp(27px, 3.5vw, 46px);
  line-height: 1.26;
  letter-spacing: -.02em;
  max-width: 24ch;
  text-wrap: pretty;
}
.manifesto p + p { margin-top: 1.05em; }
.manifesto em { font-style: italic; color: var(--accent); }
.manifesto .turn { display: block; margin-top: 1.3em; }

/* The manifesto page runs the piece on its own. A narrow column parked on the
   left of a wide screen reads as unfinished; centred, the same column reads as
   a statement. Text stays flush left inside it. */
.measure { max-width: 820px; margin-inline: auto; }
.measure .manifesto { max-width: none; }

/* The closing lockup — how every Think Different spot ended */
.signature { display: flex; flex-wrap: wrap; align-items: baseline; gap: 18px; }
.signature .mark { font-family: var(--sans); font-size: clamp(30px, 3.6vw, 46px); letter-spacing: -.02em; }
.signature .claim {
  font-family: var(--mono); font-size: clamp(12px, 1.2vw, 15px);
  letter-spacing: .22em; text-transform: uppercase; color: var(--text-faint);
}

/* ---------------------------------------------------------------- record
   The lab's public record: award, field deployment, competition. */

.record { display: grid; gap: 1px; background: var(--line); border-block: 1px solid var(--line); grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.record > article { background: var(--paper); padding: 32px 30px 34px; display: flex; flex-direction: column; }
.record .k { font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--color-primary-dark); margin-bottom: 20px; }
.record .v { font-family: var(--sans); font-size: 25px; line-height: 1.18; letter-spacing: -.015em; margin-bottom: 14px; }
.record .d { font-size: 15.5px; line-height: 1.6; color: var(--text-muted); margin-bottom: 22px; }
.record .link-out { margin-top: auto; align-self: start; font-size: 15px; }

/* ------------------------------------------------------------- fact list */

.facts { border-top: 1px solid var(--line); }
.facts > div {
  display: grid; gap: 4px 32px; grid-template-columns: minmax(0, 1fr);
  padding: 18px 0; border-bottom: 1px solid var(--line);
}
@media (min-width: 640px) { .facts > div { grid-template-columns: 190px minmax(0, 1fr); } }
.facts dt { font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-faint); padding-top: 4px; }
.facts dd { font-size: 17px; }

/* ----------------------------------------------------------------- people */

.people { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); }
.people > div { background: var(--paper); padding: 26px 24px 28px; }
.people .name { font-family: var(--sans); font-size: 21px; letter-spacing: -.01em; line-height: 1.2; }
.people .role { font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-faint); margin-top: 10px; }

/* --------------------------------------------------------------- teasers
   The three lines, announced under the hero. */

.teasers {
  display: grid; gap: 1px; background: var(--line);
  border-top: 1px solid var(--line);
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.teasers > a { background: var(--sand); padding: 26px 26px 24px; transition: background-color .18s ease; }
.teasers > a:hover { background: #ece7d9; }
/* Stacked on small screens, the cards' own inset would push their text out of
   line with the hero above. Drop it and let the 1px gaps read as rules. */
@media (max-width: 700px) { .teasers > a { padding-inline: 0; } }
.teasers .k { font-family: var(--mono); font-size: 10.5px; letter-spacing: .15em; text-transform: uppercase; margin-bottom: 13px; }
.teasers .n { font-family: var(--sans); font-size: 26px; letter-spacing: -.015em; line-height: 1.1; }
.teasers .d { font-size: 15px; line-height: 1.55; color: var(--text-muted); margin-top: 9px; }

/* ------------------------------------------------------------------ line
   A line of business: label column, argument, artwork. */

.line-block { padding-block: clamp(56px, 7vw, 84px); border-bottom: 1px solid var(--line); }
.line-body { display: grid; gap: clamp(28px, 3.5vw, 52px); grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 880px)  { .line-body { grid-template-columns: 290px minmax(0, 1fr); } }
/* Only blocks that actually carry artwork get the third track — otherwise the
   column sits empty and starves the argument of width. */
@media (min-width: 1180px) { .line-body.with-art { grid-template-columns: 290px minmax(0, 1fr) 340px; } }
.line-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 18px; margin-bottom: 12px; }
.line-name { font-family: var(--sans); font-weight: 400; font-size: clamp(34px, 3.6vw, 50px); letter-spacing: -.022em; line-height: 1; }
.line-art { border: 1px solid var(--line); background: var(--sand); }
.dark .line-art { background: #1c1a17; border-color: var(--line-on-ink); }
.line-art svg { width: 100%; height: auto; }
.line-art figcaption {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .13em; text-transform: uppercase;
  color: var(--text-faint); padding: 12px 16px; border-top: 1px solid var(--line);
}

/* ---------------------------------------------------------------- footer */

.footer { background: var(--ink); color: var(--on-ink); padding-block: clamp(48px, 6vw, 72px) 40px; }
.footer a:hover { color: var(--accent); }
.footer-grid { display: grid; gap: 40px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.footer h4 { font-family: var(--mono); font-size: 10.5px; letter-spacing: .17em; text-transform: uppercase; color: var(--on-ink-faint); font-weight: 400; margin-bottom: 16px; }
.footer ul { list-style: none; display: grid; gap: 10px; font-size: 15.5px; }
.footer .small { color: var(--on-ink-muted); max-width: 34ch; }
.footer .brand-mark { font-size: 22px; display: inline-block; margin-bottom: 14px; }
.footer-base {
  margin-top: 56px; padding-top: 26px; border-top: 1px solid var(--line-on-ink);
  display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: baseline; justify-content: space-between;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .15em; text-transform: uppercase; color: var(--on-ink-faint);
}

/* ------------------------------------------------------------------ misc */

.cta-band { padding-block: clamp(64px, 8vw, 104px); }
.contact-lines { display: grid; gap: 14px; font-size: 19px; }
.contact-lines a { border-bottom: 1px solid var(--line-faint); padding-bottom: 2px; }
.contact-lines a:hover { border-bottom-color: var(--accent); }

.note {
  font-family: var(--mono); font-size: 11px; letter-spacing: .1em;
  color: var(--text-faint); line-height: 1.7;
}

/* ------------------------------------------------------------- utilities
   The CSP is `style-src 'self'`, which blocks inline style="..." attributes as
   well as inline <style> blocks. Everything that would have been a one-off
   inline declaration lives here instead. Declared last so a utility beats the
   component default it is overriding (equal specificity, later wins). */

.c-blue   { color: var(--accent); }
.c-green  { color: var(--p3rf); }
.c-coral  { color: var(--coral); }
.c-faint  { color: var(--text-faint); }
.dark .c-coral { color: var(--coral-light); }

.pb-0 { padding-bottom: 0; }
.hero-pad { padding-bottom: clamp(40px, 5vw, 64px); }

.center-screen { min-height: 70vh; display: flex; align-items: center; }
