/* ════════════════════════════════════════════════════════
   MaisonVoxel — shared "light gallery" system
   Palette of the app + reminder emails: plaster cream · forest
   green · brass · walnut. Cormorant Garamond (display) ·
   Instrument Sans (text). Tokens, base, nav, menu, hero + arch,
   steps, specs, closing image and footer live here; each page
   adds its own sections (home.css, smart.css, journal.css).
   ════════════════════════════════════════════════════════ */

/* Width-matched fallbacks: text wraps the same before and after the web
   fonts arrive, so the hero doesn't jump (ratios measured with canvas). */
@font-face { font-family: "Cormorant fallback"; src: local("Times New Roman"); size-adjust: 96%; }
@font-face { font-family: "Instrument fallback"; src: local("Arial"); size-adjust: 101.3%; }

:root {
  --plaster: #F5F2EB;   /* page */
  --linen: #ECE6D9;     /* alternate band */
  --paper: #FBF9F4;     /* raised surfaces */
  --forest: #28331F;    /* text, primary buttons, footer */
  --moss: #5B6352;      /* secondary text (5.6:1 on plaster) */
  --brass: #B98A3E;     /* accents only — too light for small text */
  --brass-ink: #96692A; /* brass for large text (3.9:1 on linen) */
  --line: rgba(40, 51, 31, 0.16);
  --cream-on-forest: #EFEADF;

  --sw-green: #3F5139;
  --sw-beige: #E2D5BA;
  --sw-black: #262626;

  --font-display: "Cormorant Garamond", "Cormorant fallback", serif;
  --font-text: "Instrument Sans", "Instrument fallback", Arial, sans-serif;

  --gutter: clamp(1.25rem, 4vw, 4rem);
  --max: 88rem;
  --nav-h: 4.5rem;
  --radius: 6px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 1rem);
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--plaster);
  color: var(--forest);
  font-family: var(--font-text);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

.i18n-pending body { visibility: hidden; } /* see the inline script in each page head */

img { display: block; max-width: 100%; height: auto; }
[hidden] { display: none !important; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; }

::selection { background: var(--forest); color: var(--plaster); }
:focus-visible { outline: 2px solid var(--forest); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.012em;
  text-wrap: balance;
}
h2 { font-size: clamp(2.4rem, 4.6vw, 4.25rem); }
h3 { font-size: 1.75rem; font-weight: 600; line-height: 1.1; }
p { text-wrap: pretty; }

.skip {
  position: absolute; left: var(--gutter); top: -4rem;
  z-index: 100;
  background: var(--forest); color: var(--plaster);
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  text-decoration: none;
}
.skip:focus { top: 0.75rem; }

/* ── Wordmark (logo.svg as a mask, so it takes any colour) ── */
.wordmark {
  display: inline-block;
  width: 9.5rem;
  aspect-ratio: 1702.3 / 290.4;
  background: currentColor;
  -webkit-mask: url("../assets/logo/logo.svg") center / contain no-repeat;
  mask: url("../assets/logo/logo.svg") center / contain no-repeat;
}
.wordmark--cream { color: var(--cream-on-forest); }

/* ── Buttons & links ─────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0.8rem 1.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--font-text);
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.25s, color 0.25s, border-color 0.25s;
}
.btn--primary { background: var(--forest); color: var(--plaster); }
.btn--primary:hover { background: #3a4a2e; }
.btn--ghost { border-color: var(--forest); color: var(--forest); }
.btn--ghost:hover { background: var(--forest); color: var(--plaster); }
.btn--cream { background: var(--cream-on-forest); color: var(--forest); }
.btn--cream:hover { background: #fff; }
.btn--small { min-height: 2.5rem; padding: 0.55rem 1.1rem; font-size: 0.875rem; }
.btn--wide { width: 100%; }
.btn:disabled { opacity: 0.4; pointer-events: none; }
.footer :focus-visible { outline-color: var(--cream-on-forest); }

.link {
  display: inline-block;
  font-weight: 500;
  font-size: 0.9375rem;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
  text-decoration-color: var(--line);
  transition: text-decoration-color 0.25s;
}
.link:hover { text-decoration-color: var(--forest); }
.link > [aria-hidden] { display: inline-block; } /* the arrow sits outside the underline */

/* ── Colour swatches (real finish colours) ───────────── */
.swatch {
  display: inline-block;
  width: 0.85rem; height: 0.85rem;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(40, 51, 31, 0.25);
  flex: none;
}
.swatch--green { background: var(--sw-green); }
.swatch--beige { background: var(--sw-beige); }
.swatch--black { background: var(--sw-black); }

/* ── Section scaffolding ─────────────────────────────── */
.hero { max-width: calc(var(--max) + 2 * var(--gutter)); }
.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 1.25rem clamp(2rem, 6vw, 6rem);
  align-items: end;
  margin-bottom: clamp(2.5rem, 5vw, 4.5rem);
}
.section-head p { color: var(--moss); max-width: 46ch; }

/* ── Navigation ──────────────────────────────────────── */
.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0 max(var(--gutter), (100% - var(--max)) / 2);
  transition: background-color 0.3s, box-shadow 0.3s;
}
.nav.is-scrolled {
  background: rgba(245, 242, 235, 0.9);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--line);
}
.nav__brand { display: flex; color: var(--forest); }
.nav__links { display: flex; gap: clamp(1.25rem, 2.2vw, 2.25rem); }
.nav__links a, .menu__links a { text-decoration: none; }
.nav__links a {
  font-size: 0.9375rem;
  font-weight: 500;
  padding-block: 0.4rem;
  background: linear-gradient(var(--forest), var(--forest)) left bottom / 0 1px no-repeat;
  transition: background-size 0.3s var(--ease);
}
/* "page" on the page itself, "true" on its children (journal articles) */
.nav__links a:hover, .nav__links a[aria-current] { background-size: 100% 1px; }
.nav__right { display: flex; align-items: center; gap: 0.75rem; }
.nav__lang {
  min-width: 2.5rem; min-height: 2.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid var(--line);
  transition: border-color 0.25s;
}
.nav__lang:hover { border-color: var(--forest); }
.nav__burger {
  display: none;
  width: 2.75rem; height: 2.75rem;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.nav__burger span {
  width: 24px; height: 1.5px;
  background: var(--forest);
  transition: transform 0.35s var(--ease);
}
.nav__burger[aria-expanded="true"] span:first-child { transform: translateY(4.25px) rotate(45deg); }
.nav__burger[aria-expanded="true"] span:last-child { transform: translateY(-4.25px) rotate(-45deg); }

/* ── Mobile menu ─────────────────────────────────────── */
.menu {
  position: fixed; inset: 0;
  z-index: 40;
  background: var(--plaster);
  display: flex;
  flex-direction: column;
  justify-content: safe center;
  gap: 2rem;
  padding: calc(var(--nav-h) + 1rem) var(--gutter) 2rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0s linear 0.3s; /* stay visible while fading out */
}
/* visible at once on open, so site.js can move focus into the menu */
.menu.is-open { opacity: 1; visibility: visible; transition: opacity 0.3s; }
.menu__links { display: flex; flex-direction: column; }
.menu__links a {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, min(8vw, 7svh), 2.75rem);
  font-weight: 500;
  line-height: 1.1;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
}
.menu__links a[aria-current] { color: var(--brass-ink); }
.menu__cta { align-self: flex-start; }
.menu__foot { font-size: 0.875rem; color: var(--moss); }

/* ── Hero ────────────────────────────────────────────── */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
  min-height: min(100svh, 62rem);
  margin-inline: auto;
  padding: calc(var(--nav-h) + clamp(1.5rem, 4vh, 3rem)) var(--gutter) clamp(2.5rem, 6vh, 4rem);
}
.hero__title {
  font-size: clamp(3.6rem, min(8.4vw, 14svh), 8rem);
  line-height: 0.92;
  letter-spacing: -0.02em;
}
.hero__lede {
  margin-top: clamp(1.5rem, 3vw, 2.25rem);
  font-size: clamp(1.125rem, 1.5vw, 1.3rem);
  line-height: 1.5;
  max-width: 34ch;
  color: var(--moss);
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: clamp(1.75rem, 3vw, 2.5rem);
}

/* The arched niche. Width follows the viewport height so the
   whole arch always fits on screen next to the headline. */
.hero__arch {
  position: relative;
  justify-self: end;
  width: min(100%, calc((min(100svh, 62rem) - var(--nav-h) - 6rem) * 0.8));
  aspect-ratio: 4 / 5;
  border-radius: 50% 50% var(--radius) var(--radius) / 40% 40% var(--radius) var(--radius);
  overflow: hidden;
  background: var(--linen);
}
.hero__arch img { width: 100%; height: 100%; object-fit: cover; }

/* ── Spec table (label | value rows) ─────────────────── */
.specs { margin-top: clamp(2rem, 4vw, 3rem); border-top: 1px solid var(--line); }
.specs div {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9375rem;
}
.specs dt { color: var(--moss); }
.specs dd { font-weight: 500; }

/* ── Numbered steps (real sequences only) ────────────── */
.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(1.25rem, 3vw, 2.5rem);
  margin-top: clamp(3.5rem, 7vw, 6rem);
  counter-reset: step;
}
.steps li { counter-increment: step; border-top: 1px solid var(--forest); padding-top: 1.25rem; }
.steps li::before {
  content: counter(step);
  display: block;
  font-family: var(--font-display);
  font-size: 2.75rem;
  font-weight: 500;
  line-height: 1;
  font-variant-numeric: lining-nums; /* Cormorant's old-style 1 reads as an I */
  color: var(--brass-ink);
  margin-bottom: 0.75rem;
}
.steps h3 { font-size: 1.5rem; }
.steps p { margin-top: 0.5rem; color: var(--moss); font-size: 0.9375rem; }

/* site.js appends an .sr-only "opens in a new tab" note inside these links;
   anchor it to the link so it can never widen the page from inside a scroller */
a[target="_blank"] { position: relative; }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ── Closing image + footer ──────────────────────────── */
.finale {
  width: 100%;
  height: clamp(18rem, 56vw, 44rem);
  object-fit: cover;
}
.footer {
  background: var(--forest);
  color: var(--cream-on-forest);
  padding: clamp(4rem, 8vw, 7rem) var(--gutter) 2.5rem;
}
.footer > * { max-width: var(--max); margin-inline: auto; }
.footer__cta {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
}
.footer__cta h2 { font-size: clamp(2.8rem, 7vw, 6rem); max-width: 12ch; }
:lang(fr) .footer__cta h2 { max-width: 18ch; } /* French headlines run longer */
.footer__cols {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
  margin-top: clamp(3.5rem, 7vw, 6rem);
  padding-top: 2rem;
  border-top: 1px solid rgba(239, 234, 223, 0.2);
  font-size: 0.9375rem;
  color: rgba(239, 234, 223, 0.78);
}
.footer__cols .wordmark { display: block; margin-bottom: 0.9rem; }
.footer__cols ul { display: grid; gap: 0.4rem; }
.footer__cols a { text-decoration: none; color: var(--cream-on-forest); }
.footer__cols a:hover { text-decoration: underline; text-underline-offset: 0.25em; }
.footer__legal { justify-self: end; text-align: right; max-width: 22ch; }

/* ════ Responsive ════════════════════════════════════ */
@media (min-width: 861px) and (max-height: 700px) {
  .hero__lede { margin-top: 1.25rem; }
  .hero__actions { margin-top: 1.5rem; }
}

@media (max-width: 1080px) {
  .js .nav__links { display: none; }
  .js .nav__burger { display: flex; }
  html:not(.js) .nav { position: absolute; flex-wrap: wrap; height: auto; padding-block: 0.9rem; row-gap: 0.4rem; }
  html:not(.js) .nav__links { order: 3; width: 100%; flex-wrap: wrap; gap: 0.2rem 1.1rem; }
  html:not(.js) .hero { padding-top: calc(var(--nav-h) + 4rem); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 2.5rem; }
}

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
    gap: 2.5rem;
  }
  .hero__arch { justify-self: stretch; width: 100%; max-width: 32rem; margin-inline: auto; }
  .section-head { grid-template-columns: 1fr; }
  .footer__cols { grid-template-columns: 1fr 1fr; }
  .footer__legal { grid-column: 1 / -1; justify-self: start; text-align: left; max-width: none; }
}

@media (max-width: 640px) {
  .nav__cta { display: none; }
  .steps { grid-template-columns: 1fr; }
  .specs div { grid-template-columns: 7.5rem 1fr; }
  .footer__cols { grid-template-columns: 1fr; }
}

@media (max-width: 400px) {
  .specs div { grid-template-columns: 5.75rem 1fr; gap: 0.75rem; }
}

/* ── Forced colours (Windows high contrast) ─────────── */
@media (forced-colors: active) {
  .wordmark, .nav__burger span { forced-color-adjust: none; background: CanvasText; }
}

/* ── Reduced motion ──────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
