/* TSYS Hardware — page d'accueil
   Motif : la barrette M.2 2280 (encoche M). Il découpe le hero, les boutons et les photos. */

:root {
  --ground: #333333;
  --surface-1: #3c3c3c;
  --surface-2: #474747;
  --ink: #e2e2e2;          /* gris clair, discret */
  --muted: #ababab;        /* contraste 5:1 sur le fond */
  --accent: #E95420;       /* orange Ubuntu */
  --accent-deep: #b8401a;
  --accent-text: #ff8a5c;   /* orange lisible en petit corps sur fond gris */
  --on-accent: #1c1c1c;

  --font: "Bai Jamjuree", system-ui, sans-serif;
  --step-display: clamp(52px, 6.6vw, 104px);
  --step-h2: clamp(36px, 4.2vw, 64px);
  --step-h3: clamp(26px, 2.6vw, 40px);
  --step-body: 18px;
  --step-small: 15px;

  --margin: clamp(16px, 3vw, 40px);
  --gap-section: clamp(120px, 14vw, 200px);

  /* encoche M : position et taille, réutilisées partout */
  --notch-x: 14%;
  --notch-w: 14px;
  --notch-h: 10px;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--step-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.03em; line-height: 0.98; color: var(--ink); }
p { margin: 0; }
::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Marque ---------- */
.w-light { font-weight: 400; }
.w-bold { font-weight: 700; }
.w-accent { font-weight: 600; color: var(--accent); }

/* ---------- Motif : encoche M ---------- */
.btn-notch, .notch-mask {
  clip-path: polygon(
    0 0, 100% 0, 100% 100%,
    calc(var(--notch-x) + var(--notch-w)) 100%,
    calc(var(--notch-x) + var(--notch-w)) calc(100% - var(--notch-h)),
    var(--notch-x) calc(100% - var(--notch-h)),
    var(--notch-x) 100%, 0 100%
  );
}

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 56px; padding: 0 30px 4px;
  background: var(--accent); color: var(--on-accent);
  font: 600 var(--step-body)/1 var(--font); text-decoration: none;
  transition: transform .18s var(--ease-out), background-color .18s;
}
.btn:hover { background: #f2652f; }
.btn:active { transform: scale(.97); }
.btn-small { min-height: 42px; padding: 0 20px 3px; font-size: 15px; --notch-h: 7px; --notch-w: 10px; }
.btn-dark { background: var(--on-accent); color: var(--ink); }
.btn-dark:hover { background: #000; }

/* ---------- Barre ---------- */
.bar {
  position: absolute; inset: 0 0 auto 0; z-index: 10;
  background: var(--ground);
  display: flex; align-items: center; gap: 32px;
  padding: 24px var(--margin);
}
.wordmark { font-size: 24px; text-decoration: none; letter-spacing: 0.02em; white-space: nowrap; }
.bar nav { margin-left: auto; }
.nav-links { display: flex; gap: 28px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 500;
  transition: color .15s;
}
.nav-links a:hover { color: var(--accent-text); }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100svh; overflow: hidden;
  display: grid; align-items: center;
  padding: 120px var(--margin) 80px;
}
.hero-text { position: relative; z-index: 2; max-width: 46%; }
.hero h1 { font-size: var(--step-display); }
.hero-lead { margin-top: 36px; max-width: 34ch; }
.hero .btn { margin-top: 40px; }
.hero-shape {
  position: absolute; z-index: 1;
  left: 46%; top: 56%;
  width: 150vh; min-width: 900px;
  transform: translateY(-50%) rotate(-62deg) translateX(-8%);
  transform-origin: 30% 50%;
}
.m2 { width: 100%; height: auto; overflow: visible; }

/* ---------- Séries ---------- */
.series {
  display: grid; grid-template-columns: 1fr 1fr;
  min-height: 88svh;
  margin-top: var(--gap-section);
  background: var(--surface-1);
}
.tab-input { position: absolute; opacity: 0; pointer-events: none; }
.series-photo { display: grid; place-items: center; padding: 40px; }
.series-photo figure { margin: 0; width: 100%; aspect-ratio: 1; overflow: hidden; }
.series-photo img { width: 100%; height: 100%; object-fit: cover; }
.photo-nas { display: none; }
#tab-nas:checked ~ .series-photo .photo-adv { display: none; }
#tab-nas:checked ~ .series-photo .photo-nas { display: block; }

.series-text {
  display: flex; flex-direction: column; justify-content: space-between; gap: 48px;
  padding: 56px var(--margin) 40px 40px;
}
.tabs { display: flex; gap: 32px; font-size: 18px; font-weight: 600; letter-spacing: 0.02em; }
.tabs label { color: var(--muted); cursor: pointer; padding: 6px 0; transition: color .15s; }
.tabs label:hover { color: var(--ink); }
#tab-adv:checked ~ .series-text label[for="tab-adv"],
#tab-nas:checked ~ .series-text label[for="tab-nas"] { color: var(--accent-text); }
#tab-adv:focus-visible ~ .series-text label[for="tab-adv"],
#tab-nas:focus-visible ~ .series-text label[for="tab-nas"] { outline: 3px solid var(--accent); outline-offset: 4px; }

.panel-nas { display: none; }
#tab-nas:checked ~ .series-text .panel-adv { display: none; }
#tab-nas:checked ~ .series-text .panel-nas { display: block; }
.series-name { font-size: var(--step-h3); }
.series-desc { margin-top: 32px; max-width: 36ch; }
.figures { display: flex; flex-wrap: wrap; gap: 24px 56px; margin: 48px 0 0; }
.figures div { display: flex; flex-direction: column-reverse; }
.figures dt { color: var(--muted); font-size: var(--step-small); margin-top: 6px; }
.figures dd { margin: 0; font-size: var(--step-h2); font-weight: 700; line-height: 1; letter-spacing: -0.03em; }
.figures dd span { font-size: var(--step-body); font-weight: 600; color: var(--accent-text); letter-spacing: 0; }

.cells { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cell {
  display: flex; align-items: center; padding: 0 24px; min-height: 72px;
  font-weight: 600; text-decoration: none;
  transition: background-color .15s, transform .18s var(--ease-out);
}
.cell:active { transform: scale(.98); }
.cell-ink { background: var(--accent); color: var(--on-accent); }
.cell-ink:hover { background: #f2652f; }
.cell-tone { background: var(--surface-2); color: var(--ink); }
.cell-tone:hover { background: #525252; }

/* ---------- Capacités ---------- */
.specs { padding: var(--gap-section) var(--margin) 0; }
.specs-title { font-size: var(--step-h2); }
.specs-title { text-indent: 3vw; }
.specs-grid {
  display: grid; grid-template-columns: repeat(12, 1fr); gap: 0 24px;
  margin-top: 96px; align-items: end;
}
.calc { grid-column: 1 / 7; background: var(--surface-1); padding: 40px; }
.calc-title { font-size: var(--step-h3); line-height: 1.1; letter-spacing: -0.02em; }
.calc-label { display: block; margin-top: 28px; color: var(--ink); }
.calc-label output { color: var(--accent-text); font-weight: 700; }
input[type="range"] {
  width: 100%; margin: 16px 0 0; height: 44px; background: transparent;
  -webkit-appearance: none; appearance: none; accent-color: var(--accent);
}
input[type="range"]::-webkit-slider-runnable-track { height: 6px; background: var(--surface-2); }
input[type="range"]::-moz-range-track { height: 6px; background: var(--surface-2); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 28px; height: 28px; margin-top: -11px;
  background: var(--accent); border: 0; border-radius: 0;
}
input[type="range"]::-moz-range-thumb { width: 28px; height: 28px; background: var(--accent); border: 0; border-radius: 0; }
.presets { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.presets button {
  font: 500 15px/1 var(--font); color: var(--ink);
  background: var(--surface-2); border: 0; padding: 12px 14px; min-height: 44px; cursor: pointer;
  transition: background-color .15s, transform .15s var(--ease-out);
}
.presets button:hover { background: #555; }
.presets button:active { transform: scale(.96); }
.presets button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.years { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 36px; }
.years p { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; }
.years-num { font-size: var(--step-h2); font-weight: 700; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.years-unit { font-weight: 600; color: var(--accent-text); }
.years-name { flex-basis: 100%; color: var(--muted); font-size: var(--step-small); margin-top: 6px; }
.calc-note { margin-top: 28px; color: var(--muted); font-size: var(--step-small); }

.table-wrap { grid-column: 8 / 13; position: relative; }
.table-name { position: absolute; left: -24px; top: 0; transform: translateX(-100%); color: var(--muted); font-size: var(--step-small); }
table { width: 100%; border-collapse: collapse; font-size: var(--step-small); font-variant-numeric: tabular-nums; }
th, td { padding: 13px 0; text-align: left; font-weight: 400; vertical-align: baseline; }
th { color: var(--ink); font-weight: 600; width: 34%; }
td { color: var(--muted); }
td:last-child { text-align: right; color: var(--ink); }
td a { text-decoration: none; color: var(--accent-text); font-weight: 600; }
td a:hover { text-decoration: underline; text-underline-offset: 4px; }
tr.group-start th, tr.group-start td { padding-top: 44px; }

/* ---------- Sélection ---------- */
.select { padding: var(--gap-section) var(--margin) 0; }
.select-intro { display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px; align-items: start; }
.select-intro h2 { grid-column: 1 / 6; font-size: var(--step-h2); }
.select-intro p { grid-column: 7 / 12; }
.stages { display: flex; height: 520px; margin-top: 64px; }
.stage { flex: 0 0 9%; position: relative; overflow: hidden; transition: flex-basis .45s var(--ease-out); }
.stage[open] { flex: 1 1 58%; }
.s1 { background: #4a2a1c; color: #efefef; }
.s2 { background: #6b3219; color: #efefef; }
.s3 { background: #943d17; color: #f4f4f4; }
.s4 { background: #c04714; color: #ffffff; }
.s5 { background: #E95420; color: var(--on-accent); }
.stage summary {
  list-style: none; cursor: pointer; position: absolute; inset: 0;
  font-size: var(--step-body); font-weight: 700;
}
.stage summary::-webkit-details-marker { display: none; }
.stage:not([open]) summary {
  writing-mode: vertical-rl; transform: rotate(180deg);
  padding: 28px 0 0; display: flex; align-items: flex-start; justify-content: flex-start;
  padding-right: calc(50% - 12px);
}
.stage:not([open]):hover { filter: brightness(1.12); }
.stage[open] summary { position: absolute; inset: 32px auto auto 32px; font-size: var(--step-h3); letter-spacing: -0.03em; cursor: default; }
.stage-body {
  position: absolute; inset: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 32px;
  padding: 32px; padding-top: 110px;
}
.stage-body p { align-self: end; max-width: 36ch; }
.stage-body img { width: 100%; height: 100%; object-fit: cover; grid-column: 2; grid-row: 1; }
.stage-body:not(:has(img)) p { grid-column: 1 / -1; }

/* ---------- FAQ ---------- */
.faq {
  display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px;
  padding: var(--gap-section) var(--margin) 0; align-items: start;
}
.faq-side { grid-column: 1 / 5; position: sticky; top: 40px; }
.faq-title { font-size: var(--step-h2); }
.faq-side img { margin-top: 40px; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.faq-list { grid-column: 5 / 13; display: grid; gap: 8px; }
.tile { background: var(--surface-1); transition: background-color .2s; }
.tile summary {
  list-style: none; cursor: pointer; min-height: 72px; padding: 20px 64px 20px 24px;
  display: flex; align-items: center; font-size: var(--step-body); font-weight: 600; position: relative;
}
.tile summary::-webkit-details-marker { display: none; }
.tile summary::before, .tile summary::after {
  content: ""; position: absolute; right: 24px; top: 50%; width: 16px; height: 3px;
  background: currentColor; transition: transform .25s var(--ease-out);
}
.tile summary::after { transform: rotate(90deg); }
.tile:not([open]) summary:hover { background: var(--surface-2); }
.tile[open] { background: var(--accent); color: var(--on-accent); }
.tile[open] summary::after { transform: rotate(0deg); }
.tile p { padding: 0 24px 24px; max-width: 52ch; }

/* ---------- CTA ---------- */
.cta { padding-top: var(--gap-section); overflow: hidden; }
.cta-row {
  display: grid; grid-template-columns: 1fr 4fr 1fr; gap: 12px;
  height: 360px; margin: 0 calc(-1 * 6vw);
}
.cta-flank { overflow: hidden; }
.cta-photo img { width: 100%; height: 100%; object-fit: cover; }
.cta-flat { background: var(--surface-2); }
.cta-main {
  background: var(--accent); color: var(--on-accent);
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
  padding: 40px;
}
.cta-main h2 { font-size: var(--step-h3); color: var(--on-accent); max-width: 18ch; }
.cta-main p { margin-top: 20px; max-width: 44ch; }
.cta-main .btn { margin-top: 28px; }

/* ---------- Pied de page ---------- */
.foot { margin-top: 96px; background: #2a2a2a; padding: 32px var(--margin) 32px; }
.blocks { display: flex; align-items: flex-end; gap: 4px; height: 34svh; min-height: 220px; }
.b {
  flex: 1; display: flex; align-items: flex-end; justify-content: center;
  background: var(--surface-2); color: #2a2a2a;
  font-size: clamp(64px, 15vw, 240px); line-height: .8; font-weight: 400; padding-bottom: 2%;
}
.b-bold { font-weight: 700; background: var(--accent); }
.b1 { height: 86%; } .b2 { height: 78%; } .b3 { height: 92%; } .b4 { height: 82%; }
.b5 { height: 100%; } .b6 { height: 90%; } .b7 { height: 96%; }
.foot-cols {
  display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px; margin-top: 56px;
}
.foot-cols ul { grid-column: span 2; list-style: none; margin: 0; padding: 0; font-size: var(--step-small); display: grid; gap: 8px; }
.foot-cols a { color: var(--ink); text-decoration: none; }
.foot-cols a:hover { color: var(--accent); }
.foot-contact { grid-column: 9 / 13; font-style: normal; font-size: var(--step-small); color: var(--ink); }
.credits { margin-top: 48px; font-size: var(--step-small); color: var(--muted); max-width: 120ch; }
.credits a { color: var(--ink); }
.foot-last { display: flex; justify-content: space-between; align-items: center; margin-top: 32px; font-size: var(--step-small); color: var(--muted); }

/* ---------- Mouvement ---------- */
.js .reveal { opacity: 0; transform: translateY(24px); }
.js .reveal.in { opacity: 1; transform: none; transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); transition-delay: var(--d, 0ms); }

.js .shutter { clip-path: inset(0 100% 0 0); }
.js .shutter img { transform: scale(1.12); }
.js .shutter.in { clip-path: polygon(0 0,100% 0,100% 100%,calc(var(--notch-x) + 28px) 100%,calc(var(--notch-x) + 28px) calc(100% - 20px),var(--notch-x) calc(100% - 20px),var(--notch-x) 100%,0 100%); transition: clip-path 1.1s var(--ease-out); }
.js .shutter.in img { transform: none; transition: transform 1.4s var(--ease-out); }
.series-photo .notch-mask { --notch-w: 28px; --notch-h: 20px; }

.hero-shape .m2 { animation: board-in 1.2s var(--ease-out) both .15s; }
@keyframes board-in { from { opacity: 0; transform: translateX(14%); } to { opacity: 1; transform: none; } }

.cta-photo img { animation: drift 18s ease-in-out infinite alternate; }
@keyframes drift { from { transform: scale(1.06) translateX(-2%); } to { transform: scale(1.12) translateX(2%); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal, .js .reveal.in { opacity: 1; transform: none; transition: opacity .3s; }
  .js .shutter, .js .shutter.in { transition: none; }
  .js .shutter img, .js .shutter.in img { transform: none; transition: none; }
  .hero-shape .m2, .cta-photo img { animation: none; }
  .stage { transition: none; }
}

/* ---------- Tablette ---------- */
@media (max-width: 1024px) {
  .bar > .btn { display: none; }
  .nav-links { gap: 20px; }
  .hero-text { max-width: 58%; }
  .hero-shape { left: 52%; }
  .calc { grid-column: 1 / 13; }
  .table-wrap { grid-column: 1 / 13; margin-top: 72px; }
  .table-name { position: static; transform: none; margin-bottom: 8px; }
  .specs-grid { align-items: start; }
  .faq-side { grid-column: 1 / -1; position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: end; }
  .faq-side img { margin-top: 0; }
  .faq-list { grid-column: 1 / -1; }
}

/* ---------- Téléphone ---------- */
@media (max-width: 720px) {
  .bar { padding: 16px var(--margin); gap: 16px; }
  .wordmark { font-size: 18px; }
  .wordmark .w-accent { color: var(--accent-text); }
  .nav-links li:not(:first-child) { display: none; }

  .hero { align-items: start; padding-top: 15svh; min-height: 100svh; }
  .hero-text { max-width: none; }
  .hero h1 { font-size: 13vw; }
  .hero-lead { margin-top: 24px; }
  .hero .btn { margin-top: 28px; }
  .hero-shape {
    left: 50%; top: 66svh; width: 150vw; min-width: 0;
    transform: translateX(-50%) rotate(-8deg);
    transform-origin: 50% 50%;
  }

  .series { grid-template-columns: 1fr; min-height: 0; }
  .series-photo { padding: 16px 16px 0; }
  .series-text { padding: 32px 16px 16px; gap: 32px; }
  .tabs { font-size: var(--step-body); }
  .series-desc { margin-top: 20px; }
  .figures { margin-top: 32px; }
  .cells { grid-template-columns: 1fr; }
  .cell { min-height: 60px; }

  .specs-title { font-size: 9.5vw; text-indent: 0; }
  .specs-grid { margin-top: 56px; }
  .calc { padding: 24px 16px; margin: 0 -16px; }
  .years { gap: 16px; }

  .select-intro h2 { grid-column: 1 / -1; }
  .select-intro p { grid-column: 1 / -1; }
  .stages { flex-direction: column; height: auto; margin-top: 40px; }
  .stage { flex: none; min-height: 64px; }
  .stage[open] { flex: none; }
  .stage summary, .stage:not([open]) summary, .stage[open] summary {
    position: static; writing-mode: horizontal-tb; transform: none;
    padding: 20px 16px; font-size: 18px; min-height: 64px; display: flex; align-items: center;
  }
  .stage[open] summary { font-size: 24px; }
  .stage-body { position: static; display: block; padding: 0 16px 20px; }
  .stage-body p { font-size: 17px; }
  .stage-body img { margin-top: 16px; aspect-ratio: 3 / 2; height: auto; }

  .faq-title { font-size: 9vw; }
  .faq-side { grid-template-columns: 1fr; }
  .faq-side img { width: 60%; margin-left: auto; }
  .faq-list { gap: 6px; }
  .tile summary { font-size: 18px; min-height: 64px; }
  .tile p { font-size: 16px; padding: 0 20px 20px; }

  .cta-row { grid-template-columns: 1fr 1fr; grid-template-rows: auto 120px; height: auto; margin: 0 var(--margin); gap: 8px; }
  .cta-main { grid-column: 1 / -1; grid-row: 1; min-height: 300px; padding: 28px 20px; }
  .cta-main h2 { font-size: 28px; }
  .cta-photo { grid-row: 2; grid-column: 1; }
  .cta-flat { grid-row: 2; grid-column: 2; }

  .blocks { height: 22svh; min-height: 140px; }
  .b { font-size: 20vw; }
  .foot-cols { grid-template-columns: 1fr 1fr; }
  .foot-cols ul { grid-column: span 1; }
  .foot-contact { grid-column: 1 / -1; }
  .foot-last { gap: 16px; }
}
