/* ifrep.eu landing page. Plain CSS, no build step, no JS, no third-party request.

   DIRECTION (#914, supersedes the earlier mockup's tokens). The page it replaced was a
   54ch ribbon of prose pinned to the left of a 64rem field, ten sections deep, with one
   layout repeated and the product's whole argument told in paragraphs. Sober was right;
   unfinished was not.

   The language here is a LEDGER: warm paper, deep ink, hairline rules, figures set in
   mono and aligned on their decimal, section numbers in the margin. It is chosen because
   it is what the product IS - an auditable calculation - and because a regulatory buyer
   reads a ruled table as competence, where they read a gradient as a pitch.

   ACCENT (revised, #914). The old rule was "at most twice per viewport", which starved
   the page. The accent now marks ONE THING, consistently: the binding or authoritative
   value - the section number, the constraint that binds under art. 11, the article a
   figure traces back to. It is a pointer, never decoration. If you are about to make
   something orange, ask whether it is the answer to "which one governs?" - if not, use
   --ink or --muted.

   THREE LAYOUTS, on purpose, because one was the defect: `.chapter` (numbered rail +
   content), `.slab` (full-width grid of items), and the inverted `.dark` section. Every
   section must be one of them. */

@import url("fonts.css");

:root {
  /* Ink and paper. The paper is warm on purpose - a pure #FFF field is what made the
     empty right half read as a hole rather than as margin. */
  --ink: #16203A;
  --ink-deep: #111A30;
  --body: #414A5C;
  --muted: #6E7686;
  --muted-dark: #A9B1C4;      /* muted, legible on --ink-deep */
  --paper: #FFFFFF;
  --tint: #F8F5EF;
  --cream: #F1ECE1;
  --rule: #E4DFD4;
  --rule-mid: #CDC6B7;
  --rule-dark: #2A3450;       /* hairline inside an inverted section */

  --signal: #D2691E;
  --signal-ink: #A8480F;
  --signal-bg: #FCF3EA;
  --signal-br: #E7C7A8;
  --signal-dark: #E9944F;     /* accent on --ink-deep */

  --serif: "Spectral", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  /* Only 400/600 of the sans and 400/500 of the mono are vendored. Nothing here may ask
     for a weight that is not in assets/fonts/ - the browser would synthesise it, and a
     faux-bold Spectral is instantly visible next to the real one. */
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --measure: 62ch;
  --wide: 76rem;
  --rail: 15rem;              /* the numbered margin of a .chapter */
  --gap: 3.5rem;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--body);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  font-weight: 400;
}

/* ---- Type ---------------------------------------------------------------- */

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 0.5em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.4rem, 1.3rem + 3.4vw, 3.75rem);
  line-height: 1.06;
  letter-spacing: -0.022em;
}
h2 {
  font-size: clamp(1.6rem, 1.2rem + 1.3vw, 2.125rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
}
h3 { font-size: 1.0625rem; line-height: 1.35; letter-spacing: -0.005em; }

p { margin: 0 0 1em; max-width: var(--measure); }
ul { margin: 0 0 1em; padding-left: 1.15em; max-width: var(--measure); }
li { margin-bottom: 0.55em; }
li > strong, strong { font-weight: 600; color: var(--ink); }

a { color: var(--ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

/* Not a token colour: focus must stand apart from the palette to be unmistakable. */
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 2px; }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  font-weight: 500;
  margin: 0 0 1.1em;
}
.lede { font-size: 1.1875rem; line-height: 1.55; color: var(--body); }
.small { font-size: 0.875rem; line-height: 1.6; color: var(--muted); }
.mono { font-family: var(--mono); font-variant-ligatures: none; }

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

.wrap { max-width: var(--wide); margin: 0 auto; padding: 0 32px; }

section { padding: 5.5rem 0; border-top: 1px solid var(--rule); }
section.tint { background: var(--tint); }
section:first-of-type { border-top: 0; }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: var(--paper); padding: 10px 16px; z-index: 20;
}
.skip:focus { left: 8px; top: 8px; }

/* LAYOUT 1 - the numbered chapter. The section number and heading sit in a fixed rail,
   the content runs beside them, so prose keeps a readable measure WITHOUT leaving half
   the viewport empty: the width the old page wasted is now the rail. */
.chapter { display: grid; grid-template-columns: var(--rail) 1fr; gap: var(--gap); align-items: start; }
.chapter > .rail > h2 { margin-bottom: 0.35em; }
.chapter > .body > :last-child { margin-bottom: 0; }

.num {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--signal-ink);
  display: block;
  padding-bottom: 0.9rem;
  margin-bottom: 0.9rem;
  border-bottom: 2px solid var(--signal);
  width: 2.75rem;
}
.rail .small { margin-top: 0.75rem; }

/* A prose chapter still has to fill its column, or the defect this redesign exists to fix
   comes back at a smaller scale: measured at 1440, the prose-only sections were leaving
   30% of the wrap unused, because a single 62ch column cannot span it. Two columns of
   ~46ch each read as a document page and use the width honestly. `break-inside` keeps a
   paragraph whole - a paragraph split across a column boundary is worse than the gap. */
.cols2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 3rem; }
.cols2 > p { max-width: 48ch; break-inside: avoid; }
.cols2 > p:last-child { margin-bottom: 0; }
@media (max-width: 900px) { .cols2 { grid-template-columns: 1fr; gap: 0; } }

/* LAYOUT 2 - the slab: a full-width grid of items separated by hairlines rather than
   boxed in cards. Boxes would fight the ledger rules; a rule is the motif. */
.slab { display: grid; gap: 0; margin: 0; }
.slab.cols-3 { grid-template-columns: repeat(3, 1fr); }
.slab.cols-2 { grid-template-columns: repeat(2, 1fr); }
.slab > * {
  padding: 1.75rem 2rem;
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
  margin: 0;
}
.slab.cols-3 > :nth-child(3n + 1), .slab.cols-2 > :nth-child(2n + 1) { border-left: 0; padding-left: 0; }
.slab > * > p { max-width: none; margin-bottom: 0; font-size: 1rem; }
.slab > * > h3 { margin-bottom: 0.4em; }
.slab .tag {
  font-family: var(--mono); font-size: 0.6875rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted); display: block; margin-bottom: 0.6rem;
}

/* LAYOUT 3 - the inverted section. One per page: it is the rhythm break that stops nine
   pale slabs reading as one, and it is spent on the opinionated section rather than on
   the hero, where inversion would just be theatre. */
section.dark { background: var(--ink-deep); border-top: 0; color: #D7DCE7; }
section.dark h2, section.dark h3, section.dark strong { color: #FFFFFF; }
section.dark .num { color: var(--signal-dark); border-bottom-color: var(--signal-dark); }
section.dark .small, section.dark .eyebrow { color: var(--muted-dark); }
section.dark a { color: #FFFFFF; }
section.dark .slab > * { border-color: var(--rule-dark); }
section.dark .pull { border-left-color: var(--signal-dark); color: #FFFFFF; }

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

.site-head {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(1.4) blur(6px);
  border-bottom: 1px solid var(--rule);
  padding: 14px 0;
}
.site-head .wrap { display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; }
.brand img { display: block; }
.brand span { font-family: var(--serif); font-weight: 600; color: var(--ink); font-size: 1.125rem; letter-spacing: -0.01em; }
.site-head nav { display: flex; gap: 22px; font-size: 0.875rem; align-items: center; }
.site-head nav a { color: var(--muted); text-decoration: none; }
.site-head nav a:hover { color: var(--ink); text-decoration: underline; }
.site-head .nav-wide { display: flex; gap: 22px; }

/* ---- Hero ---------------------------------------------------------------- */
/* Asymmetric, not centred: the old page centred the hero and left-aligned everything
   after it, so the axis flipped once and the seam read as two pages. */

.hero { padding: 5.5rem 0 5rem; border-top: 0; position: relative; overflow: hidden; }
/* The ledger motif: hairlines, at the opacity of paper grain rather than of decoration. */
.hero::before {
  content: ""; position: absolute; inset: 0;
  background-image: repeating-linear-gradient(to bottom, var(--rule) 0 1px, transparent 1px 2.25rem);
  opacity: 0.5; pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 72%);
          mask-image: linear-gradient(to bottom, #000 0%, transparent 72%);
}
.hero .wrap { position: relative; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 4rem; align-items: start; }
.hero h1 { margin-bottom: 0.4em; }
.hero .subhead { font-size: 1.25rem; line-height: 1.5; color: var(--body); max-width: 34ch; }

.actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 2rem 0 1.5rem; }

.btn {
  display: inline-block;
  font: inherit; font-size: 0.9375rem; font-weight: 600;
  padding: 12px 22px;
  border-radius: 3px;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn-primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-primary:hover { background: var(--ink-deep); }
.btn-secondary { background: transparent; color: var(--ink); border-color: var(--rule-mid); }
.btn-secondary:hover { border-color: var(--ink); }

/* Status tag, not an apology. */
.badge {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--signal-bg);
  border: 1px solid var(--signal-br);
  color: var(--signal-ink);
  border-radius: 999px;
  padding: 6px 15px;
  font-size: 0.8125rem;
  max-width: none;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--signal); flex: none; }

/* ---- Exhibits ------------------------------------------------------------ */
/* Real numbers, real table semantics, no motion. These are the argument: the page says
   a figure carries its window, its coefficient and its article, so it had better show
   one doing it rather than assert it in a paragraph. */

.exhibit {
  border: 1px solid var(--rule-mid);
  border-radius: 4px;
  background: var(--paper);
  padding: 1.25rem 1.5rem 1.15rem;
  box-shadow: 0 1px 0 var(--rule), 0 12px 32px -22px rgba(22, 32, 58, 0.45);
}
.exhibit + .exhibit { margin-top: 1rem; }
.exhibit table { width: 100%; border-collapse: collapse; }
.exhibit caption {
  caption-side: top; text-align: left;
  font-family: var(--mono);
  font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--muted); font-weight: 500;
  padding-bottom: 0.9rem;
}
.exhibit th, .exhibit td { padding: 0.5rem 0; font-size: 0.9375rem; }
.exhibit th { text-align: left; font-weight: 400; color: var(--body); }
.exhibit td { text-align: right; font-family: var(--mono); font-size: 0.875rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.exhibit tbody tr + tr th, .exhibit tbody tr + tr td { border-top: 1px solid var(--rule); }
.exhibit .binding th { font-weight: 600; color: var(--ink); }
.exhibit .binding td { font-weight: 500; color: var(--signal-ink); }
.exhibit tfoot td {
  border-top: 1px solid var(--rule-mid);
  padding-top: 0.75rem;
  text-align: left;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--signal-ink);
}
/* The trace: label / value pairs where the value is the authority (article, window). */
.trace { display: grid; grid-template-columns: auto 1fr; gap: 0.45rem 1.25rem; margin: 0; }
.trace dt { font-size: 0.8125rem; color: var(--muted); }
.trace dd {
  margin: 0; text-align: right;
  font-family: var(--mono); font-size: 0.8125rem; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.trace dd.is-source { color: var(--signal-ink); }

/* ---- The pipeline -------------------------------------------------------- */
/* Was a single mono line with arrows in it, scrolling sideways on small screens. */

.pipeline { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; margin: 0 0 2.5rem; padding: 0; list-style: none; max-width: none; }
.pipeline li {
  margin: 0; padding: 1rem 1.1rem 1.1rem;
  border: 1px solid var(--rule);
  border-left-width: 0;
  background: var(--paper);
  position: relative;
}
.pipeline li:first-child { border-left-width: 1px; border-radius: 3px 0 0 3px; }
.pipeline li:last-child { border-radius: 0 3px 3px 0; }
.pipeline .step {
  display: block; font-family: var(--mono); font-size: 0.625rem; letter-spacing: 0.14em;
  color: var(--muted); margin-bottom: 0.4rem;
}
.pipeline .what { display: block; font-size: 0.9375rem; color: var(--ink); font-weight: 600; line-height: 1.3; }
.pipeline li:last-child { background: var(--cream); }
.pipeline li:last-child .what { color: var(--ink); }

/* ---- K-factor chips ------------------------------------------------------ */
/* Nine names, findable without reading a paragraph. */

.factors { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 1.5rem; padding: 0; list-style: none; max-width: none; }
.factors li {
  margin: 0;
  font-family: var(--mono); font-size: 0.8125rem; font-weight: 500;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule-mid);
  border-radius: 3px;
  padding: 5px 10px;
}

/* ---- Scope table --------------------------------------------------------- */
/* "What it doesn't do yet" was a bullet wall. A boundary and where it stands is a table:
   the honest shape for it, and the scannable one. */

/* Three columns - state, boundary, detail - so every row aligns on ONE baseline. Stacking
   the state chip above the boundary name inside a single cell left the detail text
   aligned to the chip and floating a line above the name it belongs to. */
.scope { width: 100%; border-collapse: collapse; margin: 0; }
.scope caption { position: absolute; left: -9999px; }
.scope th, .scope td { text-align: left; padding: 0.95rem 1.25rem 0.95rem 0; border-top: 1px solid var(--rule); vertical-align: baseline; }
.scope tr:first-child th, .scope tr:first-child td { border-top: 0; }
.scope th { font-weight: 600; color: var(--ink); width: 11rem; }
.scope td { color: var(--body); }
.scope td.state-cell { width: 9.5rem; }
.scope td p { margin: 0; max-width: none; }
.state {
  display: inline-block;
  font-family: var(--mono); font-size: 0.625rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--rule-mid); border-radius: 2px;
  padding: 2px 7px; margin-bottom: 0.35rem;
}
.state.is-out { color: var(--signal-ink); border-color: var(--signal-br); background: var(--signal-bg); }

/* ---- Pull quote ---------------------------------------------------------- */

.pull {
  font-family: var(--serif); font-size: 1.375rem; line-height: 1.35; color: var(--ink);
  border-left: 2px solid var(--signal);
  padding-left: 1.25rem;
  margin: 0 0 1.5rem;
  max-width: 40ch;
}

/* ---- Specs (definition list) --------------------------------------------- */

.specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem 2rem; margin: 0 0 1.5rem; }
.specs > div { border-top: 1px solid var(--rule); padding-top: 0.85rem; }
.specs dt { font-family: var(--mono); font-size: 0.6875rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.3rem; }
.specs dd { margin: 0; color: var(--ink); font-size: 0.9375rem; }

/* ---- Contact ------------------------------------------------------------- */

.form { margin: 0; }
.form-panel {
  border: 1px solid var(--rule-mid);
  border-radius: 4px;
  background: var(--paper);
  padding: 1.5rem;
}
.field { display: block; margin-bottom: 0.9rem; }
.field > span {
  display: block;
  font-family: var(--mono); font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.1em;
  font-weight: 500; color: var(--muted); margin-bottom: 0.35rem;
}
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: 0.9375rem;
  padding: 10px 12px;
  border: 1px solid var(--rule-mid);
  border-radius: 3px;
  background: var(--paper);
  color: var(--body);
}
.field textarea { min-height: 104px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--ink); }
.form .btn { width: 100%; text-align: center; }

/* Honeypot. Positioned off-screen rather than `display: none`, which the better bots
   detect and skip; the input also carries tabindex="-1" so keyboard users never land
   on a field they cannot see. */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) 23rem; gap: var(--gap); align-items: start; }
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; gap: 2rem; } }

.mailto { font-family: var(--mono); font-size: 1.0625rem; }

/* Published demo credentials. Mono so a visitor sees exactly what to type: an l/1 or O/0
   read wrongly out of a proportional face is a support email, not a typo. */
.creds { font-family: var(--mono); }
.mailto a { color: var(--signal-ink); }

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

.site-foot { padding: 2rem 0 3rem; font-size: 0.875rem; color: var(--muted); border-top: 1px solid var(--rule); }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }
.site-foot a { color: var(--muted); }

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

@media (max-width: 1080px) {
  :root { --rail: 12rem; --gap: 2.5rem; }
  .pipeline { grid-template-columns: repeat(2, 1fr); }
  .pipeline li { border-left-width: 1px; border-radius: 3px; margin: -1px 0 0 -1px; }
  .slab.cols-3 { grid-template-columns: repeat(2, 1fr); }
  .slab.cols-3 > :nth-child(3n + 1) { border-left: 1px solid var(--rule); padding-left: 2rem; }
  .slab.cols-3 > :nth-child(2n + 1) { border-left: 0; padding-left: 0; }
}

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .hero .subhead { max-width: var(--measure); }
  .chapter { grid-template-columns: 1fr; gap: 1.5rem; }
  .num { padding-bottom: 0.6rem; margin-bottom: 0.75rem; }
  .site-head .nav-wide { display: none; }   /* the section links, not the language switch */
}

@media (max-width: 700px) {
  body { font-size: 16px; }
  .wrap { padding: 0 20px; }
  section { padding: 3.5rem 0; }
  .hero { padding: 3rem 0 3.5rem; }
  .slab.cols-3, .slab.cols-2 { grid-template-columns: 1fr; }
  .slab > * { border-left: 0 !important; padding: 1.4rem 0 !important; }
  .pipeline { grid-template-columns: 1fr; }
  .specs { grid-template-columns: 1fr; }
  .scope th, .scope td { display: block; width: auto; padding: 0; border-top: 0; }
  .scope td.state-cell { padding-top: 1.25rem; border-top: 1px solid var(--rule); }
  .scope th { padding: 0.35rem 0 0.15rem; }
  .scope td { padding-bottom: 1.25rem; }
  .scope tr:first-child td.state-cell { border-top: 0; padding-top: 0; }
  .actions { flex-direction: column; align-items: stretch; }
  .actions .btn { width: 100%; text-align: center; }
  .exhibit { padding: 1.1rem 1.1rem 1rem; }
}

/* There is almost no motion here. Keep it that way. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
