/* =========================================================
   Shared base: reset, type, buttons, header, footer, cursor,
   reveal utilities, olive light scene. Used by every page.
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--c-ink);
  color: var(--c-text);
  font-family: var(--f-sans);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
::selection { background: var(--c-sage); color: var(--c-ink); }
:focus-visible { outline: 2px solid var(--c-sage); outline-offset: 4px; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: 0.75rem; left: 0.75rem; z-index: 200;
  padding: 0.75rem 1rem; background: var(--c-cream); color: var(--c-ink);
  transform: translateY(-200%); transition: transform 0.2s;
}
.skip-link:focus { transform: none; }

/* Film grain over everything (decorative) */
body::after {
  content: ""; position: fixed; inset: -50%; z-index: 150; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.07;
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -3%); } 60% { transform: translate(-2%, -1%); }
  80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); }
}

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section-y); position: relative; }

/* ---------- Type ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.9rem;
  font-size: var(--fs-eyebrow); font-weight: 500;
  letter-spacing: var(--tracking-eyebrow); text-transform: uppercase;
  color: var(--c-sage);
}
.eyebrow::before { content: ""; width: 2.25rem; height: 1px; background: currentColor; }
.display {
  font-family: var(--f-display); font-weight: var(--fw-display);
  letter-spacing: var(--tracking-tight); line-height: 0.95;
  text-wrap: balance;
}
.h2 { font-size: var(--fs-h2); }
.serif-accent {
  font-family: var(--f-serif); font-style: italic; font-weight: var(--fw-display);
  letter-spacing: -0.01em;
  color: var(--c-sage);
}
.lead { font-size: var(--fs-lead); line-height: 1.5; color: var(--c-text-dim); max-width: 38ch; text-wrap: pretty; }
.muted { color: var(--c-text-dim); }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--c-cream); --btn-fg: var(--c-ink);
  position: relative; display: inline-flex; align-items: center; gap: 0.85rem;
  min-height: 3.5rem; padding: 0 1.6rem;
  background: var(--btn-bg); color: var(--btn-fg);
  font-weight: 600; font-size: 1rem; letter-spacing: -0.01em;
  border-radius: var(--radius); overflow: hidden; isolation: isolate;
  transition: color 0.45s var(--ease-out);
  will-change: transform;
}
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--c-sage); transform: translateY(101%);
  transition: transform 0.55s var(--ease-out);
}
.btn:hover::before, .btn:focus-visible::before { transform: none; }
.btn__arrow { width: 1.1em; height: 1.1em; transition: transform 0.45s var(--ease-out); }
.btn:hover .btn__arrow { transform: translateX(4px); }
.btn--ghost {
  --btn-bg: transparent; --btn-fg: var(--c-cream);
  box-shadow: inset 0 0 0 1px var(--c-line-strong);
}
.btn--ghost:hover { color: var(--c-ink); }
.btn--sm { min-height: 2.75rem; padding: 0 1.15rem; font-size: 0.9375rem; }

.link-line {
  position: relative; display: inline-block;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size 0.5s var(--ease-out);
}
.link-line:hover, .link-line:focus-visible { background-size: 100% 1px; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100; height: var(--header-h);
  transition: transform 0.6s var(--ease-out), background-color 0.4s, border-color 0.4s;
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  background: rgba(16, 17, 14, 0.72);
  -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2);
  border-color: var(--c-line);
}
.site-header__inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.site-header__logo { display: block; width: 132px; flex-shrink: 0; }
.site-header__logo img { width: 100%; height: auto; }
.site-nav { display: none; }
.site-nav ul { display: flex; gap: 2.4rem; }
.site-nav a { font-size: 0.9375rem; font-weight: 500; color: var(--c-text-dim); transition: color 0.3s; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--c-cream); }
.site-nav a[aria-current="page"] { background-size: 100% 1px; }
.site-header__actions { display: flex; align-items: center; gap: 0.75rem; }
.site-header__cta { display: none; }
.menu-toggle {
  width: 2.75rem; height: 2.75rem; display: grid; place-items: center;
  box-shadow: inset 0 0 0 1px var(--c-line-strong); border-radius: var(--radius);
}
.menu-toggle__bars { display: block; width: 18px; }
.menu-toggle__bars span { display: block; width: 18px; height: 1.5px; background: currentColor; transition: transform 0.4s var(--ease-out); }
.menu-toggle__bars span + span { margin-top: 5px; }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars span:first-child { transform: translateY(3.25px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars span:last-child { transform: translateY(-3.25px) rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: 0; z-index: 99; background: var(--c-ink);
  padding: calc(var(--header-h) + 2rem) var(--gutter) 2rem;
  display: flex; flex-direction: column; justify-content: space-between;
  clip-path: inset(0 0 100% 0); visibility: hidden;
  transition: clip-path 0.7s var(--ease-in-out), visibility 0s 0.7s;
}
.mobile-menu.is-open { clip-path: inset(0 0 0 0); visibility: visible; transition: clip-path 0.7s var(--ease-in-out); }
.mobile-menu ul a {
  display: block; padding: 0.35rem 0;
  font-family: var(--f-display); font-size: clamp(3rem, 14vw, 5.5rem); font-weight: var(--fw-display); letter-spacing: var(--tracking-tight); line-height: 1.05;
}
.mobile-menu ul a[aria-current="page"] { color: var(--c-sage); }
body.menu-open { overflow: hidden; }

@media (min-width: 900px) {
  .site-nav { display: block; }
  .site-header__cta { display: inline-flex; }
  .menu-toggle, .mobile-menu { display: none; }
}

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--c-line); padding-top: clamp(4rem, 9vw, 7rem); padding-bottom: 2rem; position: relative; overflow: hidden; }
.site-footer__cta {
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  padding-bottom: clamp(3rem, 7vw, 5rem); border-bottom: 1px solid var(--c-line);
}
.site-footer__big {
  font-family: var(--f-display); font-size: clamp(3.75rem, 13vw, 12rem); font-weight: var(--fw-display); letter-spacing: var(--tracking-tight);
  line-height: 0.9;
  display: inline-flex; align-items: center; gap: 0.25em;
  transition: color 0.4s;
}
.site-footer__big svg { width: 0.62em; height: 0.62em; transition: transform 0.6s var(--ease-out); }
.site-footer__big:hover { color: var(--c-sage); }
.site-footer__big:hover svg { transform: rotate(-45deg); }
.site-footer__grid { display: grid; gap: 2.5rem; padding-block: 3rem; grid-template-columns: 1fr; }
.site-footer__logo { width: 170px; }.site-footer h2 { font-size: var(--fs-eyebrow); letter-spacing: var(--tracking-eyebrow); text-transform: uppercase; color: var(--c-text-faint); font-weight: 500; margin-bottom: 1rem; }
.site-footer li + li { margin-top: 0.4rem; }
.site-footer a { color: var(--c-text-dim); transition: color 0.3s; }
.site-footer a:hover { color: var(--c-cream); }
.site-footer__base {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem;
  padding-top: 1.5rem; border-top: 1px solid var(--c-line);
  font-size: var(--fs-small); color: var(--c-text-faint);
}
@media (min-width: 760px) {
  .site-footer__grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
}

/* ---------- Custom cursor (fine pointers only) ---------- */
.cursor { display: none; }
@media (pointer: fine) {
  html.has-cursor .cursor {
    display: block; position: fixed; top: 0; left: 0; z-index: 180; pointer-events: none;
    mix-blend-mode: difference;
  }
  .cursor__dot, .cursor__ring { position: fixed; top: 0; left: 0; border-radius: 50%; will-change: transform; }
  .cursor__dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; background: var(--c-cream); }
  .cursor__ring {
    width: 38px; height: 38px; margin: -19px 0 0 -19px;
    border: 1px solid var(--c-cream);
    display: grid; place-items: center;
    transition: width 0.45s var(--ease-out), height 0.45s var(--ease-out), margin 0.45s var(--ease-out), background-color 0.3s, opacity 0.3s;
  }
  .cursor__label {
    font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase;
    color: var(--c-ink); opacity: 0; transition: opacity 0.3s;
  }
  .cursor.is-hover .cursor__ring { width: 64px; height: 64px; margin: -32px 0 0 -32px; background: var(--c-cream); }
  .cursor.is-label .cursor__ring { width: 92px; height: 92px; margin: -46px 0 0 -46px; background: var(--c-cream); }
  .cursor.is-label .cursor__label { opacity: 1; }
  .cursor.is-hidden { opacity: 0; }
}

/* ---------- Reveal utilities ---------- */
html.js [data-reveal] {
  opacity: 0; transform: translateY(28px);
  transition: opacity var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
  transition-delay: calc(var(--d, 0) * 90ms);
}
html.js [data-reveal].is-in { opacity: 1; transform: none; }
/* Clip the children, not the observed element (clip-path hides it from IntersectionObserver) */
html.js [data-reveal="mask"] { opacity: 1; transform: none; }
html.js [data-reveal="mask"] > * { clip-path: inset(0 0 100% 0); transition: clip-path 1.3s var(--ease-in-out); transition-delay: calc(var(--d, 0) * 90ms); }
html.js [data-reveal="mask"].is-in > * { clip-path: inset(0 0 0 0); }

/* Split lines: words slide up from a mask */
.split-line { display: block; overflow: hidden; padding-bottom: 0.22em; margin-bottom: -0.22em; }
.split-line > span { display: inline-block; }
html.js [data-split] .split-line > span { transform: translateY(140%); transition: transform 1.1s var(--ease-out); transition-delay: calc(var(--i, 0) * 80ms); }
html.js [data-split].is-in .split-line > span { transform: none; }

/* ---------- Olive light scene (from the olive light brand animation) ---------- */
.olive-scene { position: absolute; inset: 0; overflow: hidden; background: var(--c-olive-deep); }
.olive-scene__texture {
  position: absolute; inset: -4%;
  background: url("../img/olive-texture.jpg") center / cover;
  animation: os-drift 40s ease-in-out infinite alternate;
}
.olive-scene__light {
  position: absolute; inset: -40%;
  background: repeating-linear-gradient(118deg,
    rgba(255, 246, 214, 0) 0px, rgba(255, 246, 214, 0) 70px,
    rgba(255, 246, 214, 0.55) 120px, rgba(255, 246, 214, 0) 180px, rgba(255, 246, 214, 0) 260px);
  filter: blur(28px); mix-blend-mode: soft-light; transform-origin: 0 0;
  animation: os-sway 14s ease-in-out infinite alternate;
}
.olive-scene__light--two { opacity: 0.7; animation: os-sway2 19s ease-in-out infinite alternate; }
.olive-scene__leaves {
  position: absolute; inset: -20%; mix-blend-mode: multiply; filter: blur(14px); opacity: 0.75;
  transform-origin: 0 0; animation: os-breeze 6s ease-in-out infinite alternate;
}
.olive-scene__leaves span {
  position: absolute; display: block; width: 34vw; height: 7vw;
  border-radius: 0 100% 0 100%; background: rgba(36, 40, 24, 0.95);
  left: var(--x); top: var(--y); transform-origin: 0 50%; transform: rotate(var(--r));
  animation: os-flutter var(--dur-l, 2.6s) ease-in-out infinite alternate; animation-delay: var(--delay, 0s);
}
.olive-scene__glow {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 20% 15%, rgba(255, 240, 200, 0.35), transparent 60%);
  mix-blend-mode: soft-light; animation: os-breathe 9s ease-in-out infinite alternate;
}
.olive-scene__vignette { position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 45%, rgba(16, 17, 14, 0.7)); }
@keyframes os-drift { from { transform: scale(1.02); } to { transform: scale(1.06) translate(-1.5%, 1%); } }
@keyframes os-sway { from { transform: rotate(-3deg) translateX(-4%); } to { transform: rotate(3deg) translateX(4%); } }
@keyframes os-sway2 { from { transform: rotate(4deg) translate(3%, -2%); } to { transform: rotate(-2deg) translate(-3%, 2%); } }
@keyframes os-breeze { from { transform: rotate(-6deg) translate(-4%, -1%); } to { transform: rotate(5deg) translate(5%, 3%); } }
@keyframes os-flutter {
  0% { transform: rotate(var(--r)) scaleY(1); }
  50% { transform: rotate(calc(var(--r) + 9deg)) scaleY(0.75); }
  100% { transform: rotate(calc(var(--r) - 7deg)) scaleY(1.1); }
}
@keyframes os-breathe { from { opacity: 0.4; } to { opacity: 1; } }

/* ---------- Reduced motion: simple fades only ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body::after { animation: none; }
  .olive-scene *, .olive-scene__leaves span { animation: none !important; }
  html.js [data-reveal] { transform: none; transition: opacity 0.6s ease; }
  html.js [data-reveal="mask"] > * { clip-path: none; }
  html.js [data-split] .split-line > span { transform: none; opacity: 0; transition: opacity 0.6s ease; }
  html.js [data-split].is-in .split-line > span { opacity: 1; }
}
