/* ---------- Tokens ---------- */
:root {
  --cream: #f9efe7;
  --dark: #1c1c1b;
  /* call-to-action accent: deep emerald, a calm cool hue against the warm palette;
     cream text ~4.7:1 */
  --cta: #127a52;
  --cta-hover: #0d6643;
  --cta-ink: #f9efe7;
  --text: #333333;
  --muted: #73675e;
  --muted-light: #998a7e;
  --tag-bg: #e5ccb2;
  --tag-text: #4b5563;
  --footer-dark: #201d1d;

  --font: "Geist", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;
  --display: "Funnel Display", "Geist", sans-serif;

  /* fluid sizing: 16px at 1440 wide, clamped between 1280 and 1920 */
  --size-container: clamp(1280px, 100vw, 1920px);
  --size-font: calc(var(--size-container) / 90);
  --pad: 2rem;
  --ease: cubic-bezier(0.65, 0.05, 0, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: var(--size-font); -webkit-font-smoothing: antialiased; }
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(--text);
  font-family: var(--font);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  letter-spacing: -0.04em;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
p, h1, h2, h3 { margin: 0; font-weight: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; letter-spacing: inherit; text-align: left; }

.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 1rem; }
.container { padding: 0 var(--pad); position: relative; }
.mono { font-family: var(--mono); font-size: 0.75rem; line-height: 1; text-transform: uppercase; letter-spacing: -0.04em; }
.muted { color: var(--muted); }
.muted-light { color: var(--muted-light); }
.label { font-size: 1.2rem; line-height: 0.92; color: var(--dark); padding-bottom: 4.95rem; }
.dark { background: var(--dark); }
.dark .label { color: var(--cream); }

/* split text helpers */
/* nowrap: a measured line can come out a hair wider once rebuilt; it must never wrap into an extra line */
.split-line { display: block; overflow: hidden; padding-bottom: 0.08em; margin-bottom: -0.08em; white-space: nowrap; }
.split-line > .split-inner { display: block; }
.word { display: inline-block; white-space: nowrap; }
.char { display: inline-block; }

/* ---------- Buttons (letters wave up, arrow swaps out top-right) ---------- */
.btn {
  --btn-ease: cubic-bezier(0.625, 0.05, 0, 1);
  --dup: 1.5em;
  display: inline-flex; align-items: center; gap: 0.4em;
  padding: 0.3em 0.5em; border-radius: 0.125em;
  background: var(--cream); color: var(--dark);
  font-size: 1rem; font-weight: 600; line-height: 1; white-space: nowrap;
  transition: color 0.4s, background-color 0.4s;
}
.btn__mask { display: flex; clip-path: inset(-10% 0); }
.btn__text { display: inline-block; text-shadow: 0 var(--dup) currentColor; font-kerning: none; }
.btn__text .char { display: inline-block; }
.btn__icon { width: 1.125em; height: 1.125em; position: relative; overflow: clip; flex: none; }
.btn__icon svg { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0.2em; transition: transform 0.9s var(--btn-ease); }
.btn__icon svg + svg { transform: translate(-100%, 100%); }
.btn:hover .btn__icon svg { transform: translate(100%, -100%); }
.btn:hover .btn__icon svg + svg { transform: translate(0, 0); }

/* ---------- Loader ---------- */
.loader { position: fixed; inset: 0 0 auto; height: 100dvh; z-index: 102; color: var(--cream); }
.loader__bg { position: absolute; inset: 0; background: var(--dark); }
.loader__bar {
  position: absolute; left: 0; right: 0; bottom: 0; height: 0.5em; z-index: 1;
  background: var(--cream); transform: scaleX(0); transform-origin: 0% 50%;
}
.loader__container { position: relative; z-index: 2; width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.loader__logo-wrap { position: relative; width: 15em; height: 3em; display: flex; align-items: center; justify-content: center; }
.loader__logo {
  position: absolute; white-space: nowrap; padding: 0 0.1em;
  font-family: var(--display); font-weight: 750; font-size: 2.6em; letter-spacing: -0.05em; line-height: 1;
}
.loader__logo.is--base { opacity: 0.2; }
.loader__logo.is--top { clip-path: inset(0 100% 0 0); }
.loader__text-wrap {
  position: absolute; bottom: 3.5em; display: flex; flex-direction: column; align-items: center;
  font-family: var(--mono); font-size: 0.75em; font-weight: 500; line-height: 1; letter-spacing: -0.04em;
}
.loader__text { position: absolute; text-transform: uppercase; white-space: nowrap; padding-bottom: 0.25em; margin-bottom: -0.25em; visibility: hidden; }
.loader__text .split-line { overflow: clip; }

/* ---------- Cursor + grain ---------- */
.cursor { position: fixed; left: 0; top: 0; z-index: 90; pointer-events: none; }
.cursor__bubble {
  height: 1.5em; display: flex; align-items: center; padding: 0 0.5em; margin: 0.3em 0 0 0.5em;
  border-radius: 2px; font-size: 1rem; font-weight: 500; white-space: nowrap;
  background: var(--dark); color: #f5ede4; opacity: 0;
  transform: translateX(0%) scale(0.9);
  transition: transform 0.4s cubic-bezier(0.625, 0.05, 0, 1), opacity 0.4s cubic-bezier(0.625, 0.05, 0, 1), background-color 0.3s, color 0.3s;
}
.cursor__bubble span { font-size: 0.9em; letter-spacing: -0.04em; }
.cursor[data-cursor="active"] .cursor__bubble { opacity: 1; transform: translateX(0%) scale(1); }
.cursor[data-cursor="active-edge"] .cursor__bubble { opacity: 1; transform: translateX(-100%) scale(1); margin-left: -0.5em; }
.cursor[data-cursor-theme="on-image"] .cursor__bubble { background: #f5ede4; color: #1a1a1a; }
.cursor[data-cursor-theme="off-image"] .cursor__bubble { background: var(--dark); color: #f5ede4; }
@media (hover: none) { .cursor { display: none; } }

.grain {
  position: fixed; inset: -50%; width: 200%; height: 200%; z-index: 80; pointer-events: none; opacity: 0.08;
  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='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-5%, 3%); } 40% { transform: translate(3%, -6%); }
  60% { transform: translate(-7%, 2%); } 80% { transform: translate(6%, 5%); } 100% { transform: translate(0, 0); }
}

/* ---------- Nav ---------- */
/* nav colours follow the section underneath (data-theme-nav on <body>) */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 50; color: var(--dark); transition: color 0.4s; }
[data-theme-nav="dark"] .nav { color: var(--cream); }
.nav__inner { height: 4.7rem; align-items: center; padding: 0 var(--pad); }
.nav__logo { grid-column: 1 / 3; justify-self: start; display: block; line-height: 0; }
/* the logo mark is a mask filled with the nav colour, so it follows the light/dark theme */
.nav__mark {
  display: block; height: 2.3rem; aspect-ratio: 294 / 324; background-color: currentColor;
  -webkit-mask: url("assets/logo-mark.png") center / contain no-repeat;
  mask: url("assets/logo-mark.png") center / contain no-repeat;
  transition: transform 0.6s var(--ease);
}
.nav__logo:hover .nav__mark { transform: rotate(-6deg) scale(1.06); }
.nav__logo:focus-visible { outline: 2px solid var(--cta); outline-offset: 4px; }
.nav__links { grid-column: 7 / 9; display: flex; gap: 0.4rem; }
.nav__link { display: inline-block; overflow: hidden; line-height: 1.1; letter-spacing: -0.04em; }
.nav__btn-wrap { grid-column: 11 / 13; justify-self: end; }
/* Get in touch stays cobalt on every section so it always draws the eye */
.nav .btn { background: var(--cta); color: var(--cta-ink); }
.nav .btn:hover { background: var(--cta-hover); }

/* letter roll hover (driven by GSAP) */
[data-split-hover] .roll { display: inline-block; position: relative; overflow: hidden; vertical-align: top; }
[data-split-hover] .roll span { display: block; }
[data-split-hover] .roll span + span { position: absolute; left: 0; top: 0; }

/* ---------- Hero ---------- */
.hero { position: relative; height: 100vh; min-height: 40rem; background: var(--cream); overflow: hidden; }
.hero__shader { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero__inner { position: relative; height: 100%; padding: var(--pad) var(--pad) 2rem; display: flex; flex-direction: column; justify-content: space-between; }
.hero__text { flex: 1; align-content: center; }
.hero__h1 { grid-column: 7 / 13; max-width: 29.8rem; font-size: 1.3rem; line-height: 1.2; color: var(--dark); }
.hero__h1 .gap { margin-top: 1.2em; }
.hero__h1 > span { display: block; }
.hero__bottom { display: flex; flex-direction: column; gap: 3.5rem; }

.wordmark {
  font-family: var(--display); font-weight: 750; color: var(--dark);
  line-height: 0.78; letter-spacing: -0.05em; white-space: nowrap; width: max-content;
  font-size: 13rem; /* refined by JS to span the full width */
  margin-left: -0.04em; padding-bottom: 0.06em;
}

/* ---------- Shutter ---------- */
.shutter { position: absolute; left: 0; right: 0; bottom: 0; height: 100vh; pointer-events: none; display: flex; flex-direction: column; z-index: 3; }
.shutter__row { flex: 1; background: var(--dark); transform: scaleY(0); transform-origin: bottom; margin-top: -1px; }

/* ---------- Statement ---------- */
/* one gradient across the full 350vh: dark at 18% -> cream at 91% */
.statement { position: relative; z-index: 10; height: 350vh; background: linear-gradient(180deg, var(--dark) 18%, var(--cream) 91%); }
/* covers the whole section (inset 0), so the grid scrolls with the page and can't spill outside it */
.statement__dots { position: absolute; inset: 0; display: block; width: 100%; height: 100%; pointer-events: none; }
.statement__sticky { position: sticky; top: 0; height: 100vh; display: flex; align-items: center; justify-content: center; }
.statement__inner { position: relative; width: 60rem; max-width: calc(100% - 2 * var(--pad)); display: grid; }
.statement__title {
  grid-area: 1 / 1; align-self: center;
  font-size: 4rem; line-height: 1; letter-spacing: -0.04em; color: var(--cream); text-align: center; text-wrap: balance;
}
/* the last statement lands on the cream end of the gradient */
.statement__title--dark { color: #2b2b2b; }

/* ---------- Work ---------- */
.work { position: relative; background: var(--cream); padding: 4rem 0; overflow: hidden; }
.work__item { position: relative; }
.work__media { grid-column: 3 / 9; aspect-ratio: 3 / 2; position: relative; overflow: hidden; border-radius: 2px; }
.work__parallax { position: absolute; left: 0; right: 0; top: 0; height: 113%; }
.work__parallax > *, .work__media img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 2px; transition: filter 0.4s ease; }
.work__media.is-playing .work__parallax > * { filter: blur(4px); }
.work__media video {
  position: absolute; left: 50%; top: 50%; width: 63%; transform: translate(-50%, -50%);
  border-radius: 2px; z-index: 5; opacity: 0; pointer-events: none; transition: opacity 0.4s ease;
}
.work__media.is-playing video { opacity: 1; }
/* touch / small screens: the video fills the whole media box instead of the hover inset */
.work__media.is-inline-video video {
  left: 0; top: 0; width: 100%; height: 100%; object-fit: cover; transform: none; opacity: 1; border-radius: 2px;
}
.work__media.is-inline-video .work__parallax { visibility: hidden; }
.work__desc { grid-column: 9 / 13; display: flex; flex-direction: column; gap: 3rem; }
.work__desc .mono { font-size: 0.75rem; }
.work__title { font-size: 2rem; line-height: 1.27; color: var(--dark); margin-top: 1.5rem; letter-spacing: -0.02em; }
.work__p { margin-top: 1.5rem; max-width: 85%; color: var(--muted); line-height: 1.2; }
.tags { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.tag { background: var(--tag-bg); color: var(--tag-text); border-radius: 0.15rem; padding: 0.35rem 0.5rem; font-size: 0.75rem; line-height: 1.1; letter-spacing: 0; }
.divider { height: calc(5rem + 0.0625rem); position: relative; }
.divider::after { content: ""; position: absolute; left: calc((100% + 1rem) / 6); right: 0; top: 2.5rem; height: 0.0625rem; background: #d9d9d9; }

/* placeholder media — swap for real images */
/* textured so scroll movement is visible until real images go in */
.media__ph { width: 100%; height: 100%; border-radius: 2px; background-blend-mode: soft-light, normal, normal; }
.ph-1 { background: repeating-linear-gradient(135deg, rgba(255,255,255,.18) 0 2px, transparent 2px 28px), radial-gradient(40% 30% at 30% 30%, #ead8c4, transparent), radial-gradient(120% 90% at 30% 20%, #c9b29c, #6d5a4a); }
.ph-2 { background: repeating-linear-gradient(135deg, rgba(255,255,255,.18) 0 2px, transparent 2px 28px), radial-gradient(40% 30% at 65% 55%, #b9d3d2, transparent), radial-gradient(120% 90% at 70% 30%, #7ea3a6, #20393d); }
.ph-3 { background: repeating-linear-gradient(135deg, rgba(255,255,255,.18) 0 2px, transparent 2px 28px), radial-gradient(40% 30% at 40% 60%, #f1dcb8, transparent), radial-gradient(120% 90% at 40% 70%, #d7b98f, #7a4b2a); }
.ph-4 { background: repeating-linear-gradient(135deg, rgba(255,255,255,.18) 0 2px, transparent 2px 28px), radial-gradient(40% 30% at 55% 40%, #d6d2cc, transparent), radial-gradient(120% 90% at 60% 40%, #a7a39d, #36332f); }

/* ---------- Services ---------- */
.services { position: relative; padding: 4rem 0; color: var(--cream); }
/* services, slogan and FAQ grids use 12 columns with no gutter */
.services__grid, .services__slogan, .faq__grid { column-gap: 0; }
.services__grid { align-items: start; }
.services__img { grid-column: 1 / 4; aspect-ratio: 302 / 271; position: relative; border-radius: 2px; overflow: hidden; }
/* width/height are required: an absolutely positioned <img> otherwise renders at its
   natural size and gets cropped. The images share the box's 302:271 ratio, so nothing is cut. */
.services__img > * { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; object-fit: cover; }
.services__img > .is-active { opacity: 1; }
.services__list { grid-column: 5 / 13; display: flex; flex-direction: column; gap: 1.1rem; }
.services__item {
  font-size: 4rem; line-height: 0.8; letter-spacing: -0.04em; color: var(--cream);
  opacity: 0.35; cursor: pointer; width: max-content; position: relative; transition: opacity 0.4s var(--ease);
}
.services__item.is-active { opacity: 1; }
.services__item::after {
  content: ""; position: absolute; right: -1.6rem; top: 50%; width: 0.4rem; height: 0.4rem; border-radius: 50%;
  background: var(--cream); transform: translateY(-50%) scale(0); transition: transform 0.4s var(--ease);
}
.services__item.is-active::after { transform: translateY(-50%) scale(1); }
.services__slogan { margin-top: 10rem; }
.slogan { grid-column: 8 / 13; font-size: 1.5rem; line-height: 1.2; color: var(--cream); }
.slogan p + p { margin-top: 1.4rem; }

/* ---------- FAQ ---------- */
.faq { position: relative; padding: 4rem 0 4rem; color: var(--cream); z-index: 2; }
.faq__grid { row-gap: 4.5rem; }
.faq__title { grid-column: 3 / 13; font-size: 4rem; line-height: 1.1; color: var(--cream); max-width: 52rem; }
.faq__list { grid-column: 4 / 13; }
.faq__item { border-bottom: 1px solid rgba(249, 239, 231, 0.12); }
.faq__item:first-child { border-top: 1px solid rgba(249, 239, 231, 0.12); }
.faq__q { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 20px 0; font-size: 1.25rem; line-height: 1.6; color: var(--cream); letter-spacing: -0.04em; }
.faq__icon { width: 20px; height: 20px; margin-right: 20px; position: relative; flex: none; }
.faq__icon::before, .faq__icon::after { content: ""; position: absolute; left: 0; right: 0; top: calc(50% - 1px); height: 2px; background: #fff; transition: transform 0.5s var(--ease); }
.faq__icon::after { transform: rotate(90deg); }
.faq__item.open .faq__icon::after { transform: rotate(0); }
.faq__a { height: 0; overflow: hidden; }
.faq__a p { padding: 0 0 20px; max-width: 50%; color: var(--muted-light); font-size: 1rem; line-height: 1.6; letter-spacing: -0.04em; }
.cta { margin-top: 6rem; }
.cta__inner { grid-column: 4 / 7; }
.cta__text { font-size: 2rem; line-height: 1; color: var(--cream); }
.cta__text + .cta__text { margin-top: 0.27em; }
.cta__text.muted-light { color: var(--muted-light); }
.cta .btn { margin-top: 1.9rem; }

/* ---------- Footer ---------- */
.footer-wrap { position: relative; overflow: hidden; background: var(--cream); }
.wm-word { display: inline-block; will-change: transform; }
.footer { position: relative; padding: 2.5rem 2.5rem 2rem; background: var(--cream); }
.footer__links { padding-bottom: 7.5rem; }
.footer__col .mono { margin-bottom: 3.8rem; }
.f1 { grid-column: 1 / 5; } .f2 { grid-column: 7 / 9; } .f3 { grid-column: 10 / 13; }
.footer__list { display: flex; flex-direction: column; gap: 0.4rem; }
.footer__a { font-size: 2rem; line-height: 1.03; color: var(--dark); width: max-content; letter-spacing: -0.04em; }
.footer__a .arrow { font-size: 0.7em; vertical-align: 0.15em; display: inline-block; transition: transform 0.5s var(--ease); }
.footer__a:hover .arrow { transform: translate(2px, -2px); }
.backtotop { margin-top: 2rem; }
.backtotop:hover .arrow { transform: translateY(-4px); }
.footer__bottom { margin-bottom: 3.5rem; }
.b1 { grid-column: 1 / 3; } .b2 { grid-column: 7 / 8; } .b3 { grid-column: 10 / 13; text-align: right; }
.footer-wrap__dark { position: absolute; inset: 0; background: var(--footer-dark); pointer-events: none; opacity: 0; }

/* ---------- Mobile ---------- */
@media (max-width: 767px) {
  :root { --size-font: 15px; --pad: 1rem; }
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .nav__inner { display: flex; justify-content: space-between; }
  .nav__links { display: none; }
  .hero__h1 { grid-column: 1 / -1; }
  .statement__title { font-size: 2.4rem; }
  .work__media, .work__desc { grid-column: 1 / -1; }
  .work__desc { margin-top: 1.5rem; gap: 1.5rem; }
  .divider::after { left: 0; }
  .services__img { grid-column: 1 / -1; margin-bottom: 2rem; }
  .services__list { grid-column: 1 / -1; padding-left: 0; }
  .services__item { font-size: 2.05rem; max-width: 100%; }
  .services__item::after { display: none; }
  .services__slogan { margin-top: 4rem; }
  .slogan, .faq__title, .faq__list, .cta__inner { grid-column: 1 / -1; }
  .faq__title { font-size: 2.6rem; }
  .faq__a p { max-width: 80%; }
  .label { padding-bottom: 2.5rem; }
  .footer { padding: 2rem 1rem; }
  .f1, .f2, .f3 { grid-column: 1 / -1; margin-bottom: 2.5rem; }
  .footer__col .mono { margin-bottom: 1.2rem; }
  .footer__links { padding-bottom: 2rem; }
  .b1 { grid-column: 1 / 3; } .b2 { display: none; } .b3 { grid-column: 3 / 5; }
}

@media (prefers-reduced-motion: reduce) {
  .grain { animation: none; }
}
