:root {
  --paper: #edf0ee;
  --card: #ffffff;
  --rule: #d3dad8;
  --grid: rgba(23, 85, 122, .055);
  --ink: #0e1519;
  --ink-2: #5a686f;
  --blue: #17557a;
  --blue-soft: #e3edf3;
  --ok: #2a7d4f;
  --ok-soft: #e2f0e7;
  --over: #b8412c;
  --over-soft: #f8e6e1;
  --warn: #8a6100;
  --warn-soft: #f6eeda;
  --shadow: 0 1px 2px rgba(14, 21, 25, .06), 0 6px 18px rgba(14, 21, 25, .05);
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0e161c;
    --card: #15212a;
    --rule: #23343f;
    --grid: rgba(108, 176, 221, .06);
    --ink: #e6edf1;
    --ink-2: #90a2ad;
    --blue: #6cb0dd;
    --blue-soft: #14293a;
    --ok: #4cbb7d;
    --ok-soft: #13291d;
    --over: #e0745c;
    --over-soft: #2e1712;
    --warn: #d9a441;
    --warn-soft: #2c2412;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.6 var(--sans);
}

.wrap { max-width: 58rem; margin: 0 auto; padding: 0 1.15rem; }

:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
a { color: var(--blue); }

/* measurements speak in monospace — every number here is a measurement */
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* header */

.top { border-bottom: 1px solid var(--rule); background: var(--card); }

.top .wrap {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  padding-block: .8rem;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: .18rem;
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -.03em;
  color: var(--ink);
  text-decoration: none;
}

.brand i { font-style: normal; color: var(--blue); }

.nav { display: flex; gap: 1.1rem; margin-left: auto; font-size: .87rem; flex-wrap: wrap; }
.nav a { color: var(--ink-2); text-decoration: none; padding-bottom: 2px; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current] { color: var(--ink); border-bottom-color: var(--blue); }

/* drafting sheet behind the tool */

.sheet {
  border-bottom: 1px solid var(--rule);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: center;
  padding-block: 2.5rem 2.75rem;
}

main { padding-bottom: 3.5rem; }

.eyebrow {
  font: 600 .7rem/1 var(--mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--blue);
  margin: 0 0 .75rem;
}

h1 {
  font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.5rem);
  line-height: 1.12;
  letter-spacing: -.03em;
  font-weight: 700;
  margin: 0 0 .55rem;
  max-width: 22ch;
}

h2 { font-size: 1.28rem; letter-spacing: -.015em; font-weight: 650; margin: 0 0 .7rem; }
h3 { font-size: 1.02rem; font-weight: 620; margin: 1.7rem 0 .4rem; }
p { margin: 0 0 1rem; }

.lead { color: var(--ink-2); font-size: 1.06rem; max-width: 44ch; }

/* controls */

.controls {
  margin: 1.9rem 0 1.15rem;
  display: grid;
  gap: .5rem;
  max-width: 46rem;
}

.field { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }

.field > .label {
  font: 600 .68rem/1 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-2);
  min-width: 5.6rem;
}

.field button {
  font: 500 .88rem var(--sans);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: .38rem .72rem;
  cursor: pointer;
}

.field button:hover { border-color: var(--blue); color: var(--blue); }

.field button[aria-pressed="true"] {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.custom {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: .26rem .5rem .26rem .62rem;
}

.custom:focus-within { border-color: var(--blue); }

.custom input {
  width: 4rem;
  font: 500 .88rem var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  background: none;
  border: none;
  padding: .12rem 0;
}

.custom input:focus { outline: none; }

.custom select {
  font: 500 .82rem var(--sans);
  color: var(--ink-2);
  background: none;
  border: none;
  cursor: pointer;
}

.custom .sep, .custom .unit {
  font: 500 .8rem var(--mono);
  color: var(--ink-2);
}

/* drop zone */

.drop {
  display: block;
  width: 100%;
  max-width: 46rem;
  background: var(--card);
  border: 1px dashed var(--rule);
  border-radius: 4px;
  padding: 2.4rem 1.5rem;
  text-align: center;
  cursor: pointer;
  color: var(--ink);
  font: inherit;
  transition: border-color .15s, box-shadow .15s;
}

.drop:hover, .drop.hover { border-color: var(--blue); box-shadow: var(--shadow); }
.drop.hover { border-style: solid; }
.drop b { display: block; font-size: 1.05rem; font-weight: 650; margin-bottom: .25rem; }
.drop small { color: var(--ink-2); font-size: .85rem; }

/* results */

.results { display: grid; gap: .75rem; margin-top: 1.15rem; max-width: 46rem; }

.file {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 1.1rem;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
}

@media (max-width: 560px) {
  .file { grid-template-columns: 84px minmax(0, 1fr); gap: .8rem; padding: .85rem .9rem; }
}

/* the proportion figure: original outline with the result nested at true scale */
.figure { width: 100%; height: auto; display: block; }
.figure .outer { fill: none; stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 3 3; opacity: .8; }
.figure .inner { fill: var(--blue-soft); stroke: var(--blue); stroke-width: 1.5; }
.figure .tick { stroke: var(--ink-2); stroke-width: 1; opacity: .55; }

.body { min-width: 0; }

.head { display: flex; align-items: baseline; gap: .6rem; margin-bottom: .5rem; }

.name {
  font-weight: 620;
  font-size: .95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.badge {
  margin-left: auto;
  flex: none;
  font: 600 .68rem/1 var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .22rem .42rem;
  border-radius: 2px;
}

.badge.ok { color: var(--ok); background: var(--ok-soft); }
.badge.over { color: var(--over); background: var(--over-soft); }

.specs {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .1rem .7rem;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: .82rem;
  color: var(--ink-2);
  margin-bottom: .6rem;
}

.specs b { color: var(--ink); font-weight: 600; }
.specs .arrow { color: var(--ink-2); padding: 0 .15rem; }

/* weight rule with the limit tick */
.gauge { position: relative; height: 6px; background: var(--paper); border-radius: 2px; margin-bottom: .55rem; }
.gauge .fill { position: absolute; inset: 0 auto 0 0; border-radius: 2px; background: var(--ok); transition: width .45s cubic-bezier(.2,.9,.3,1); }
.gauge .fill.over { background: var(--over); }
.gauge .limit { position: absolute; top: -4px; bottom: -4px; width: 1px; background: var(--ink); opacity: .6; }

.meta { font-family: var(--mono); font-size: .76rem; color: var(--ink-2); margin: 0 0 .7rem; }

.actions { display: flex; gap: .45rem; flex-wrap: wrap; }

.btn {
  display: inline-block;
  font: 600 .85rem var(--sans);
  padding: .42rem .85rem;
  border-radius: 3px;
  border: 1px solid var(--blue);
  background: var(--blue);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
}

.btn.ghost { background: none; color: var(--blue); }

.batch { margin-top: .9rem; max-width: 46rem; }

/* content */

section { margin-top: 2.75rem; }
.prose { max-width: 40rem; }
.prose ul { padding-left: 1.15rem; margin: 0 0 1rem; }
.prose li { margin-bottom: .35rem; }

.callout {
  border-left: 2px solid var(--blue);
  background: var(--blue-soft);
  padding: .75rem .95rem;
  border-radius: 0 3px 3px 0;
  color: var(--ink);
  font-size: .95rem;
  margin: 1.4rem 0;
}

.callout p:last-child { margin-bottom: 0; }

.swap {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .9rem;
  margin-top: 1.4rem;
}

/* ads */

.ad { margin: 2.5rem 0; text-align: center; }

.ad > span {
  display: block;
  font: 600 .64rem/1 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-2);
  opacity: .7;
  margin-bottom: .45rem;
}

.ad ins { display: block; min-height: 90px; }

/* AdSense stamps data-ad-status on the unit. Until the account serves, that is
   three empty 280px voids per page — which reads as a broken site to a
   reviewer. Reserve little, and collapse entirely once known unfilled. */
.ad:has(ins[data-ad-status="unfilled"]) { display: none; }

/* footer */

.foot {
  border-top: 1px solid var(--rule);
  background: var(--card);
  padding-block: 1.6rem 2.1rem;
  font-size: .85rem;
  color: var(--ink-2);
}

.foot .wrap { display: flex; gap: 1rem 1.75rem; flex-wrap: wrap; align-items: baseline; }
.foot nav { display: flex; gap: 1.1rem; flex-wrap: wrap; margin-left: auto; }
.foot a { color: var(--ink-2); }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .gauge .fill { transition: none; }
}

main > .wrap:first-child { padding-top: 2.5rem; }

/* Touch targets. Measured on a 500 px viewport: preset buttons came out 31 px
   tall, nav links 26, the custom field 20 — too small for a thumb on a tool
   that is mostly used from a phone. */
@media (max-width: 640px) {
  .field button { padding: .62rem .85rem; }
  .custom { padding: .46rem .6rem .46rem .72rem; }
  .custom input { padding: .3rem 0; }
  .nav { gap: .5rem 1.1rem; }
  .nav a { padding-block: .4rem; }
  .btn { padding: .62rem 1.1rem; }
  .field > .label { min-width: 100%; margin-bottom: -.15rem; }
}

/* WCAG 2.5.8 wants 24x24 for standalone targets. Nav, footer and the related
   links sat at 20-22 px; the unit select at 18. Inline links inside a sentence
   are exempt, these are not. */
.nav a, .foot a, .related a { display: inline-block; padding-block: .28rem; }
.custom select { padding-block: .3rem; }
.related { display: flex; flex-wrap: wrap; gap: .3rem 1rem; }

/* images -> PDF */

.shots { list-style: none; margin: 1.1rem 0 0; padding: 0; display: grid; gap: .5rem; max-width: 46rem; }

.shot {
  display: grid;
  grid-template-columns: 1.6rem 64px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: .8rem;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: .55rem .8rem;
}

.shot .rank { font: 600 .8rem var(--mono); color: var(--ink-2); text-align: right; }
.thumb { display: flex; align-items: center; justify-content: center; height: 54px; }
.thumb-canvas {
  display: block; max-width: 64px; max-height: 54px; width: auto; height: auto;
  border-radius: 2px; border: 1px solid var(--rule);
}
.shot-name { font-size: .9rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shot-dims { font-size: .78rem; color: var(--ink-2); }
.shot-move { display: flex; gap: .25rem; }

.mv {
  font: 600 .85rem var(--sans);
  color: var(--ink-2);
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 3px;
  width: 30px; height: 30px;
  cursor: pointer;
}

.mv:hover { border-color: var(--blue); color: var(--blue); }
.mv.rm:hover { border-color: var(--over); color: var(--over); }

.pdf-card {
  margin-top: 1rem;
  max-width: 46rem;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
}

.pdf-card .head { display: flex; align-items: baseline; gap: .6rem; margin-bottom: .45rem; }
.pdf-card .name { font-weight: 620; font-size: .95rem; }
.pdf-card .meta { margin-bottom: .8rem; }

#pdf-empty { max-width: 46rem; margin-top: 1rem; }

@media (max-width: 560px) {
  .shot { grid-template-columns: 1.3rem 48px minmax(0, 1fr) auto; gap: .55rem; }
  .shot-dims { display: none; }
  .thumb { height: 44px; }
  .thumb-canvas { max-width: 48px; max-height: 44px; }
}

/* ---------------------------------------------------------------- guides */

/* tableaux de mesures : chaque cellule est un nombre, d'ou le tabulaire et la
   colonne de gauche en sans — c'est la seule qui porte du texte. */
.table-scroll { overflow-x: auto; margin: 1.3rem 0; }

table.data {
  border-collapse: collapse;
  width: 100%;
  font-size: .84rem;
  font-variant-numeric: tabular-nums;
}

table.data th, table.data td {
  padding: .42rem .7rem;
  text-align: right;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}

table.data th:first-child, table.data td:first-child { text-align: left; }

table.data thead th {
  font: 600 .68rem/1.3 var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-2);
}

table.data tbody td { font-family: var(--mono); }
table.data tbody td:first-child { font-family: var(--sans); color: var(--ink-2); }
table.data tbody tr:last-child td { border-bottom: none; }
table.data td small { color: var(--ink-2); margin-left: .35rem; font-size: .9em; }

/* une mesure qui va dans le mauvais sens : fichier plus gros, cible manquee */
table.data td.bad, table.data tr.bad td { color: var(--over); }
table.data td.bad small { color: var(--over); opacity: .75; }

.figcaption { font-size: .8rem; color: var(--ink-2); margin: -.9rem 0 1.4rem; }

.prose code {
  font: .88em var(--mono);
  background: var(--blue-soft);
  padding: .1em .32em;
  border-radius: 2px;
}

pre.code {
  overflow-x: auto;
  background: var(--card);
  border: 1px solid var(--rule);
  border-left: 2px solid var(--blue);
  border-radius: 0 3px 3px 0;
  padding: .85rem 1rem;
  margin: 1.3rem 0;
  font: .82rem/1.55 var(--mono);
}

pre.code code { background: none; padding: 0; font: inherit; }

/* index des guides : le chiffre a gauche est l'accroche, pas une decoration —
   c'est la mesure que l'article rapporte. */
.guides { display: grid; gap: .7rem; margin: 2rem 0 2.75rem; max-width: 46rem; }

.guide {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  gap: 1.1rem;
  align-items: start;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 1rem 1.15rem;
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow);
}

.guide:hover { border-color: var(--blue); }
.guide-fig { font: 650 1.35rem/1.15 var(--mono); color: var(--blue); letter-spacing: -.02em; }
.guide-title { display: block; font-weight: 650; font-size: 1.02rem; margin-bottom: .25rem; }
.guide-hook { display: block; color: var(--ink-2); font-size: .9rem; line-height: 1.5; }

@media (max-width: 560px) {
  .guide { grid-template-columns: minmax(0, 1fr); gap: .3rem; }
  .guide-fig { font-size: 1.05rem; }
}

/* ------------------------------------------------------------- metadata */

/* Pas de figure de proportion sur ces fiches : une seule colonne. */
.exif-card { grid-template-columns: minmax(0, 1fr); }
.exif-card .table-scroll { margin: .9rem 0; }
.exif-card table.data { font-size: .8rem; }
.exif-card .specs { grid-template-columns: auto minmax(0, 1fr); }
.exif-card .specs span:nth-child(even) { font-family: var(--sans); white-space: normal; }

/* Les valeurs EXIF sont du texte libre, parfois tres long (chemins, versions,
   commentaires) : celles-la doivent se replier, contrairement aux mesures. */
table.exif-rows td:first-child { width: 11rem; font-family: var(--sans); }
table.exif-rows td:last-child { text-align: left; white-space: normal; word-break: break-word; }

.callout.gps { border-left-color: var(--over); background: var(--over-soft); }
.badge.warn { color: var(--warn); background: var(--warn-soft); }

#exif-empty { max-width: 46rem; margin-top: 1rem; }
