/* MK Grains & Commodities, sample 03: Cutaway on a light sky */
:root {
  --cream: #F3E8D8;
  --cream-2: #EBDDC7;
  --ink: #3D3A36;
  --black: #15130F;
  --sage: #5E6D55;
  --sage-ink: #4C5945;
  --gold: #B8862E;
  --display: "Cormorant Garamond", "Caudex", Georgia, serif;
  --serif: "Caudex", Georgia, serif;
  --sans: "Mulish", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --pad: clamp(20px, 5vw, 88px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 300 18px/1.65 var(--sans);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
p { margin: 0 0 1em; }
h1, h2, h3, h4 { margin: 0; font-weight: 400; }
::selection { background: var(--sage); color: var(--cream); }
:focus-visible { outline: 2px solid var(--sage); outline-offset: 3px; }

.skip-link {
  position: fixed; left: 16px; top: -60px; z-index: 200;
  background: var(--ink); color: var(--cream); padding: 10px 16px; text-decoration: none;
}
.skip-link:focus { top: 16px; }

/* ---------- layers: sky (0) < back headline (0, later in DOM) < canvas (1) < content (2) ---------- */
.sky {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(120% 70% at 70% 105%, rgba(243, 232, 216, 1) 0%, rgba(243, 232, 216, 0) 60%),
    linear-gradient(180deg, #A7BCC8 0%, #BFCCD0 30%, #DAD9CF 62%, #F0E5D5 88%, #F3E8D8 100%);
}
#scene {
  position: fixed; inset: 0; z-index: 1;
  width: 100%; height: 100vh; height: 100lvh;
  pointer-events: none; display: block;
}

/* ---------- preloader ---------- */
.preloader {
  position: fixed; inset: 0; z-index: 100;
  background: var(--cream);
  display: grid; place-items: center;
  cursor: pointer;
}
.pl-inner { display: grid; justify-items: center; gap: 10px; }
.pl-silo { width: 64px; height: auto; overflow: visible; }
.pl-f { transform-box: fill-box; transform-origin: 50% 100%; transform: scaleY(0); }
.pl-mark {
  margin: 14px 0 0; display: flex; overflow: hidden;
  font: italic 400 64px/1 var(--serif); color: var(--ink); letter-spacing: -.01em;
}
.pl-mark span { display: inline-block; transform: translateY(105%); }
.pl-name { margin: 0; font: 400 15px/1 var(--serif); color: var(--sage-ink); opacity: 0; letter-spacing: .02em; }
.pl-hint { position: absolute; bottom: 28px; margin: 0; font-size: 13px; color: var(--ink); opacity: .55; }
body:not(.is-loading) .preloader { pointer-events: none; }

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  display: flex; align-items: center; gap: 32px;
  padding: 18px var(--pad);
  transition: background-color .5s var(--ease), backdrop-filter .5s var(--ease);
}
.nav.is-scrolled {
  background: rgba(243, 232, 216, .72);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
}
.wordmark { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); margin-right: auto; }
.wm-mk { font: italic 400 34px/1 var(--serif); letter-spacing: -.02em; }
.wm-name { font: 400 12.5px/1.25 var(--serif); padding-left: 10px; border-left: 1px solid currentColor; }
.wm-name em { font-style: italic; opacity: .75; }
.nav-links { display: flex; gap: 30px; }
.nav-links a {
  font-size: 15px; font-weight: 400; text-decoration: none; position: relative; padding: 6px 0;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: right;
  transition: transform .45s var(--ease);
}
.nav-links a:hover::after { transform: scaleX(1); transform-origin: left; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 22px;
  font: 600 14px/1 var(--sans); letter-spacing: .01em; text-decoration: none;
  transition: transform .4s var(--ease), background-color .3s, color .3s;
}
.btn--ink { background: var(--black); color: var(--cream); }
.btn--ink:hover { background: var(--sage); transform: translateY(-2px); }
.btn--lg { min-height: 56px; padding: 0 30px; font-size: 15px; }

/* ---------- hero ---------- */
.hero { position: relative; min-height: 100vh; min-height: 100svh; }
.hero-title {
  position: absolute; left: 0; right: 0; top: 19vh;
  font: 300 clamp(56px, 10.4vw, 200px)/.9 var(--display);
  letter-spacing: -.025em; color: var(--ink);
}
.hl { display: block; position: relative; }
.hl--back { z-index: 0; padding-left: calc(var(--pad) - .04em); }
.hl--front { z-index: 2; text-align: right; padding-right: var(--pad); margin-top: .06em; }
.hl--front .w:last-child > span { font-style: italic; }
.w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
.w > span { display: inline-block; }

.hero-foot {
  position: absolute; z-index: 2; left: var(--pad); right: var(--pad); bottom: 6vh;
  display: flex; justify-content: space-between; align-items: flex-end; gap: 32px;
}
.hero-sub {
  max-width: 360px; margin: 0; padding-left: 18px; border-left: 1px solid var(--sage);
  font-size: 18px; line-height: 1.5; font-weight: 400;
}
.scroll-cue { display: flex; align-items: center; gap: 14px; font-size: 14px; text-decoration: none; font-weight: 400; }
.scroll-cue i { position: relative; width: 1px; height: 52px; background: rgba(61, 58, 54, .2); overflow: hidden; }
.scroll-cue i::after {
  content: ""; position: absolute; left: 0; top: -40%; width: 1px; height: 40%; background: var(--ink);
  animation: cue 2.2s var(--ease) infinite;
}
@keyframes cue { to { top: 100%; } }

/* ---------- chapters (sticky text, silo moves behind) ---------- */
.chapter { position: relative; z-index: 2; min-height: 160vh; }
.chapter-inner {
  position: sticky; top: 0; height: 100vh; height: 100svh;
  display: flex; align-items: center; padding: 0 var(--pad);
}
.copy { max-width: 520px; }
.chapter--right .copy { margin-left: auto; }
.kicker { font: italic 400 19px/1.3 var(--serif); color: var(--sage-ink); margin-bottom: 18px; }
.title { font: 300 clamp(44px, 5.4vw, 92px)/.98 var(--display); letter-spacing: -.02em; margin-bottom: 28px; }
.ptitle { font: 300 clamp(64px, 9.4vw, 168px)/.88 var(--display); letter-spacing: -.03em; margin: 0 0 26px -.04em; }
.stitle { font: 300 clamp(52px, 7vw, 124px)/.9 var(--display); letter-spacing: -.025em; margin: 0 0 26px -.03em; }
.copy p:not(.kicker) { max-width: 46ch; }
.note { font-family: var(--serif); font-style: italic; font-size: 16px; opacity: .8; }

/* ---------- sustainability (sage panel) ---------- */
.sustain {
  position: relative; z-index: 2;
  background: var(--sage); color: var(--cream);
  padding: clamp(96px, 16vh, 180px) var(--pad);
  display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(40px, 7vw, 120px); align-items: start;
}
.sustain .kicker { color: #E6DCC6; }
.sustain .title { font-size: clamp(36px, 3.9vw, 64px); line-height: 1.04; }
.sustain-head p:last-child { max-width: 48ch; opacity: .92; }
.sustain-list { margin: 0; display: grid; gap: 40px; padding-top: 10px; }
.sustain-list > div { padding-top: 22px; border-top: 1px solid rgba(243, 232, 216, .35); }
.sustain-list dt { font: 400 26px/1.2 var(--serif); margin-bottom: 10px; }
.sustain-list dd { margin: 0; opacity: .9; max-width: 44ch; }

/* ---------- contact ---------- */
.contact { position: relative; z-index: 2; min-height: 100vh; display: flex; align-items: center; padding: 18vh var(--pad); }
.contact-inner { max-width: 760px; }
.ctitle { font: 300 clamp(48px, 6.6vw, 116px)/.94 var(--display); letter-spacing: -.025em; margin-bottom: 40px; }
.contact-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 28px; margin-top: 56px; }
.contact-grid h3 { font: italic 400 17px/1.2 var(--serif); color: var(--sage-ink); margin-bottom: 8px; }
.contact-grid p { font-size: 16px; line-height: 1.55; font-weight: 400; margin: 0; }
.contact-grid a { text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .4s var(--ease); }
.contact-grid a:hover { background-size: 100% 1px; }

/* ---------- projected layer tags ---------- */
.tags { position: fixed; inset: 0; z-index: 3; pointer-events: none; }
.tag {
  position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 10px;
  font: italic 400 17px/1 var(--serif); color: var(--ink); white-space: nowrap;
  opacity: 0; will-change: transform, opacity;
}
.tag i { display: block; width: 44px; height: 1px; background: var(--ink); position: relative; }
.tag i::before { content: ""; position: absolute; left: -3px; top: -3px; width: 7px; height: 7px; border-radius: 50%; background: var(--ink); }
.tag.flip { flex-direction: row-reverse; }
.tag.flip i::before { left: auto; right: -3px; }

/* ---------- footer ---------- */
.footer { position: relative; z-index: 2; background: var(--black); color: var(--cream); padding: 72px var(--pad) 28px; }
.footer-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; padding-bottom: 48px; border-bottom: 1px solid rgba(243, 232, 216, .16); }
.footer-top p { margin: 0; font: italic 400 18px/1.45 var(--serif); text-align: right; opacity: .85; }
.wordmark--light { color: var(--cream); margin-right: 0; }
.footer-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px;
  padding-top: 24px; font-size: 13px; color: rgba(243, 232, 216, .72);
}
.footer-credit { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.footer-credit img { height: 27px; width: auto; }
.footer-credit a { display: inline-flex; transition: opacity .3s; }
.footer-credit a:hover { opacity: .75; }

/* ---------- reveal start states (JS sets them; no-JS sees everything) ---------- */
.js .rv, .js .rv-hero { opacity: 0; }
.js .split .w > span, .js .hero-title .w > span { transform: translateY(105%); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .sustain { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; gap: 22px; }
}
@media (max-width: 760px) {
  body { font-size: 16.5px; }
  .nav { padding: 14px 20px; gap: 12px; }
  .wm-mk { font-size: 28px; }
  .wm-name { font-size: 11px; }
  .nav .btn { min-height: 40px; padding: 0 14px; font-size: 13px; }
  .hero-title { top: 15vh; font-size: clamp(54px, 17.5vw, 96px); line-height: .92; }
  .hl--back { padding-left: 20px; }
  .hl--front { padding-right: 20px; margin-top: 0; }
  .hero-foot { left: 20px; right: 20px; bottom: 4vh; }
  .hero-sub { font-size: 15.5px; max-width: 290px; background: rgba(243, 232, 216, .7); padding: 10px 12px 10px 14px; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
  .scroll-cue span { display: none; }
  .chapter { min-height: 150vh; }
  .chapter-inner { align-items: flex-end; padding: 0 16px 4vh; }
  .copy {
    max-width: none; width: 100%;
    background: rgba(243, 232, 216, .84); padding: 22px 20px 6px;
    -webkit-backdrop-filter: blur(12px) saturate(130%); backdrop-filter: blur(12px) saturate(130%);
  }
  .kicker { font-size: 16px; margin-bottom: 10px; }
  .title { font-size: 42px; margin-bottom: 16px; }
  .ptitle { font-size: 60px; margin-bottom: 14px; }
  .stitle { font-size: 46px; margin-bottom: 14px; }
  .tag { font-size: 14px; }
  .tag i { width: 26px; }
  .contact { padding: 14vh 20px 50vh; align-items: flex-start; }
  .ctitle { font-size: 46px; }
  .footer-top { flex-direction: column; align-items: flex-start; }
  .footer-top p { text-align: left; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

/* ---------- reduced motion: calm static version ---------- */
.rm #scene { position: absolute; height: 100vh; }
.rm .sky { position: absolute; height: 100vh; }
.rm .preloader, .rm .tags { display: none; }
.rm .scroll-cue i::after { animation: none; top: 30%; }
.rm .chapter { min-height: 0; }
.rm .chapter-inner { position: relative; height: auto; padding-top: 14vh; padding-bottom: 14vh; }
.rm .btn--ink:hover { transform: none; }
.rm .nav { background: var(--cream); box-shadow: 0 1px 0 rgba(61, 58, 54, .1); }
