/* Tricodex — vitrine. Palette et typo reprises de l'app. */

@font-face {
  font-family: "Silkscreen";
  font-weight: 400;
  font-display: swap;
  src: url(/assets/fonts/silkscreen-latin-400-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212;
}
@font-face {
  font-family: "Silkscreen";
  font-weight: 700;
  font-display: swap;
  src: url(/assets/fonts/silkscreen-latin-700-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-weight: 400;
  font-display: swap;
  src: url(/assets/fonts/atkinson-hyperlegible-latin-400-normal.woff2) format("woff2");
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-weight: 700;
  font-display: swap;
  src: url(/assets/fonts/atkinson-hyperlegible-latin-700-normal.woff2) format("woff2");
}
@font-face {
  font-family: "DotGothic16";
  font-weight: 400;
  font-display: swap;
  src: url(/assets/fonts/dotgothic16-ja.woff2) format("woff2");
}

:root {
  --ink: #1a112a;
  --plum: #241a38;
  --plum-2: #2e2247;
  --line: #3d2e5c;
  --violet: #6d42c8;
  --violet-deep: #4a2c8f;
  --rose: #ff6f91;
  --rose-deep: #c4466a;
  --saffron: #ffb347;
  --cream: #f5eee6;
  --cream-deep: #b9aed0;
  --lav: #a99ec2;
  --text: #ebe4f2;

  --px: 4px;
  --font-px: "Silkscreen", "DotGothic16", ui-monospace, monospace;
  --font-body: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --wrap: 1120px;
  --gutter: clamp(1.25rem, 4vw, 2rem);

  color-scheme: dark;
}

:lang(ja) {
  --font-px: "Silkscreen", "DotGothic16", "Hiragino Sans", sans-serif;
  --font-body: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", Meiryo, system-ui, sans-serif;
}

*, *::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(--ink);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
:lang(ja) body, body:lang(ja) { line-height: 1.85; }

img { max-width: 100%; height: auto; display: block; }

a { color: var(--rose); text-underline-offset: .2em; }
a:hover { color: var(--cream); }

:focus-visible {
  outline: 3px solid var(--saffron);
  outline-offset: 6px;
}

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

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip {
  position: absolute;
  left: 1rem; top: -4rem;
  z-index: 10;
  background: var(--saffron);
  color: var(--ink);
  padding: .5rem 1rem;
  font-weight: 700;
}
.skip:focus { top: 1rem; }

h1, h2, h3 {
  font-family: var(--font-px);
  font-weight: 700;
  color: var(--cream);
  text-wrap: balance;
  margin: 0;
}
:lang(ja) h1, :lang(ja) h2 { font-weight: 400; }

/* ---------- Pixel boxes ----------
   Le "border" est fait de 4 ombres sans les coins : coins crantés comme dans l'app. */
.px {
  --c: var(--plum);
  --depth: transparent;
  background: var(--c);
  box-shadow:
    0 calc(var(--px) * -1) 0 var(--c),
    0 var(--px) 0 var(--c),
    calc(var(--px) * -1) 0 0 var(--c),
    var(--px) 0 0 var(--c),
    0 calc(var(--px) * 2) 0 var(--depth);
}

/* ---------- Header ---------- */
.site-header {
  padding-block: 1.25rem;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  color: var(--cream);
  text-decoration: none;
  font-family: "Silkscreen", monospace;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: .02em;
  margin-right: auto;
}
.brand svg { width: 28px; height: 28px; image-rendering: pixelated; }
.brand:hover { color: var(--cream); }

.lang { position: relative; }
.lang summary {
  list-style: none;
  cursor: pointer;
  font-family: "Silkscreen", monospace;
  font-size: .875rem;
  color: var(--lav);
  padding: .35rem .6rem;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}
.lang summary::-webkit-details-marker { display: none; }
.lang summary::after {
  content: "";
  width: 8px; height: 4px;
  background: currentColor;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.lang summary:hover, .lang[open] summary { color: var(--cream); }
.lang ul {
  position: absolute;
  right: 0;
  top: calc(100% + .75rem);
  z-index: 5;
  margin: 0;
  padding: .5rem 0;
  list-style: none;
  min-width: 13rem;
  --c: var(--plum-2);
}
.lang li a {
  display: block;
  padding: .45rem 1rem;
  color: var(--text);
  text-decoration: none;
  font-size: 1rem;
}
.lang li a:hover { background: var(--line); color: var(--cream); }
.lang li a[aria-current="true"] { color: var(--saffron); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-px);
  font-weight: 700;
  font-size: .9rem;
  text-decoration: none;
  color: var(--ink);
  padding: .55rem 1rem;
  margin: var(--px);
  --c: var(--rose);
  --depth: var(--rose-deep);
  transition: transform .06s;
}
:lang(ja) .btn { font-weight: 400; }
.btn:hover { color: var(--ink); --c: #ff86a3; }
.btn:active { transform: translateY(var(--px)); --depth: transparent; }

/* ---------- Hero ---------- */
.hero {
  padding-block: clamp(1.5rem, 5vw, 4rem) clamp(3rem, 7vw, 5.5rem);
}
.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: center;
}
.hero h1 {
  font-size: clamp(2rem, 4.4vw, 3.25rem);
  line-height: 1.12;
}
:lang(ja) .hero h1 { font-size: clamp(2rem, 4.2vw, 3.1rem); line-height: 1.3; }
.hero-lede {
  font-size: clamp(1.125rem, 1.6vw, 1.3rem);
  max-width: 33em;
  margin: 1.5rem 0 2rem;
}
.hero-platforms {
  color: var(--lav);
  font-size: 1rem;
  margin: 1.1rem 0 0;
}

.stores {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .9rem 1rem;
}
.badge {
  display: inline-block;
  line-height: 0;
  border-radius: 9px;
}
.badge img { height: 54px; width: auto; display: block; }

/* ---------- Démo jacquard ---------- */
.demo {
  --c: var(--plum);
  padding: 1rem;
  margin: var(--px);
  max-width: 30rem;
  justify-self: center;
  width: calc(100% - var(--px) * 2);
}
.demo-paper {
  background: var(--cream);
  color: #3a3346;
  padding: .9rem .9rem .7rem;
}
.demo-chart { width: 100%; height: auto; display: block; }
.demo-chart .hl { transition: transform .14s ease-out; }
.demo-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem 1rem;
  margin: .6rem 0 0;
  padding: 0;
  list-style: none;
  font-size: .8rem;
  line-height: 1.3;
}
.demo-legend li { display: inline-flex; align-items: center; gap: .4rem; }
.sw {
  display: inline-block;
  width: .85rem; height: .85rem;
  border: 1px solid rgba(0, 0, 0, .25);
  flex: none;
}
.sw-0 { background: #ece4d3; }
.sw-1 { background: #2f4372; }
.sw-2 { background: #e0a43a; }

.demo-status {
  text-align: center;
  padding: 1rem .25rem .25rem;
}
.demo-row {
  font-family: "Silkscreen", monospace;
  color: var(--cream);
  font-size: 1rem;
  margin: 0;
}
.demo-row-label { font-family: var(--font-px); font-weight: 400; }
.demo-row b { font-size: 1.9rem; vertical-align: -.12em; }
.demo-row .of { color: var(--lav); }
.demo-runs {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: .35rem .7rem;
  min-height: 1.9rem;
  margin: .35rem 0 0;
  font-family: "Silkscreen", monospace;
  font-weight: 700;
  color: var(--cream);
}
.demo-runs .reps { color: var(--saffron); }
.demo-runs .run { display: inline-flex; align-items: center; gap: .3rem; }
.demo-runs .sw { width: 1.1rem; height: 1.1rem; border-color: rgba(255, 255, 255, .2); }

.demo-controls {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0 .4rem;
}
.demo-caption {
  margin: 0;
  font-size: .9rem;
  color: var(--lav);
  line-height: 1.35;
  justify-self: start;
}
.plus-frame {
  grid-column: 2;
  position: relative;
  width: 132px; height: 132px;
  display: grid;
  place-items: center;
}
/* Le cadre est dessiné au-dessus du bouton (positionné) : il ne doit pas capter les clics. */
.plus-frame svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.plus-frame .track { stroke: var(--violet-deep); }
.plus-frame .fill { stroke: var(--saffron); transition: stroke-dasharray .14s ease-out; }
.plus {
  position: relative;
  appearance: none;
  border: 0;
  cursor: pointer;
  width: 92px; height: 92px;
  --c: var(--rose);
  --depth: var(--rose-deep);
  color: var(--cream);
  font-family: "Silkscreen", monospace;
  font-weight: 700;
  font-size: 1.6rem;
  line-height: 1;
  display: grid;
  place-content: center;
  gap: .2rem;
  transition: transform .06s;
}
.plus small {
  font-family: var(--font-px);
  font-size: .7rem;
  font-weight: 400;
  letter-spacing: .04em;
}
.plus:active { transform: translateY(var(--px)); --depth: transparent; }
.minus {
  grid-column: 3;
  justify-self: start;
  appearance: none;
  border: 0;
  cursor: pointer;
  width: 52px; height: 52px;
  --c: var(--violet);
  --depth: var(--violet-deep);
  color: var(--cream);
  font-family: "Silkscreen", monospace;
  font-weight: 700;
  font-size: 1rem;
  margin-right: var(--px);
  transition: transform .06s;
}
.minus:active { transform: translateY(var(--px)); --depth: transparent; }

/* ---------- Bande jacquard (bordure de pull) ---------- */
.band {
  height: 28px;
  background-color: var(--plum);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 7 7' shape-rendering='crispEdges'%3E%3Crect width='7' height='7' fill='%23241a38'/%3E%3Cpath fill='%23ffb347' d='M3 1h1v1H3zM2 2h3v1H2zM1 3h5v1H1zM2 4h3v1H2zM3 5h1v1H3z'/%3E%3Cpath fill='%23ff6f91' d='M0 0h1v1H0zM6 6h1v1H6zM0 6h1v1H0zM6 0h1v1H6z'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-size: 28px 28px;
  image-rendering: pixelated;
}

/* ---------- Fonctionnalités ---------- */
.features {
  padding-block: clamp(3rem, 8vw, 6rem) clamp(2rem, 6vw, 4rem);
}
.feature {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}
.feature + .feature { margin-top: clamp(4rem, 10vw, 7.5rem); }
.feature:nth-child(even) .feature-media { order: 2; }

.feature-media {
  display: flex;
  justify-content: center;
}
.feature-media.duo { padding-bottom: 3rem; }
.feature-media.duo .phone:nth-child(2) {
  margin-left: -3.5rem;
  transform: translateY(3rem);
}

.phone {
  margin: 0;
  width: clamp(200px, 24vw, 280px);
  padding: 8px;
  --c: #0f0a1a;
  margin: var(--px);
  flex: none;
}
.feature-media.duo .phone { width: clamp(170px, 20vw, 240px); }
.phone img {
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  background: var(--plum-2);
}

.feature-text h2 {
  font-size: clamp(1.5rem, 2.8vw, 2.15rem);
  line-height: 1.18;
  margin-bottom: 1.25rem;
}
:lang(ja) .feature-text h2 { line-height: 1.4; }
.feature-text p {
  margin: 0;
  max-width: 34em;
}
.feature-text p + p { margin-top: 1em; color: var(--lav); }

/* ---------- Hors ligne ---------- */
.offline {
  padding-block: clamp(3rem, 7vw, 5rem);
}
.offline .wrap {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  gap: clamp(1.25rem, 6vw, 5rem);
  align-items: start;
}
.offline h2 {
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  line-height: 1.2;
}
.offline p { margin: 0; max-width: 34em; }

/* ---------- Partenaire ---------- */
.partner {
  border-top: var(--px) solid var(--line);
  padding-block: clamp(3rem, 7vw, 5rem);
}
.partner .wrap {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(1.5rem, 6vw, 4.5rem);
  align-items: center;
}
.partner-logo img { width: clamp(160px, 22vw, 240px); height: auto; }
.partner-label {
  margin: 0 0 .4rem;
  color: var(--saffron);
  font-family: var(--font-px);
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.partner h2 {
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  line-height: 1.2;
}
.partner p { max-width: 36em; }
.partner-btn { margin-top: .75rem; --c: var(--saffron); --depth: #b97a26; }
.partner-btn:hover { --c: #ffc36b; }

/* ---------- Appel final ---------- */
.cta {
  background: var(--plum-2);
  padding-block: clamp(3rem, 7vw, 5rem);
}
.cta .wrap {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 4.5rem);
  align-items: center;
}
.cta-cat {
  width: clamp(200px, 30vw, 343px);
  image-rendering: pixelated;
}
.cta h2 {
  font-size: clamp(1.9rem, 4vw, 3rem);
  line-height: 1.1;
}
.cta p { margin: .75rem 0 1.75rem; color: var(--lav); }

/* ---------- Footer ---------- */
.site-footer {
  padding-block: 2.5rem 3rem;
  font-size: .95rem;
  color: var(--lav);
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: space-between;
}
.site-footer p { margin: 0; }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.footer-links a { color: var(--lav); }
.footer-links a:hover { color: var(--cream); }
.footer-langs {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: .25rem 1.1rem;
  margin: .5rem 0 0;
  padding: 1.25rem 0 0;
  border-top: 2px solid var(--line);
  list-style: none;
  font-size: .9rem;
}
.footer-langs a { color: var(--lav); text-decoration: none; }
.footer-langs a:hover { color: var(--cream); text-decoration: underline; }
.footer-langs a[aria-current="true"] { color: var(--saffron); }

/* ---------- Pages légales ---------- */
.legal {
  padding-block: clamp(2rem, 6vw, 4rem) clamp(3rem, 8vw, 6rem);
}
.legal .wrap { max-width: 46rem; }
.legal h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.15;
  margin-bottom: .5rem;
}
.legal h2 {
  font-size: 1.15rem;
  margin: 2.5rem 0 .75rem;
  color: var(--saffron);
}
.legal h3 {
  font-size: 1rem;
  margin: 1.5rem 0 .5rem;
}
.legal p { margin: 0 0 1em; }
.legal ul { margin: 0 0 1em; padding-left: 1.25em; }
.legal li { margin-bottom: .35em; }
.legal-date { color: var(--lav); font-size: .95rem; }
.todo { background: var(--saffron); color: var(--ink); padding: 0 .25em; }

/* ---------- Page de choix de langue / 404 ---------- */
.picker {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 2rem var(--gutter);
  text-align: center;
}
.picker .brand { margin: 0 auto 1.5rem; font-size: 1.6rem; }
.picker .brand svg { width: 40px; height: 40px; }
.picker h1 { font-size: 1.25rem; font-weight: 400; color: var(--lav); margin-bottom: 1.75rem; }
.picker p { color: var(--lav); }
.picker ul {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 1.25rem;
  max-width: 40rem;
}
.picker li .btn { width: calc(100% - var(--px) * 2); font-family: var(--font-body); font-size: 1.05rem; }

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .hero .wrap,
  .feature,
  .offline .wrap,
  .partner .wrap,
  .cta .wrap {
    grid-template-columns: minmax(0, 1fr);
  }
  .feature:nth-child(even) .feature-media { order: 0; }
  .feature-media { order: 0; }
  .cta .wrap { justify-items: start; }
  .cta-cat { justify-self: center; }
}

@media (max-width: 520px) {
  body { font-size: 1.0625rem; }
  .site-header .btn { display: none; }
  .badge img { height: 48px; }
  .demo { padding: .7rem; }
  .demo-caption { grid-row: 1; grid-column: 1 / -1; justify-self: center; text-align: center; }
  .plus-frame, .minus { grid-row: 2; }
  .feature-media.duo .phone { width: 44vw; }
  .feature-media.duo .phone:nth-child(2) { margin-left: -2rem; }
}

@media (prefers-reduced-motion: reduce) {
  .demo-chart .hl,
  .plus-frame .fill { transition: none; }
}
