/* ============================================================
   ATELIER PSY — Design system
   Requires brand_assets/palette/palette.css to be loaded first.

   FONT SWAP: to move to the licensed Athelas / Vanguard files,
   replace only --ap-font-body and --ap-font-display below and
   add the @font-face blocks. Nothing else names a typeface.
   ============================================================ */

:root {
  --ap-font-body:    'Newsreader', Georgia, 'Times New Roman', serif;
  --ap-font-display: 'Archivo', 'Archivo Black', Impact, sans-serif;

  /* Type scale — fluid, 1.25 modular */
  --ap-t-display: clamp(3.5rem, 9vw, 8.5rem);
  --ap-t-h1:      clamp(2.75rem, 6vw, 5rem);
  --ap-t-h2:      clamp(2rem, 4vw, 3.25rem);
  --ap-t-h3:      clamp(1.35rem, 2vw, 1.75rem);
  --ap-t-lead:    clamp(1.1rem, 1.5vw, 1.35rem);
  --ap-t-body:    1.0625rem;
  --ap-t-small:   0.9375rem;
  --ap-t-label:   0.72rem;

  /* Spacing — 8px base, named by intent not size */
  --ap-s-1: 0.5rem;
  --ap-s-2: 1rem;
  --ap-s-3: 1.5rem;
  --ap-s-4: 2rem;
  --ap-s-5: 3rem;
  --ap-s-6: 4rem;
  --ap-s-7: 6rem;
  --ap-s-8: 9rem;
  /* Generous: the gap between panels is where the tree is actually seen */
  --ap-section: clamp(5.5rem, 15vh, 11rem);

  /* Radii */
  --ap-r-sm: 10px;
  --ap-r-md: 18px;
  --ap-r-lg: 28px;
  --ap-r-xl: 40px;
  --ap-r-pill: 999px;

  /* Elevation — tinted with bark + leaf, never neutral grey */
  --ap-e-1: 0 1px 2px rgba(74, 59, 46, .05),
            0 2px 8px rgba(74, 59, 46, .04);
  --ap-e-2: 0 2px 4px rgba(74, 59, 46, .05),
            0 8px 20px rgba(74, 59, 46, .06),
            0 1px 0 rgba(255, 255, 255, .7) inset;
  --ap-e-3: 0 4px 8px rgba(74, 59, 46, .06),
            0 16px 40px rgba(74, 59, 46, .09),
            0 1px 0 rgba(255, 255, 255, .8) inset;
  --ap-e-4: 0 8px 16px rgba(51, 71, 47, .08),
            0 28px 70px rgba(51, 71, 47, .13),
            0 1px 0 rgba(255, 255, 255, .85) inset;

  /* Motion */
  --ap-ease-out:   cubic-bezier(.16, 1, .3, 1);
  --ap-ease-inout: cubic-bezier(.4, 0, .2, 1);
  --ap-dur-fast:   180ms;
  --ap-dur:        320ms;
  --ap-dur-slow:   620ms;

  --ap-measure: 68ch;
  --ap-gutter: clamp(1.25rem, 4vw, 3rem);
  /* Deliberately narrow: the living scene behind the page has to stay
     visible down both sides. Panels never span the viewport. */
  --ap-max: 1120px;
}

/* ============================================================
   RESET
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--ap-font-body);
  font-size: var(--ap-t-body);
  line-height: 1.7;
  color: var(--ap-ink);
  background: var(--ap-beige);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* MUST come before any display rule: a later `display: flex` on the same
   element beats the UA stylesheet's [hidden] { display: none } and the
   element stays visible. This bit the form errors and success messages. */
[hidden] { display: none !important; }

img, svg, video, canvas { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
ul, ol { list-style: none; padding: 0; }

/* Lenis smooth scroll takes over from native */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

/* ============================================================
   TYPOGRAPHY
   ============================================================ */

.ap-display {
  font-family: var(--ap-font-display);
  font-variation-settings: 'wdth' 68, 'wght' 800;
  font-size: var(--ap-t-display);
  line-height: .92;
  letter-spacing: -.04em;
  text-transform: uppercase;
}

h1, .ap-h1 {
  font-family: var(--ap-font-display);
  font-variation-settings: 'wdth' 70, 'wght' 800;
  font-size: var(--ap-t-h1);
  line-height: .98;
  letter-spacing: -.035em;
  text-transform: uppercase;
}

h2, .ap-h2 {
  font-family: var(--ap-font-body);
  font-size: var(--ap-t-h2);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -.02em;
}

h3, .ap-h3 {
  font-family: var(--ap-font-body);
  font-size: var(--ap-t-h3);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -.01em;
}

.ap-lead {
  font-size: var(--ap-t-lead);
  line-height: 1.6;
  color: var(--ap-ink-soft);
  max-width: var(--ap-measure);
}

/* On a solid surface --ap-ink-soft carries the lead at 7.4:1 and reads as the
   softer step below a heading. Over translucent glass the scene eats that
   margin, so leads riding glass take full ink. Hierarchy still comes from
   size and line-height, which is where it should come from anyway. */
.ap-glass .ap-lead,
.ap-glass-soft .ap-lead { color: var(--ap-ink); }

p { max-width: var(--ap-measure); }

.ap-label {
  font-family: var(--ap-font-display);
  font-variation-settings: 'wdth' 100, 'wght' 700;
  font-size: var(--ap-t-label);
  text-transform: uppercase;
  letter-spacing: .18em;
  /* Forest, not leaf-deep. At 0.72rem this is small text needing 4.5:1, and
     --ap-leaf-deep only clears that against a SOLID cream panel. Over
     translucent glass on the golden-hour scene it measured 3.4:1. */
  color: var(--ap-forest);
  display: inline-flex;
  align-items: center;
  gap: .6em;
}

.ap-label::before {
  content: '';
  width: 1.8em;
  height: 2px;
  background: var(--ap-sun-deep);
  border-radius: 2px;
}

.ap-mute { color: var(--ap-ink-mute); }
.ap-soft { color: var(--ap-ink-soft); }

/* Serif italic pull-quote — a distinct editorial voice */
.ap-quote {
  font-size: clamp(1.25rem, 2.2vw, 1.7rem);
  font-style: italic;
  line-height: 1.45;
  letter-spacing: -.015em;
  color: var(--ap-ink);
}

.ap-num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
}

/* ============================================================
   LAYOUT
   ============================================================ */

.ap-wrap {
  width: 100%;
  max-width: var(--ap-max);
  margin-inline: auto;
  padding-inline: var(--ap-gutter);
}

.ap-wrap-wide { max-width: 1480px; }

.ap-section {
  position: relative;
  padding-block: var(--ap-section);
  z-index: 1;
}
/* The last section hands the scene back its room. At full scroll the tree has
   to finish inside the window, and a full --ap-section under the closing panel
   pushed the canopy out through the top of it. */
main > .ap-section:last-child { padding-block-end: var(--ap-s-5); }

/* Content column alignment — the page must not be centred all the way down */
.ap-col-left   { max-width: 640px; margin-inline-end: auto; }
.ap-col-right  { max-width: 640px; margin-inline-start: auto; }
.ap-col-center { max-width: 760px; margin-inline: auto; text-align: center; }
.ap-col-center .ap-lead, .ap-col-center p { margin-inline: auto; }
.ap-col-center .ap-label { justify-content: center; }

.ap-grid { display: grid; gap: var(--ap-s-3); }
.ap-grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.ap-grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.ap-grid-4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

.ap-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}
@media (max-width: 860px) { .ap-split { grid-template-columns: 1fr; } }

/* ============================================================
   GLASS — the panels that carry text over the living scene
   Large editorial planes, not a grid of frosted boxes.
   ============================================================ */

.ap-glass {
  position: relative;
  /* 0.50 at blur(13px) was the old floor — below it, --ap-ink over the
     darkest canopy fell under 4.5:1. Two things changed: the panels are now
     narrow and bled to the side, so the dense middle of the canopy rarely
     sits behind text at all, and the blur is wider. A wider blur averages
     the backdrop over a larger area, which lifts the darkest patch it can
     produce, so alpha can drop without contrast dropping with it.
     Verified by sampling composited pixels — see scripts/measure-contrast.mjs.
     Re-run it before changing either number. */
  background: rgba(255, 253, 249, .44);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  backdrop-filter: blur(18px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: var(--ap-r-xl);
  box-shadow: var(--ap-e-4);
  padding: clamp(1.75rem, 4vw, 3.5rem);
}

/* Panel width + offset modifiers. Sections alternate sides down the page so
   the scene is revealed from the opposite side each time.

   The tree stands at the CENTRE of the viewport, so a panel only actually
   uncovers it if it is both narrow AND pushed out past the content column.
   The old rule nudged a full-width panel inward by 7% and the trunk stayed
   hidden the whole way down. These panels are capped near a reading measure
   and bled out into the outer margin instead, which opens a column of scene
   across the middle of the screen.

   --ap-bleed is whatever room exists between .ap-wrap and the window edge,
   floored at 0 so nothing escapes the page on narrow screens. It slightly
   over-estimates when a classic scrollbar is present; the gutter absorbs it.

   Logical properties throughout — in Arabic the whole rhythm mirrors. */
.ap-panel-narrow { max-width: 820px; margin-inline: auto; }
.ap-panel-mid    { max-width: 980px; margin-inline: auto; }

@media (min-width: 1150px) {
  .ap-panel-left,
  .ap-panel-right {
    --ap-bleed: max(0px, (100vw - var(--ap-max)) / 2 - var(--ap-gutter));
    max-width: 620px;
  }
  /* Panels carrying a split or a grid need more than a text measure. */
  .ap-panel-left.ap-panel-wide,
  .ap-panel-right.ap-panel-wide { max-width: 700px; }

  .ap-panel-left {
    margin-inline-start: calc(var(--ap-bleed) * -1);
    margin-inline-end: auto;
  }
  .ap-panel-right {
    margin-inline-start: auto;
    margin-inline-end: calc(var(--ap-bleed) * -1);
  }
}

/* A softer wash for sections that need less separation */
.ap-glass-soft {
  background: rgba(255, 253, 249, .40);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  backdrop-filter: blur(16px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, .45);
  border-radius: var(--ap-r-lg);
  box-shadow: var(--ap-e-2);
}

/* Dark glass for the deep sections */
.ap-glass-dark {
  /* Dark glass fails in the opposite direction to light glass: its risk is a
     BRIGHT backdrop washing it out, and the golden-hour sky is the brightest
     thing on the page. 0.60 put the sun-coloured label at 3.6:1. */
  background: rgba(51, 71, 47, .78);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
  backdrop-filter: blur(18px) saturate(1.25);
  border: 1px solid rgba(163, 188, 152, .22);
  border-radius: var(--ap-r-xl);
  box-shadow: var(--ap-e-4);
  color: var(--ap-ink-invert);
  padding: clamp(2rem, 5vw, 4.5rem);
}
.ap-glass-dark h2, .ap-glass-dark h3 { color: var(--ap-ink-invert); }
.ap-glass-dark .ap-lead, .ap-glass-dark p { color: rgba(247, 243, 234, .92); }
.ap-glass-dark .ap-label { color: var(--ap-sun); }

/* A .ap-card keeps its own pale surface even when it sits inside a dark
   panel, so the inverted colours above must not reach into it — they were
   painting cream headings onto cream cards at 1.5:1. Scoped back to ink. */
.ap-glass-dark .ap-card h2,
.ap-glass-dark .ap-card h3 { color: var(--ap-ink); }
.ap-glass-dark .ap-card p,
.ap-glass-dark .ap-card .ap-lead { color: var(--ap-ink-soft); }
.ap-glass-dark .ap-card .ap-label { color: var(--ap-forest); }

/* Fallback where backdrop-filter is unsupported */
/* Without backdrop-filter the panels have no blur to lift text off the
   scene, so they fall back to near-opaque rather than unreadable. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .ap-glass      { background: rgba(255, 253, 249, .94); }
  .ap-glass-soft { background: rgba(255, 253, 249, .90); }
  .ap-glass-dark { background: rgba(51, 71, 47, .95); }
  .ap-card       { background: rgba(255, 253, 249, .96); }
}

/* ============================================================
   BUTTONS
   ============================================================ */

.ap-btn {
  --btn-bg: var(--ap-leaf-deep);
  --btn-fg: var(--ap-cream);
  --btn-bd: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6em;
  padding: .95em 1.9em;
  font-family: var(--ap-font-display);
  font-variation-settings: 'wdth' 100, 'wght' 700;
  font-size: .875rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--btn-fg);
  background: var(--btn-bg);
  border: 1.5px solid var(--btn-bd);
  border-radius: var(--ap-r-pill);
  cursor: pointer;
  transition:
    transform var(--ap-dur) var(--ap-ease-out),
    box-shadow var(--ap-dur) var(--ap-ease-out),
    background-color var(--ap-dur-fast) var(--ap-ease-inout),
    color var(--ap-dur-fast) var(--ap-ease-inout);
  box-shadow: 0 2px 4px rgba(51, 71, 47, .12), 0 8px 20px rgba(51, 71, 47, .14);
  will-change: transform;
}

.ap-btn:hover  { transform: translateY(-3px); box-shadow: 0 6px 12px rgba(51,71,47,.14), 0 18px 38px rgba(51,71,47,.20); }
.ap-btn:active { transform: translateY(-1px); box-shadow: 0 2px 6px rgba(51,71,47,.16); }
.ap-btn:focus-visible {
  outline: 3px solid var(--ap-sun-deep);
  outline-offset: 3px;
}

.ap-btn-ghost {
  --btn-bg: transparent;
  --btn-fg: var(--ap-ink);
  --btn-bd: rgba(79, 107, 74, .35);
  box-shadow: none;
}
.ap-btn-ghost:hover {
  --btn-bg: rgba(255, 253, 249, .8);
  --btn-bd: var(--ap-leaf-deep);
  box-shadow: 0 6px 18px rgba(74, 59, 46, .1);
}

.ap-btn-sun {
  --btn-bg: var(--ap-sun);
  --btn-fg: var(--ap-ink);
  box-shadow: 0 2px 4px rgba(224, 185, 92, .2), 0 8px 22px rgba(224, 185, 92, .26);
}
.ap-btn-sun:hover { --btn-bg: var(--ap-sun-deep); }

.ap-btn-sm { padding: .7em 1.3em; font-size: .78rem; }
.ap-btn-block { display: flex; width: 100%; }

/* Text link with a growing underline */
.ap-link {
  color: var(--ap-leaf-deep);
  text-decoration: none;
  font-weight: 600;
  background-image: linear-gradient(var(--ap-sun-deep), var(--ap-sun-deep));
  background-size: 0% 2px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  padding-bottom: 2px;
  transition: background-size var(--ap-dur) var(--ap-ease-out), color var(--ap-dur-fast) linear;
}
.ap-link:hover { background-size: 100% 2px; color: var(--ap-forest); }
.ap-link:focus-visible { outline: 2px solid var(--ap-sun-deep); outline-offset: 3px; border-radius: 3px; }

/* ============================================================
   NAV
   ============================================================ */

.ap-nav {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  z-index: 100;
  transition: background-color var(--ap-dur) var(--ap-ease-inout),
              box-shadow var(--ap-dur) var(--ap-ease-inout),
              backdrop-filter var(--ap-dur) var(--ap-ease-inout);
}

.ap-nav-inner {
  max-width: 1480px;
  margin-inline: auto;
  padding: 1rem var(--ap-gutter);
  display: flex;
  align-items: center;
  gap: var(--ap-s-3);
}

.ap-nav.is-stuck {
  background: rgba(245, 239, 228, .72);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  backdrop-filter: blur(20px) saturate(1.4);
  box-shadow: 0 1px 0 rgba(107, 86, 68, .1), 0 8px 30px rgba(74, 59, 46, .07);
}

.ap-brand {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  text-decoration: none;
  margin-inline-end: auto;
  border-radius: var(--ap-r-sm);
}
.ap-brand:focus-visible { outline: 3px solid var(--ap-sun-deep); outline-offset: 4px; }
.ap-brand svg { width: 40px; height: 40px; flex: none; }
.ap-brand-text { display: flex; flex-direction: column; line-height: 1; }
.ap-brand-name {
  font-family: var(--ap-font-display);
  font-variation-settings: 'wdth' 82, 'wght' 800;
  font-size: 1.15rem;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--ap-ink);
}
.ap-brand-sub {
  font-size: .66rem;
  font-style: italic;
  letter-spacing: .08em;
  color: var(--ap-leaf-deep);
  margin-block-start: 3px;
}

.ap-nav-links { display: flex; align-items: center; gap: .35rem; }

.ap-nav-link {
  position: relative;
  padding: .55rem .85rem;
  font-size: .94rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--ap-ink-soft);
  border-radius: var(--ap-r-pill);
  transition: color var(--ap-dur-fast) linear, background-color var(--ap-dur-fast) linear;
}
.ap-nav-link::after {
  content: '';
  position: absolute;
  inset-block-end: .3rem;
  inset-inline-start: 50%;
  translate: -50% 0;
  width: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--ap-sun-deep);
  transition: width var(--ap-dur) var(--ap-ease-out);
}
.ap-nav-link:hover { color: var(--ap-ink); }
.ap-nav-link:hover::after { width: 1.2rem; }
.ap-nav-link[aria-current='page'] { color: var(--ap-forest); font-weight: 600; }
.ap-nav-link[aria-current='page']::after { width: 1.2rem; }
.ap-nav-link:focus-visible { outline: 2px solid var(--ap-sun-deep); outline-offset: 2px; }

.ap-nav-actions { display: flex; align-items: center; gap: .5rem; }

/* Language switcher */
.ap-lang { position: relative; }
.ap-lang-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem .8rem;
  background: transparent;
  border: 1.5px solid rgba(79, 107, 74, .28);
  border-radius: var(--ap-r-pill);
  font-family: var(--ap-font-display);
  font-variation-settings: 'wdth' 100, 'wght' 700;
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ap-ink);
  cursor: pointer;
  transition: border-color var(--ap-dur-fast) linear, background-color var(--ap-dur-fast) linear;
}
.ap-lang-btn:hover { border-color: var(--ap-leaf-deep); background: rgba(255,253,249,.7); }
.ap-lang-btn:focus-visible { outline: 3px solid var(--ap-sun-deep); outline-offset: 3px; }
.ap-lang-btn svg { width: 12px; height: 12px; transition: rotate var(--ap-dur) var(--ap-ease-out); }
.ap-lang.is-open .ap-lang-btn svg { rotate: 180deg; }

.ap-lang-menu {
  position: absolute;
  inset-block-start: calc(100% + .5rem);
  inset-inline-end: 0;
  min-width: 150px;
  padding: .4rem;
  background: rgba(255, 253, 249, .92);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.7);
  border-radius: var(--ap-r-md);
  box-shadow: var(--ap-e-3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity var(--ap-dur) var(--ap-ease-out),
              transform var(--ap-dur) var(--ap-ease-out),
              visibility var(--ap-dur);
}
.ap-lang.is-open .ap-lang-menu { opacity: 1; visibility: visible; transform: translateY(0); }

.ap-lang-opt {
  display: flex;
  width: 100%;
  align-items: center;
  gap: .6rem;
  padding: .6rem .8rem;
  background: transparent;
  border: 0;
  border-radius: var(--ap-r-sm);
  font-size: .9rem;
  text-align: start;
  cursor: pointer;
  transition: background-color var(--ap-dur-fast) linear;
}
.ap-lang-opt:hover { background: rgba(122, 148, 113, .16); }
.ap-lang-opt[aria-selected='true'] { font-weight: 700; color: var(--ap-leaf-deep); }
.ap-lang-opt:focus-visible { outline: 2px solid var(--ap-sun-deep); outline-offset: -2px; }

/* Cart button */
.ap-cart-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px; height: 42px;
  background: transparent;
  border: 1.5px solid rgba(79,107,74,.28);
  border-radius: 50%;
  cursor: pointer;
  transition: border-color var(--ap-dur-fast) linear, background-color var(--ap-dur-fast) linear, transform var(--ap-dur) var(--ap-ease-out);
}
.ap-cart-btn:hover { border-color: var(--ap-leaf-deep); background: rgba(255,253,249,.7); transform: translateY(-2px); }
.ap-cart-btn:focus-visible { outline: 3px solid var(--ap-sun-deep); outline-offset: 3px; }
.ap-cart-btn svg { width: 19px; height: 19px; }

.ap-cart-count {
  position: absolute;
  inset-block-start: -5px;
  inset-inline-end: -5px;
  min-width: 20px; height: 20px;
  padding-inline: 5px;
  display: grid;
  place-items: center;
  background: var(--ap-sun-deep);
  color: var(--ap-ink);
  font-family: var(--ap-font-display);
  font-variation-settings: 'wght' 700;
  font-size: .68rem;
  border-radius: var(--ap-r-pill);
  box-shadow: 0 2px 6px rgba(224,185,92,.5);
  scale: 0;
  transition: scale var(--ap-dur) var(--ap-ease-out);
}
.ap-cart-count.is-visible { scale: 1; }

/* Burger */
.ap-burger {
  display: none;
  width: 42px; height: 42px;
  background: transparent;
  border: 1.5px solid rgba(79,107,74,.28);
  border-radius: 50%;
  cursor: pointer;
  place-items: center;
}
.ap-burger:focus-visible { outline: 3px solid var(--ap-sun-deep); outline-offset: 3px; }
.ap-burger span {
  display: block; width: 17px; height: 1.8px;
  background: var(--ap-ink); border-radius: 2px;
  transition: transform var(--ap-dur) var(--ap-ease-out), opacity var(--ap-dur-fast) linear;
}
.ap-burger span + span { margin-block-start: 4.5px; }
.ap-burger[aria-expanded='true'] span:nth-child(1) { transform: translateY(6.3px) rotate(45deg); }
.ap-burger[aria-expanded='true'] span:nth-child(2) { opacity: 0; }
.ap-burger[aria-expanded='true'] span:nth-child(3) { transform: translateY(-6.3px) rotate(-45deg); }

/* The tagline wraps to two lines and crowds the header once the nav
   actions are all competing for the same row. */
@media (max-width: 600px) {
  .ap-brand-sub { display: none; }
  .ap-brand svg { width: 34px; height: 34px; }
  .ap-brand-name { font-size: 1.02rem; }
  .ap-nav-actions { gap: .35rem; }
}

@media (max-width: 1040px) {
  .ap-burger { display: grid; }
  .ap-nav-links {
    position: fixed;
    inset-block-start: 0;
    inset-inline-end: 0;
    width: min(340px, 84vw);
    height: 100dvh;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: .25rem;
    padding: var(--ap-s-6) var(--ap-s-4);
    background: rgba(245, 239, 228, .96);
    -webkit-backdrop-filter: blur(30px);
    backdrop-filter: blur(30px);
    box-shadow: -20px 0 60px rgba(74,59,46,.14);
    transform: translateX(100%);
    transition: transform var(--ap-dur-slow) var(--ap-ease-out);
  }
  [dir='rtl'] .ap-nav-links { transform: translateX(-100%); }
  .ap-nav-links.is-open { transform: translateX(0); }
  .ap-nav-link { padding: .9rem 1rem; font-size: 1.15rem; }
  .ap-nav-link::after { inset-inline-start: 1rem; translate: 0 0; }
}

/* ============================================================
   CARDS
   ============================================================ */

.ap-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: rgba(255, 253, 249, .72);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
  backdrop-filter: blur(16px) saturate(1.15);
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: var(--ap-r-lg);
  overflow: hidden;
  box-shadow: var(--ap-e-2);
  transition: transform var(--ap-dur-slow) var(--ap-ease-out),
              box-shadow var(--ap-dur-slow) var(--ap-ease-out),
              border-color var(--ap-dur) linear;
  will-change: transform;
}
.ap-card:hover {
  transform: translateY(-7px);
  box-shadow: var(--ap-e-4);
  border-color: rgba(122, 148, 113, .34);
  background: rgba(255, 253, 249, .88);
}

.ap-card-figure {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--ap-beige-deep);
  overflow: hidden;
}
.ap-card-figure svg, .ap-card-figure img {
  width: 100%; height: 100%; object-fit: cover;
  transition: scale var(--ap-dur-slow) var(--ap-ease-out);
}
.ap-card:hover .ap-card-figure svg,
.ap-card:hover .ap-card-figure img { scale: 1.045; }

/* Gradient + colour treatment over imagery, per house rules */
.ap-card-figure::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(51,71,47,.28), transparent 55%);
  pointer-events: none;
}

.ap-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: var(--ap-s-2);
  padding: clamp(1.3rem, 2.4vw, 1.9rem);
}

.ap-card-title { font-size: 1.28rem; font-weight: 600; letter-spacing: -.015em; line-height: 1.3; }
.ap-card-desc { font-size: var(--ap-t-small); color: var(--ap-ink-soft); line-height: 1.65; }

.ap-badge {
  position: absolute;
  inset-block-start: .9rem;
  inset-inline-end: .9rem;
  z-index: 2;
  padding: .35em .9em;
  background: var(--ap-sun);
  color: var(--ap-ink);
  font-family: var(--ap-font-display);
  font-variation-settings: 'wdth' 100, 'wght' 700;
  font-size: .66rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  border-radius: var(--ap-r-pill);
  box-shadow: 0 2px 10px rgba(224,185,92,.45);
}

.ap-meta { display: flex; flex-direction: column; gap: .55rem; margin-block: .25rem; }
.ap-meta-row {
  display: flex; align-items: center; gap: .6rem;
  font-size: .85rem; color: var(--ap-ink-mute);
}
.ap-meta-row svg { width: 15px; height: 15px; flex: none; color: var(--ap-leaf-deep); }

.ap-card-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .85rem var(--ap-s-2);
  margin-block-start: auto;
  padding-block-start: var(--ap-s-2);
  border-block-start: 1px solid rgba(107, 86, 68, .13);
}
/* In a 3-up grid the label "Ajouter au panier" has nowhere to go and wraps
   inside the pill. Given a flex basis it drops to its own full-width line
   instead, which stays clean at every column count. */
.ap-card-foot .ap-price { flex: 0 0 auto; }
.ap-card-foot .ap-btn { flex: 1 1 155px; }

.ap-price {
  display: flex;
  align-items: baseline;
  gap: .3rem;
  font-family: var(--ap-font-display);
  font-variation-settings: 'wdth' 78, 'wght' 800;
  font-size: 1.85rem;
  line-height: 1;
  letter-spacing: -.02em;
  color: var(--ap-forest);
  font-variant-numeric: tabular-nums;
}
.ap-price small {
  font-size: .62rem;
  letter-spacing: .12em;
  color: var(--ap-ink-mute);
  font-variation-settings: 'wdth' 100, 'wght' 600;
}

/* ============================================================
   STATS
   ============================================================ */

.ap-stat { text-align: center; }
.ap-stat-num {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: .08em;
  font-family: var(--ap-font-display);
  font-variation-settings: 'wdth' 70, 'wght' 800;
  font-size: clamp(3.25rem, 7vw, 5.5rem);
  line-height: 1;
  letter-spacing: -.04em;
  color: var(--ap-forest);
  font-variant-numeric: tabular-nums;
}
.ap-stat-suffix { font-size: .42em; color: var(--ap-sun-deep); }
.ap-stat-label {
  margin-block-start: .7rem;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--ap-ink-mute);
}

/* ============================================================
   MARQUEE — oversized horizontal type
   ============================================================ */

.ap-marquee {
  position: relative;
  overflow: hidden;
  padding-block: var(--ap-s-4);
  user-select: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.ap-marquee-track {
  display: flex;
  align-items: center;
  gap: 3rem;
  width: max-content;
  will-change: transform;
}
.ap-marquee-item {
  font-family: var(--ap-font-display);
  font-variation-settings: 'wdth' 64, 'wght' 800;
  font-size: clamp(3rem, 11vw, 9rem);
  line-height: 1;
  letter-spacing: -.03em;
  text-transform: uppercase;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(79, 107, 74, .38);
  white-space: nowrap;
}
.ap-marquee-item.is-solid {
  color: var(--ap-leaf-deep);
  -webkit-text-stroke: 0;
}
.ap-marquee-dot { width: .28em; height: .28em; border-radius: 50%; background: var(--ap-sun-deep); flex: none; }

/* ============================================================
   FORMS
   ============================================================ */

.ap-field { display: flex; flex-direction: column; gap: .45rem; }
.ap-field-label {
  font-family: var(--ap-font-display);
  font-variation-settings: 'wdth' 100, 'wght' 600;
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .13em;
  color: var(--ap-ink-soft);
}
.ap-input, .ap-textarea, .ap-select {
  width: 100%;
  padding: .85rem 1.1rem;
  background: rgba(255, 253, 249, .8);
  border: 1.5px solid rgba(107, 86, 68, .18);
  border-radius: var(--ap-r-md);
  font-size: 1rem;
  color: var(--ap-ink);
  transition: border-color var(--ap-dur-fast) linear,
              box-shadow var(--ap-dur) var(--ap-ease-out),
              background-color var(--ap-dur-fast) linear;
}
.ap-textarea { min-height: 150px; resize: vertical; line-height: 1.6; }
.ap-input::placeholder, .ap-textarea::placeholder { color: var(--ap-ink-mute); opacity: .75; }
.ap-input:hover, .ap-textarea:hover, .ap-select:hover { border-color: rgba(107, 86, 68, .32); }
.ap-input:focus, .ap-textarea:focus, .ap-select:focus {
  outline: none;
  background: var(--ap-cream);
  border-color: var(--ap-leaf-deep);
  box-shadow: 0 0 0 4px rgba(122, 148, 113, .2);
}
.ap-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5 6 6.5l5-5' stroke='%234F6B4A' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1.1rem center;
  background-size: 12px;
  padding-inline-end: 2.6rem;
}
[dir='rtl'] .ap-select { background-position: left 1.1rem center; }

/* ============================================================
   FOOTER
   ============================================================ */

.ap-footer {
  position: relative;
  z-index: 1;
  background: var(--ap-forest);
  color: var(--ap-ink-invert);
  /* Deliberately shallow. The page ends on the scene, so at full scroll the
     CTA and the whole tree have to stay in frame above this band — a deep
     footer pushed both off the top of the window. It is a directory, not a
     section, and it is sized like one. No top margin either: every page ends
     in a section that already carries a full --ap-section of bottom padding.
     Adding more left a dead band. */
  padding-block: var(--ap-s-4) var(--ap-s-2);
}

.ap-footer-name {
  font-family: var(--ap-font-display);
  font-variation-settings: 'wdth' 82, 'wght' 800;
  font-size: 1.3rem;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--ap-ink-invert);
  margin-block-end: .6rem;
}
.ap-footer::before {
  content: '';
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(240, 214, 138, .5), transparent);
}
.ap-footer h4 {
  font-family: var(--ap-font-display);
  font-variation-settings: 'wdth' 100, 'wght' 700;
  font-size: .76rem;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--ap-sun);
  margin-block-end: .7rem;
}
.ap-footer p, .ap-footer li { color: rgba(247, 243, 234, .76); font-size: var(--ap-t-small); }
.ap-footer a { text-decoration: none; transition: color var(--ap-dur-fast) linear; }
.ap-footer-links li + li { margin-block-start: .4rem; }
.ap-footer-links a { color: rgba(247, 243, 234, .76); }
.ap-footer-links a:hover { color: var(--ap-sun); }
.ap-footer a:focus-visible { outline: 2px solid var(--ap-sun); outline-offset: 3px; border-radius: 3px; }

.ap-footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1.2fr 1fr;
  gap: var(--ap-s-3) var(--ap-s-4);
}
@media (max-width: 880px) { .ap-footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .ap-footer-grid { grid-template-columns: 1fr; } }

.ap-contact-row {
  display: flex; align-items: flex-start; gap: .7rem;
  font-size: var(--ap-t-small); color: rgba(247,243,234,.76);
}
.ap-contact-row + .ap-contact-row { margin-block-start: .8rem; }
.ap-contact-row svg { width: 16px; height: 16px; flex: none; margin-block-start: .28em; color: var(--ap-sun); }

.ap-social { display: flex; gap: .6rem; }
.ap-social a {
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border: 1px solid rgba(163, 188, 152, .3);
  border-radius: 50%;
  color: rgba(247,243,234,.8);
  transition: background-color var(--ap-dur-fast) linear,
              border-color var(--ap-dur-fast) linear,
              transform var(--ap-dur) var(--ap-ease-out),
              color var(--ap-dur-fast) linear;
}
.ap-social a:hover {
  background: var(--ap-sun); border-color: var(--ap-sun);
  color: var(--ap-forest); transform: translateY(-3px);
}
.ap-social svg { width: 17px; height: 17px; }

.ap-footer-base {
  margin-block-start: var(--ap-s-3);
  padding-block-start: var(--ap-s-2);
  border-block-start: 1px solid rgba(163, 188, 152, .18);
  display: flex; flex-wrap: wrap; gap: var(--ap-s-2);
  align-items: center; justify-content: space-between;
  font-size: .82rem; color: rgba(247, 243, 234, .55);
}

/* ============================================================
   CART DRAWER
   ============================================================ */

.ap-drawer-scrim {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(35, 48, 31, .42);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0; visibility: hidden;
  transition: opacity var(--ap-dur) var(--ap-ease-inout), visibility var(--ap-dur);
}
.ap-drawer-scrim.is-open { opacity: 1; visibility: visible; }

.ap-drawer {
  position: fixed;
  inset-block: 0;
  inset-inline-end: 0;
  z-index: 201;
  width: min(430px, 100vw);
  display: flex; flex-direction: column;
  background: var(--ap-beige);
  box-shadow: -24px 0 70px rgba(51, 71, 47, .22);
  transform: translateX(100%);
  transition: transform var(--ap-dur-slow) var(--ap-ease-out);
}
[dir='rtl'] .ap-drawer { transform: translateX(-100%); }
.ap-drawer.is-open { transform: translateX(0); }

.ap-drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--ap-s-2);
  padding: var(--ap-s-3) var(--ap-s-4);
  border-block-end: 1px solid rgba(107,86,68,.14);
}
.ap-drawer-body { flex: 1; overflow-y: auto; padding: var(--ap-s-3) var(--ap-s-4); }
.ap-drawer-foot {
  padding: var(--ap-s-3) var(--ap-s-4) var(--ap-s-4);
  border-block-start: 1px solid rgba(107,86,68,.14);
  background: rgba(255,253,249,.6);
}

.ap-icon-btn {
  display: grid; place-items: center;
  width: 38px; height: 38px;
  background: transparent; border: 0;
  border-radius: 50%; cursor: pointer;
  color: var(--ap-ink-soft);
  transition: background-color var(--ap-dur-fast) linear, color var(--ap-dur-fast) linear;
}
.ap-icon-btn:hover { background: rgba(122,148,113,.16); color: var(--ap-ink); }
.ap-icon-btn:focus-visible { outline: 3px solid var(--ap-sun-deep); outline-offset: 2px; }
.ap-icon-btn svg { width: 18px; height: 18px; }

.ap-cart-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .35rem var(--ap-s-2);
  padding-block: var(--ap-s-2);
}
.ap-cart-item + .ap-cart-item { border-block-start: 1px solid rgba(107,86,68,.12); }
.ap-cart-item-title { font-weight: 600; font-size: .98rem; line-height: 1.35; }
.ap-cart-item-meta { font-size: .8rem; color: var(--ap-ink-mute); }
.ap-cart-item-price {
  font-family: var(--ap-font-display);
  font-variation-settings: 'wdth' 84, 'wght' 700;
  font-size: 1.05rem; color: var(--ap-forest);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ap-qty { display: inline-flex; align-items: center; gap: .1rem; border: 1.5px solid rgba(107,86,68,.2); border-radius: var(--ap-r-pill); }
.ap-qty button {
  width: 28px; height: 28px; display: grid; place-items: center;
  background: transparent; border: 0; border-radius: 50%; cursor: pointer;
  color: var(--ap-leaf-deep); font-size: 1rem; line-height: 1;
  transition: background-color var(--ap-dur-fast) linear;
}
.ap-qty button:hover { background: rgba(122,148,113,.2); }
.ap-qty button:focus-visible { outline: 2px solid var(--ap-sun-deep); outline-offset: -1px; }
.ap-qty span { min-width: 22px; text-align: center; font-size: .9rem; font-variant-numeric: tabular-nums; }

.ap-cart-total {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-block-end: var(--ap-s-2);
}
.ap-cart-total dt { font-size: .8rem; text-transform: uppercase; letter-spacing: .14em; color: var(--ap-ink-mute); }
.ap-cart-total dd {
  font-family: var(--ap-font-display);
  font-variation-settings: 'wdth' 76, 'wght' 800;
  font-size: 2rem; color: var(--ap-forest);
  font-variant-numeric: tabular-nums;
}

.ap-empty { text-align: center; padding-block: var(--ap-s-6); }
.ap-empty svg { width: 84px; height: 84px; margin-inline: auto; margin-block-end: var(--ap-s-2); opacity: .75; }

/* Toast */
.ap-toast {
  position: fixed;
  inset-block-end: var(--ap-s-3);
  inset-inline-start: 50%;
  z-index: 300;
  display: flex; align-items: center; gap: .7rem;
  padding: .85rem 1.4rem;
  background: var(--ap-forest);
  color: var(--ap-ink-invert);
  border-radius: var(--ap-r-pill);
  box-shadow: 0 12px 40px rgba(51,71,47,.3);
  font-size: .92rem;
  transform: translate(-50%, 160%);
  opacity: 0;
  visibility: hidden;
  transition: transform var(--ap-dur-slow) var(--ap-ease-out),
              opacity var(--ap-dur) var(--ap-ease-out),
              visibility var(--ap-dur-slow);
}
.ap-toast.is-visible { transform: translate(-50%, 0); opacity: 1; visibility: visible; }
.ap-toast svg { width: 18px; height: 18px; color: var(--ap-sun); flex: none; }

/* ============================================================
   SCROLL REVEAL
   ============================================================ */

[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity var(--ap-dur-slow) var(--ap-ease-out),
              transform var(--ap-dur-slow) var(--ap-ease-out);
  will-change: transform, opacity;
}
[data-reveal='left']  { transform: translateX(-38px); }
[data-reveal='right'] { transform: translateX(38px); }
[data-reveal='scale'] { transform: scale(.94); }
[data-reveal='clip']  { transform: none; clip-path: inset(0 0 100% 0); transition: clip-path 900ms var(--ap-ease-out), opacity var(--ap-dur-slow) var(--ap-ease-out); }

[data-reveal].is-in {
  opacity: 1;
  transform: none;
  clip-path: inset(0 0 0 0);
}

/* Scroll progress bar */
.ap-progress {
  position: fixed;
  inset-block-start: 0;
  inset-inline-start: 0;
  z-index: 150;
  height: 3px;
  width: 100%;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--ap-leaf-deep), var(--ap-sun-deep));
}
[dir='rtl'] .ap-progress { transform-origin: 100% 50%; }

/* Skip link */
.ap-skip {
  position: absolute;
  inset-block-start: -100px;
  inset-inline-start: var(--ap-s-2);
  z-index: 400;
  padding: .8rem 1.4rem;
  background: var(--ap-forest);
  color: var(--ap-ink-invert);
  border-radius: var(--ap-r-pill);
  text-decoration: none;
  transition: top var(--ap-dur) var(--ap-ease-out);
}
.ap-skip:focus { inset-block-start: var(--ap-s-2); }

/* ============================================================
   PAGE HEADER (inner pages)
   ============================================================ */

.ap-pagehead {
  position: relative;
  padding-block: clamp(8rem, 16vh, 12rem) var(--ap-s-6);
  overflow: hidden;
}
.ap-pagehead::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(1000px 460px at 78% -8%, rgba(240, 214, 138, .34), transparent 62%),
    radial-gradient(760px 400px at 12% 108%, rgba(122, 148, 113, .3), transparent 60%);
  pointer-events: none;
}

/* Paper grain — sits over the ground, under content */
.ap-grain {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: .28;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='.42'/%3E%3C/svg%3E");
}

/* ============================================================
   RTL
   ============================================================ */

[dir='rtl'] {
  --ap-font-body: 'Amiri', 'Newsreader', Georgia, serif;
  --ap-font-display: 'Cairo', 'Archivo', sans-serif;
}
[dir='rtl'] .ap-display,
[dir='rtl'] h1, [dir='rtl'] .ap-h1 {
  letter-spacing: 0;
  text-transform: none;
  font-variation-settings: 'wght' 800;
  line-height: 1.15;
}
[dir='rtl'] .ap-label,
[dir='rtl'] .ap-btn,
[dir='rtl'] .ap-field-label,
[dir='rtl'] .ap-footer h4,
[dir='rtl'] .ap-stat-label,
[dir='rtl'] .ap-badge {
  letter-spacing: 0;
  text-transform: none;
}
[dir='rtl'] .ap-marquee-item { letter-spacing: 0; text-transform: none; }

/* ============================================================
   REDUCED MOTION — non-negotiable
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] { opacity: 1 !important; transform: none !important; clip-path: none !important; }
  .ap-marquee-track { transform: none !important; }
}

/* ============================================================
   PRINT
   ============================================================ */

@media print {
  .ap-nav, .ap-drawer, .ap-drawer-scrim, .ap-progress, .ap-grain, #ap-scene { display: none !important; }
  .ap-glass, .ap-glass-soft { background: #fff !important; box-shadow: none !important; border: 1px solid #ccc !important; backdrop-filter: none !important; }
  body { background: #fff; }
}


/* ============================================================
   SELECTION  (not a basket — see assets/js/site.js)
   ============================================================ */

/* A toggle, so it has to show state. aria-pressed carries it for
   assistive tech; this carries it visually. */
.ap-btn-select.is-selected {
  --btn-bg: rgba(122, 148, 113, .16);
  --btn-fg: var(--ap-leaf-deep);
  --btn-bd: var(--ap-leaf-deep);
  box-shadow: none;
}
.ap-btn-select.is-selected:hover {
  --btn-bg: rgba(168, 68, 58, .1);
  --btn-fg: #8E3B32;
  --btn-bd: #A8443A;
}

.ap-sel-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--ap-s-2);
  padding-block: var(--ap-s-2);
}
.ap-sel-item + .ap-sel-item { border-block-start: 1px solid rgba(107, 86, 68, .12); }

.ap-line-ref {
  margin-block-start: .35rem;
  font-size: .78rem;
  color: var(--ap-ink-mute);
  font-variant-numeric: tabular-nums;
}
