:root {
  --bg: #fff6ee;
  --ink: #1d1a17;
  --ink-soft: #3a3530;
  --line: rgba(29, 26, 23, 0.07);
  --yellow: #f6f38a;
  --nav-h: 82px;
  --reel-gap: 28px; /* space between the nav and the pinned video */
  --gutter: clamp(16px, 8vw, 160px);
  --serif: "Newsreader", "Times New Roman", serif;
  --sans: "Figtree", system-ui, -apple-system, sans-serif;
  --hand: "Gochi Hand", "Comic Sans MS", cursive;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; }
.hand { font-family: var(--hand); font-weight: 400; }

.skip {
  position: fixed; left: 12px; top: -60px; z-index: 200;
  background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 8px;
}
.skip:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; border-radius: 6px; }

/* ---------- Cursor ---------- */
.cursor {
  position: fixed; left: 0; top: 0; z-index: 1000;
  /* drawn at its largest size (the "View" circle) and scaled down, so it stays crisp */
  width: 88px; height: 88px; margin: -44px 0 0 -44px;
  display: grid; place-items: center;
  border-radius: 50%; background: var(--ink);
  pointer-events: none; opacity: 0;
  transition: opacity .3s ease;
  will-change: transform;
}
.cursor__label {
  color: var(--bg); font-family: var(--sans); font-weight: 500; font-size: 17px;
  opacity: 0; transition: opacity .2s ease;
}
.cursor.is-view .cursor__label { opacity: 1; transition-delay: .08s; }
@media (hover: hover) and (pointer: fine) {
  html.has-cursor, html.has-cursor * { cursor: none !important; }
  html.has-cursor .cursor.is-visible { opacity: 1; }
}

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--nav-h);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0 var(--gutter);
  border-bottom: 1px solid transparent;
  transition: background-color .4s ease, border-color .4s ease;
}
.nav.is-scrolled { background: var(--bg); border-color: var(--line); }
.nav__left { display: flex; align-items: center; gap: 18px; }
.nav__logo img { height: 26px; width: auto; mix-blend-mode: multiply; }
.nav__clock { font-size: 18px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.nav__links { display: flex; gap: 28px; }
.nav__links a {
  text-decoration: none; font-weight: 500; font-size: 17px;
  position: relative; padding: 6px 0;
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 3px; height: 1.5px;
  background: currentColor; transform: scaleX(0); transform-origin: right;
  transition: transform .45s var(--ease-out);
}
.nav__links a:hover::after, .nav__links a.is-active::after { transform: scaleX(1); transform-origin: left; }
.btn {
  justify-self: end;
  display: inline-flex; align-items: center; min-height: 44px;
  padding: 0 18px; border-radius: 999px;
  background: var(--yellow); border: 1.5px solid var(--ink);
  font-weight: 600; font-size: 17px; text-decoration: none;
  transition: transform .3s var(--ease-out), box-shadow .3s var(--ease-out);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 4px 0 var(--ink); }
.btn:active { transform: translateY(0); box-shadow: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  height: 100vh; height: 100svh; min-height: 640px;
  overflow: hidden;
}
.hero__grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 139px 139px;
  background-position: -69px -1px;
  border-bottom: 1px solid var(--line);
}
.hero__content {
  position: absolute; left: 0; right: 0; top: 29%;
  display: flex; flex-direction: column; align-items: center;
  padding: 0 16px; pointer-events: none;
}
.hero__title {
  margin: 0; text-align: center;
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(52px, 7.7vw, 172px);
  line-height: 0.93; letter-spacing: -0.02em;
  font-variation-settings: "opsz" 72;
}
.hero__title .line { display: block; }
.hero__title .w {
  display: inline-block; position: relative;
  opacity: 0; transform: translateY(40%); filter: blur(10px);
  transition: opacity 1s var(--ease-out), transform 1.1s var(--ease-out), filter 1s var(--ease-out);
}
.w--hl { padding: 0 0.04em; }
.hl {
  position: absolute; inset: -0.02em 0 -0.04em 0; z-index: -1;
  background: var(--yellow);
  transform: scaleX(0); transform-origin: left;
  transition: transform .9s var(--ease-out);
}
.hero__title .hl__txt { position: relative; }
.is-loaded .hero__title .w { opacity: 1; transform: none; filter: none; }
.is-loaded .hl { transform: scaleX(1); transition-delay: .75s; }

.hero__sub {
  position: relative; margin-top: clamp(20px, 2.6vw, 44px);
  opacity: 0; transform: translateY(16px);
  transition: opacity .9s var(--ease-out) .65s, transform .9s var(--ease-out) .65s;
}
.is-loaded .hero__sub { opacity: 1; transform: none; }
.hero__sub p {
  margin: 0; max-width: 410px; text-align: center; text-wrap: balance;
  font-size: clamp(16px, 1.05vw, 20px); line-height: 1.45; color: var(--ink-soft);
  letter-spacing: -0.01em;
}
.scribble-arrow {
  position: absolute; right: calc(100% + clamp(40px, 5.5vw, 110px)); top: -26px;
  width: 58px; overflow: visible;
  fill: none; stroke: var(--ink); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round;
}
.scribble-arrow path { stroke-dasharray: 80; stroke-dashoffset: 80; transition: stroke-dashoffset 1s var(--ease-out) 1.1s; }
.scribble-arrow path + path { transition-delay: 1.6s; }
.is-loaded .scribble-arrow path { stroke-dashoffset: 0; }

/* Notes */
.note {
  position: absolute; margin: 0; font-size: 17px; white-space: nowrap; color: var(--ink);
  opacity: 0; transition: opacity 1s ease 1.3s;
  pointer-events: none;
}
.is-loaded .note { opacity: 1; }
.note--drag { left: calc(2.5% + 30px); top: calc(var(--nav-h) + 28px + clamp(52px, 3.8vw, 76px)); }
.note--drag span { display: inline-block; animation: nudge 2.4s ease-in-out infinite; }
.note--drag span:last-child { animation-direction: reverse; }
.note--book { left: 5.8%; bottom: 20px; }
.note--scroll { right: 4%; bottom: 20px; }
.note__arrow { display: inline-block; animation: bob 1.8s ease-in-out infinite; }
.note--curious { right: 2.5%; top: 44%; font-size: 16px; }
@keyframes nudge { 50% { transform: translateX(-4px); } }
@keyframes bob { 50% { transform: translateY(4px); } }

/* Draggable objects */
.obj {
  position: absolute; z-index: 5;
  touch-action: none; user-select: none; -webkit-user-select: none;
  cursor: grab;
}
.obj:active { cursor: grabbing; }
.obj img {
  width: 100%; height: auto; pointer-events: none;
  mix-blend-mode: multiply;
  filter: drop-shadow(0 10px 14px rgba(40, 25, 10, 0));
  transition: filter .35s ease;
}
.obj.is-dragging img { filter: drop-shadow(0 22px 22px rgba(40, 25, 10, .18)); }
.obj__inner { will-change: transform; }
.obj--tools { left: 2.5%; top: calc(var(--nav-h) + 28px); width: clamp(130px, 11vw, 210px); }
.obj--book  { left: 3%; bottom: 54px; width: clamp(130px, 10.5vw, 200px); }
.obj--wheel { right: 3%; bottom: 54px; width: clamp(130px, 10vw, 190px); }

/* Entrance of objects (handled on .obj__inner, wrapper keeps drag transform) */
.obj__inner {
  opacity: 0; transform: scale(.6) rotate(-14deg);
  transition: opacity .8s ease, transform 1.2s cubic-bezier(.34, 1.56, .64, 1);
}
.is-loaded .obj__inner { opacity: 1; transform: none; }
.obj--tools .obj__inner { transition-delay: .9s; }
.obj--book .obj__inner  { transition-delay: 1.05s; }
.obj--wheel .obj__inner { transition-delay: 1.2s; }

/* ---------- Reel ---------- */
.reel {
  position: relative; z-index: 10;
  margin-top: -27vh; margin-top: -27svh;
  pointer-events: none;
}
.reel__sticky {
  position: sticky; top: calc(var(--nav-h) + var(--reel-gap));
  height: calc(100vh - var(--nav-h) - var(--reel-gap)); height: calc(100svh - var(--nav-h) - var(--reel-gap));
  display: flex; justify-content: center;
}
.reel__frame {
  position: relative; overflow: hidden; pointer-events: auto;
  transform-origin: 50% 0;
  opacity: 0; translate: 0 40px;
  transition: opacity 1s ease 1s, translate 1.2s var(--ease-out) 1s;
  will-change: transform;
  background: #111;
}
.is-loaded .reel__frame { opacity: 1; translate: 0 0; }
.reel__frame video { width: 100%; height: 100%; object-fit: cover; }
.reel__caption {
  position: absolute; left: 0; right: 0; top: 0; margin: 0;
  text-align: center; font-size: 18px;
  opacity: 0; transition: opacity 1s ease 1.4s;
}
.is-loaded .reel__caption { opacity: var(--cap-o, 1); transition: opacity .2s linear; }

/* ---------- About ---------- */
.about {
  position: relative; z-index: 11;
  padding: clamp(56px, 6vw, 96px) 16px clamp(96px, 12vw, 200px);
  text-align: center;
}
.about__eyebrow { display: inline-block; margin: 0 0 40px; font-size: 22px; }
.about__eyebrow svg {
  display: block; width: 84px; margin: 2px auto 0;
  fill: none; stroke: var(--ink); stroke-width: 1.3; stroke-linecap: round;
}
.about__text {
  margin: 0 auto; max-width: 20ch;
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(32px, 3.9vw, 74px); line-height: 1.2; letter-spacing: -0.02em;
  font-variation-settings: "opsz" 60;
  max-width: 1240px;
}
.about__text mark {
  background: var(--yellow); color: inherit;
  text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 0.12em;
  padding: 0 .04em;
}

/* ---------- Selected works ---------- */
.works {
  position: relative; z-index: 11;
  padding: clamp(64px, 7vw, 120px) 16px clamp(96px, 10vw, 180px);
  border-top: 1px solid var(--line);
}
.works__grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: center top;
}
.works__head {
  position: relative; max-width: 1180px; margin: 0 auto clamp(56px, 7vw, 110px);
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
}
.works__box {
  border: 1px solid var(--line); background: var(--bg);
  padding: clamp(24px, 2.6vw, 40px) clamp(24px, 3vw, 44px) clamp(20px, 2.4vw, 36px);
}
.works__eyebrow { position: relative; display: inline-block; font-size: 20px; padding: 6px 12px; }
.works__eyebrow svg {
  position: absolute; inset: -4px -8px; width: calc(100% + 16px); height: calc(100% + 8px);
  fill: none; stroke: var(--ink); stroke-width: 1.2; stroke-linecap: round; overflow: visible;
}
.works__title {
  margin: 8px 0 0; font-family: var(--serif); font-weight: 400;
  font-size: clamp(46px, 5.6vw, 104px); line-height: 1; letter-spacing: -0.02em;
  font-variation-settings: "opsz" 72;
}
.works__note { margin: 0 0 12px; font-size: 18px; white-space: nowrap; }
.works__list {
  position: relative; max-width: 1180px; margin: 0 auto;
  display: grid; gap: clamp(24px, 4vw, 80px);
}
.work { display: block; text-decoration: none; color: inherit; border-radius: 2px; }
.work__frame {
  background: var(--bg); border: 1px solid var(--line);
  padding: clamp(10px, 1.2vw, 16px) clamp(10px, 1.2vw, 16px) 0;
  box-shadow: 0 1px 0 rgba(29, 26, 23, .03), 0 18px 40px -28px rgba(29, 26, 23, .25);
  transform-origin: 50% 50%; will-change: transform;
}
.work__media { aspect-ratio: 16 / 10; overflow: hidden; background: #e9e1d6; }
.work__media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 1.1s var(--ease-out);
}
.work:hover .work__media img, .work:focus-visible .work__media img { transform: scale(1.035); }
.work__meta {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  padding: clamp(14px, 1.6vw, 22px) 2px clamp(16px, 1.8vw, 24px);
}
.work__title {
  margin: 0; font-family: var(--serif); font-weight: 400;
  font-size: clamp(26px, 2.8vw, 46px); line-height: 1.05; letter-spacing: -0.01em;
}
.work__cat { font-size: clamp(16px, 1.3vw, 21px); white-space: nowrap; }

/* ---------- Project page (slides up, tilted, until it fills the screen) ---------- */
html { scrollbar-gutter: stable; }
html.case-open { overflow: hidden; }
.case { position: fixed; inset: 0; z-index: 90; }
.case[hidden] { display: none; }
.case__backdrop {
  position: absolute; inset: 0; background: rgba(29, 26, 23, .38);
  opacity: 0; transition: opacity .6s ease;
}
.case.is-open .case__backdrop { opacity: 1; }
.case__panel {
  position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain;
  background: var(--bg); outline: none; overflow-anchor: none;
  transform: translate3d(0, 112%, 0) rotate(7deg);
  transform-origin: 0% 0%;
  box-shadow: 0 -30px 80px -20px rgba(29, 26, 23, .35);
  transition: transform .65s cubic-bezier(.55, 0, .85, .35); /* leaving */
  will-change: transform;
}
.case__panel.is-in {
  transform: none;
  transition: transform .95s cubic-bezier(.16, 1, .3, 1); /* arriving */
}
.case__bar {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  height: var(--nav-h); padding: 0 var(--gutter);
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.case__logo { height: 26px; width: auto; mix-blend-mode: multiply; }
.case__close {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border: 1.5px solid var(--ink); border-radius: 999px; background: transparent; color: var(--ink);
  font: 500 16px var(--sans); cursor: pointer;
  transition: background-color .25s ease;
}
.case__close span { font-size: 22px; line-height: 1; }
.case__close:hover { background: var(--yellow); }
.case__intro {
  max-width: 1180px; margin: 0 auto; padding: clamp(56px, 7vw, 110px) 16px clamp(40px, 5vw, 72px);
  display: grid; grid-template-columns: 1.3fr 1fr; column-gap: clamp(32px, 6vw, 96px);
}
.case__eyebrow { grid-column: 1 / -1; margin: 0 0 8px; font-size: 20px; }
.case__title {
  grid-column: 1 / -1; margin: 0 0 clamp(28px, 3.5vw, 56px);
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(52px, 8.4vw, 150px); line-height: .95; letter-spacing: -0.025em;
  font-variation-settings: "opsz" 72;
}
.case__desc { margin: 0; font-size: clamp(18px, 1.4vw, 22px); line-height: 1.5; color: var(--ink-soft); max-width: 46ch; }
.case__meta { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 20px 24px; align-content: start; }
.case__meta dt { font-family: var(--hand); font-size: 17px; opacity: .7; }
.case__meta dd { margin: 2px 0 0; font-size: 16px; font-weight: 500; }
.case__meta a { text-underline-offset: 3px; }
.case__gallery { max-width: 1400px; margin: 0 auto; padding: 0 16px; display: grid; gap: 4px; }
.case__row { display: flex; justify-content: center; gap: 4px; }
.case__fig { margin: 0; min-width: 0; background: #e9e1d6; }
.case__fig img { width: 100%; height: auto; }
.case__next {
  display: block; max-width: 1180px; margin: clamp(80px, 10vw, 160px) auto 0;
  padding: 0 16px clamp(80px, 10vw, 140px); text-align: center; text-decoration: none; color: inherit;
}
.case__next-label { display: block; font-size: 20px; }
.case__next-title {
  display: block; margin-top: 6px;
  font-family: var(--serif); font-size: clamp(40px, 6vw, 104px); line-height: 1; letter-spacing: -0.02em;
}
.case__next img {
  width: min(640px, 100%); aspect-ratio: 16 / 10; object-fit: cover; margin: clamp(28px, 3vw, 44px) auto 0;
  transition: transform 1.1s var(--ease-out);
}
.case__next:hover img { transform: scale(1.03); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  :root { --nav-h: 68px; --reel-gap: 16px; }
  .nav { grid-template-columns: 1fr auto; }
  .nav__links { display: none; }
  .nav__clock { font-size: 16px; }
  .btn { font-size: 15px; padding: 0 14px; }
  .note--curious { display: none; }
  .scribble-arrow { display: none; }
  .hero__content { top: 30%; }
  .obj--tools { top: calc(var(--nav-h) + 8px); }
  .note--drag { top: calc(var(--nav-h) + 58px); }
}
@media (max-width: 560px) {
  .works__head { flex-direction: column; align-items: flex-start; }
  .work__media { aspect-ratio: 4 / 3; }
  .work__meta { flex-direction: column; gap: 2px; }
  .case__intro { grid-template-columns: 1fr; row-gap: 32px; }
  .case__gallery { padding: 0; }
  .nav__clock { display: none; }
  .obj--book, .obj--wheel { width: 100px; bottom: 44px; }
  .note { font-size: 14px; }
  .note--book { left: 16px; bottom: 18px; }
  .note--scroll { right: 16px; bottom: 18px; }
  .hero__content { top: 25%; }
  .reel { margin-top: -46vh; margin-top: -46svh; }
}

@media (prefers-reduced-motion: reduce) {
  .case__panel { transform: none; opacity: 0; }
  .case__panel.is-in { opacity: 1; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
}
