/* Brassel Labs — feuille de styles unique, sans dépendance externe.
   Polices : piles système (aucun fichier à télécharger). */

:root {
  --paper: #fbf8f3;
  --paper-2: #f3eee6;
  --ink: #1c1b19;
  --ink-2: #57534c;          /* texte secondaire : contraste ≈ 7:1 sur --paper */
  --rule: #e2dbcf;
  --accent: #a93226;         /* rouge « sceau » : ≈ 6,3:1 sur --paper */
  --accent-soft: #f6e4df;
  --focus: #1f5fbf;
  --device: #17161a;
  --todo-bg: #fff1a8;
  --todo-ink: #4a3b00;
  --shadow: 0 1px 2px rgb(40 30 20 / .06), 0 8px 24px rgb(40 30 20 / .08);

  --serif: "Iowan Old Style", "Charter", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --wrap: 68rem;
  --measure: 40rem;
  --gutter: clamp(1rem, 4vw, 2rem);
  color-scheme: light dark;
}

/* Sombre : suit le système, sauf choix explicite via le bouton (data-theme sur <html>) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #151412;
    --paper-2: #1e1c19;
    --ink: #ede8e0;
    --ink-2: #b3ab9f;
    --rule: #34302a;
    --accent: #f08a78;
    --accent-soft: #3a211c;
    --focus: #8ab4ff;
    --device: #000;
    --todo-bg: #5c4a00;
    --todo-ink: #fff3b8;
    --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 8px 24px rgb(0 0 0 / .35);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #151412;
  --paper-2: #1e1c19;
  --ink: #ede8e0;
  --ink-2: #b3ab9f;
  --rule: #34302a;
  --accent: #f08a78;
  --accent-soft: #3a211c;
  --focus: #8ab4ff;
  --device: #000;
  --todo-bg: #5c4a00;
  --todo-ink: #fff3b8;
  --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 8px 24px rgb(0 0 0 / .35);
}
:root[data-theme="light"] { color-scheme: light; }

/* Chinois simplifié : polices système adaptées (aucun téléchargement) */
:lang(zh) {
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Source Han Sans SC", "Microsoft YaHei", system-ui, sans-serif;
}
html:lang(zh) body { line-height: 1.75; }
html:lang(zh) h1, html:lang(zh) h2, html:lang(zh) h3 { letter-spacing: .02em; line-height: 1.3; }
html:lang(zh) .eyebrow { letter-spacing: .2em; }
:lang(zh) .lead { line-height: 1.6; }
/* Titres et accroches : coupure seulement aux espaces et à la ponctuation */
html:lang(zh) h1, html:lang(zh) .tagline { word-break: keep-all; overflow-wrap: anywhere; }

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1.0625rem/1.6 var(--sans);
  font-kerning: normal;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

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

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 .5em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.1rem, 1.6rem + 2.4vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 1.3rem + 1vw, 2rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; text-wrap: pretty; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--accent); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip {
  position: absolute;
  left: -999rem;
  top: .5rem;
  z-index: 10;
  background: var(--ink);
  color: var(--paper);
  padding: .5rem 1rem;
  border-radius: 6px;
}
.skip:focus { left: .5rem; }

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

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

.todo {
  background: var(--todo-bg);
  color: var(--todo-ink);
  padding: 0 .3em;
  border-radius: 3px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: .85em;
}

/* ---------- En-tête ---------- */

.site-header {
  border-bottom: 1px solid var(--rule);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}
.brand span { white-space: nowrap; }
.brand svg { width: 2rem; height: 2rem; flex: none; }
/* le lien Contact reste dans le pied de page de chaque page */
@media (max-width: 30em) { .site-nav .nav-contact { display: none; } }
/* très petits écrans : le logo seul (le lien garde son nom accessible) */
@media (max-width: 22em) { .brand span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } }
@media (max-width: 26em) {
  .brand { font-size: 1.05rem; gap: .45rem; }
  .brand svg { width: 1.75rem; height: 1.75rem; }
  .site-nav ul { font-size: .88rem; gap: .7rem; }
}
.brand:hover { color: inherit; }

.site-nav ul {
  display: flex;
  align-items: center;
  gap: clamp(.75rem, 3vw, 1.75rem);
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: .95rem;
}
.site-nav a { text-decoration: none; padding: .5rem 0; }
.site-nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
/* Menu de langues : <details> natif, sans JavaScript */
.lang { position: relative; }
.lang summary {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  min-height: 2rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: .15rem .6rem;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .04em;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.lang summary::-webkit-details-marker { display: none; }
.lang summary:hover { border-color: var(--ink-2); }
.lang summary svg { transition: transform .15s; }
.lang details[open] summary svg { transform: rotate(180deg); }
.lang ul {
  position: absolute;
  right: 0;
  top: calc(100% + .4rem);
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 9rem;
  margin: 0;
  padding: .35rem;
  list-style: none;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: .75rem;
  box-shadow: var(--shadow);
}
.lang ul a {
  display: block;
  padding: .5rem .7rem;
  border-radius: .5rem;
  font-size: .92rem;
}
.lang ul a:hover { background: var(--paper-2); color: var(--ink); }
.lang ul a[aria-current="page"] { font-weight: 600; text-decoration: none; }
.lang ul a[aria-current="page"]::after { content: " ✓"; color: var(--accent); }

/* ---------- Sections communes ---------- */

.section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.section + .section { border-top: 1px solid var(--rule); }
.eyebrow {
  font-family: var(--sans);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .75rem;
}
.lead {
  font-family: var(--serif);
  font-size: clamp(1.2rem, 1.05rem + .6vw, 1.45rem);
  line-height: 1.45;
  max-width: var(--measure);
  color: var(--ink);
}
.muted { color: var(--ink-2); }
.measure { max-width: var(--measure); }

/* ---------- Accueil ---------- */

.hero { padding-block: clamp(3rem, 9vw, 6.5rem) clamp(2rem, 6vw, 4rem); }
.hero h1 { max-width: 18ch; }
.hero .lead { margin-top: 1.25rem; }

.app-cards {
  display: grid;
  gap: 1.25rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 48em) {
  .app-cards { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
}
.group-title {
  margin: 2.5rem 0 0;
  font-family: var(--sans);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.group-title + .app-cards { margin-top: 1rem; }

.app-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem 1.25rem;
  align-items: start;
  padding: clamp(1.25rem, 3vw, 1.75rem);
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 1.25rem;
  transition: border-color .15s, transform .15s;
}
.app-card:hover { border-color: var(--ink-2); }
.app-card:focus-within { border-color: var(--focus); }
.app-card h4 { margin: .1rem 0 .25rem; font-size: 1.45rem; }
.app-card h4 a { text-decoration: none; }
.app-card h4 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.app-card h4 a:focus-visible { outline: none; }
.app-card .tagline { font-family: var(--serif); font-size: 1.1rem; margin: 0 0 .75rem; }
.app-card .summary { grid-column: 1 / -1; margin: 0; color: var(--ink-2); }
.app-card { grid-template-rows: auto 1fr auto; }
.app-card .summary { align-self: start; }
.app-card .more {
  grid-column: 1 / -1;
  font-weight: 600;
  font-size: .95rem;
  color: var(--accent);
}

.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; padding: 0; list-style: none; }
.chips li {
  font-size: .78rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: .1rem .55rem;
  color: var(--ink-2);
  background: var(--paper);
}

.app-icon {
  width: var(--icon, 4.5rem);
  height: var(--icon, 4.5rem);
  border-radius: 22.5%;
  box-shadow: var(--shadow);
  flex: none;
}
.app-icon img { width: 100%; height: 100%; border-radius: inherit; }
/* Icônes macOS : marge transparente et forme déjà incluses dans l'image */
.app-icon.mac { border-radius: 0; box-shadow: none; transform: scale(1.18); }

.about { display: grid; gap: 2rem; }
@media (min-width: 48em) {
  .about { grid-template-columns: 1fr 2fr; align-items: start; }
}

/* ---------- Page d'application ---------- */

.app-hero {
  padding-block: clamp(2.5rem, 7vw, 5rem) clamp(1.5rem, 4vw, 2.5rem);
  display: grid;
  gap: 1.5rem;
}
@media (min-width: 40em) {
  .app-hero { grid-template-columns: auto 1fr; align-items: center; gap: 2rem; }
}
.app-hero .app-icon { --icon: clamp(5.5rem, 14vw, 8rem); }
.app-hero h1 { margin-bottom: .25rem; }
.app-hero .tagline {
  font-family: var(--serif);
  font-size: clamp(1.2rem, 1.05rem + .7vw, 1.55rem);
  line-height: 1.35;
  margin: 0;
  max-width: 34ch;
}
.app-hero .chips { margin-top: 1rem; }

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem 1.25rem;
  margin-top: 1.5rem;
}
.actions .badge img { height: 3rem; width: auto; }
.badge-placeholder {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  height: 3rem;
  padding: 0 1rem;
  border-radius: .55rem;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  line-height: 1.1;
}
.badge-placeholder small { font-size: .65rem; letter-spacing: .02em; }
.badge-placeholder span { font-size: 1.15rem; font-weight: 600; letter-spacing: -.01em; }
.badge-placeholder:hover { color: var(--paper); opacity: .9; }
.button {
  display: inline-flex;
  align-items: center;
  min-height: 3rem;
  padding: 0 1.25rem;
  border-radius: .7rem;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  text-decoration: none;
}
.button:hover { color: var(--paper); opacity: .9; }

code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: .88em;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: .05em .3em;
}
pre.code {
  margin: 0 0 1em;
  padding: 1rem 1.15rem;
  overflow-x: auto;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: .75rem;
  line-height: 1.55;
}
pre.code code { background: none; border: 0; padding: 0; font-size: .9rem; }
.text-link { font-weight: 600; }
.text-link::after { content: " →"; }

/* Galerie de captures dans un cadre d'appareil dessiné en CSS */
.gallery {
  display: flex;
  gap: clamp(1rem, 3vw, 2rem);
  margin: 0;
  padding: .5rem var(--gutter) 1.5rem;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  -webkit-overflow-scrolling: touch;
}
@media (min-width: 60em) {
  .gallery { justify-content: center; overflow-x: visible; }
}
.gallery li { flex: none; scroll-snap-align: start; width: min(68vw, 16.5rem); }
.gallery figure { margin: 0; }
.gallery figcaption {
  margin-top: .9rem;
  font-size: .9rem;
  color: var(--ink-2);
  text-align: center;
  text-wrap: balance;
}
.device {
  position: relative;
  padding: 3.2%;
  background: var(--device);
  border-radius: 13% / 6%;
  box-shadow: var(--shadow), inset 0 0 0 1.5px rgb(255 255 255 / .12);
}
.device img {
  width: 100%;
  height: auto;
  border-radius: 10.5% / 4.9%;
  background: #000;
}

/* Captures Mac : fenêtres sur fond blanc, dans un simple panneau */
.gallery-mac li { width: min(86vw, 34rem); }
.gallery-mac li.sz-s { width: min(86vw, 20rem); }
.gallery-mac li.sz-m { width: min(86vw, 26rem); }
.gallery-mac li.sz-l { width: min(86vw, 30rem); }
.gallery-mac { align-items: flex-start; }
@media (min-width: 60em) {
  .gallery-mac {
    justify-content: flex-start;
    overflow-x: auto;
    padding-inline: max(var(--gutter), calc((100vw - var(--wrap)) / 2 + var(--gutter)));
    scroll-padding-inline: max(var(--gutter), calc((100vw - var(--wrap)) / 2 + var(--gutter)));
  }
}
.shot {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.shot img { width: 100%; height: auto; }

.cols { display: grid; gap: 2.5rem; }
.cols > * { min-width: 0; }   /* un bloc de code défile au lieu d'élargir la colonne */
@media (min-width: 52em) {
  .cols { grid-template-columns: 1fr 1fr; gap: 3.5rem; }
}

.features {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 1rem;
}
.features li {
  position: relative;
  padding-left: 1.5rem;
}
.features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .62em;
  width: .55rem;
  height: .55rem;
  border-radius: 2px;
  background: var(--accent);
}
.features strong { font-weight: 600; }

.offer {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}
@media (min-width: 40em) {
  .offer { grid-template-columns: 1fr 1fr; }
}
.plan {
  border: 1px solid var(--rule);
  border-radius: 1rem;
  padding: 1.25rem 1.5rem;
  background: var(--paper-2);
}
.plan h3 { margin-bottom: .2rem; }
.plan .price { font-family: var(--serif); font-size: 1.25rem; margin: 0 0 .75rem; }
.plan ul { margin: 0; padding-left: 1.1rem; }
.plan li + li { margin-top: .35rem; }
.plan.premium { border-color: var(--accent); }
.offer + p { margin-top: 1.25rem; }

.note {
  border-left: 3px solid var(--accent);
  padding: .25rem 0 .25rem 1rem;
  color: var(--ink-2);
  font-size: .95rem;
}

.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: .6rem 1.5rem;
  margin: 0;
}
.facts dt { color: var(--ink-2); }
.facts dd { margin: 0; }
@media (max-width: 30em) {
  .facts { grid-template-columns: 1fr; gap: .1rem; }
  .facts dd { margin-bottom: .6rem; }
}

/* ---------- Pages de texte (légal, contact) ---------- */

.page-head { padding-block: clamp(2.5rem, 7vw, 4.5rem) 1rem; }
.prose { max-width: var(--measure); padding-bottom: clamp(3rem, 8vw, 5rem); }
.prose h2 { font-size: 1.4rem; margin-top: 2.25rem; }
.prose h3 { font-size: 1.1rem; margin-top: 1.5rem; }
.prose ul { padding-left: 1.2rem; }
.prose li + li { margin-top: .35rem; }
.prose address { font-style: normal; }
.updated { font-size: .9rem; color: var(--ink-2); }

.contact-mail {
  display: inline-block;
  font-family: var(--serif);
  font-size: clamp(1.4rem, 1.1rem + 1.4vw, 2rem);
  margin: .5rem 0 1.5rem;
  word-break: break-word;
}

/* ---------- Pied de page ---------- */

.site-footer {
  border-top: 1px solid var(--rule);
  padding-block: 2rem;
  font-size: .9rem;
  color: var(--ink-2);
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem 2rem;
}
.site-footer p { margin: 0; }
.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

@media print {
  .site-header nav, .skip, .gallery { display: none; }
  body { background: #fff; color: #000; }
}

/* ---------- Bascule de thème ---------- */
.theme-item { display: flex; }
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.theme-toggle[hidden] { display: none; }
.theme-toggle:hover { border-color: var(--ink-2); }
.theme-toggle svg { width: 1rem; height: 1rem; }
/* Lune en clair (passer en sombre), soleil en sombre (passer en clair) */
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: none; }
}

/* Images qui existent en version claire et sombre (icône d'A Quai, badges) */
.only-dark { display: none !important; }
:root[data-theme="dark"] .only-dark { display: block !important; }
:root[data-theme="dark"] .only-light { display: none !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .only-dark { display: block !important; }
  :root:not([data-theme="light"]) .only-light { display: none !important; }
}
