/* Brickive — site web, style « Brique » de l'app : papier crème, briques à tranche pleine, tenons. */
:root {
  color-scheme: light;
  --paper: #FFF9E8;
  --paper-dark: #F4ECD2;
  --surface: #FFFFFF;
  --edge: #E6DCC0;
  --ink: #16204A;
  --ink-edge: #0A1030;
  --muted: #5A6178;
  --yellow: #FFCD00;
  --yellow-edge: #D9A000;
  --yellow-stud: #FFDC4D;
  --red: #D0161B;
  --red-edge: #96100F;
  --blue: #0B57C4;
  --blue-edge: #073E8F;
  --green: #2F7D4F;
  --green-edge: #1F5A37;
  --display: Fredoka, "Figtree", system-ui, sans-serif;
  --body: Figtree, system-ui, -apple-system, sans-serif;
  --side: clamp(16px, 4vw, 40px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font: 500 17px/1.5 var(--body);
}
main { flex: 1; }
img { display: block; max-width: 100%; height: auto; }
svg { width: 1em; height: 1em; flex: none; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
h1, h2, h3, p, figure, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.05; letter-spacing: -.01em; text-wrap: balance; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.shell { width: min(1120px, 100% - 2 * var(--side)); margin-inline: auto; }

/* ---------- Briques : une face, une tranche pleine dessous ---------- */
.brick-white, .brick-ink, .brick-yellow, .brick-red {
  --depth: 5px;
  border-radius: 22px;
  box-shadow: 0 var(--depth) 0 var(--brick-edge);
  background: var(--brick-face);
}
.brick-white { --brick-face: var(--surface); --brick-edge: var(--edge); }
.brick-ink { --brick-face: var(--ink); --brick-edge: var(--ink-edge); color: var(--surface); }
.brick-yellow { --brick-face: var(--yellow); --brick-edge: var(--yellow-edge); color: var(--ink); }
.brick-red { --brick-face: var(--red); --brick-edge: var(--red-edge); color: var(--surface); }

a.button, button.round, a.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  text-decoration: none; font-weight: 700; cursor: pointer; border: 0;
  transition: transform .08s ease, box-shadow .08s ease;
}
a.button { min-height: 54px; padding: 0 24px; border-radius: 18px; font: 600 1.1rem/1 var(--display); }
a.button svg { width: 1.15em; height: 1.15em; }
a.pill { min-height: 44px; padding: 0 18px; border-radius: 999px; --depth: 4px; font-size: .95rem; }
/* Enfoncée : la face descend sur sa tranche, comme dans l'app. */
:is(a.button, button.round, a.pill):active {
  transform: translateY(calc(var(--depth) - 1px));
  box-shadow: 0 1px 0 var(--brick-edge);
}
@media (hover: hover) {
  :is(a.button, button.round, a.pill):hover { filter: brightness(1.04); }
}

/* Tenons vus du dessus, sur les bandeaux jaunes. */
.yellow-band {
  position: relative;
  background: var(--yellow);
  border-radius: 0 0 36px 36px;
  box-shadow: 0 6px 0 var(--yellow-edge);
  overflow: hidden;
  isolation: isolate;
}
.yellow-band::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(circle, var(--yellow-stud) 0 12px, transparent 13px) 0 0 / 38px 38px;
  -webkit-mask-image: linear-gradient(100deg, transparent 30%, #000 75%);
  mask-image: linear-gradient(100deg, transparent 30%, #000 75%);
}

.dot {
  width: 10px; height: 10px; border-radius: 50%; flex: none;
  background: var(--gamme, var(--muted));
  box-shadow: inset 0 0 0 1.5px rgb(0 0 0 / .18);
}

/* ---------- En-tête et pied ---------- */
.topbar { position: relative; z-index: 2; }
.page-home .topbar, .page-list .topbar { background: var(--yellow); }
.topbar-inner { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: inline-block; text-decoration: none; font: 700 1.5rem/1 var(--display); white-space: nowrap; }
/* Le B en briques tient lieu de capitale : un peu plus haut, sa tranche passe sous la ligne. */
.brand-b { height: 1.02em; width: auto; vertical-align: -0.05em; margin-right: 0.06em; }
.brand-small { font-size: 1.15rem; }
nav { display: flex; align-items: center; gap: 20px; }
.nav-link { font-weight: 700; text-decoration: none; }
.nav-link:hover { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 2px; }

.footer { margin-top: clamp(56px, 8vw, 96px); padding: 28px 0 36px; border-top: 2px solid var(--edge); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px 28px; flex-wrap: wrap; }
.footer p { color: var(--muted); font-size: .88rem; max-width: 52ch; }
.footer-links { display: grid; gap: 6px; font-size: .88rem; font-weight: 700; }
.footer-links span { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.footer-links a { text-underline-offset: 4px; }

/* ---------- Accueil ---------- */
.hero-inner {
  display: grid; grid-template-columns: 1.05fr .95fr; align-items: center;
  gap: clamp(28px, 5vw, 64px);
  padding: clamp(20px, 4vw, 48px) 0 clamp(48px, 6vw, 80px);
}
.sticker {
  display: inline-block; transform: rotate(-3deg);
  background: var(--surface); border-radius: 10px; padding: 6px 12px;
  box-shadow: 0 3px 0 var(--yellow-edge);
  font: 600 .95rem/1.2 var(--display);
}
.hero h1 { font-size: clamp(2.7rem, 6.4vw, 5.2rem); margin-top: 18px; max-width: 12ch; }
.lead { margin-top: 18px; max-width: 40ch; font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: #3A3F55; }
.actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }

.hero-art { position: relative; padding: 18px 10px 24px; }
.hero-card { padding: 14px 14px 18px; transform: rotate(2deg); --depth: 7px; border-radius: 28px; }
.hero-card img { width: 100%; border-radius: 18px; background: #FDEBEC; }
.hero-card figcaption { display: grid; gap: 4px; padding: 14px 6px 0; }
.hero-card strong { font: 700 1.45rem/1.1 var(--display); }
.hero-meta { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; font-size: .95rem; }
.hero-exit { position: absolute; left: -6px; top: 4px; transform: rotate(-4deg); }
.hero-sticker {
  position: absolute; right: -4px; bottom: 6px; transform: rotate(-6deg);
  background: var(--surface); border-radius: 12px; padding: 8px 14px;
  box-shadow: 0 4px 0 var(--edge); font: 700 1.3rem/1 var(--display);
}

.open-card {
  display: grid; grid-template-columns: 1fr minmax(280px, 420px); align-items: center;
  gap: 18px 40px; margin-top: clamp(44px, 6vw, 72px);
  padding: clamp(22px, 3.5vw, 36px); border-radius: 28px; --depth: 6px;
}
.open-card h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.open-card p { color: var(--muted); margin-top: 8px; }
.code-form { display: flex; gap: 12px; align-items: center; }
.code-form input {
  flex: 1; min-width: 0; height: 58px; padding: 0 18px;
  background: var(--paper); border: 2px solid var(--edge); border-radius: 18px;
  font: 700 1.35rem/1 var(--body); letter-spacing: .14em; text-transform: uppercase;
}
.code-form input::placeholder { color: #B9B09A; }
.code-form input:focus { outline: none; border-color: var(--blue); }
button.round { width: 58px; height: 58px; border-radius: 50%; --depth: 5px; }
button.round svg { width: 26px; height: 26px; }

.steps { margin-top: clamp(56px, 8vw, 96px); }
.steps h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); }
.steps ol { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 30px; }
.step {
  position: relative; padding: 34px 24px 26px; border-radius: 24px;
  background: var(--step); color: var(--surface); box-shadow: 0 6px 0 var(--step-edge);
}
/* Deux tenons sur le dessus de chaque brique. */
.step::before, .step::after {
  content: ""; position: absolute; top: -9px; width: 28px; height: 10px;
  border-radius: 6px 6px 0 0; background: var(--step);
}
.step::before { left: 26px; }
.step::after { left: 70px; }
.step-blue { --step: var(--blue); --step-edge: var(--blue-edge); }
.step-red { --step: var(--red); --step-edge: var(--red-edge); }
.step-green { --step: var(--green); --step-edge: var(--green-edge); }
.step-num {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: rgb(255 255 255 / .2); font: 700 1.4rem/1 var(--display);
}
.step strong { display: block; margin-top: 18px; font: 700 1.45rem/1.1 var(--display); }
.step p { margin-top: 8px; opacity: .92; }
.soon { margin-top: 26px; color: var(--muted); font-weight: 600; }

/* ---------- Liste d'envies ---------- */
.list-hero { padding: 6px 0 clamp(64px, 8vw, 92px); }
.list-kicker { font-weight: 600; font-size: 1.05rem; }
.list-hero h1 { font-size: clamp(2.8rem, 8vw, 5.4rem); margin-top: 4px; overflow-wrap: anywhere; }
.list-body { margin-top: clamp(-56px, -6vw, -40px); position: relative; }

.stats { padding: clamp(18px, 3vw, 28px); border-radius: 26px; --depth: 6px; }
.figures { display: grid; grid-template-columns: 1fr auto auto; align-items: baseline; gap: 18px clamp(20px, 5vw, 56px); }
.figure { display: grid; gap: 2px; }
.figure strong { font: 700 clamp(1.5rem, 3.4vw, 2.1rem)/1 var(--display); }
.figure-main strong { font-size: clamp(2.2rem, 5vw, 3.1rem); }
.figure span { color: var(--muted); font-weight: 600; font-size: .92rem; }
.figure-end { text-align: right; }

.gamme-bar { display: flex; gap: 4px; margin-top: 26px; padding-top: 7px; }
/* Tenons comme dans l'app : 20 × 7 px, coins du haut arrondis, côté droit ombré,
   répartis sur la largeur (repeat: space) et absents quand la brique est trop courte. */
.segment {
  position: relative; min-width: 22px; height: 18px; border-radius: 6px;
  background: var(--gamme); box-shadow: 0 4px 0 var(--gamme-edge);
  container-type: inline-size;
}
.segment::before {
  --stud: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='7'%3E%3Cpath d='M0 7V5a5 5 0 0 1 5-5h10a5 5 0 0 1 5 5v2z'/%3E%3C/svg%3E");
  content: ""; position: absolute; left: 6px; right: 6px; top: -7px; height: 7px;
  background:
    linear-gradient(90deg, var(--gamme) 16px, color-mix(in srgb, var(--gamme), #000 12%) 16px)
    0 0 / 20px 7px space no-repeat;
  -webkit-mask: var(--stud) 0 0 / 20px 7px space no-repeat;
  mask: var(--stud) 0 0 / 20px 7px space no-repeat;
}
@container (max-width: 31px) { .segment::before { display: none; } }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 18px; }
.legend li { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; color: var(--muted); font-size: .92rem; }
.legend strong { color: var(--ink); }

.list-heading { font-size: clamp(1.5rem, 3vw, 2rem); margin: clamp(36px, 5vw, 52px) 0 20px 4px; }

/* Grille en maçonnerie : chaque carte garde les proportions de sa photo. */
.set-grid { columns: 4 240px; column-gap: 18px; }
.set-card {
  break-inside: avoid; margin-bottom: 20px; display: flex; flex-direction: column;
  background: var(--tint); border-radius: 20px; box-shadow: 0 5px 0 var(--tint-edge);
  padding: 8px; overflow: hidden;
}
.set-photo { position: relative; min-height: 150px; display: grid; place-items: center; padding: 14px 10px 10px; }
.set-photo img { width: 100%; max-height: 340px; object-fit: contain; mix-blend-mode: multiply; }
.set-photo-empty svg { width: 64px; height: 64px; color: var(--tint-edge); }
.parts-badge {
  position: absolute; top: 4px; right: 4px;
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--surface); border-radius: 999px; padding: 4px 10px 4px 8px;
  box-shadow: 0 2px 0 rgb(0 0 0 / .14); font-size: .82rem; font-weight: 700;
}
.parts-badge svg { width: 14px; height: 14px; }
.set-label {
  display: grid; justify-items: start; gap: 8px;
  background: var(--surface); border-radius: 13px; padding: 11px 13px 12px;
  box-shadow: 0 2px 0 var(--tint-edge);
}
.set-label h3 { font-size: 1.08rem; font-weight: 600; line-height: 1.18; }
.set-meta { display: flex; align-items: center; gap: 7px; width: 100%; font-size: .86rem; }
.set-gamme { flex: 1; min-width: 0; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.set-meta strong { font-size: .95rem; }

.exit-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--red); color: var(--surface); border-radius: 999px; padding: 5px 12px 5px 9px;
  box-shadow: 0 2px 0 var(--red-edge); font-size: .85rem; font-weight: 700; white-space: nowrap;
}
.exit-pill svg { width: 15px; height: 15px; }

.empty { display: grid; justify-items: center; gap: 14px; padding: 48px 24px; text-align: center; color: var(--muted); font-weight: 600; }

.invite {
  display: flex; align-items: center; justify-content: space-between; gap: 18px 32px; flex-wrap: wrap;
  margin-top: clamp(40px, 6vw, 64px); padding: clamp(22px, 3.5vw, 34px); border-radius: 28px; --depth: 6px;
}
.invite h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
.invite p { margin-top: 6px; opacity: .8; }

/* ---------- Liste introuvable ---------- */
.status { display: grid; place-items: center; padding-top: clamp(40px, 8vw, 90px); }
.status-card { width: min(520px, 100%); display: grid; justify-items: center; gap: 14px; text-align: center; padding: 36px 26px 32px; border-radius: 28px; --depth: 6px; }
.status-card h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); }
.status-card p { color: var(--muted); margin-bottom: 8px; }

/* ---------- Petits écrans ---------- */
/* ---------- Pages d'information (aide, confidentialité, suppression) ---------- */
.doc-hero { padding: clamp(36px, 6vw, 72px) 0 clamp(28px, 5vw, 56px); }
.doc-hero h1 { font-size: clamp(2.2rem, 5.4vw, 3.8rem); max-width: 18ch; }
.doc-hero p { margin-top: 14px; max-width: 60ch; font-weight: 600; }
.doc { width: min(760px, 100% - 2 * var(--side)); margin: clamp(32px, 5vw, 56px) auto 0; display: grid; gap: clamp(28px, 4vw, 44px); }
.doc section { display: grid; gap: 12px; }
.doc h2 { font-size: clamp(1.4rem, 3vw, 1.8rem); }
.doc h3 { font-size: 1.1rem; margin-top: 6px; }
.doc ul, .doc ol { display: grid; gap: 8px; padding-left: 1.2em; list-style: disc; }
.doc ol { list-style: decimal; }
.doc li::marker { color: var(--yellow-edge); }
.doc a { font-weight: 700; text-underline-offset: 4px; }
.doc-note { color: var(--muted); font-size: .92rem; }
.doc-card { padding: 22px 24px; border-radius: 22px; --depth: 5px; display: grid; gap: 10px; }
.doc table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 10px 12px 10px 0; border-bottom: 2px solid var(--edge); }
.doc th { font-family: var(--display); }

@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-art { max-width: 460px; justify-self: center; width: 100%; }
  .open-card { grid-template-columns: minmax(0, 1fr); }
  .steps ol { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 560px) {
  .nav-link { display: none; }
  .actions a.button { flex: 1 1 100%; }
  .figures { grid-template-columns: 1fr 1fr; }
  .figure-main { grid-column: 1 / -1; }
  .figure-end { text-align: left; }
  .set-grid { columns: 2; column-gap: 12px; }
  .set-card { margin-bottom: 14px; padding: 6px; border-radius: 16px; }
  .set-photo { min-height: 110px; padding: 10px 6px 8px; }
  .set-label { padding: 9px 10px 10px; }
  .set-label h3 { font-size: .98rem; }
  .exit-pill { font-size: .72rem; padding: 4px 9px; letter-spacing: -.01em; }
  .exit-pill svg { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
