/* ============ A Cantina di Corsica — Corsican premium ============ */
:root {
  --cream-logo: #fdf9f2;   /* fond exact du blason */
  --bg-light: #f2ecdf;
  --bg-dark: #17120d;
  --text-on-light: #211a12;
  --text-soft: #5c5245;
  --text-on-dark: #f2ecdf;
  --accent: #b4501e;      /* terracotta / paprika */
  --accent-soft: #c87d3f; /* ochre */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Work Sans', system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: auto; }
body {
  font-family: var(--font-body);
  background: var(--bg-light);
  color: var(--text-on-light);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Loader ---------- */
#loader {
  position: fixed; inset: 0; z-index: 100;
  background: var(--bg-dark);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1.4rem; color: var(--text-on-dark);
  transition: opacity .7s ease, visibility .7s;
}
#loader.done { opacity: 0; visibility: hidden; }
.loader-brand {
  font-family: var(--font-display); font-size: clamp(2rem, 6vw, 3.4rem);
  font-weight: 600; letter-spacing: .02em;
}
.loader-track { width: min(240px, 60vw); height: 2px; background: rgba(242,236,223,.18); }
#loader-bar { width: 0%; height: 100%; background: var(--accent-soft); transition: width .2s ease; }
#loader-percent { font-size: .8rem; letter-spacing: .25em; color: var(--accent-soft); }

/* ---------- Header ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem clamp(1rem, 4vw, 3rem);
  mix-blend-mode: normal;
}
.logo {
  font-family: var(--font-display); font-weight: 700;
  font-size: 1.25rem; color: inherit; text-decoration: none; letter-spacing: .01em;
}
.site-header nav { display: flex; gap: clamp(.9rem, 2.5vw, 2rem); }
.site-header nav a {
  color: inherit; text-decoration: none; font-size: .8rem;
  letter-spacing: .12em; text-transform: uppercase; font-weight: 500;
  opacity: .75; transition: opacity .25s;
}
.site-header nav a:hover, .site-header nav a.active { opacity: 1; }
.site-header.on-canvas { color: #fff; text-shadow: 0 1px 12px rgba(0,0,0,.45); }

/* ---------- Hero ---------- */
.hero-standalone {
  position: relative; height: 100vh; height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--bg-light); text-align: center; z-index: 10;
  padding: 0 1.2rem;
  overflow: hidden;
}
.hero-standalone.has-photo { background: var(--bg-dark); color: var(--text-on-dark); }
.hero-bg {
  position: absolute; inset: -6%;
  background: url("../assets/hero-photo.jpg") center / cover no-repeat;
  background-size: cover; background-position: center;
  animation: kenburns 16s ease-in-out infinite alternate;
  filter: brightness(.9) saturate(1.05);
}
@keyframes kenburns {
  from { transform: scale(1); }
  to   { transform: scale(1.1) translateY(-1.5%); }
}
.hero-veil {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(23,18,13,.55) 0%, rgba(23,18,13,.25) 35%, rgba(23,18,13,.35) 65%, rgba(23,18,13,.7) 100%);
}
.hero-standalone.has-photo .section-label { color: var(--accent-soft); }
.hero-standalone.has-photo .hero-heading { color: var(--text-on-dark); text-shadow: 0 4px 40px rgba(0,0,0,.45); }
.hero-standalone.has-photo .hero-tagline { color: rgba(242,236,223,.88); text-shadow: 0 1px 14px rgba(0,0,0,.5); }
.hero-standalone.has-photo .scroll-indicator { color: rgba(242,236,223,.85); }
.hero-standalone > .section-label, .hero-heading, .hero-tagline, .scroll-indicator { position: relative; }
.section-label {
  display: block; font-size: .74rem; letter-spacing: .3em; text-transform: uppercase;
  color: var(--accent); font-weight: 600; margin-bottom: 1.1rem;
}
.hero-heading {
  font-family: var(--font-display); font-weight: 700; line-height: .92;
  font-size: clamp(2.6rem, 13vw, 10rem); letter-spacing: -.01em;
  white-space: nowrap; text-align: center;
}
.hero-heading .word { display: inline-block; }
.hero-tagline {
  margin-top: 1.6rem; font-size: clamp(.95rem, 2.6vw, 1.2rem);
  color: var(--text-soft); font-weight: 300; max-width: 34ch;
}
.scroll-indicator {
  position: absolute; bottom: max(2.2rem, env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
  font-size: .7rem; letter-spacing: .22em; text-transform: uppercase; color: var(--text-soft);
  animation: bob 2.4s ease-in-out infinite;
}
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(8px); } }

/* ---------- Canvas ---------- */
.canvas-wrap {
  position: fixed; inset: 0; z-index: 1;
  clip-path: circle(0% at 50% 50%);
  pointer-events: none;
}
#canvas { width: 100%; height: 100%; display: block; }

/* ---------- Dark overlay ---------- */
#dark-overlay {
  position: fixed; inset: 0; z-index: 2;
  background: rgba(15, 10, 6, .92); opacity: 0; pointer-events: none;
}

/* ---------- Marquee ---------- */
.marquee-wrap {
  position: fixed; top: 50%; left: 0; z-index: 3;
  width: 100%; overflow: hidden; pointer-events: none;
  opacity: 0; transform: translateY(-50%);
}
.marquee-text {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(4rem, 13vw, 11rem); line-height: 1;
  white-space: nowrap; color: rgba(242, 236, 223, .22);
  text-transform: uppercase; letter-spacing: .01em;
  will-change: transform;
}

/* ---------- Scroll container & sections ---------- */
#scroll-container { position: relative; height: 850vh; z-index: 5; }

.scroll-section {
  position: absolute; left: 0; width: 100%;
  transform: translateY(-50%);
  pointer-events: none;
}
.scroll-section .section-inner { pointer-events: auto; }

.align-left  { padding-left: 5vw;  padding-right: 55vw; }
.align-right { padding-left: 55vw; padding-right: 5vw; text-align: right; }
.align-left .section-inner, .align-right .section-inner { max-width: 40vw; }
.align-right .section-inner { margin-left: auto; }

.section-content { color: #fff; }
.section-content .section-label { color: var(--accent-soft); }
.section-heading {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(2.2rem, 5vw, 4.6rem); line-height: 1.02;
  text-wrap: balance;
}
.section-content .section-heading { text-shadow: 0 2px 24px rgba(0,0,0,.35); }
.section-body {
  margin-top: 1.1rem; font-size: clamp(.95rem, 1.6vw, 1.15rem);
  line-height: 1.65; font-weight: 300; text-shadow: 0 1px 14px rgba(0,0,0,.5);
  max-width: 42ch;
}
.align-right .section-body { margin-left: auto; }

.text-link {
  display: inline-block; margin-top: 1.4rem; color: var(--accent-soft);
  text-decoration: none; font-weight: 500; letter-spacing: .04em;
  border-bottom: 1px solid currentColor; padding-bottom: .15rem;
}

/* ---------- Stats ---------- */
.section-stats { color: var(--text-on-dark); padding: 0 clamp(1.2rem, 6vw, 6rem); }
.stats-grid {
  display: flex; justify-content: center; gap: clamp(2rem, 8vw, 7rem);
  flex-wrap: wrap; text-align: center;
}
.stat { display: flex; flex-direction: column; gap: .4rem; }
.stat-row { display: flex; align-items: baseline; justify-content: center; gap: .3rem; }
.stat-number {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(3.6rem, 9vw, 7rem); line-height: 1; color: var(--text-on-dark);
}
.stat-suffix { font-family: var(--font-display); font-size: clamp(1.2rem, 3vw, 2rem); color: var(--accent-soft); }
.stat-label { font-size: .8rem; letter-spacing: .18em; text-transform: uppercase; color: rgba(242,236,223,.65); }

/* ---------- CTA ---------- */
.section-cta { color: #fff; text-align: center; padding: 0 1.2rem; }
.section-cta .section-inner { max-width: none; margin: 0 auto; }
.section-cta .section-heading { font-size: clamp(3rem, 8vw, 7rem); }
.section-cta .section-body { margin-left: auto; margin-right: auto; }
.cta-button {
  display: inline-block; margin-top: 2rem;
  background: var(--accent); color: #fff; text-decoration: none;
  font-weight: 600; letter-spacing: .1em; text-transform: uppercase; font-size: .85rem;
  padding: 1.05rem 2.6rem; border-radius: 999px;
  transition: transform .3s ease, background .3s ease;
}
.cta-button:hover { transform: translateY(-3px); background: var(--accent-soft); }

/* ---------- Footer ---------- */
.site-footer {
  position: relative; z-index: 6;
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 1.6rem clamp(1rem, 4vw, 3rem);
  background: var(--bg-dark); color: rgba(242,236,223,.6); font-size: .78rem; letter-spacing: .06em;
}

/* ---------- Accueil : intro blason ---------- */
.home { background: var(--cream-logo); }
.intro-panel {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--cream-logo); text-align: center;
  padding: 5.5rem 1.2rem 4.5rem; overflow: hidden;
}
.intro-inner { display: flex; flex-direction: column; align-items: center; }
.crest {
  width: min(72vw, 480px); height: auto; display: block;
  margin-bottom: .6rem;
}
.logo-hero {
  width: min(88vw, 620px); max-height: 62svh; object-fit: contain;
  height: auto; display: block;
  border-radius: 50%;
  filter: drop-shadow(0 18px 40px rgba(60, 40, 15, .18));
  animation: breathe 7s ease-in-out infinite;
  will-change: transform;
}
@keyframes breathe {
  0%, 100% { transform: scale(1) translateY(0); }
  50%      { transform: scale(1.025) translateY(-4px); }
}
@media (prefers-reduced-motion: reduce) { .logo-hero { animation: none; } }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.wordmark { display: flex; flex-direction: column; align-items: center; line-height: 1; }
.wordmark-main {
  font-family: var(--font-display); font-weight: 700; color: #1d1b18;
  font-size: clamp(3.4rem, 13vw, 8.2rem); letter-spacing: .015em;
  display: flex;
}
.wordmark-main .ch { display: inline-block; }
.wordmark-sub {
  font-family: var(--font-display); font-weight: 600; color: #a4622f;
  font-size: clamp(1.3rem, 4.6vw, 2.6rem); letter-spacing: .34em; text-transform: uppercase;
  margin-top: .55em; display: flex; align-items: center; gap: .7em; text-indent: .34em;
}
.wordmark-sub .rule { width: clamp(28px, 6vw, 64px); height: 1.5px; background: #a4622f; opacity: .7; }
.intro-tagline {
  margin-top: 1.9rem; font-size: clamp(.92rem, 2.4vw, 1.12rem);
  color: var(--text-soft); font-weight: 300; max-width: 40ch;
}
.intro-panel .scroll-indicator { color: var(--text-soft); }

/* ---------- Accueil : hall des univers ---------- */
.hall { display: flex; min-height: 100vh; min-height: 100svh; }
.portal {
  position: relative; flex: 1; display: flex; align-items: center; justify-content: center;
  min-height: 100svh; text-decoration: none; overflow: hidden; color: #fff;
}
.portal-bg {
  position: absolute; inset: 0; background-position: center; background-size: cover;
  transition: transform 1.1s cubic-bezier(.22,.61,.36,1);
}
.portal-charcut .portal-bg { background-image: url("../assets/hero-charcut.jpg"); }
.portal-fromage .portal-bg { background-image: url("../assets/portal-fromage.jpg"); }
.portal-veil {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(15,10,6,.5), rgba(15,10,6,.24) 45%, rgba(15,10,6,.62));
  transition: background .6s ease;
}
.portal:hover .portal-bg, .portal:focus-visible .portal-bg { transform: scale(1.06); }
.portal-inner {
  position: relative; display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: .65rem; padding: 1.5rem;
}
.portal-label {
  font-size: .72rem; letter-spacing: .3em; text-transform: uppercase;
  color: var(--accent-soft); font-weight: 600;
}
.portal-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2.6rem, 6.5vw, 5.4rem); line-height: 1;
  text-shadow: 0 4px 40px rgba(0,0,0,.45);
}
.portal-sub {
  font-weight: 300; font-size: clamp(.9rem, 1.8vw, 1.05rem);
  color: rgba(242,236,223,.85); max-width: 30ch; text-shadow: 0 1px 12px rgba(0,0,0,.5);
}
.portal-cta {
  margin-top: 1.1rem; display: inline-flex; align-items: center; gap: .6rem;
  border: 1.5px solid rgba(255,255,255,.85); border-radius: 999px;
  padding: .8rem 1.9rem; font-size: .8rem; letter-spacing: .18em; text-transform: uppercase;
  font-weight: 600; transition: background .35s ease, color .35s ease, transform .35s ease;
}
.portal:hover .portal-cta, .portal:focus-visible .portal-cta {
  background: #fff; color: #17120d; transform: translateY(-2px);
}

/* ---------- Accueil : bandeau histoire ---------- */
.story-band {
  background: var(--bg-dark); color: var(--text-on-dark); text-align: center;
  padding: clamp(4rem, 10vw, 7rem) 1.4rem;
}
.story-heading {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.7rem, 4.6vw, 3.2rem); line-height: 1.15;
  max-width: 22ch; margin: 0 auto; text-wrap: balance;
}
.story-band .text-link { margin-top: 1.8rem; }

/* ---------- Univers : zone produits ---------- */
.products-zone {
  position: relative; z-index: 8;
  background: var(--bg-light);
  padding: clamp(4rem, 9vw, 7rem) clamp(1.2rem, 5vw, 4rem) clamp(3rem, 7vw, 5rem);
  max-width: none;
}
.products-heading {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2.2rem, 6vw, 4.4rem); line-height: 1.02; margin-bottom: .8rem;
}
.products-intro { color: var(--text-soft); font-weight: 300; max-width: 52ch; margin-bottom: 2.6rem; }
.next-universe {
  display: flex; flex-direction: column; gap: .5rem; align-items: center; text-align: center;
  margin-top: 3.2rem; padding: clamp(2.4rem, 6vw, 4rem);
  background: var(--bg-dark); border-radius: 14px; text-decoration: none; color: #fff;
  transition: transform .35s ease;
}
.next-universe:hover { transform: translateY(-4px); }
.next-title {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.6rem, 4.4vw, 2.8rem);
}

/* ---------- Univers fromage : sections sur fond clair ---------- */
.section-content.ink { color: var(--text-on-light); }
.section-content.ink .section-heading { text-shadow: none; }
.section-content.ink .section-body { text-shadow: none; color: #3d352b; }
.section-content.ink .section-label { color: var(--accent); }

/* ---------- Bouton ambiance sonore ---------- */
.ambience-toggle {
  position: fixed; z-index: 60;
  right: max(1.1rem, env(safe-area-inset-right));
  bottom: max(1.1rem, env(safe-area-inset-bottom));
  width: 46px; height: 46px; border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,.5);
  background: rgba(23,18,13,.55); color: #f2ecdf;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: transform .3s ease, background .3s ease;
}
.ambience-toggle:hover { transform: scale(1.08); }
.ambience-toggle .icon-off { display: block; }
.ambience-toggle .icon-on { display: none; }
.ambience-toggle.is-on .icon-off { display: none; }
.ambience-toggle.is-on .icon-on { display: block; }
.home .ambience-toggle { border-color: rgba(29,27,24,.35); background: rgba(253,249,242,.75); color: #1d1b18; }

/* ---------- Static pages ---------- */
.page-main { max-width: 1080px; margin: 0 auto; padding: 8.5rem clamp(1.2rem, 5vw, 3rem) 5rem; }
.page-main .section-label { margin-bottom: .8rem; }
.page-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2.8rem, 8vw, 5.5rem); line-height: 1; margin-bottom: 1.6rem;
}
.page-intro { font-size: clamp(1rem, 2vw, 1.2rem); line-height: 1.7; color: var(--text-soft); max-width: 60ch; margin-bottom: 3rem; font-weight: 300; }
.page-photo { width: 100%; border-radius: 14px; display: block; margin-bottom: 3rem; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.6rem; }
.product-card { background: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 10px 40px rgba(33,26,18,.08); }
.product-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.product-card .card-body { padding: 1.2rem 1.3rem 1.5rem; }
.product-card h3 { font-family: var(--font-display); font-size: 1.3rem; margin-bottom: .4rem; }
.product-card p { font-size: .9rem; color: var(--text-soft); line-height: 1.55; }
.badge {
  display: inline-block; margin-top: .8rem; font-size: .68rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--accent); font-weight: 600;
}
.contact-block { background: var(--bg-dark); color: var(--text-on-dark); border-radius: 14px; padding: clamp(1.6rem, 5vw, 3rem); margin-top: 3rem; }
.contact-block h2 { font-family: var(--font-display); font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: .8rem; }
.contact-block p { color: rgba(242,236,223,.75); line-height: 1.7; font-weight: 300; }

/* ---------- Mobile ---------- */
@media (max-width: 767px) {
  #scroll-container { height: 620vh; }
  .site-header { padding: .8rem 1rem; flex-direction: column; align-items: flex-start; gap: .3rem; }
  .site-header nav a { font-size: .64rem; letter-spacing: .08em; }
  .site-header nav { gap: 1rem; }
  .logo { font-size: 1.1rem; }

  .align-left, .align-right {
    padding: 0 1.4rem; text-align: center;
  }
  .align-left .section-inner, .align-right .section-inner {
    max-width: none; margin: 0 auto;
  }
  .section-content .section-inner {
    background: linear-gradient(180deg, rgba(15,10,6,0) 0%, rgba(15,10,6,.55) 18%, rgba(15,10,6,.55) 82%, rgba(15,10,6,0) 100%);
    padding: 1.6rem 1.2rem; border-radius: 12px;
  }
  .section-body { margin-left: auto; margin-right: auto; }
  .stats-grid { flex-direction: column; gap: 2.2rem; }

  .section-content.ink .section-inner {
    background: linear-gradient(180deg, rgba(253,249,242,0) 0%, rgba(253,249,242,.82) 18%, rgba(253,249,242,.82) 82%, rgba(253,249,242,0) 100%);
  }

  .hall { flex-direction: column; }
  .portal { min-height: 78svh; }
  .crest { width: min(88vw, 420px); }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
