/* =========================================================
   MAISON MARAY — système de design
   ========================================================= */

:root {
  /* palette */
  --ivoire: #F5F1EA;
  --travertin: #E4DACE;
  --noyer: #2A1F18;
  --noyer-soft: #3A2B22;
  --laiton: #B08A4B;
  --laiton-deep: #8E6E37;
  --blanc: #FFFFFF;
  --rule: rgba(42, 31, 24, 0.12);
  --rule-strong: rgba(42, 31, 24, 0.22);

  /* type */
  --font-display: "Cormorant Garamond", "EB Garamond", "Times New Roman", serif;
  --font-body: "Inter", "Söhne", "Helvetica Neue", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;

  /* layout */
  --gutter-d: 64px;
  --gutter-m: 24px;
  --maxw: 1680px;

  /* motion */
  --ease: cubic-bezier(.2,.6,.2,1);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  color-scheme: light;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

:focus-visible {
  outline: 2px solid var(--laiton);
  outline-offset: 3px;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--ivoire);
  color: var(--noyer);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

button { font-family: inherit; cursor: pointer; }

::selection { background: var(--laiton); color: var(--ivoire); }

/* utilities */
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-inline: var(--gutter-d);
}
@media (max-width: 720px) { .container { padding-inline: var(--gutter-m); } }

.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
}
@media (max-width: 1024px) { .grid-12 { grid-template-columns: repeat(6, 1fr); } }
@media (max-width: 720px)  { .grid-12 { grid-template-columns: repeat(4, 1fr); gap: 16px; } }

.bg-ivoire    { background: var(--ivoire); }
.bg-travertin { background: var(--ivoire); } /* unified canvas — kept selector for compat */
.bg-noyer     { background: var(--noyer); color: var(--ivoire); }

/* paper texture — subtle grain on ivoire bg */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .045; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* section divider — animated horizontal rule + scarab mark in middle */
.divider { position: relative; display: flex; align-items: center; justify-content: center; gap: 22px; padding: clamp(40px, 5vw, 64px) var(--gutter-d); max-width: var(--maxw); margin: 0 auto; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--rule); transform: scaleX(0); transform-origin: var(--origin, left); transition: transform 1.4s var(--ease); }
.divider::before { --origin: right; }
.divider::after  { --origin: left; }
.divider.in::before, .divider.in::after { transform: scaleX(1); }
.divider .mark { width: 22px; height: 28px; display: block;
  -webkit-mask: url("logo-mark.png") center / contain no-repeat;
          mask: url("logo-mark.png") center / contain no-repeat;
  background: var(--noyer); opacity: 0; transform: rotate(-8deg) scale(.7);
  transition: opacity .8s var(--ease) .4s, transform .8s var(--ease) .4s;
}
.divider.in .mark { opacity: .4; transform: rotate(0) scale(1); }

/* giant scarab watermark — section marker */
.scarab-mark { position: absolute; pointer-events: none;
  -webkit-mask: url("logo-mark.png") center / contain no-repeat;
          mask: url("logo-mark.png") center / contain no-repeat;
  background: var(--noyer);
  opacity: .04 !important;
  transition: opacity 1.2s var(--ease), transform 1.6s var(--ease);
  z-index: 0;
}
.scarab-mark.lg { width: clamp(280px, 38vw, 540px); aspect-ratio: 22/28; }
.scarab-mark.xl { width: clamp(420px, 60vw, 820px); aspect-ratio: 22/28; }
.scarab-mark.tr { right: -8%; top: -6%; }
.scarab-mark.bl { left:  -8%; bottom: -8%; }
.scarab-mark.tl { left:  -8%; top: -6%; }
.scarab-mark.br { right: -8%; bottom: -8%; }

/* type system */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--noyer);
  opacity: .65;
  font-weight: 400;
}
.eyebrow.with-leader { display: inline-flex; align-items: center; gap: 14px; }
.eyebrow.with-leader::before {
  content: ""; display: block; width: 0; height: 1px; background: currentColor;
  transform-origin: left; transition: width 1.1s var(--ease) .1s;
}
.reveal.in .eyebrow.with-leader::before,
.eyebrow.reveal.with-leader.in::before { width: 32px; }

/* fixed scroll progress bar — top of viewport */
.scroll-progress { position: fixed; top: 0; left: 0; right: 0; height: 1px; z-index: 100; pointer-events: none; background: rgba(42,31,24,.08); }
.scroll-progress .bar { display: block; height: 100%; background: var(--laiton); transform-origin: left; transform: scaleX(0); will-change: transform; }

/* sticky chapter indicator — bottom-left widget */
.chapter-indicator { position: fixed; left: 6px; bottom: clamp(40px, 5vw, 56px); z-index: 50; pointer-events: none; display: flex; flex-direction: column; align-items: center; gap: 12px; opacity: 0; transition: opacity .6s var(--ease); }
.chapter-indicator.in { opacity: 1; pointer-events: auto; }
.chapter-indicator .ci-num { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .06em; color: var(--noyer); opacity: .75; display: inline-flex; align-items: center; gap: 2px; }
.chapter-indicator .ci-num em { font-style: normal; opacity: .4; margin: 0 1px; }
.chapter-indicator .ci-rail { position: relative; width: 1px; height: clamp(56px, 7vw, 88px); background: rgba(42,31,24,.18); overflow: hidden; }
.chapter-indicator .ci-fill { position: absolute; left: 0; top: 0; right: 0; height: 0%; background: var(--laiton); transition: height .35s var(--ease); }
.chapter-indicator .ci-label { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .22em; text-transform: uppercase; color: var(--noyer); opacity: .7; writing-mode: vertical-rl; transform: rotate(180deg); }
@media (max-width: 880px) { .chapter-indicator { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .scroll-progress .bar { transform: scaleX(0) !important; }
  .chapter-indicator .ci-fill { transition: none; }
}

.display {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 0.92;
  margin: 0;
  text-wrap: balance;
}
.display.italic-mix em { font-style: italic; font-weight: 400; }

h1.display { font-size: clamp(36px, 8vw, 168px); }
h2.display { font-size: clamp(28px, 6vw, 124px); }
h3.display { font-size: clamp(22px, 3.5vw, 64px); }

.lede {
  font-family: var(--font-body);
  font-size: clamp(17px, 1.25vw, 22px);
  line-height: 1.5;
  letter-spacing: 0.005em;
  max-width: 56ch;
  text-wrap: pretty;
}

p { text-wrap: pretty; }

/* section rhythm */
section { position: relative; }
.section-pad     { padding-block: clamp(96px, 12vw, 200px); }
.section-pad-sm  { padding-block: clamp(56px, 8vw, 120px); }

.rule { height: 1px; background: var(--rule); width: 100%; }

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 26px;
  font-family: var(--font-body);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  transition: background .35s var(--ease), color .35s var(--ease), border-color .35s var(--ease);
  border-radius: 0;
  cursor: pointer;
  line-height: 1;
}
.btn .arr { width: 34px; height: 1px; background: currentColor; position: relative; transform-origin: left; transform: scaleX(0.65); transition: transform .35s var(--ease); }
.btn .arr::after { content: ""; position: absolute; right: 0; top: -3px; width: 7px; height: 7px; border-top: 1px solid currentColor; border-right: 1px solid currentColor; transform: rotate(45deg); }
.btn:hover .arr { transform: scaleX(1); }

.btn-solid {
  background: var(--laiton);
  color: var(--ivoire);
  border-color: var(--laiton);
}
.btn-solid:hover { background: var(--laiton-deep); border-color: var(--laiton-deep); color: var(--ivoire); }

.btn-line {
  border-color: var(--laiton);
  color: var(--laiton-deep);
}
.btn-line:hover { background: var(--laiton); color: var(--ivoire); }

.btn-ghost {
  border-color: var(--noyer);
  color: var(--noyer);
}
.btn-ghost:hover { background: var(--noyer); color: var(--ivoire); }
.bg-noyer .btn-ghost { border-color: var(--ivoire); color: var(--ivoire); }
.bg-noyer .btn-ghost:hover { background: var(--ivoire); color: var(--noyer); }

/* link with hairline */
.link-line {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding-bottom: 6px;
  border-bottom: 1px solid currentColor;
}
.link-line:hover { color: var(--laiton-deep); }

/* image hover treatment */
.img-hover { overflow: hidden; }
.img-hover img,
.img-hover .img-fill {
  transition: transform .9s var(--ease), filter .9s var(--ease);
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.img-hover:hover img,
.img-hover:hover .img-fill { transform: scale(1.025); filter: brightness(1.05); }

.img-fill { width: 100%; height: 100%; object-fit: cover; display: block; }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal.delay-1 { transition-delay: .08s; }
.reveal.delay-2 { transition-delay: .16s; }
.reveal.delay-3 { transition-delay: .24s; }
.reveal.delay-4 { transition-delay: .32s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* =========================================================
   HEADER
   ========================================================= */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  padding: 22px var(--gutter-d);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background .4s var(--ease), color .4s var(--ease), border-color .4s var(--ease);
  border-bottom: 1px solid transparent;
  color: var(--ivoire);
  mix-blend-mode: normal;
}
.site-header.scrolled,
.site-header.solid {
  background: var(--ivoire);
  color: var(--noyer);
  border-bottom-color: var(--rule);
  padding-block: 16px;
}
@media (max-width: 720px) { .site-header { padding-inline: var(--gutter-m); } }

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.brand .mark {
  width: 22px; height: 28px; display: block;
  -webkit-mask: url("logo-mark.png") center / contain no-repeat;
          mask: url("logo-mark.png") center / contain no-repeat;
  background: currentColor;
  transition: transform .6s var(--ease);
}
.brand:hover .mark { transform: rotate(360deg) scale(1.08); }
.brand-name { font-size: 15px; letter-spacing: 0.32em; font-family: var(--font-body); font-weight: 500; }
@media (min-width: 1280px) {
  .brand { gap: 16px; }
  .brand .mark { width: 30px; height: 38px; }
  .brand-name { font-size: 17px; letter-spacing: 0.36em; }
}
@media (min-width: 1600px) {
  .brand .mark { width: 36px; height: 46px; }
  .brand-name { font-size: 18px; }
}

.nav {
  display: flex;
  align-items: center;
  gap: 36px;
  font-size: 12.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.nav a { position: relative; padding-block: 4px; }
.nav a.active::after,
.nav a:hover::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: currentColor; }
.nav .cta {
  background: var(--laiton);
  color: var(--ivoire);
  padding: 12px 18px;
  border: 1px solid var(--laiton);
}
.site-header.scrolled .nav .cta:hover { background: var(--laiton-deep); border-color: var(--laiton-deep); }

.nav-toggle { display: none; }

@media (max-width: 880px) {
  .nav .nav-link,
  .nav .cta { display: none; }
  .nav-toggle {
    display: inline-flex; flex-direction: column; gap: 5px;
    width: 28px; height: 22px; background: none; border: 0; padding: 0;
  }
  .nav-toggle span { height: 1px; background: currentColor; display: block; }
}

/* mobile menu */
.mobile-menu {
  position: fixed; inset: 0; z-index: 70;
  background: var(--ivoire);
  color: var(--noyer);
  display: flex; flex-direction: column;
  padding: 24px var(--gutter-m) 40px;
  transform: translateY(-100%);
  transition: transform .55s var(--ease);
}
.mobile-menu.open { transform: none; }
.mobile-menu .top { display: flex; align-items: center; justify-content: space-between; }
.mobile-menu .links {
  margin-top: 64px;
  display: flex; flex-direction: column; gap: 28px;
  font-family: var(--font-display);
  font-size: 44px;
  line-height: 1;
}
.mobile-menu .meta { margin-top: auto; font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; opacity: .6; }
.mobile-close { background: none; border: 0; font-size: 24px; }

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
  background: var(--noyer);
  color: var(--ivoire);
  padding: clamp(40px, 4vw, 56px) var(--gutter-d) 32px;
}
@media (max-width: 720px) { .site-footer { padding-inline: var(--gutter-m); } }

.footer-mark {
  font-family: var(--font-display);
  font-size: clamp(72px, 14vw, 220px);
  line-height: 0.85;
  letter-spacing: -0.02em;
  margin: 0 0 80px;
}
.footer-mark em { font-style: italic; opacity: .55; }

.footer-cols {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr;
  gap: 48px;
}
@media (max-width: 880px) { .footer-cols { grid-template-columns: 1fr 1fr; } }
@media (max-width: 540px) { .footer-cols { grid-template-columns: 1fr; gap: 32px; } }

.footer-col h3 {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin: 0 0 20px;
  opacity: .55;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; font-size: 14px; }
.footer-col a:hover { color: var(--laiton); }

.footer-bottom {
  margin-top: 64px;
  display: flex; justify-content: space-between; align-items: end;
  gap: 32px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: .65;
  flex-wrap: wrap;
}


/* =========================================================
   PLACEHOLDERS — image slots
   ========================================================= */
.ph {
  position: relative;
  background: linear-gradient(135deg, #d8cdbe 0%, #ccc0ad 50%, #c2b6a3 100%);
  overflow: hidden;
}
.ph::after {
  content: attr(data-label);
  position: absolute;
  inset: auto 0 0 0;
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(42, 31, 24, .6);
}

/* hairline svg icons */
.ico { width: 22px; height: 22px; stroke: currentColor; stroke-width: 1; fill: none; }

/* numbers — for stats */
.stat {
  font-family: var(--font-display);
  font-size: clamp(36px, 4vw, 64px);
  line-height: 1;
}
.stat-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: .6;
}
