/* Company Zero public site. Tokens and rules: ../DESIGN.md */

@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/instrument-sans-var.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/ibm-plex-mono-400.woff2") format("woff2");
}
@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/instrument-serif-italic-400.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --zero-paper: #F1EFE7;
  --zero-ink: #111311;
  --graphite: #5B5E58;
  --machine-grey: #A5A8A2;
  --hairline: #D6D4CB;
  --hairline-ink: #2B2D2A;
  --zero-signal: #D7FF38;

  --sans: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;

  --container: 1240px;
  --gutter: clamp(20px, 5vw, 64px);
  --section: clamp(72px, 9vw, 128px);
  --rail: 176px;
  --body-pad: 48px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scrollbar-color: var(--machine-grey) var(--zero-paper);
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--zero-paper);
  color: var(--zero-ink);
  caret-color: var(--zero-ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(17, 19, 17, 0.08);
}

::selection { background: var(--zero-signal); color: var(--zero-ink); }

a { color: inherit; text-underline-offset: 5px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 2px solid var(--zero-ink); outline-offset: 3px; border-radius: 2px; }
.on-ink :focus-visible { outline-color: var(--zero-paper); }

h1, h2, h3 { text-wrap: balance; }
.nowrap { white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
p { text-wrap: pretty; }
[id] { scroll-margin-top: 24px; }

.wrap { max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }

.skip {
  position: absolute; left: -9999px; top: 12px; z-index: 10;
  background: var(--zero-ink); color: var(--zero-paper);
  padding: 10px 14px; text-decoration: none;
}
.skip:focus { left: 12px; }

/* ---------- Logo: Origin lockup ---------- */
.logo { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; white-space: nowrap; }
.logo__xy { font-weight: 600; font-size: 0.9375rem; letter-spacing: 0.02em; }
.logo__x { position: relative; width: 34px; height: 24px; flex: none; }
.logo__x::before, .logo__x::after { content: ""; position: absolute; background: var(--machine-grey); }
.logo__x::before {
  left: 0; right: 0; top: 11.5px; height: 1px;
  -webkit-mask: linear-gradient(90deg, #000 0 36%, transparent 36% 64%, #000 64% 100%);
  mask: linear-gradient(90deg, #000 0 36%, transparent 36% 64%, #000 64% 100%);
}
.logo__x::after {
  top: 0; bottom: 0; left: 16.5px; width: 1px;
  -webkit-mask: linear-gradient(180deg, #000 0 30%, transparent 30% 70%, #000 70% 100%);
  mask: linear-gradient(180deg, #000 0 30%, transparent 30% 70%, #000 70% 100%);
}
.logo__sq { position: absolute; left: 14px; top: 9px; width: 6px; height: 6px; background: var(--zero-signal); }
.logo__word { font-size: 0.8125rem; font-weight: 500; letter-spacing: 0.28em; text-transform: uppercase; }

/* ---------- Header ---------- */
.top { border-bottom: 1px solid var(--hairline); }
.top__bar { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 72px; }
.top__right { display: flex; align-items: center; gap: 32px; }
.nav ul { display: flex; gap: 28px; list-style: none; margin: 0; padding: 0; }
.nav a { display: inline-block; padding-block: 10px; font-size: 0.9375rem; text-decoration: none; }
.nav a:hover { text-decoration: underline; }

.lang { display: flex; gap: 2px; font-family: var(--mono); font-size: 0.75rem; }
.lang a {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; min-height: 40px; padding: 0 8px;
  color: var(--graphite); text-decoration: none;
  border: 1px solid transparent; border-radius: 2px;
}
.lang a[aria-current="page"] { color: var(--zero-ink); border-color: var(--zero-ink); }
.lang a:hover { color: var(--zero-ink); }
.on-ink .lang a { color: var(--machine-grey); }
.on-ink .lang a[aria-current="page"], .on-ink .lang a:hover { color: var(--zero-paper); border-color: var(--zero-paper); }

/* ---------- Section frame with the vertical axis ---------- */
.sec { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); }
.sec__rail { position: relative; border-right: 1px solid var(--machine-grey); }
.sec__body { min-width: 0; padding-left: var(--body-pad); }
.sec--line { border-top: 1px solid var(--hairline); }
.sec--line .sec__body, .sec--line .sec__rail { padding-block: var(--section); }

.marker {
  position: sticky; top: 28px;
  display: inline-flex; flex-direction: column; gap: 7px;
  font-family: var(--mono); font-size: 0.75rem; line-height: 1.2;
  color: var(--graphite); text-decoration: none;
  padding: 4px 0;
}
.marker i { display: block; width: 14px; height: 1px; background: currentColor; }
.marker b { font-weight: 400; font-size: 0.6875rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--zero-ink); }
.marker:hover b { text-decoration: underline; text-underline-offset: 4px; }
.on-ink .marker { color: var(--machine-grey); }
.on-ink .marker b { color: var(--zero-paper); }

/* Active marker (set by rail.js): the one place Signal appears on the rail */
.marker[aria-current="true"] { color: var(--zero-ink); }
.marker[aria-current="true"] b { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.marker[aria-current="true"] i { height: 3px; background: var(--zero-signal); outline: 1px solid var(--zero-ink); }
.on-ink .marker[aria-current="true"] { color: var(--zero-paper); }
.on-ink .marker[aria-current="true"] i { outline-color: var(--zero-paper); }

/* ---------- Buttons and links ---------- */
.btn {
  display: inline-flex; align-items: center; min-height: 48px; padding: 12px 22px; line-height: 1.25;
  background: var(--zero-ink); color: var(--zero-paper);
  border-radius: 3px; font-weight: 500; font-size: 1rem; text-decoration: none;
  transition: background-color 0.15s ease-out;
}
.btn:hover { background: #000; }
.btn--on-ink { background: var(--zero-paper); color: var(--zero-ink); }
.btn--on-ink:hover { background: #fff; }
.textlink { display: inline-block; padding-block: 12px; font-weight: 500; text-underline-offset: 6px; }

/* ---------- Hero ---------- */
/* The axis starts at the hero's 0,0 (DESIGN.md → Layout): no rail line above the origin */
.hero .sec__rail { border-right-color: transparent; }
.hero .sec__body { padding-top: clamp(56px, 8vw, 112px); padding-bottom: clamp(64px, 8vw, 104px); }
.hero h1, .e404 h1, .doc h1 {
  margin: 0 0 28px; max-width: 14ch;
  font-size: clamp(2.75rem, 1.35rem + 5.4vw, 5.75rem);
  line-height: 0.98; letter-spacing: -0.032em; font-weight: 500;
}
.lede { margin: 0 0 36px; max-width: 35rem; font-size: clamp(1.125rem, 1rem + 0.45vw, 1.3125rem); line-height: 1.5; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }

.hero__trace { position: relative; margin: clamp(64px, 8vw, 104px) 0 0 calc(-1 * var(--body-pad)); }
.hero__trace::before {
  content: ""; position: absolute; left: -1px; top: 7px; width: 1px;
  bottom: calc(-1 * clamp(64px, 8vw, 104px)); background: var(--machine-grey);
}
.hero__origin {
  position: absolute; right: 100%; top: -2px; margin-right: 14px;
  font-family: var(--mono); font-size: 0.75rem; color: var(--graphite);
}

/* 404 page */
/* « Confidentialité » must fit the 280px column at 320px. */
.doc h1 { font-size: clamp(2.5rem, 1.35rem + 5.4vw, 5.75rem); }
.e404, .doc { padding-block: clamp(56px, 8vw, 112px) clamp(64px, 8vw, 104px); }
/* Privacy pages */
.doc h2 { margin: 40px 0 8px; font-size: 1.375rem; line-height: 1.2; letter-spacing: -0.01em; font-weight: 500; }
.doc p { margin: 0; max-width: 40rem; color: var(--graphite); }
.doc p.doc__date { margin-top: 48px; font-family: var(--mono); font-size: 0.75rem; }
.e404__en { margin-top: clamp(48px, 6vw, 72px); padding-top: 20px; border-top: 1px solid var(--hairline); max-width: 35rem; }
.e404__en p { margin: 0; color: var(--graphite); }

/* ---------- Trace: tool, AI step, person ---------- */
.trace {
  --tgap: 32px;
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--tgap);
}
.trace > li { position: relative; padding-top: 36px; min-width: 0; }
.trace > li::before {
  content: ""; position: absolute; top: 7px; left: 0; right: calc(-1 * var(--tgap));
  height: 1px; background: var(--machine-grey);
}
.trace > li:nth-child(2)::before { top: 6.5px; height: 2px; background: var(--zero-ink); }
.trace > li:last-child::before { display: none; }

.mk { position: absolute; z-index: 1; display: block; }
.mk--tool { top: 3px; left: 0; width: 9px; height: 9px; border-radius: 50%; background: var(--graphite); }
.mk--ai { top: 0; left: 0; width: 15px; height: 15px; border-radius: 50%; border: 2px solid var(--zero-ink); background: var(--zero-signal); }
.mk--person { top: 2px; left: 0; width: 11px; height: 11px; background: var(--zero-ink); }
.hero__trace .mk--tool { left: -5px; background: var(--zero-ink); }

.trace__k { display: block; margin-bottom: 6px; font-family: var(--mono); font-size: 0.75rem; color: var(--graphite); }
.trace__v { display: block; font-size: 1rem; line-height: 1.45; text-wrap: pretty; }
.trace--hero .trace__v { text-wrap: balance; max-width: 18ch; font-size: 1.125rem; font-weight: 500; }
.trace--method h3 { margin: 0 0 10px; font-size: 1.375rem; line-height: 1.2; letter-spacing: -0.01em; font-weight: 500; }
.trace--method p { margin: 0; max-width: 32ch; color: var(--graphite); }

@media (prefers-reduced-motion: no-preference) {
  .trace--hero > li::before { transform-origin: left center; animation: cz-draw 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both; }
  .trace--hero > li:nth-child(2)::before { animation-duration: 0.75s; animation-delay: 1.25s; }
  .trace--hero > li:nth-child(2) .mk { animation: cz-pop 0.35s cubic-bezier(0.16, 1, 0.3, 1) 1s both; }
  .trace--hero > li:nth-child(3) .mk { animation: cz-pop 0.3s cubic-bezier(0.16, 1, 0.3, 1) 1.95s both; }
}
@keyframes cz-draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes cz-draw-y { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes cz-pop { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---------- Section headings ---------- */
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding-bottom: 18px; border-bottom: 1px solid var(--zero-ink); margin-bottom: 28px; }
.head h2 {
  margin: 0; max-width: 17ch;
  font-size: clamp(2rem, 1.3rem + 2.5vw, 3.25rem);
  line-height: 1.04; letter-spacing: -0.024em; font-weight: 500;
}
.head__note { flex: none; margin: 0 0 6px; font-family: var(--mono); font-size: 0.75rem; color: var(--graphite); }
.intro { margin: 0 0 clamp(40px, 5vw, 56px); max-width: 38rem; color: var(--graphite); }

/* Signals */
.signals { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.signals h3 { margin: 0 0 8px; font-size: 1.375rem; line-height: 1.25; letter-spacing: -0.01em; font-weight: 500; }
.signals p { margin: 0; max-width: 32ch; color: var(--graphite); }
.signals p + p { margin-top: 10px; }
.signals p strong { font-weight: 500; color: var(--zero-ink); }
.offer__actions { margin-top: clamp(36px, 4.5vw, 52px); }

/* Systems */
.systems { list-style: none; margin: 0; padding: 0; }
.system {
  display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: 24px 48px; padding-block: 36px; border-top: 1px solid var(--hairline);
}
.system:first-child { border-top: 0; padding-top: 8px; }
.system h3 { margin: 0 0 10px; font-size: 1.375rem; line-height: 1.2; letter-spacing: -0.012em; font-weight: 500; }
.system__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 14px; }
.system__sector { font-family: var(--mono); font-size: 0.75rem; color: var(--graphite); }
.system__today { margin: 0; max-width: 34ch; font-size: 1rem; color: var(--graphite); }
.system__today strong { font-weight: 500; color: var(--zero-ink); }
.tag {
  display: inline-block; padding: 2px 10px;
  font-family: var(--mono); font-size: 0.75rem; color: var(--graphite);
  border: 1px solid var(--graphite); border-radius: 999px;
}
.system .trace { --tgap: 28px; align-self: start; margin-top: 4px; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.3fr) minmax(0, 0.85fr); }

/* Questions */
.faq { max-width: none; }
.faq details { border-top: 1px solid var(--hairline); }
.faq details:first-child { border-top: 0; }
.faq details:last-child { border-bottom: 1px solid var(--hairline); }
.faq summary {
  display: flex; justify-content: space-between; align-items: baseline; gap: 24px;
  padding: 20px 0; cursor: pointer; list-style: none;
  font-size: 1.1875rem; line-height: 1.35; font-weight: 500; text-wrap: balance;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; content: "+" / ""; flex: none; font-family: var(--mono); font-size: 1.25rem; color: var(--graphite); }
.faq details[open] summary::after { content: "\2212"; content: "\2212" / ""; }
.faq summary:hover { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }
.faq p { margin: 0 0 24px; max-width: 40rem; color: var(--graphite); }

/* ---------- Contact and footer ---------- */
.contact { background: var(--zero-ink); color: var(--zero-paper); }
.contact .sec__rail { border-right-color: var(--machine-grey); }
.contact .sec__body, .contact .sec__rail { padding-block: clamp(80px, 10vw, 144px); }
.contact h2 {
  margin: 0 0 24px; max-width: 18ch;
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: clamp(2.375rem, 1.2rem + 3.8vw, 4.5rem); line-height: 1.04; letter-spacing: -0.01em;
}
.contact__text { margin: 0 0 36px; max-width: 32rem; font-size: 1.125rem; color: var(--machine-grey); }
.contact__alt { margin: 16px 0 0; font-size: 0.9375rem; color: var(--machine-grey); }
.contact__addr { color: var(--zero-paper); user-select: all; -webkit-user-select: all; }
/* The same address line under the Offer button, on the light ground. */
.offer__alt { color: var(--graphite); }
.offer__alt .contact__addr { color: var(--zero-ink); }
.social { margin: 44px 0 0; max-width: 32rem; color: var(--machine-grey); font-size: 0.9375rem; line-height: 1.55; }
.social a { padding-block: 10px; font-weight: 500; color: var(--zero-paper); }

.foot { background: var(--zero-ink); color: var(--machine-grey); border-top: 1px solid var(--hairline-ink); }
.foot__grid { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 32px 48px; padding-block: 40px 48px; }
.statement { margin: 0; max-width: 34ch; font-size: 1.25rem; line-height: 1.3; letter-spacing: -0.01em; font-weight: 500; }
.statement span { display: block; }
.statement span + span { color: var(--zero-paper); }
.foot__meta { display: flex; flex-direction: column; align-items: flex-end; gap: 14px; font-size: 0.875rem; }
.foot__meta p { margin: 0; }
.foot .logo { color: var(--zero-paper); }

/* ---------- Responsive ---------- */
@media (max-width: 1099px) {
  .sec { grid-template-columns: minmax(0, 1fr); }
  .sec__rail { display: none; }
  .sec__body { padding-left: 0; }
  .hero { --hero-pad: clamp(22px, 4vw, 48px); }
  .hero .sec__body { padding-left: var(--hero-pad); border-left: 1px solid transparent; }
  .hero__trace::before { left: 0; }
  .hero__trace { margin-left: calc(-1 * var(--hero-pad) - 1px); }
  .hero__trace .mk--tool { left: -4px; }
  .hero__origin { right: auto; left: 14px; top: -26px; margin-right: 0; }
  .system { grid-template-columns: minmax(0, 1fr); }
  .signals { grid-template-columns: minmax(0, 1fr); gap: 28px; }
}

/* Five nav links plus the language switch need about 960px; below that only Contact stays */
@media (max-width: 959px) {
  .nav li:not(.nav__keep) { display: none; }
}

@media (max-width: 759px) {
  .top__right { gap: 12px; }
  .top .logo__xy, .top .logo__x { display: none; }

  .head { flex-direction: column; align-items: flex-start; gap: 8px; }

  /* Vertical trace: every marker and line centred on x = 7.5px */
  .trace, .system .trace { grid-template-columns: minmax(0, 1fr); }
  .trace > li { padding: 0 0 26px 34px; }
  .trace > li:last-child { padding-bottom: 0; }
  .trace > li::before { top: 9px; bottom: -9px; left: 7px; right: auto; width: 1px; height: auto; }
  .trace > li:nth-child(2)::before { top: 9px; left: 6.5px; width: 2px; height: auto; }
  .mk--tool { top: 3px; left: 3px; }
  .mk--ai { top: 0; left: 0; }
  .mk--person { top: 2px; left: 2px; }
  .hero__trace { margin-left: calc(-1 * var(--hero-pad) - 8px); }
  .hero__trace .mk--tool { left: 3px; }
  .hero__origin { left: 22px; }
  .hero__trace::before { left: 7px; }
  .trace--hero .trace__v { max-width: none; }

  .foot__meta { align-items: flex-start; }
}

/* Smallest phones (WCAG reflow at 320px): the header must still fit on one line */
@media (max-width: 379px) {
  .top__bar { gap: 12px; }
  .top__right { gap: 8px; }
  .logo__word { letter-spacing: 0.18em; }
  .lang a { min-width: 36px; padding: 0 6px; }
}

@media (max-width: 759px) and (prefers-reduced-motion: no-preference) {
  .trace--hero > li::before { transform-origin: center top; animation-name: cz-draw-y; }
}
