/* ==========================================================================
   Cozzi Studio — Designing Better Cafes
   Warm editorial design system
   ========================================================================== */

:root {
  /* Brand palette */
  --espresso: #2A1810;
  --roast: #362117;
  --mocha: #5B3A28;
  --latte: #C6B8B3;
  --oat: #E3D8CC;
  --cream: #F3EDE5;
  --amber: #B5702A;
  --amber-soft: #D9A066;

  /* Semantic tokens */
  --bg: var(--cream);
  --fg: var(--espresso);
  --fg-muted: #6B5446;
  --line: rgba(42, 24, 16, 0.16);
  --accent: var(--amber);

  /* Type */
  --font-display: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-lg: clamp(1.0625rem, 0.95rem + 0.4vw, 1.25rem);
  --fs-h4: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  --fs-h3: clamp(2rem, 1.5rem + 2vw, 3rem);
  --fs-h2: clamp(2.5rem, 1.6rem + 4vw, 5rem);
  --fs-h1: clamp(3.25rem, 1.8rem + 6.5vw, 8.5rem);

  /* Space & layout */
  --gutter: clamp(1rem, 0.5rem + 2.5vw, 3rem);
  --section: clamp(5rem, 3rem + 8vw, 11rem);
  --max: 1440px;
  --radius: 4px;
  --header-h: 76px;

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 200ms;
  --dur: 450ms;
}

/* Dark brown sections */
.theme-dark {
  --bg: var(--espresso);
  --fg: #F1E8DF;
  --fg-muted: #BBA99F;
  --line: rgba(241, 232, 223, 0.16);
  --accent: var(--amber-soft);
}
.theme-roast {
  --bg: var(--roast);
  --fg: #F1E8DF;
  --fg-muted: #BBA99F;
  --line: rgba(241, 232, 223, 0.16);
  --accent: var(--amber-soft);
}
.theme-oat { --bg: var(--oat); }

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: var(--header-h); }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--fg);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  /* Visitors can't highlight text; form fields stay selectable so typing still works. */
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
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; cursor: pointer; padding: 0; }
h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--amber); color: var(--cream); }

.sr-only {
  position: absolute; 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: 1000;
  padding: 0.75rem 1rem; background: var(--espresso); color: var(--cream);
  transform: translateY(-200%); transition: transform var(--dur-fast);
}
.skip-link:focus { transform: none; }

/* ---------- Layout ---------- */
.section { background: var(--bg); color: var(--fg); padding-block: var(--section); position: relative; }
.container { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.grid-12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gutter); }

/* ---------- Type ---------- */
.display, h1, h2, h3 { font-family: var(--font-display); font-weight: 400; letter-spacing: -0.015em; line-height: 1.02; }
.h1 { font-size: var(--fs-h1); line-height: 0.95; letter-spacing: -0.025em; }
.h2 { font-size: var(--fs-h2); }
.h3 { font-size: var(--fs-h3); }
.h4 { font-family: var(--font-display); font-size: var(--fs-h4); line-height: 1.1; }
.display em, .h1 em, .h2 em, .h3 em { font-style: italic; color: var(--accent); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.75rem;
  font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--fg-muted);
}
.eyebrow::before { content: ""; width: 2rem; height: 1px; background: currentColor; opacity: 0.6; }
.lead { font-size: var(--fs-lg); line-height: 1.65; color: var(--fg-muted); max-width: 38rem; }
.muted { color: var(--fg-muted); }

/* Split-text masks (filled by JS) */
.split-mask { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.1em; margin-bottom: -0.1em; padding-right: 0.04em; }
.split-word { display: inline-block; }

/* ---------- Buttons & links ---------- */
.btn {
  --btn-bg: var(--fg);
  --btn-fg: var(--bg);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 0.75rem;
  min-height: 52px; padding: 0.9rem 1.6rem;
  border-radius: 999px; border: 1px solid var(--btn-bg);
  background: var(--btn-bg); color: var(--btn-fg);
  font-size: var(--fs-sm); font-weight: 600; letter-spacing: 0.04em;
  overflow: hidden; isolation: isolate; cursor: pointer;
  transition: color var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out);
}
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--accent); border-radius: inherit;
  transform: translateY(101%); transition: transform var(--dur) var(--ease-out);
}
.btn:hover::before, .btn:focus-visible::before { transform: none; }
.btn:hover, .btn:focus-visible { border-color: var(--accent); color: var(--espresso); }
.btn--ghost { --btn-bg: transparent; --btn-fg: var(--fg); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--accent); }
.btn .arrow { width: 1rem; height: 1rem; transition: transform var(--dur) var(--ease-out); }
.btn:hover .arrow { transform: translateX(4px); }

.link-underline {
  position: relative; display: inline-flex; align-items: center; gap: 0.5rem;
  font-weight: 600; font-size: var(--fs-sm); letter-spacing: 0.04em; padding-block: 0.5rem; min-height: 44px;
}
.link-underline::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0.25rem; height: 1px;
  background: currentColor; transform-origin: right; transform: scaleX(1);
  transition: transform var(--dur) var(--ease-out);
}
.link-underline:hover::after { transform-origin: left; animation: underline 700ms var(--ease-out); }
@keyframes underline { 0% { transform: scaleX(1); transform-origin: right; } 45% { transform: scaleX(0); transform-origin: right; } 55% { transform: scaleX(0); transform-origin: left; } 100% { transform: scaleX(1); transform-origin: left; } }

/* ---------- Preloader & page transition ---------- */
.preloader {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center;
  background: var(--espresso); color: var(--latte);
}
.preloader__mark { width: clamp(56px, 9vw, 92px); overflow: visible; }
.preloader__word {
  position: absolute; bottom: clamp(2rem, 6vh, 4rem); left: 0; right: 0; text-align: center;
  font-family: var(--font-body); font-weight: 700; letter-spacing: -0.01em;
  font-size: var(--fs-sm); color: #8F7A6E;
}
html:not(.is-loading) .preloader { display: none; }

.curtain {
  position: fixed; inset: 0; z-index: 190; pointer-events: none;
  background: var(--espresso); transform: translateY(100%);
}

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100; height: var(--header-h);
  color: var(--cream);
  will-change: transform;
  transition: transform 600ms var(--ease-out), color 350ms var(--ease-out);
}
/* The frosted bar lives on its own layer and only fades its opacity, so it never flashes in. */
.site-header::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: rgba(42, 24, 16, 0.86); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  opacity: 0; transition: opacity 350ms var(--ease-out);
}
.site-header.is-scrolled::before { opacity: 1; }
.site-header__inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.site-header.is-hidden { transform: translateY(-100%); transition: transform 450ms var(--ease-in-out), color 350ms var(--ease-out); }
.site-header--light:not(.is-scrolled) { color: var(--espresso); }

/* Logo and name share a baseline; wrap + align-content centres that line inside the 44px tap target. */
.brand { display: inline-flex; flex-wrap: wrap; align-content: center; align-items: baseline; gap: 0.45em; min-height: 44px; font-size: 1.125rem; }
/* Logo mark matches the capitals of "Cozzi Studio" (Manrope bold: 0.74em above the baseline, 0.02em below),
   and sits on the same baseline, so the two read as one unit at any size. */
.brand__mark { height: 0.76em; width: auto; flex: none; color: currentColor; transform: translateY(0.02em); }
.brand__mark path { fill: currentColor; }
.brand__name { font-family: var(--font-body); font-weight: 700; line-height: 1; letter-spacing: -0.01em; }


.nav { display: none; }
.nav__list { display: flex; gap: clamp(1.25rem, 2.5vw, 2.5rem); align-items: center; }
.nav__link { position: relative; font-size: var(--fs-sm); font-weight: 500; padding-block: 0.75rem; opacity: 0.85; transition: opacity var(--dur-fast); }
.nav__link:hover, .nav__link[aria-current="page"] { opacity: 1; }
.nav__link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0.45rem; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: right; transition: transform var(--dur) var(--ease-out);
}
.nav__link:hover::after, .nav__link[aria-current="page"]::after { transform: scaleX(1); transform-origin: left; }
.header-cta { display: none; }
.site-header .btn { --btn-bg: var(--cream); --btn-fg: var(--espresso); min-height: 44px; padding: 0.6rem 1.25rem; }
.site-header--light:not(.is-scrolled) .btn { --btn-bg: var(--espresso); --btn-fg: var(--cream); }

.menu-toggle {
  display: inline-flex; align-items: center; gap: 0.75rem; min-height: 44px; min-width: 44px; justify-content: flex-end;
  font-size: var(--fs-sm); font-weight: 600; letter-spacing: 0.06em;
}
.menu-toggle__icon { position: relative; width: 26px; height: 10px; }
.menu-toggle__icon::before, .menu-toggle__icon::after {
  content: ""; position: absolute; left: 0; right: 0; height: 1.5px; background: currentColor;
  transition: transform var(--dur) var(--ease-out), top var(--dur) var(--ease-out);
}
.menu-toggle__icon::before { top: 0; }
.menu-toggle__icon::after { top: 8.5px; }
.menu-open .menu-toggle__icon::before { top: 4.25px; transform: rotate(45deg); }
.menu-open .menu-toggle__icon::after { top: 4.25px; transform: rotate(-45deg); }

@media (min-width: 960px) {
  .nav { display: block; }
  .header-cta { display: inline-flex; }
  .menu-toggle { display: none; }
}

/* Mobile menu */
.mobile-menu {
  position: fixed; inset: 0; z-index: 90; background: var(--espresso); color: var(--cream);
  display: flex; flex-direction: column; justify-content: space-between;
  overflow-y: auto; overscroll-behavior: contain; /* short phones can scroll the menu */
  padding: calc(var(--header-h) + 2rem) var(--gutter) 2rem;
  clip-path: inset(0 0 100% 0); visibility: hidden;
  transition: clip-path 700ms var(--ease-in-out), visibility 0s 700ms;
}
.menu-open .mobile-menu { clip-path: inset(0 0 0 0); visibility: visible; transition: clip-path 700ms var(--ease-in-out); }
.menu-open .site-header { color: var(--cream); }
.menu-open .site-header::before { opacity: 0; }
.mobile-menu__list { display: grid; gap: 0.25rem; }
.mobile-menu__link {
  display: flex; align-items: baseline; gap: 1rem; padding-block: 0.4rem;
  font-family: var(--font-display); font-size: clamp(2.5rem, 11vw, 4rem); line-height: 1.05;
}
.mobile-menu__link small { font-family: var(--font-body); font-size: var(--fs-xs); color: #8F7A6E; letter-spacing: 0.1em; }
.mobile-menu__link[aria-current="page"] { color: var(--amber-soft); font-style: italic; }
.mobile-menu__foot { display: grid; gap: 0.5rem; font-size: var(--fs-sm); color: var(--latte); }
.mobile-menu__foot a { min-height: 44px; display: inline-flex; align-items: center; }
.mobile-menu .mm-item { opacity: 0; transform: translateY(24px); transition: opacity 500ms, transform 700ms var(--ease-out); }
.menu-open .mobile-menu .mm-item { opacity: 1; transform: none; transition-delay: calc(250ms + var(--i, 0) * 60ms); }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100svh; display: flex; align-items: flex-end;
  background: var(--espresso); color: #F6EEE6; overflow: hidden; isolation: isolate;
}
.hero__media { position: absolute; inset: 0; z-index: -2; overflow: hidden; }
.hero__media img { width: 100%; height: 115%; object-fit: cover; object-position: 50% 40%; will-change: transform; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(42, 24, 16, 0.55) 0%, rgba(42, 24, 16, 0) 28%),
    linear-gradient(0deg, rgba(42, 24, 16, 0.92) 0%, rgba(42, 24, 16, 0.55) 38%, rgba(42, 24, 16, 0.1) 70%);
}
.hero__content { width: 100%; padding-bottom: clamp(2.5rem, 7vh, 5rem); padding-top: calc(var(--header-h) + 3rem); }
.hero .eyebrow { color: #D8C9BF; }
.hero__title { max-width: 14ch; margin-block: 1.25rem 1.75rem; }
.hero__foot { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 2rem; }
.hero__sub { max-width: 30rem; color: #E1D4CA; font-size: var(--fs-lg); line-height: 1.6; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.hero .btn { --btn-bg: var(--cream); --btn-fg: var(--espresso); }
.hero .btn--ghost { --btn-bg: transparent; --btn-fg: var(--cream); border-color: rgba(246, 238, 230, 0.35); }
.scroll-cue {
  position: absolute; right: var(--gutter); top: 50%; display: none;
  writing-mode: vertical-rl; font-size: var(--fs-xs); letter-spacing: 0.3em; text-transform: uppercase; color: #CBBBB0;
}
.scroll-cue::after { content: ""; display: block; width: 1px; height: 64px; margin: 1rem auto 0; background: currentColor; transform-origin: top; animation: cue 2.2s var(--ease-in-out) infinite; }
@keyframes cue { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }
@media (min-width: 960px) { .scroll-cue { display: block; } }

/* Page hero (inner pages) */
.page-hero { padding-top: calc(var(--header-h) + clamp(4rem, 10vw, 9rem)); padding-bottom: clamp(3rem, 6vw, 6rem); }
.page-hero__title { max-width: 16ch; margin-top: 1.5rem; }
.page-hero__lead { margin-top: 2rem; }

/* ---------- Intro statement ---------- */
.statement { display: grid; gap: 2.5rem; }
.statement__text { font-family: var(--font-display); font-size: clamp(2rem, 1.2rem + 3.4vw, 4.25rem); line-height: 1.08; letter-spacing: -0.015em; max-width: 22ch; }
.statement__body { max-width: 34rem; }
@media (min-width: 960px) {
  .statement { grid-template-columns: 1fr 1fr; align-items: end; }
  .statement__aside { padding-bottom: 0.75rem; }
}

/* ---------- Marquee ---------- */
.marquee { overflow: hidden; border-block: 1px solid var(--line); padding-block: 1.5rem; background: var(--bg); color: var(--fg); }
.marquee__track { display: flex; width: max-content; animation: marquee 50s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__group { display: flex; align-items: center; flex-shrink: 0; }
.marquee__item { font-family: var(--font-display); font-size: clamp(1.75rem, 1rem + 3vw, 3.5rem); line-height: 1; padding-inline: 1.5rem; white-space: nowrap; }
.marquee__item:nth-child(even) { font-style: italic; color: var(--accent); }
.marquee__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Stats ---------- */
.stats { display: grid; gap: 3rem 2rem; grid-template-columns: 1fr; }
.stat { border-top: 1px solid var(--line); padding-top: 1.5rem; }
.stat__value { font-family: var(--font-display); font-size: clamp(4rem, 2rem + 8vw, 9rem); line-height: 0.9; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat__value sup { font-size: 0.4em; vertical-align: top; position: relative; top: 0.25em; color: var(--accent); }
.stat__label { margin-top: 1rem; font-size: var(--fs-sm); letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-muted); }
.stat--hero .stat__value { font-size: clamp(6rem, 3rem + 14vw, 15rem); color: var(--accent); }
@media (min-width: 768px) { .stats { grid-template-columns: 1.6fr 1fr 1fr; align-items: end; } }

/* ---------- Section heads ---------- */
.section-head { display: grid; gap: 1.5rem; margin-bottom: clamp(3rem, 6vw, 5.5rem); }
.section-head__title { max-width: 16ch; }
@media (min-width: 960px) {
  .section-head { grid-template-columns: 1fr auto; align-items: end; }
  .section-head .lead { max-width: 26rem; }
}

/* ---------- Services ---------- */
.services { display: grid; border-top: 1px solid var(--line); }
.service {
  display: grid; gap: 1.25rem; padding-block: clamp(2rem, 4vw, 3.25rem);
  border-bottom: 1px solid var(--line); position: relative;
}
.service__num { font-size: var(--fs-sm); color: var(--accent); font-weight: 600; letter-spacing: 0.1em; }
.service__title { font-family: var(--font-display); font-size: clamp(2.25rem, 1.5rem + 3vw, 4rem); line-height: 1; transition: transform var(--dur) var(--ease-out), color var(--dur); }
.service__price {
  display: inline-flex; align-self: start; justify-self: start; padding: 0.4rem 0.9rem; border: 1px solid var(--line); border-radius: 999px;
  font-size: var(--fs-sm); font-weight: 600; white-space: nowrap;
}
.service__summary { color: var(--fg-muted); max-width: 32rem; }
.service__list { display: grid; gap: 0.5rem; margin-top: 0.5rem; font-size: var(--fs-sm); }
.service__list li { display: flex; gap: 0.75rem; align-items: baseline; }
.service__list li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex-shrink: 0; transform: translateY(-2px); }
@media (hover: hover) { .service:hover .service__title { transform: translateX(0.75rem); color: var(--accent); } }
@media (min-width: 960px) {
  .service { grid-template-columns: 4rem 1.2fr 1fr auto; align-items: start; column-gap: 3rem; }
  .service__body { display: grid; gap: 1rem; }
}

/* ---------- Featured projects ---------- */
.features { display: grid; gap: clamp(4rem, 8vw, 9rem); }
.feature { display: grid; gap: 1.75rem; align-items: end; }
.feature__media { position: relative; overflow: hidden; border-radius: var(--radius); aspect-ratio: 4 / 5; background: var(--roast); }
.feature__media img { width: 100%; height: 120%; object-fit: cover; will-change: transform; transition: filter 800ms var(--ease-out); }
.feature__meta { display: grid; gap: 1rem; }
.feature__index { font-size: var(--fs-sm); color: var(--fg-muted); letter-spacing: 0.1em; }
.feature__title { font-family: var(--font-display); font-size: clamp(2.5rem, 1.6rem + 3.5vw, 5rem); line-height: 0.98; }
.feature__tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tag { padding: 0.3rem 0.8rem; border: 1px solid var(--line); border-radius: 999px; font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.06em; color: var(--fg-muted); }
.feature a.feature__link { display: contents; }
@media (hover: hover) { .feature:hover .feature__media img { filter: saturate(1.15) brightness(1.06); } }
@media (min-width: 768px) {
  .feature { grid-template-columns: repeat(12, 1fr); column-gap: var(--gutter); }
  .feature__media { grid-column: 1 / span 7; aspect-ratio: 5 / 4; }
  .feature__meta { grid-column: 9 / span 4; padding-bottom: 1rem; }
  .feature:nth-child(even) .feature__media { grid-column: 6 / span 7; order: 2; }
  .feature:nth-child(even) .feature__meta { grid-column: 1 / span 4; order: 1; }
  .feature:nth-child(3n) .feature__media { aspect-ratio: 16 / 10; grid-column: 1 / span 8; }
  .feature:nth-child(3n) .feature__meta { grid-column: 9 / span 4; }
}

/* ---------- Project index (list with hover preview) ---------- */
.plist { border-top: 1px solid var(--line); }
.prow {
  display: grid; grid-template-columns: 1fr auto; gap: 0.5rem 1.5rem; align-items: baseline;
  padding-block: clamp(1.5rem, 3vw, 2.5rem); border-bottom: 1px solid var(--line); position: relative;
}
.prow__thumb { grid-column: 1 / -1; aspect-ratio: 16 / 10; overflow: hidden; border-radius: var(--radius); margin-bottom: 1rem; }
.prow__thumb img { width: 100%; height: 100%; object-fit: cover; }
.prow__title { font-family: var(--font-display); font-size: clamp(2rem, 1.3rem + 3vw, 4.25rem); line-height: 1; transition: transform var(--dur) var(--ease-out), color var(--dur); }
.prow__year { font-size: var(--fs-sm); color: var(--fg-muted); font-variant-numeric: tabular-nums; }
.prow__info { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; font-size: var(--fs-sm); color: var(--fg-muted); }
@media (min-width: 960px) and (hover: hover) {
  .prow { grid-template-columns: 1.5fr 1fr 1fr 5rem; }
  .prow__thumb { display: none; }
  .prow__info { grid-column: auto; display: contents; }
  .prow:hover .prow__title { transform: translateX(1rem); color: var(--accent); }
}
.hover-preview {
  position: fixed; top: 0; left: 0; z-index: 50; width: 340px; aspect-ratio: 4 / 5; pointer-events: none;
  border-radius: var(--radius); overflow: hidden; opacity: 0; transform: translate(-50%, -50%) scale(0.85);
  transition: opacity 300ms, transform 500ms var(--ease-out);
}
.hover-preview.is-visible { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.hover-preview img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Process ---------- */
.process { position: relative; }
.process__list { display: grid; gap: 0; counter-reset: step; list-style: none; padding: 0; margin: 0; }
.process__progress { position: absolute; left: 0; top: 0; bottom: 0; width: 1px; background: var(--line); }
.process__progress span { display: block; width: 100%; height: 100%; background: var(--accent); transform-origin: top; transform: scaleY(0); }
.step { position: relative; padding: 0 0 clamp(2.5rem, 5vw, 4rem) clamp(2rem, 5vw, 4rem); display: grid; gap: 0.75rem; }
.step::before {
  counter-increment: step; content: "0" counter(step);
  font-size: var(--fs-sm); font-weight: 600; color: var(--accent); letter-spacing: 0.1em;
}
.step__dot { position: absolute; left: -5px; top: 0.4rem; width: 11px; height: 11px; border-radius: 50%; background: var(--bg); border: 1px solid var(--accent); }
.step__title { font-family: var(--font-display); font-size: clamp(2.25rem, 1.5rem + 3vw, 4rem); line-height: 1; }
.step__body { color: var(--fg-muted); max-width: 30rem; }
@media (min-width: 960px) {
  .process-wrap { display: grid; grid-template-columns: 5fr 7fr; gap: var(--gutter); align-items: start; }
  .process-wrap .section-head { position: sticky; top: calc(var(--header-h) + 3rem); margin: 0; grid-template-columns: 1fr; }
}

/* ---------- Journal cards ---------- */
.cards { display: grid; gap: clamp(2.5rem, 4vw, 3rem) var(--gutter); }
@media (min-width: 768px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .cards { grid-template-columns: repeat(3, 1fr); } }
.card { display: grid; gap: 1.1rem; align-content: start; }
.card__media { aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--radius); background: var(--roast); }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s var(--ease-out); }
.card:hover .card__media img { transform: scale(1.05); }
.card__meta { display: flex; gap: 1rem; font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-muted); }
.card__meta span:first-child { color: var(--accent); }
.card__title { font-family: var(--font-display); font-size: clamp(1.75rem, 1.4rem + 1vw, 2.25rem); line-height: 1.08; }
.card__excerpt { color: var(--fg-muted); font-size: var(--fs-sm); line-height: 1.7; }

/* ---------- CTA ---------- */
.cta { text-align: center; overflow: hidden; }
.cta__mark { width: clamp(48px, 6vw, 72px); margin: 0 auto 2.5rem; color: var(--latte); }
.cta__mark path { fill: currentColor; }
.cta__mark svg, .portrait__placeholder svg { width: 100%; height: auto; transform: none; } /* standalone logo fills its box */
.cta__title { font-size: clamp(2.5rem, 1.4rem + 4vw, 5.5rem); line-height: 1; max-width: 14ch; margin-inline: auto; }
.cta__body { margin: 2rem auto 2.75rem; max-width: 32rem; color: var(--fg-muted); font-size: var(--fs-lg); }
.cta__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--espresso); color: #E9DED4; padding-top: clamp(4rem, 8vw, 7rem); overflow: hidden; }
.site-footer a:hover { color: var(--amber-soft); }
.footer-grid { display: grid; gap: 2.5rem; padding-bottom: 3rem; }
.footer-col h3 { font-family: var(--font-body); font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: #8F7A6E; margin-bottom: 1rem; }
.footer-col ul { display: grid; gap: 0.25rem; }
.footer-col a { display: inline-flex; min-height: 40px; align-items: center; transition: color var(--dur-fast); }
.footer-col p { max-width: 22rem; color: #BBA99F; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1.3fr; } }
.footer-word {
  font-family: var(--font-body); font-weight: 700; letter-spacing: -0.045em;
  font-size: clamp(3rem, 16vw, 15rem); line-height: 0.9;
  color: var(--roast); white-space: nowrap; text-align: center;
  padding-top: 1rem; padding-bottom: 0.15em;
}
.footer-bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; border-top: 1px solid rgba(241, 232, 223, 0.12); padding-block: 1.5rem; font-size: var(--fs-sm); color: #8F7A6E; }

/* ---------- Case study (compact) ---------- */
.cs-head { padding-top: calc(var(--header-h) + clamp(1.5rem, 4vw, 3rem)); }
.cs-back { display: inline-flex; align-items: center; min-height: 44px; font-size: var(--fs-sm); font-weight: 600; color: var(--fg-muted); }
.cs-head__grid { display: grid; gap: 1.5rem; margin-top: clamp(1rem, 2vw, 1.5rem); align-items: end; }
@media (min-width: 960px) { .cs-head__grid { grid-template-columns: 7fr 5fr; gap: var(--gutter); } }
.cs-title { font-family: var(--font-display); font-weight: 400; font-size: clamp(2.5rem, 1.6rem + 3.6vw, 5rem); line-height: 1; letter-spacing: -0.01em; margin-top: 0.9rem; }
.cs-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem 1.5rem; margin: 0; padding-top: 1rem; border-top: 1px solid var(--line); }
.cs-facts dt { font-size: var(--fs-xs); letter-spacing: 0.15em; text-transform: uppercase; color: var(--fg-muted); }
.cs-facts dd { margin: 0.2rem 0 0; font-size: var(--fs-sm); font-weight: 600; line-height: 1.4; }
.cs-cover { --r: 1.7778; margin-top: clamp(1.5rem, 3vw, 2.5rem); aspect-ratio: var(--r); max-height: 78svh; overflow: hidden; border-radius: var(--radius); background: var(--roast); }
.cs-cover img { width: 100%; height: 112%; object-fit: cover; }

.cs-body { padding-block: clamp(2.5rem, 5vw, 4.5rem); }
.cs-body__grid { display: grid; gap: 2.5rem; }
@media (min-width: 960px) {
  .cs-body__grid { grid-template-columns: 7fr 5fr; gap: var(--gutter); align-items: start; }
  .cs-aside { position: sticky; top: calc(var(--header-h) + 1.5rem); }
}
.cs-story, .cs-aside { display: grid; gap: 2.25rem; align-content: start; }
@media (min-width: 640px) and (max-width: 959px) { .cs-aside { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; } }
.cs-label { font-family: var(--font-body); font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.9rem; }
.cs-lead { font-family: var(--font-display); font-size: clamp(1.4rem, 1.1rem + 1vw, 1.9rem); line-height: 1.25; }
.cs-lead + .muted { margin-top: 1rem; }
.cs-prose { font-size: var(--fs-base); }
.cs-aside .cs-block { background: var(--oat); border-radius: var(--radius); padding: clamp(1.25rem, 2.5vw, 1.75rem); }
.cs-aside .cs-label { color: var(--fg-muted); }

.cs-outcomes { display: grid; }
.cs-outcomes li { display: grid; grid-template-columns: minmax(4.5rem, auto) 1fr; gap: 1rem; align-items: baseline; padding-block: 0.7rem; border-top: 1px solid var(--line); }
.cs-outcomes li:first-child { border-top: 0; padding-top: 0; }
.cs-outcomes__value { font-family: var(--font-display); font-size: 2rem; line-height: 1; color: var(--accent); white-space: nowrap; }
.cs-outcomes__label { font-size: var(--fs-sm); color: var(--fg-muted); }

.cs-palette { display: grid; gap: 0.6rem; }
.swatch { display: flex; align-items: center; gap: 0.85rem; }
.swatch__chip { flex: none; width: 2.5rem; height: 2.5rem; border-radius: 50%; border: 1px solid var(--line); transform-origin: center; }
.swatch__text { display: grid; line-height: 1.3; }
.swatch__name { font-weight: 600; font-size: var(--fs-sm); }
.swatch__hex { font-size: var(--fs-xs); color: var(--fg-muted); letter-spacing: 0.08em; text-transform: uppercase; }

.cs-gallery-wrap { padding-bottom: clamp(3rem, 6vw, 5rem); }
/* Justified rows: each photo keeps its own aspect ratio (--r, set from the image) and every row shares one height. */
.cs-gallery { --row-h: clamp(110px, 4rem + 14vw, 300px); display: flex; flex-wrap: wrap; gap: 0.6rem; }
.cs-gallery::after { content: ""; flex: 10 1 0; }
.cs-gallery figure { --r: 1.3333; position: relative; flex: var(--r) 1 calc(var(--r) * var(--row-h)); aspect-ratio: var(--r); overflow: hidden; border-radius: var(--radius); background: var(--oat); }
@media (min-width: 768px) { .cs-gallery { gap: 0.75rem; } }
.cs-gallery img { width: 100%; height: 100%; object-fit: cover; }
.cs-gallery figcaption { position: absolute; left: 0.5rem; bottom: 0.5rem; padding: 0.25rem 0.6rem; border-radius: 999px; background: rgba(42, 24, 16, 0.7); color: var(--cream); font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.06em; }

.cs-next { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0.5rem 1.5rem; padding-block: clamp(2.5rem, 5vw, 4rem); }
.cs-next .eyebrow { grid-column: 1 / -1; }
.cs-next__title { font-size: clamp(2rem, 1.2rem + 3.5vw, 4.5rem); line-height: 1; transition: color var(--dur); }
.cs-next__arrow { font-size: clamp(1.5rem, 1rem + 2vw, 3rem); transition: transform var(--dur) var(--ease-out); }
.cs-next:hover .cs-next__title { color: var(--accent); font-style: italic; }
.cs-next:hover .cs-next__arrow { transform: translateX(0.4rem); }

.two-col { display: grid; gap: 2rem; }
@media (min-width: 960px) { .two-col { grid-template-columns: 4fr 8fr; gap: var(--gutter); } }
.two-col__label { position: relative; }
@media (min-width: 960px) { .two-col__label .eyebrow { position: sticky; top: calc(var(--header-h) + 2rem); } }

.prose { font-size: var(--fs-lg); line-height: 1.75; max-width: 42rem; }
.prose > * + * { margin-top: 1.25em; }
.prose h2 { font-size: clamp(1.75rem, 1.3rem + 1.5vw, 2.5rem); margin-top: 2.2em; line-height: 1.1; }
.prose h3 { font-size: 1.5rem; margin-top: 1.8em; }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose li + li { margin-top: 0.5em; }
.prose a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--accent); }
.prose strong { font-weight: 700; }
.prose blockquote { font-family: var(--font-display); font-size: 1.75rem; line-height: 1.3; border-left: 2px solid var(--accent); padding-left: 1.25rem; }
.prose--lead > p:first-child { font-family: var(--font-display); font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.5rem); line-height: 1.2; }

/* ---------- About ---------- */
.portrait { aspect-ratio: 4 / 5; overflow: hidden; border-radius: var(--radius); background: var(--roast); position: relative; display: grid; place-items: center; }
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.portrait__placeholder { color: var(--latte); width: 30%; opacity: 0.6; }
.portrait__placeholder path { fill: currentColor; }
.about-grid { display: grid; gap: clamp(2.5rem, 6vw, 6rem); }
@media (min-width: 960px) { .about-grid { grid-template-columns: 5fr 7fr; align-items: start; } .about-grid .portrait { position: sticky; top: calc(var(--header-h) + 2rem); } }
.values { display: grid; gap: 2rem; }
@media (min-width: 768px) { .values { grid-template-columns: repeat(3, 1fr); } }
.value { border-top: 1px solid var(--line); padding-top: 1.5rem; display: grid; gap: 0.75rem; }
.value h3 { font-size: var(--fs-h4); }
.value p { color: var(--fg-muted); }

.initiatives { display: grid; gap: 0; border-top: 1px solid var(--line); counter-reset: init; }
.initiative { display: grid; gap: 0.75rem; padding-block: clamp(1.75rem, 3vw, 2.5rem); border-bottom: 1px solid var(--line); }
.initiative::before { counter-increment: init; content: "0" counter(init); color: var(--accent); font-weight: 600; font-size: var(--fs-sm); letter-spacing: 0.1em; }
.initiative h3 { font-size: var(--fs-h4); }
.initiative p { color: var(--fg-muted); max-width: 40rem; }
@media (min-width: 960px) { .initiative { grid-template-columns: 4rem 1fr 1.2fr; gap: 2rem; align-items: baseline; } }

/* ---------- Book / contact ---------- */
.book { display: grid; gap: clamp(2.5rem, 5vw, 5rem); }
@media (min-width: 960px) { .book { grid-template-columns: 5fr 7fr; } }
.contact-list { display: grid; gap: 0; border-top: 1px solid var(--line); margin-top: 2.5rem; }
.contact-item { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding-block: 1.25rem; border-bottom: 1px solid var(--line); min-height: 64px; transition: color var(--dur-fast); }
.contact-item:hover { color: var(--accent); }
.contact-item small { display: block; font-size: var(--fs-xs); letter-spacing: 0.15em; text-transform: uppercase; color: var(--fg-muted); }
.contact-item strong { font-weight: 500; font-size: var(--fs-lg); word-break: break-word; }
.contact-item svg { width: 20px; height: 20px; flex-shrink: 0; }
.typeform-shell { min-height: 560px; border-radius: var(--radius); overflow: hidden; background: var(--oat); }
.typeform-shell [data-tf-live], .typeform-shell [data-tf-widget] { width: 100%; height: 620px; }
.form-fallback { padding: clamp(2rem, 4vw, 3.5rem); display: grid; gap: 1.5rem; align-content: center; min-height: 560px; }
.form-fallback ol { display: grid; gap: 1rem; padding: 0; list-style: none; counter-reset: q; }
.form-fallback li { display: flex; gap: 1rem; align-items: baseline; }
.form-fallback li::before { counter-increment: q; content: counter(q); flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--espresso); color: var(--cream); font-size: var(--fs-xs); font-weight: 700; }
.form-fallback .actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* WhatsApp floating button */
.wa-float {
  position: fixed; right: max(1rem, env(safe-area-inset-right)); bottom: max(1rem, env(safe-area-inset-bottom)); z-index: 80;
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  background: var(--amber); color: var(--espresso); box-shadow: 0 10px 30px rgba(42, 24, 16, 0.35);
  transition: transform var(--dur) var(--ease-out), background var(--dur);
}
.wa-float:hover { transform: translateY(-3px) scale(1.04); background: var(--amber-soft); }
.wa-float svg { width: 26px; height: 26px; }

/* ---------- Image placeholders while loading ---------- */
.img-wrap { background: var(--roast); }
img[loading="lazy"] { opacity: 0; transition: opacity 700ms var(--ease-out); }
img.is-loaded, img[loading="lazy"].is-loaded { opacity: 1; }

/* ---------- Reveal states (only when motion allowed + JS) ---------- */
.motion [data-reveal] { opacity: 0; transform: translateY(32px); }
.motion [data-reveal-img] { clip-path: inset(100% 0 0 0); }

/* Empty / error */
.notice { padding: 2rem; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--fg-muted); }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .marquee__track { animation: none; flex-wrap: wrap; width: auto; }
  .marquee__group[aria-hidden="true"] { display: none; }
}

/* Page-transition curtain covers the page until the next page is ready */
.is-entering .curtain { transform: none; }
.is-loading body { overflow: hidden; }

/* Smooth scrolling (Lenis). Iframes stay clickable so the Typeform embed keeps working. */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

/* Keep typing and copying possible inside form fields */
input, textarea, select, [contenteditable="true"] { -webkit-user-select: text; user-select: text; }

/* ---------- Email app chooser ---------- */
.mail-chooser {
  width: min(26rem, calc(100% - 2rem)); max-width: none; max-height: none; padding: 0; border: 0; margin: auto;
  background: transparent; color: var(--espresso); overflow: visible;
}
.mail-chooser::backdrop { background: rgba(42, 24, 16, 0.55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.mail-chooser__panel {
  background: var(--cream); border-radius: 14px; padding: 1.5rem; box-shadow: 0 24px 60px rgba(42, 24, 16, 0.35);
}
.mail-chooser[open] .mail-chooser__panel { animation: mail-in 380ms var(--ease-out); }
.mail-chooser[open]::backdrop { animation: mail-fade 300ms var(--ease-out); }
@keyframes mail-in { from { opacity: 0; transform: translateY(14px) scale(0.98); } }
@keyframes mail-fade { from { opacity: 0; } }
.mail-chooser__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.mail-chooser__title { font-family: var(--font-display); font-weight: 400; font-size: 1.75rem; line-height: 1.1; }
.mail-chooser__close { width: 44px; height: 44px; margin: -0.5rem -0.5rem -0.5rem 0; border-radius: 50%; font-size: 1.75rem; line-height: 1; color: var(--fg-muted); }
.mail-chooser__close:hover { color: var(--espresso); background: var(--oat); }
.mail-chooser__list { display: grid; gap: 0.5rem; }
.mail-chooser__option {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 56px;
  padding: 0.75rem 1rem; border: 1px solid var(--line); border-radius: 10px; background: #FBF8F4;
  transition: border-color var(--dur-fast), background-color var(--dur-fast);
}
.mail-chooser__option:hover, .mail-chooser__option:focus-visible { border-color: var(--amber); background: #fff; }
.mail-chooser__option span { display: grid; }
.mail-chooser__option strong { font-weight: 600; }
.mail-chooser__option small { font-size: var(--fs-xs); color: var(--fg-muted); }
.mail-chooser__option svg { width: 18px; height: 18px; flex: none; color: var(--fg-muted); }
.mail-chooser__copy {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 48px;
  margin-top: 1rem; padding: 0.5rem 0.25rem 0; border-top: 1px solid var(--line); font-size: var(--fs-sm); color: var(--fg-muted);
}
.mail-chooser__copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-chooser__copy em { font-style: normal; font-weight: 600; color: var(--amber); flex: none; }
/* Phones: slides up from the bottom like a native share sheet */
@media (max-width: 599px) {
  .mail-chooser { width: 100%; margin: auto 0 0; }
  .mail-chooser__panel { border-radius: 18px 18px 0 0; padding-bottom: max(1.5rem, env(safe-area-inset-bottom)); }
  @keyframes mail-in { from { transform: translateY(100%); } }
}
