@font-face {
  font-family: "Ony Okkam";
  src: url("../assets/ony-okkam-regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Climate Crisis";
  src: url("./assets/climate-crisis.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  font-family: "Climate Crisis", Arial, sans-serif;
  color-scheme: dark;
  background: #000;
  color: #fff;
  --composition-scale: 1;
  --cylinder-duration: 24s;
  --bunny-float-duration: 6.4s;
  --bunny-saturation: 1.4;
  --focus-scene-scale: 1;
  --focus-ui-scale: 1;
  --focus-duration: 450ms;
  --focus-edge-blur: 16px;
}

/* The scene moves away while the surrounding interface moves closer. */
:root.is-bunny-focus {
  --focus-scene-scale: .9;
  --focus-ui-scale: 1.1;
}

.focus-vignette {
  position: fixed;
  inset: 0;
  z-index: 20;
  opacity: 0;
  pointer-events: none;
  background:
    linear-gradient(to right, rgb(0 0 0 / .9), transparent 10%, transparent 90%, rgb(0 0 0 / .9)),
    linear-gradient(to bottom, rgb(0 0 0 / .9), transparent 10%, transparent 90%, rgb(0 0 0 / .9));
  transition: opacity var(--focus-duration) ease;
}
.is-bunny-focus .focus-vignette { opacity: 1; }

/* Sample the rendered page, then reveal the blur only along its edges. */
.focus-blur-vignette {
  position: fixed;
  inset: 0;
  z-index: 19;
  opacity: 0;
  pointer-events: none;
  -webkit-backdrop-filter: blur(var(--focus-edge-blur));
  backdrop-filter: blur(var(--focus-edge-blur));
  -webkit-mask-image:
    linear-gradient(to right, #000, transparent 10%, transparent 90%, #000),
    linear-gradient(to bottom, #000, transparent 10%, transparent 90%, #000);
  mask-image:
    linear-gradient(to right, #000, transparent 10%, transparent 90%, #000),
    linear-gradient(to bottom, #000, transparent 10%, transparent 90%, #000);
  -webkit-mask-composite: source-over;
  mask-composite: add;
  transition: opacity var(--focus-duration) ease;
}
.is-bunny-focus .focus-blur-vignette { opacity: 1; }

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; }
body { overflow: hidden; }

/* The same expanding capsule and staggered entrance as version 1. */
html.is-intro-animating { background: #f5f5f2; }
.is-intro-animating body {
  clip-path: inset(50% 50% round 999px);
  will-change: clip-path;
}
.is-intro-animating .composition,
.is-intro-animating .site-header,
.is-intro-animating .partner-brands { opacity: 0; }
.is-booting .cylinder,
.is-booting .bunny,
.is-booting .bunny-glow,
.is-booting .bunny-backdrop { animation-play-state: paused; }

.experience {
  --video-radius: clamp(57.6px, 9.6vw, 172.8px);
  /* Keep the colored shape's size and blur independent of the video mask. */
  --cursor-pearl-radius: clamp(24px, 4vw, 72px);
  --cursor-pearl-blur: clamp(10.368px, 1.728vw, 31.104px);
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #000000;
  isolation: isolate;
}

.video-background,
.cursor-pearl-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0;
  transition: opacity 250ms ease;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  -webkit-mask-image: radial-gradient(
    circle var(--video-radius) at var(--video-x, 50%) var(--video-y, 50%),
    rgb(0 0 0 / .8) 0%, rgb(0 0 0 / .68) 28%, rgb(0 0 0 / .32) 58%, transparent 100%
  );
  mask-image: radial-gradient(
    circle var(--video-radius) at var(--video-x, 50%) var(--video-y, 50%),
    rgb(0 0 0 / .8) 0%, rgb(0 0 0 / .68) 28%, rgb(0 0 0 / .32) 58%, transparent 100%
  );
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

/* Independent root layers let the flare sit between video and color mask. */
.video-background { z-index: 0; background: #000; isolation: isolate; }
.cursor-pearl-layer { z-index: 2; mix-blend-mode: color-dodge; }
.video-background.is-active,
.video-background.is-active ~ .cursor-pearl-layer { opacity: 1; }

/* Video strength is independent of the pearl overlay. */
.background-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .15;
}

.cursor-pearl {
  position: absolute;
  left: var(--video-x, 50%);
  top: var(--video-y, 50%);
  width: calc(var(--cursor-pearl-radius) * 2);
  height: auto;
  transform: translate(-50%, -50%);
  filter: blur(var(--cursor-pearl-blur));
  opacity: .56;
  pointer-events: none;
  user-select: none;
}

.site-header {
  position: fixed;
  transform: scale(var(--focus-ui-scale));
  transform-origin: left top;
  transition: transform var(--focus-duration) cubic-bezier(.22, .61, .36, 1);
  z-index: 10;
  top: clamp(24px, 5.277778vw, 76px);
  left: clamp(24px, 5.277778vw, 76px);
  display: flex;
  align-items: center;
  gap: 21px;
}

.site-mark { display: block; flex: none; }
.site-nav { display: flex; align-items: center; gap: 21px; }

.nav-button {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 136px;
  height: 41px;
  padding: 0 18px;
  border: 1px solid #fff;
  border-radius: 0;
  background: transparent;
  color: #fff;
  font: 400 22px / 42px "Ony Okkam", Arial, sans-serif;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

.nav-button--submit-project { width: auto; }
.nav-button--screen {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  place-items: center;
  width: auto;
}
/* Both labels size the same grid cell, even when only one is visible. */
.nav-button--screen > span { grid-area: 1 / 1; }
.is-inner-slide .nav-button__about,
html:not(.is-inner-slide) .nav-button__home { visibility: hidden; }
.nav-button:hover { background: #fff; color: #000; }
.nav-button:focus-visible { outline: 2px solid #fff; outline-offset: 5px; }
.nav-button:active { transform: translateY(1px); }

.partner-brands {
  position: fixed;
  z-index: 10;
  bottom: clamp(24px, 2.777778vw, 40px);
  left: 50%;
  transform: translateX(-50%) scale(var(--focus-ui-scale));
  transform-origin: center bottom;
  transition: transform var(--focus-duration) cubic-bezier(.22, .61, .36, 1);
}

.partner-brands img { display: block; }

.project-modal {
  width: min(698px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  margin: auto;
  padding: 24px;
  border: 1px solid #262626;
  background: #000;
  color: #fff;
  overflow: auto;
  overscroll-behavior: contain;
  font-family: "Ony Okkam", Arial, sans-serif;
}
.project-modal::backdrop {
  background: rgb(0 0 0 / .6);
  -webkit-backdrop-filter: blur(40px);
  backdrop-filter: blur(40px);
}
.project-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.project-modal__header h2 {
  margin: 0;
  margin-inline-start: 32px;
  font-size: 28px;
  font-weight: 400;
  line-height: 1.2;
}
.project-modal__close {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid #555;
  background: #000;
  color: #fff;
  cursor: pointer;
}
.project-modal__close:hover { background: #222; }
.project-modal__close:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.project-modal__form-window {
  --form-footer-height: 58px;
  height: 562px;
  overflow: clip;
}
.project-modal__form {
  display: block;
  width: 100%;
  max-width: 650px;
  border: 0;
  background: #fff;
  color-scheme: light;
}
@media (max-width: 600px) {
  .project-modal { padding: 16px; max-height: calc(100dvh - 32px); }
  .project-modal__header h2 { font-size: 24px; }
}

@media (max-width: 600px) {
  .site-header, .site-nav { gap: 12px; }
  .nav-button {
    width: auto;
    height: 39px;
    padding-inline: 12px;
    font-size: 16px;
    line-height: 24px;
  }
}

@media (max-width: 374px) {
  .site-header { left: 16px; }
  .site-header, .site-nav { gap: 9px; }
  .nav-button { padding-inline: 9px; font-size: 15px; }
  .partner-brands { transform: translateX(-50%) scale(calc(.82 * var(--focus-ui-scale))); }
}

/* The original Figma coordinates share one uniformly scaled composition. */
.composition,
.bunny-light-scene {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 50%;
  width: 1440px;
  height: 700px;
  transform: translate(-50%, -50%) scale(calc(var(--composition-scale) * var(--focus-scene-scale)));
  transition: transform var(--focus-duration) cubic-bezier(.22, .61, .36, 1);
}

.bunny-light-scene {
  z-index: 1;
  mix-blend-mode: luminosity;
  pointer-events: none;
}

.brand {
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  width: 100%;
  overflow: hidden;
  user-select: none;
  pointer-events: none;
}

.brand__image {
  display: block;
  width: 100%;
  height: auto;
}

.brand__image--edge {
  position: absolute;
  left: 0;
  /* The first Figma export is cropped by 5 design pixels at the frame top;
     the second is not. Align the original masks without stretching either. */
  top: calc(-5 / 1440 * 100vw);
  opacity: var(--brand-mix, 0);
  will-change: opacity;
}

/* Paused light frame, independently layered between background and mask. */
.bunny-hover-video {
  position: absolute;
  z-index: 0;
  left: calc(50% - .42px);
  top: calc(50% + 11.8px);
  width: 1080px;
  height: 1080px;
  transform: translate(-50%, -50%) scale(1);
  transition: transform 400ms cubic-bezier(.4, 0, .2, 1);
  object-fit: contain;
  opacity: .1;
  visibility: hidden;
  pointer-events: none;
}
.bunny-hover-video.is-visible { visibility: visible; }
.bunny-hover-video.is-shrinking { transform: translate(-50%, -50%) scale(0); }

/* Soft colored shape centered behind the rabbit and both text planes. */
.bunny-aura {
  position: absolute;
  z-index: -2;
  left: calc(50% - .42px);
  top: calc(50% + 11.8px);
  width: 320px;
  height: auto;
  transform: translate(-50%, -50%);
  filter: saturate(var(--bunny-saturation)) blur(80px);
  opacity: .15;
  pointer-events: none;
  user-select: none;
}

.bunny-glow, .bunny, .bunny-backdrop {
  position: absolute;
  left: calc(50% - .42px);
  top: calc(50% + 11.8px);
  width: 381.6px;
  height: 416.7px;
  object-fit: cover;
  transform: translate(-50%, -50%) rotate(10deg);
  animation: bunny-float var(--bunny-float-duration) ease-in-out infinite;
  will-change: transform;
  user-select: none;
  pointer-events: none;
}

.bunny-backdrop {
  z-index: 2;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  /* Stack four alpha-over masks to prevent sharp backdrop pixels leaking
     through translucent parts of the PNG silhouette. */
  -webkit-mask-image: var(--bunny-mask-image, none), var(--bunny-mask-image, none), var(--bunny-mask-image, none), var(--bunny-mask-image, none);
  mask-image: var(--bunny-mask-image, none), var(--bunny-mask-image, none), var(--bunny-mask-image, none), var(--bunny-mask-image, none);
  -webkit-mask-composite: source-over;
  mask-composite: add;
  -webkit-mask-size: cover;
  mask-size: cover;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

.bunny-glow {
  z-index: -1;
  top: calc(50% + 25.8px);
  opacity: .1;
  filter: saturate(var(--bunny-saturation)) blur(52px);
}

.bunny {
  z-index: 3;
  /* Match the previous PNG alpha: 245 / 255 × .833 ≈ .8. */
  opacity: .833;
  filter: saturate(var(--bunny-saturation));
}

/* Separate painted rear/front planes let backdrop-filter sample the already
   rendered rear text. Each half keeps its original cylindrical geometry. */
.cylinder-scene {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}

.cylinder-scene--rear { z-index: 1; }
.cylinder-scene--front { z-index: 4; }

.cylinder-tilt {
  position: absolute;
  left: 50%;
  top: 389px;
  width: 0;
  height: 0;
  transform: rotateZ(-15deg) rotateX(-6deg);
  transform-style: preserve-3d;
}

.cylinder {
  position: absolute;
  width: 0;
  height: 0;
  transform-style: preserve-3d;
  user-select: none;
  animation: cylinder-orbit var(--cylinder-duration) linear infinite;
}

.cylinder__glyph {
  position: absolute;
  top: -26px;
  left: 0;
  height: 52px;
  font-size: 42px;
  font-weight: 400;
  line-height: 52px;
  white-space: pre;
  text-align: center;
  transform-style: preserve-3d;
}

.cylinder__glyph-face {
  display: block;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
}

.cylinder--rear .cylinder__glyph-face {
  transform: rotateY(180deg) scaleX(-1);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

@keyframes cylinder-orbit {
  from { transform: rotateY(0deg); }
  to { transform: rotateY(-360deg); }
}

/* Animate only the rabbit and its glow; the cylinder keeps its own anchor. */
@keyframes bunny-float {
  0%, 100% {
    transform: translate(calc(-50% - 3px), calc(-50% + 9px)) rotate(8.5deg);
  }
  50% {
    transform: translate(calc(-50% + 3px), calc(-50% - 9px)) rotate(11.5deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cylinder, .bunny, .bunny-glow, .bunny-backdrop { animation: none; }
  .video-background, .cursor-pearl-layer { transition: none; }
  .nav-button { transition: none; }
  .composition, .bunny-light-scene, .site-header, .partner-brands, .focus-vignette, .focus-blur-vignette, .bunny-hover-video { transition: none; }
}

.is-suspended .cylinder,
.is-suspended .bunny,
.is-suspended .bunny-glow,
.is-suspended .bunny-backdrop { animation-play-state: paused; }

.is-project-modal-open .cylinder,
.is-project-modal-open .bunny,
.is-project-modal-open .bunny-glow,
.is-project-modal-open .bunny-backdrop { animation-play-state: paused; }
