/* ============================================================
   Treffel Coffee House — La carte
   Deux options de couleur, d'après le brand book Coffee House :
   html[data-theme="bordeaux"] (fond bordeaux #471224, écriture crème #fff9f2)
   html[data-theme="beige"]    (fond crème #fff9f2, écriture bordeaux #471224)
   Accents : or pâle #f3e8b8 sur bordeaux, vert forêt #22372c sur beige.
   Le trèfle est la seule ornementation.
   ============================================================ */

:root {
  --bordeaux: #471224;
  --cream: #fff9f2;
  --forest: #22372c;
  --gold: #f3e8b8;

  --serif: "Teodor", "Instrument Serif", Georgia, serif;
  --sans: "Bagoss Standard", "Instrument Sans", "Segoe UI", sans-serif;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

html[data-theme="bordeaux"] {
  --bg: var(--bordeaux);
  --bg-alt: #3c0f1e;
  --ink: var(--cream);
  --ink-soft: rgba(255, 249, 242, 0.74);
  --ink-faint: rgba(255, 249, 242, 0.54);
  --line: rgba(255, 249, 242, 0.26);
  --line-strong: rgba(255, 249, 242, 0.6);
  --accent: var(--gold);
  --photo-bg: #5a1c31;
  --photo-clover: rgba(255, 249, 242, 0.18);
  --pattern: var(--pattern-cream);
  --bar: rgba(71, 18, 36, 0.94);
}

html[data-theme="beige"] {
  --bg: var(--cream);
  --bg-alt: #f6eee8;
  --ink: var(--bordeaux);
  --ink-soft: rgba(71, 18, 36, 0.76);
  --ink-faint: rgba(71, 18, 36, 0.64);
  --line: rgba(71, 18, 36, 0.22);
  --line-strong: rgba(71, 18, 36, 0.56);
  --accent: var(--forest);
  --photo-bg: var(--gold);
  --photo-clover: rgba(71, 18, 36, 0.2);
  --pattern: var(--pattern-forest);
  --bar: rgba(255, 249, 242, 0.94);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

::selection { background: var(--accent); color: var(--bg); }

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  overflow-x: clip;
}

body {
  font-family: var(--sans);
  font-size: 16px;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  transition: background 0.5s var(--ease), color 0.5s var(--ease);
}

svg { fill: currentColor; }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* apparition au défilement (app.js) */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: var(--d, 0s);
}
.reveal.is-in { opacity: 1; transform: none; }

/* ============================================================
   Couverture
   ============================================================ */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: 1.1rem 1.25rem 0;
  overflow: hidden;
  overflow: clip;
  isolation: isolate;
}

/* grand trèfle en filigrane */
.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  right: -18vw;
  top: 8vh;
  width: 78vw;
  height: 78vw;
  max-width: 720px;
  max-height: 720px;
  background: var(--pattern-hero) center / contain no-repeat;
  opacity: 0.09;
  pointer-events: none;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  white-space: nowrap;
  flex-shrink: 0;
  font-size: 0.68rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  font-weight: 500;
}

.topbar-clover { width: 14px; height: 14px; }

.switches { display: flex; gap: 0.4rem; flex-shrink: 0; }

@media (max-width: 400px) {
  .topbar { gap: 0.5rem; }
  .topbar-brand { letter-spacing: 0.16em; gap: 0.4rem; font-size: 0.64rem; }
  .switches { gap: 0.3rem; }
  .switch { padding: 0.42rem 0.55rem; letter-spacing: 0.08em; font-size: 0.64rem; }
  .switch .dot { display: none; }
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: border-color 0.25s, background 0.25s;
}

.switch:hover { border-color: var(--line-strong); }

.switch span { opacity: 0.66; transition: opacity 0.2s; }
.switch span.on { opacity: 1; font-weight: 600; }
.switch .sep { opacity: 0.5; }

.switch .dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  opacity: 1;
}

.hero-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 1.6rem;
  padding: 2.5rem 0 2rem;
}

.hero-emblem {
  width: clamp(72px, 16vw, 120px);
  height: auto;
  animation: rise 1.2s 0.1s var(--ease) both;
}

.hero-text { max-width: 720px; }

.hero-kicker {
  font-size: 0.7rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 1rem;
  animation: rise 1.2s 0.3s var(--ease) both;
}

.hero-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.7rem, 9.5vw, 6.2rem);
  line-height: 0.98;
  letter-spacing: -0.01em;
  animation: rise 1.2s 0.45s var(--ease) both;
}

.hero-title em { font-style: italic; display: block; }
.hero-title span { display: block; color: var(--accent); }

.hero-line {
  font-size: clamp(0.85rem, 2.3vw, 1rem);
  color: var(--ink-soft);
  margin-top: 1.4rem;
  max-width: 34ch;
  animation: rise 1.2s 0.6s var(--ease) both;
}

.hero-foot { padding-bottom: 0.4rem; }

/* ligne de fond de court + marque centrale */
.baseline {
  position: relative;
  height: 1px;
  background: var(--line-strong);
  margin-bottom: 1.4rem;
  transform-origin: left;
  animation: draw 1.4s 0.7s var(--ease) both;
}

.baseline-tick {
  position: absolute;
  left: 50%;
  top: -7px;
  width: 1px;
  height: 15px;
  background: var(--line-strong);
}

.hero-wordmark {
  display: block;
  width: 100%;
  height: auto;
  animation: rise 1.2s 0.9s var(--ease) both;
}

.hero-house {
  font-size: calc((100vw - 2.5rem) * 0.048);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-align: center;
  margin: 0.55em 0 0.3rem 23.5%;
  text-indent: 0.2em;
  line-height: 1;
  color: var(--ink);
  animation: rise 1.2s 1.05s var(--ease) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(26px); }
  to   { opacity: 1; transform: none; }
}

@keyframes draw {
  from { transform: scaleX(0); }
  to   { transform: none; }
}

/* ============================================================
   Index des sets (barre collante)
   ============================================================ */

.index {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  gap: 1.6rem;
  overflow-x: auto;
  padding: 0.95rem 1.25rem;
  background: var(--bar);
  backdrop-filter: blur(6px);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}

.index::-webkit-scrollbar { display: none; }

.index a {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0.66;
  transition: opacity 0.25s;
}

.index a:hover { opacity: 0.85; color: inherit; }

.index a .num {
  font-family: var(--serif);
  font-size: 0.95rem;
  letter-spacing: 0;
  font-style: italic;
}

/* le trèfle se pose devant le set en cours */
.index a .mark {
  width: 0;
  height: 11px;
  overflow: hidden;
  transition: width 0.35s var(--ease);
}

.index a .mark svg { width: 11px; height: 11px; display: block; }

.index a.active { opacity: 1; color: var(--accent); }
.index a.active .mark { width: 11px; }

/* ============================================================
   La carte
   ============================================================ */

.menu { padding: 0; }

.set {
  position: relative;
  scroll-margin-top: 3.4rem;
  padding: 3.6rem 1.25rem 2.6rem;
}

/* tous les sets partagent le même fond ; seule la ligne au trèfle les sépare */

.set-inner { max-width: 1080px; margin: 0 auto; }

.set-head { margin-bottom: 2.2rem; }

.set-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.68rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.9rem;
}

.set-label svg { width: 12px; height: 12px; }

.set-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.1rem, 6.4vw, 3.4rem);
  line-height: 1;
  letter-spacing: -0.01em;
}

.set-note {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--ink-soft);
  margin-top: 0.8rem;
  max-width: 48ch;
}

/* sous-groupes (ex. Boissons : Caféteria, Matchas…) */
.group { margin-top: 2.4rem; }
.group:first-child { margin-top: 0; }

.group-head {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  margin-bottom: 1.1rem;
}

.group-title {
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 400;
}

.group-note {
  font-size: 0.78rem;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
}

/* --- la liste des produits : un registre réglé --- */

.ledger {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  border-top: 1px solid var(--line);
}

.dish {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.95rem;
  padding: 1.4rem 0 1.5rem;
  border-bottom: 1px solid var(--line);
}

/* pas de trait sous le dernier produit : la ligne au trèfle suffit */
.ledger .dish:last-child { border-bottom: 0; }


/* photo carrée ; tant qu'elle manque, un trèfle en attend une */
.dish-photo {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  overflow: hidden;
  background: var(--photo-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.dish-photo > svg {
  position: absolute;
  width: 30%;
  height: auto;
  color: var(--photo-clover);
}

.dish-photo img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.8s var(--ease);
}

.dish:hover .dish-photo img { transform: scale(1.06); }

/* vidéo en boucle par-dessus la photo (la photo sert d'image d'attente) */
.dish-photo video {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.8s var(--ease);
  pointer-events: none;
}

.dish-photo.has-video video { opacity: 1; }

/* le petit sceau trèfle, comme sur les emballages */
.dish-photo .stamp {
  position: absolute;
  z-index: 2;
  right: 8px;
  bottom: 8px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}

.dish-photo .stamp svg { width: 12px; height: 12px; }


.dish-photo.has-img .stamp { opacity: 1; transform: none; }

.dish-body { min-width: 0; }

.dish-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.dish-name {
  font-family: var(--serif);
  font-size: 1.5rem;
  line-height: 1.15;
  font-weight: 400;
}


.dish-price {
  font-family: var(--serif);
  font-size: 1.15rem;
  color: var(--accent);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.dish-desc {
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--ink-soft);
  margin-top: 0.35rem;
}

.dish-extra {
  font-size: 0.76rem;
  line-height: 1.5;
  font-style: italic;
  color: var(--ink-faint);
  margin-top: 0.3rem;
}

/* --- indices nutritionnels --- */

.nutri { margin-top: 0.75rem; }

.nutri summary {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  list-style: none;
  cursor: pointer;
  padding: 0.38rem 0.75rem 0.38rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  transition: border-color 0.25s, color 0.25s;
  -webkit-tap-highlight-color: transparent;
}

.nutri summary::-webkit-details-marker { display: none; }
.nutri summary:hover { border-color: var(--line-strong); color: var(--ink); }

.nutri-icon { width: 14px; height: 14px; fill: none; color: var(--accent); flex: none; }
.nutri-kcal { font-weight: 600; color: var(--ink); }
.nutri-dot { opacity: 0.7; }

.nutri-more {
  margin-left: 0.15rem;
  font-size: 0.9rem;
  line-height: 1;
  transition: transform 0.3s var(--ease);
}

.nutri[open] .nutri-more { transform: rotate(45deg); }
.nutri[open] summary { border-color: var(--line-strong); color: var(--ink); }

.nutri-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 0.7rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  animation: nutri-in 0.4s var(--ease);
}

.nutri-cell {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.65rem 0.3rem;
  text-align: center;
}

.nutri-cell + .nutri-cell { border-left: 1px solid var(--line); }

.nutri-val {
  font-family: var(--serif);
  font-size: 1.15rem;
  line-height: 1.1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.nutri-lbl {
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.nutri-note {
  font-size: 0.68rem;
  font-style: italic;
  color: var(--ink-faint);
  margin-top: 0.45rem;
}

@keyframes nutri-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}

/* --- séparateur entre sets : ligne de court + trèfle --- */

.rule {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.25rem;
  max-width: 1080px;
  margin: 0 auto;
}

.rule::before, .rule::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.rule svg { width: 14px; height: 14px; color: var(--ink-faint); }

/* ============================================================
   Le credo : la symbolique du trèfle (identité visuelle, p. 5)
   — les quatre feuilles : sport, social, bien-être, plaisir ;
   le lilas de la palette sert d'accent inattendu.
   ============================================================ */

.creed {
  padding: 4.8rem 1.25rem 4.4rem;
  text-align: center;
}

.creed-clover {
  width: 42px;
  height: 42px;
  color: var(--accent);
  margin-bottom: 1.5rem;
}

.creed-kicker {
  font-size: 0.68rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 1.1rem;
}

.creed-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 6vw, 3.2rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  max-width: 22ch;
  margin: 0 auto;
}

.creed-title em { font-style: italic; }
.creed-title span { color: var(--accent); white-space: nowrap; }

.creed-leaves {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.7rem 1.15rem;
  margin-top: 1.8rem;
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.creed-leaves .leaf-sep {
  width: 9px;
  height: 9px;
  color: var(--accent);
}

/* ============================================================
   Bas de page : la maison (fond légèrement décalé, --bg-alt)
   ============================================================ */

.footer {
  background: var(--bg-alt);
  padding: 0 1.25rem 2.4rem;
  margin-top: 1.5rem;
}

.footer .baseline {
  animation: none;
  margin: 0 0 3.2rem;
  background: var(--line-strong);
}

.footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.footer-emblem { width: 56px; height: auto; margin-bottom: 1.4rem; }

.footer-wordmark { width: 230px; height: auto; }

.footer-eyebrow {
  width: 230px;
  padding-left: calc(230px * 0.235);
  box-sizing: border-box;
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-indent: 0.2em;
  text-transform: uppercase;
  color: var(--ink);
  margin-top: 0.55rem;
}

.footer-grid {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin: 2.6rem 0 2.2rem;
  padding: 1.8rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.footer-label {
  font-size: 0.64rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.5rem;
}

.footer-info { font-size: 0.95rem; line-height: 1.6; }

.footer-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.7rem;
}

.footer-bottom .footer-clover { margin: 0.4rem 0; }

.footer-clover { width: 12px; height: 12px; color: var(--ink-faint); }

.footer-note {
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ============================================================
   Écrans plus larges
   ============================================================ */

@media (min-width: 720px) {
  .hero { padding: 1.4rem 2.4rem 0; }
  .hero-body { flex-direction: row; align-items: center; gap: 3.5rem; padding: 3rem 0; }
  .index { padding: 1rem 2.4rem; gap: 2.2rem; }
  .set { padding: 4.4rem 2.4rem 3.2rem; }
  .set-head { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: end; }
  .set-note { margin-top: 0; justify-self: end; text-align: right; }
  .ledger { grid-template-columns: 1fr 1fr; column-gap: 3rem; }
  .dish { gap: 1.1rem; padding: 1.6rem 0 1.8rem; }
  .rule { padding: 0 2.4rem; }
  .footer { padding: 0 2.4rem 2.6rem; }
  .footer-grid { grid-template-columns: repeat(3, 1fr); }
}

.switch, .nutri summary { border-color: var(--line-strong); }

@media (min-width: 720px) {
  .hero-house { font-size: calc((100vw - 4.8rem) * 0.048); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-emblem, .hero-kicker, .hero-title, .hero-line, .baseline, .hero-wordmark, .hero-house { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
