/* ------------------------------------------------------------------ *
 *  Tokens: MeKusta palette, straight edges
 * ------------------------------------------------------------------ */
:root {
  --cream: #faf7f2;
  --sand: #ede5d8;
  --stone: #c8b49a;
  --clay: #7a6554;
  --ink: #1c1a18;
  --sky: #2f5c85;
  --mist: #eaf2f8;
  --horizon: #b8d5ea;

  --bg: var(--cream);
  --fg: var(--ink);
  --muted: color-mix(in srgb, var(--ink) 55%, transparent);
  --line: color-mix(in srgb, var(--ink) 14%, transparent);
  --accent: var(--sky);

  --sans: "Plus Jakarta Sans", system-ui, sans-serif;
  --serif: "Instrument Serif", Georgia, serif;

  --gutter: clamp(1rem, 4vw, 3.5rem);
  --max: 96rem;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.76, 0, 0.24, 1);
}

*, *::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; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: 0; }
strong { font-weight: 700; }
::selection { background: var(--sky); color: var(--cream); }

/* ------------------------------------------------------------------ *
 *  Nav
 * ------------------------------------------------------------------ */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem var(--gutter);
  mix-blend-mode: normal;
  transition: transform 0.6s var(--ease-out), background 0.4s;
}
.nav.is-dark { color: var(--cream); }
.nav.is-dark .nav__mark span { color: var(--horizon, #b8d5ea); }
.nav.is-dark .btn { background: var(--cream); color: var(--ink); }
.nav.is-dark .btn.is-hover { color: var(--cream); }
.nav.is-hidden { transform: translateY(-110%); }
.nav.is-solid { background: color-mix(in srgb, var(--cream) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.nav__mark { font-weight: 800; font-size: 1.15rem; letter-spacing: -0.04em; }
.nav__mark span { color: var(--accent); }
.nav__links { display: flex; align-items: center; gap: clamp(1rem, 3vw, 2.25rem); }
.nav__link { font-size: 0.9rem; font-weight: 500; position: relative; }
.nav__link sup { font-size: 0.6rem; color: var(--muted); }
.nav__link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: right; transition: transform 0.5s var(--ease-out);
}
.nav__link:hover::after { transform: scaleX(1); transform-origin: left; }

/* ------------------------------------------------------------------ *
 *  Buttons: physics lives in main.js (magnet + press + bounce)
 * ------------------------------------------------------------------ */
.btn {
  --mx: 50%; --my: 50%;
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  padding: 1.15rem 2rem;
  background: var(--ink); color: var(--cream);
  font-weight: 600; font-size: 0.95rem; letter-spacing: -0.01em;
  overflow: hidden; isolation: isolate;
  will-change: transform; user-select: none; -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn--small { padding: 0.75rem 1.25rem; font-size: 0.85rem; }
.btn__fill {
  position: absolute; left: var(--mx); top: var(--my); z-index: -1;
  width: 260%; aspect-ratio: 1; border-radius: 50%;
  background: var(--sky);
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.7s var(--ease-out);
}
.btn.is-hover .btn__fill { transform: translate(-50%, -50%) scale(1); }
.btn__label { display: inline-flex; align-items: center; gap: 0.6rem; will-change: transform; }
.btn__arrow { display: inline-block; transition: transform 0.6s var(--ease-out); }
.btn.is-hover .btn__arrow { transform: translateX(4px) rotate(-45deg); }

/* ------------------------------------------------------------------ *
 *  Hero: ink stage, giant name, portrait in front (pinned)
 * ------------------------------------------------------------------ */
.eyebrow {
  margin: 0 0 1.5rem; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--clay);
}
.hero {
  position: sticky; top: 0; z-index: 0;
  height: 100svh; min-height: 34rem;
  background: var(--ink); color: var(--cream);
  display: grid; place-items: center;
  overflow: hidden;
}
.hero__name {
  position: relative; z-index: 1;
  margin: 0; width: 100%; padding: 0 var(--gutter);
  display: grid; justify-items: center;
  font-size: clamp(4.5rem, 17vw, 17.5rem); line-height: 0.84; letter-spacing: -0.06em;
  text-transform: uppercase;
}
.hero__line { display: block; will-change: transform; }
.hero__line--1 { transform: translateX(-9vw); }
.hero__line--2 { transform: translateX(10vw); }
.hero__first { font-weight: 800; }
.hero__last { font-family: var(--serif); font-style: italic; font-weight: 400; text-transform: none; letter-spacing: -0.035em; color: var(--horizon, #b8d5ea); font-size: 1.12em; }
.hero__name .char { display: inline-block; transform: translateY(110%); }
.hero__name .line-mask { display: inline-block; overflow: hidden; padding: 0.06em 0.08em 0.14em; margin: -0.06em -0.08em -0.14em; }
.is-loaded .hero__name .char { transform: none; transition: transform 1.3s var(--ease-out); transition-delay: calc(var(--i) * 45ms + 350ms); }

/* Portrait card sits in front of the letters; the cutout breaks out of the top */
.hero__portrait {
  position: absolute; z-index: 2; left: 50%; top: 50%;
  width: clamp(10rem, 16vw, 15rem); aspect-ratio: 3 / 4;
  margin: 0; translate: -50% -42%;
  will-change: transform;
}
.hero__card {
  position: absolute; inset: 0; background: var(--sand);
  transform: scaleY(0); transform-origin: bottom;
}
.hero__portrait img {
  position: absolute; left: 50%; bottom: 0; width: 128%; max-width: none; height: auto;
  translate: -50% 0; clip-path: inset(-40% 11% 0 11%);
  opacity: 0; transform: translateY(14%);
}
.is-loaded .hero__card { transform: none; transition: transform 1.2s var(--ease-in-out) 0.1s; }
.is-loaded .hero__portrait img { opacity: 1; transform: none; transition: opacity 0.8s ease 0.7s, transform 1.4s var(--ease-out) 0.6s; }

.hero__corner {
  position: absolute; bottom: 2rem; margin: 0; z-index: 3;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; line-height: 1.6;
  color: color-mix(in srgb, var(--cream) 60%, transparent);
}
.hero__corner--l { left: var(--gutter); }
.hero__corner--r { right: var(--gutter); text-align: right; }
.hero__scroll {
  position: absolute; left: 50%; bottom: 1.5rem; translate: -50% 0; z-index: 3;
  display: flex; flex-direction: column; align-items: center; gap: 0.6rem;
  font-size: 0.65rem; letter-spacing: 0.2em; text-transform: uppercase; color: color-mix(in srgb, var(--cream) 55%, transparent);
}
.hero__scroll i { width: 1px; height: 2.5rem; background: color-mix(in srgb, var(--cream) 20%, transparent); position: relative; overflow: hidden; }
.hero__scroll i::after { content: ""; position: absolute; inset: 0; background: var(--cream); animation: drip 2.2s var(--ease-in-out) infinite; }
@keyframes drip { 0% { transform: translateY(-100%); } 60%, 100% { transform: translateY(100%); } }

/* ------------------------------------------------------------------ *
 *  Intro sheet: rolls up over the pinned hero, notch on top
 * ------------------------------------------------------------------ */
.sheet {
  position: relative; z-index: 1;
  background: var(--cream);
  padding: clamp(6rem, 13vw, 11rem) var(--gutter) 0;
  text-align: center;
}
.sheet__notch {
  position: absolute; left: 50%; bottom: calc(100% - 1px); translate: -50% 0;
  width: clamp(12rem, 22vw, 20rem); height: clamp(1.2rem, 2vw, 1.9rem); fill: var(--cream);
}
.sheet__plus { position: absolute; left: 50%; top: -0.55rem; translate: -50% 0; font-size: 1rem; color: var(--clay); line-height: 1; }
.sheet__inner { max-width: 46rem; margin: 0 auto; display: grid; justify-items: center; gap: 1.75rem; }
.sheet__inner .eyebrow { margin: 0; }
.sheet__catch { margin: 0; font-size: clamp(2.2rem, 5vw, 4.3rem); line-height: 1.02; letter-spacing: -0.045em; font-weight: 500; }
.sheet__catch strong { font-weight: 800; }
.sheet__catch em { color: var(--accent); font-size: 1.08em; }
.sheet__desc { margin: 0; max-width: 34ch; font-size: 1.1rem; color: color-mix(in srgb, var(--ink) 75%, transparent); }
.sheet__desc em { font-size: 1.15em; color: var(--ink); }

/* Giant headline sliced by the bottom edge, like a horizon */
.sheet__giant {
  margin: clamp(5rem, 11vw, 9rem) calc(var(--gutter) * -1) 0;
  height: clamp(4.6rem, 12.5vw, 13rem); overflow: hidden;
  border-bottom: 1px solid var(--ink);
  font-size: clamp(5.5rem, 17vw, 17rem); font-weight: 800; line-height: 0.82; letter-spacing: -0.06em;
  text-transform: uppercase; white-space: nowrap;
}
.sheet__giant span { display: inline-block; will-change: transform; }
.sheet__giant em { text-transform: none; color: var(--accent); font-size: 1.1em; letter-spacing: -0.03em; }

/* ------------------------------------------------------------------ *
 *  Work
 * ------------------------------------------------------------------ */
.work { position: relative; z-index: 1; background: var(--cream); padding: 1.25rem var(--gutter) 4rem; }
.work__list, .work__count { max-width: var(--max); margin-left: auto; margin-right: auto; }
.work__count { margin: 0 0 clamp(3rem, 6vw, 5rem); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--clay); text-align: right; }

.work__list {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(4rem, 8vw, 8rem) clamp(1.5rem, 4vw, 4rem);
}
/* Stagger the right column for an editorial rhythm */
.project:not(.project--feature):nth-child(odd) { transform: translateY(clamp(0px, 9vw, 9rem)); }
.project--feature { grid-column: 1 / -1; }

.project__link { display: block; cursor: none; }
@media (pointer: coarse) { .project__link { cursor: pointer; } }
.project__frame {
  position: relative; overflow: hidden; aspect-ratio: 16 / 10; will-change: transform;
  background: var(--sand); outline: 1px solid var(--line); outline-offset: -1px;
}
.project--feature .project__frame { aspect-ratio: 16 / 9; }
.project__frame img {
  width: 100%; height: 100%; object-fit: cover; object-position: top center;
  will-change: transform;
}

.project__meta {
  display: grid; grid-template-columns: auto 1fr; column-gap: 1.25rem; row-gap: 0.4rem;
  padding-top: 1.4rem;
}
.project__num { grid-row: span 3; font-family: var(--serif); font-style: italic; font-size: 1.35rem; color: var(--muted); line-height: 1.2; min-width: 2ch; }
.project__name { margin: 0; font-size: clamp(1.5rem, 2.4vw, 2.2rem); font-weight: 700; letter-spacing: -0.04em; line-height: 1.05; }
.project--feature .project__name { font-size: clamp(2rem, 4.2vw, 3.8rem); }
.project__desc { margin: 0; color: color-mix(in srgb, var(--ink) 72%, transparent); max-width: 44ch; }
.project__desc strong { color: var(--ink); }
.project__desc em { font-size: 1.15em; color: var(--accent); }
.project__tag { margin: 0.35rem 0 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--clay); }
.project__tag span { color: var(--muted); font-weight: 500; letter-spacing: 0.04em; text-transform: none; }
.project__link:hover .project__name { color: var(--accent); }
.project__name { transition: color 0.4s var(--ease-out); }

/* ------------------------------------------------------------------ *
 *  Footer
 * ------------------------------------------------------------------ */
.footer { position: relative; z-index: 1; background: var(--cream); margin: 0 auto; padding: clamp(8rem, 16vw, 14rem) var(--gutter) 2.5rem; }
.footer > * { max-width: var(--max); margin-left: auto; margin-right: auto; }
.footer__big { margin-bottom: 2.5rem; margin-top: 0; font-size: clamp(2.8rem, 9vw, 8.5rem); font-weight: 800; letter-spacing: -0.055em; line-height: 0.92; }
.footer__big em { color: var(--accent); }
.footer__row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 2rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.footer__meta { margin: 0; font-size: 0.85rem; color: var(--muted); }
.footer__meta a { color: var(--ink); border-bottom: 1px solid var(--line); }

/* ------------------------------------------------------------------ *
 *  Floating cursor over projects
 * ------------------------------------------------------------------ */
.cursor {
  position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none;
  width: 7.5rem; height: 7.5rem; margin: -3.75rem 0 0 -3.75rem; border-radius: 50%;
  background: var(--sky); color: var(--cream);
  display: grid; place-items: center; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.01em;
  will-change: transform;
}
.cursor span { transform: scale(var(--ls, 0)); }
@media (pointer: coarse) { .cursor { display: none; } }

/* ------------------------------------------------------------------ *
 *  Scroll reveals
 * ------------------------------------------------------------------ */
.js [data-reveal]:not([data-reveal="img"]) { opacity: 0; transform: translateY(28px); transition: opacity 1s var(--ease-out), transform 1.2s var(--ease-out); transition-delay: var(--d, 0ms); }
.js [data-reveal].in:not([data-reveal="img"]) { opacity: 1; transform: none; }
.js [data-reveal="img"] { clip-path: inset(100% 0 0 0); transition: clip-path 1.4s var(--ease-in-out); }
.js [data-reveal="img"].in { clip-path: inset(0 0 0 0); }

/* ------------------------------------------------------------------ *
 *  Responsive
 * ------------------------------------------------------------------ */
@media (max-width: 860px) {
  .hero__name { font-size: clamp(3.6rem, 25vw, 10rem); }
  .hero__line--1 { transform: translateX(-5vw); }
  .hero__line--2 { transform: translateX(4vw); }
  /* phones: name sits higher, photo below it so the name stays readable */
  .hero__name { translate: 0 -14svh; }
  .hero__portrait { width: clamp(8rem, 38vw, 13rem); top: 50%; translate: -50% 4%; }
  .sheet__giant { height: auto; white-space: normal; font-size: 19vw; line-height: 0.86; padding-bottom: 0.35rem; }
  .sheet__giant span { transform: none !important; }
  .hero__scroll { display: none; }
  .work__list { grid-template-columns: 1fr; }
  .project:not(.project--feature):nth-child(odd) { transform: none; }
  .project--feature .project__frame { aspect-ratio: 16 / 10; }
}
@media (max-width: 480px) {
  .nav__link { display: none; }
  .btn { padding: 1rem 1.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; transition-delay: 0ms !important; }
  .hero__name .char, .hero__card, .hero__portrait img { transform: none; opacity: 1; }
  .js [data-reveal] { opacity: 1 !important; transform: none !important; clip-path: none !important; }
}
