/* ============================================================
   OXYCOUPE JADIDA — Design system
   Tokens, reset, typography, primitives
   ============================================================ */

/* ---------- 1. TOKENS ---------------------------------------- */
:root {
  /* Brand — extracted from the OXYCOUPE logotype */
  --blue:        #3067DB;
  --blue-700:    #1F49A6;
  --blue-600:    #2554BE;
  --blue-500:    #3067DB;
  --blue-400:    #5B8BFF;
  --blue-300:    #8DAEFF;
  --blue-200:    #B9CDFF;
  --blue-050:    #EEF3FF;

  /* Oxy-fuel cut — used with extreme restraint */
  --molten:      #FF5A1F;
  --molten-hot:  #FFD7A3;

  /* Steel neutrals */
  --ink:         #08090C;
  --ink-2:       #0B0D12;
  --steel-900:   #12151B;
  --steel-850:   #171B22;
  --steel-800:   #1C212A;
  --steel-700:   #262C36;
  --steel-600:   #39404C;
  --steel-500:   #5A6270;
  --steel-400:   #858D9B;
  --steel-300:   #AFB6C1;
  --steel-200:   #D5D9E0;
  --steel-150:   #E3E6EB;
  --steel-100:   #EDEFF2;
  --paper:       #F4F4F1;
  --paper-2:     #FAFAF8;
  --white:       #FFFFFF;

  /* Semantic — reassigned per section theme */
  --bg:          var(--paper);
  --bg-soft:     var(--paper-2);
  --fg:          var(--ink);
  --fg-muted:    var(--steel-500);
  --fg-faint:    var(--steel-400);
  --rule:        rgba(8, 9, 12, .12);
  --rule-soft:   rgba(8, 9, 12, .07);
  --accent:      var(--blue);

  /* Type */
  --f-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --f-body:    "Inter Tight", "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-mono:    "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Fluid type scale (min 360px → max 1600px) */
  --t-mono:   clamp(.625rem, .58rem + .19vw, .75rem);
  --t-xs:     clamp(.75rem, .72rem + .14vw, .8125rem);
  --t-sm:     clamp(.8125rem, .78rem + .18vw, .9375rem);
  --t-base:   clamp(.9375rem, .9rem + .23vw, 1.0625rem);
  --t-lg:     clamp(1.0625rem, 1rem + .35vw, 1.3125rem);
  --t-xl:     clamp(1.25rem, 1.1rem + .7vw, 1.75rem);
  --t-2xl:    clamp(1.5rem, 1.25rem + 1.2vw, 2.5rem);
  --t-3xl:    clamp(2rem, 1.5rem + 2.4vw, 3.75rem);
  --t-4xl:    clamp(2.5rem, 1.6rem + 4.2vw, 6rem);
  --t-5xl:    clamp(3rem, 1.4rem + 7.4vw, 9.5rem);
  --t-6xl:    clamp(3.5rem, 1rem + 11vw, 14rem);

  /* Space */
  --sp-1: .25rem;  --sp-2: .5rem;   --sp-3: .75rem;  --sp-4: 1rem;
  --sp-5: 1.5rem;  --sp-6: 2rem;    --sp-7: 3rem;    --sp-8: 4rem;
  --sp-9: 6rem;    --sp-10: 8rem;   --sp-11: 12rem;
  --section-y: clamp(5rem, 3rem + 8vw, 11rem);
  --gutter:    clamp(1.25rem, .6rem + 2.6vw, 4.5rem);
  --maxw:      1560px;
  --maxw-text: 68ch;

  /* Motion */
  --e-out:   cubic-bezier(.16, 1, .3, 1);
  --e-inout: cubic-bezier(.76, 0, .24, 1);
  --e-soft:  cubic-bezier(.33, 1, .68, 1);
  --d-fast:  .22s;
  --d-mid:   .45s;
  --d-slow:  .9s;

  --header-h: 76px;

  /* Film grain — one rasterised turbulence tile, reused everywhere */
  --grain-url: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.42'/%3E%3C/svg%3E");
}

/* Dark surface theme — applied per-section */
.theme-dark {
  --bg:        var(--ink);
  --bg-soft:   var(--steel-900);
  --fg:        #F2F4F7;
  --fg-muted:  var(--steel-400);
  --fg-faint:  var(--steel-500);
  --rule:      rgba(255, 255, 255, .14);
  --rule-soft: rgba(255, 255, 255, .07);
  --accent:    var(--blue-400);
  color-scheme: dark;
}

/* ---------- 2. RESET ----------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: auto; /* Lenis owns scrolling */
}

body {
  background: var(--ink);
  color: var(--fg);
  font-family: var(--f-body);
  font-size: var(--t-base);
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

body.is-locked { overflow: hidden; height: 100vh; }

img, svg, video, canvas { display: block; max-width: 100%; }
img, video { height: auto; }

button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }

a { color: inherit; text-decoration: none; }

ul, ol { list-style: none; padding: 0; }

:focus-visible {
  outline: 2px solid var(--blue-400);
  outline-offset: 3px;
  border-radius: 2px;
}
:focus:not(:focus-visible) { outline: none; }

::selection { background: var(--blue); color: #fff; }

/* ---------- 3. CUSTOM SCROLLBAR ------------------------------- */
html { scrollbar-color: var(--steel-600) var(--ink); scrollbar-width: thin; }

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track {
  background: var(--ink);
  border-left: 1px solid rgba(255, 255, 255, .06);
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--steel-600), var(--steel-700));
  border: 3px solid var(--ink);
  border-radius: 8px;
  transition: background .2s;
}
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, var(--blue), var(--blue-700)); }
::-webkit-scrollbar-corner { background: var(--ink); }

/* ---------- 4. TYPOGRAPHY ------------------------------------ */
.display,
h1, h2, h3 {
  font-family: var(--f-display);
  font-weight: 700;
  line-height: .95;
  letter-spacing: -.03em;
  font-variation-settings: "wdth" 100;
  text-wrap: balance;
}

.d-hero {
  font-size: var(--t-5xl);
  font-weight: 800;
  line-height: .86;
  letter-spacing: -.045em;
  font-variation-settings: "wdth" 108;
  text-transform: uppercase;
}

.d-xl {
  font-size: var(--t-4xl);
  font-weight: 750;
  line-height: .92;
  letter-spacing: -.038em;
  font-variation-settings: "wdth" 104;
  text-transform: uppercase;
}

.d-lg {
  font-size: var(--t-3xl);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.032em;
  font-variation-settings: "wdth" 102;
}

.d-md {
  font-size: var(--t-2xl);
  font-weight: 650;
  line-height: 1.08;
  letter-spacing: -.025em;
}

.d-sm {
  font-family: var(--f-display);
  font-size: var(--t-xl);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -.02em;
}

.lede {
  font-size: var(--t-lg);
  line-height: 1.55;
  color: var(--fg-muted);
  font-weight: 350;
  max-width: 56ch;
  text-wrap: pretty;
}

.body-lg { font-size: var(--t-lg); line-height: 1.62; font-weight: 350; }

p { text-wrap: pretty; }

/* Technical label — the blueprint voice of the site */
.tag {
  font-family: var(--f-mono);
  font-size: var(--t-mono);
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--fg-faint);
  display: inline-flex;
  align-items: center;
  gap: .6em;
  line-height: 1;
}
.tag::before {
  content: "";
  width: 1.6em; height: 1px;
  background: currentColor;
  opacity: .55;
  flex: none;
}
.tag--plain::before { display: none; }
.tag--accent { color: var(--accent); }

/* Tabular figures only — the family is inherited, so display numbers
   stay in Archivo and technical labels stay in the mono. */
.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* ---------- 5. LAYOUT PRIMITIVES ----------------------------- */
.section {
  position: relative;
  background: var(--bg);
  color: var(--fg);
  padding-block: var(--section-y);
  isolation: isolate;
}
.section--flush { padding-block: 0; }

.shell {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.shell--wide { max-width: 1780px; }
.shell--narrow { max-width: 1080px; }

.grid12 {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gutter);
}

.stack > * + * { margin-top: var(--sp-4); }
.stack-lg > * + * { margin-top: var(--sp-6); }

/* Section header block used across the page */
.sec-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--sp-5);
  margin-bottom: clamp(2.5rem, 1.5rem + 3vw, 5rem);
}
@media (min-width: 900px) {
  .sec-head {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    align-items: end;
    gap: var(--gutter);
  }
  .sec-head__aside { padding-bottom: .5rem; }
}
.sec-head__tag { margin-bottom: var(--sp-5); display: block; }

/* Hairline rules */
.rule { height: 1px; background: var(--rule); border: 0; }

/* ---------- 6. BUTTONS --------------------------------------- */
.btn {
  --btn-fg: var(--white);
  --btn-bg: var(--blue);
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .85em;
  padding: 1.05em 1.6em;
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  font-weight: 500;
  letter-spacing: .13em;
  text-transform: uppercase;
  line-height: 1;
  color: var(--btn-fg);
  background: var(--btn-bg);
  border-radius: 2px;
  overflow: hidden;
  cursor: pointer;
  isolation: isolate;
  transition: color var(--d-fast) var(--e-out), transform var(--d-fast) var(--e-out);
  will-change: transform;
}
.btn::before {
  content: "";
  position: absolute; inset: 0;
  background: var(--ink);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform .42s var(--e-out);
  z-index: -1;
}
.btn:hover::before { transform: scaleY(1); }
.btn:active { transform: translateY(1px); }
.btn__arrow {
  width: 1em; height: 1em;
  flex: none;
  transition: transform .42s var(--e-out);
}
.btn:hover .btn__arrow { transform: translateX(.28em); }

.btn--ghost {
  --btn-fg: var(--fg);
  --btn-bg: transparent;
  box-shadow: inset 0 0 0 1px var(--rule);
}
.btn--ghost::before { background: var(--fg); }
.btn--ghost:hover { --btn-fg: var(--bg); }

.btn--light {
  --btn-fg: var(--ink);
  --btn-bg: var(--white);
}
.btn--light::before { background: var(--blue); }
.btn--light:hover { --btn-fg: var(--white); }

/* Text link with a rule that wipes on hover */
.tlink {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .6em;
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  letter-spacing: .12em;
  text-transform: uppercase;
  padding-bottom: .55em;
  color: var(--fg);
}
.tlink::after {
  content: "";
  position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--rule);
}
.tlink::before {
  content: "";
  position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .5s var(--e-out);
  z-index: 1;
}
.tlink:hover::before { transform: scaleX(1); transform-origin: left; }
.tlink svg { width: .95em; height: .95em; transition: transform .45s var(--e-out); }
.tlink:hover svg { transform: translate(.25em, -.25em); }

/* ---------- 7. MEDIA ----------------------------------------- */
.media {
  position: relative;
  overflow: hidden;
  background: var(--steel-800);
}
.media > img,
.media > video {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.media--16x9 { aspect-ratio: 16 / 9; }
.media--4x3  { aspect-ratio: 4 / 3; }
.media--3x4  { aspect-ratio: 3 / 4; }
.media--1x1  { aspect-ratio: 1 / 1; }
.media--21x9 { aspect-ratio: 21 / 9; }

/* Grain overlay — the film texture that unifies all imagery */
.grain::after {
  content: "";
  position: absolute; inset: -60%;
  pointer-events: none;
  background-image: var(--grain-url);
  opacity: .5;
  mix-blend-mode: overlay;
  animation: grainShift 6s steps(6) infinite;
}
@keyframes grainShift {
  0%   { transform: translate(0, 0); }
  20%  { transform: translate(-3%, 4%); }
  40%  { transform: translate(4%, -2%); }
  60%  { transform: translate(-2%, -4%); }
  80%  { transform: translate(3%, 2%); }
  100% { transform: translate(0, 0); }
}

/* ---------- 8. REVEAL PRIMITIVES ------------------------------ */
/* Line-mask reveal: text rises out of a clipped line.
   The padding/negative-margin pair keeps descenders (g, p, y) intact. */
.rv-line {
  display: block;
  overflow: hidden;
  padding-bottom: .16em;
  margin-bottom: -.16em;
}
.rv-line > span { display: block; }
/* Deliberately NO will-change here: a headline can produce dozens of these,
   and promoting each one to its own compositing layer breaks painting. */
.w { display: inline-block; }

/* Generic fade-rise, driven by JS */

/* Image clip reveal */
.rv-clip { clip-path: inset(0 0 100% 0); }

/* ---------- 9. UTILITIES ------------------------------------- */
.u-hide { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip-link {
  position: fixed; top: 0; left: 50%;
  transform: translate(-50%, -120%);
  z-index: 10000;
  background: var(--blue); color: #fff;
  padding: .75rem 1.25rem;
  font-family: var(--f-mono); font-size: .75rem; letter-spacing: .1em;
  text-transform: uppercase;
  transition: transform .25s var(--e-out);
}
.skip-link:focus { transform: translate(-50%, 0); }

.u-accent { color: var(--accent); }
.u-mono { font-family: var(--f-mono); }
.u-nowrap { white-space: nowrap; }

/* ---------- 10. REDUCED MOTION -------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .grain::after { animation: none; }
}

/* ============================================================
   LE CHANFREIN
   Une tôle oxycoupée n'a pas d'angle vif : le chalumeau laisse un
   pan coupé. C'est la signature de forme du site — jamais un
   arrondi générique, toujours le même angle, toujours en bas à
   droite, dimensionné selon la pièce.
   ============================================================ */
:root {
  --ch-xs: 7px;
  --ch-sm: 12px;
  --ch-md: 20px;
  --ch-lg: 34px;
  --ch-xl: 56px;
}

.ch,
.ch-sm, .ch-md, .ch-lg, .ch-xl {
  --ch: var(--ch-md);
  clip-path: polygon(
    0 0,
    100% 0,
    100% calc(100% - var(--ch)),
    calc(100% - var(--ch)) 100%,
    0 100%
  );
}
.ch-sm { --ch: var(--ch-sm); }
.ch-lg { --ch: var(--ch-lg); }
.ch-xl { --ch: var(--ch-xl); }

/* Chanfrein opposé — pour les pièces qui se font face */
.ch-tl {
  --ch: var(--ch-md);
  clip-path: polygon(
    var(--ch) 0,
    100% 0,
    100% 100%,
    0 100%,
    0 var(--ch)
  );
}

/* Repère d'angle : quand une bordure doit rester nette, on marque la
   coupe d'un simple trait plutôt que de trancher le contour. */
.tick { position: relative; }
.tick::after {
  content: "";
  position: absolute;
  right: -1px; bottom: -1px;
  width: var(--ch-sm); height: var(--ch-sm);
  background: linear-gradient(-45deg, var(--bg) 50%, transparent 50.5%);
  border-bottom: 1px solid var(--rule);
  transform: rotate(0deg);
  pointer-events: none;
}

/* ============================================================
   BOUTONS — pan coupé et remplissage qui monte depuis la coupe
   ============================================================ */
.btn {
  --ch: var(--ch-sm);
  clip-path: polygon(
    0 0, 100% 0,
    100% calc(100% - var(--ch)),
    calc(100% - var(--ch)) 100%,
    0 100%
  );
  border: 0;
  background: var(--btn-bg, var(--blue));
  color: var(--btn-fg, #fff);
  padding: .92em 1.5em;
}
.btn::before { background: var(--btn-hover, var(--blue-700)); }
.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--fg);
  box-shadow: inset 0 0 0 1px var(--rule);
}
.btn--ghost::before { background: var(--fg); }
.btn--ghost:hover { --btn-fg: var(--bg); }
