@font-face {
  font-family: Barlow;
  src: url("../assets/barlow.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("../assets/barlow-condensed.woff2") format("woff2");
  font-display: swap;
}
:root {
  color-scheme: dark;
  font-family: Barlow, sans-serif;
  background: #050605;
  color: #fff;
  --gold: #f4c55b;
  --muted: #b5b7af;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; color: inherit; }
button:disabled { cursor: default; opacity: .5; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 6px; }
h1, h2, p { margin: 0; }
.study { overflow-x: clip; }
.study-header {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 20;
  min-height: 82px;
  padding: 22px 4.5%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.wordmark {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 25px;
  line-height: 1;
  font-weight: 700;
  white-space: nowrap;
}
.study-header nav {
  display: flex;
  align-items: center;
  gap: 23px;
  font-size: 13px;
  color: #b2b6ad;
}
.study-header nav a { padding-block: 9px; }
.study-header nav a:hover,
.study-header nav a[aria-current] { color: #fff; }
.study-header nav a[aria-current]::after {
  display: block;
  content: "";
  height: 1px;
  background: var(--gold);
  margin-top: 5px;
}
.all-studies { font-size: 13px; }
.all-studies span { margin-left: 10px; }
.skip-study { position: fixed; top: 8px; left: 8px; padding: 12px; background: #fff; color: #000; z-index: 50; transform: translateY(-170%); }
.skip-study:focus { transform: none; }
.experience { position: relative; }
.stage {
  position: relative;
  height: 100svh;
  min-height: 570px;
  isolation: isolate;
  overflow: clip;
  background: #050605;
}
.scene {
  position: absolute;
  inset: -2%;
  opacity: 0;
  transform-origin: 50% 50%;
  will-change: transform, opacity;
}
.scene canvas { display: block; width: 100%; height: 100%; pointer-events: none; opacity: 0; }
.has-world .scene canvas { opacity: 1; }
.scene .fallback {
  position: absolute;
  width: min(90%, 1000px);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -42%);
}
.has-world .fallback { visibility: hidden; }
.stage-vignette {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, #050605 0, transparent 16%, transparent 83%, #050605 100%);
}
.headline {
  position: absolute;
  top: 26%;
  left: 6%;
  width: 88%;
  z-index: 3;
  transform-origin: 0 0;
  pointer-events: none;
}
.headline h1 {
  font: 700 clamp(76px, 12.6vw, 240px)/.85 "Barlow Condensed", sans-serif;
  letter-spacing: -.025em;
  text-wrap: nowrap;
}
.headline span { display: block; }
.line-two { opacity: 0; }
.habit-cloud { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.habit-tag {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  border: 1px solid color-mix(in srgb, var(--accent), transparent 30%);
  border-radius: 100px;
  padding: 7px 12px;
  background: #080d0ce8;
  color: #fff;
  font-size: 13px;
  white-space: nowrap;
  box-shadow: 0 5px 22px #0005;
  opacity: 0;
  will-change: transform;
}
.habit-tag::before {
  content: "✓";
  display: grid;
  place-items: center;
  color: #0a100c;
  background: var(--accent);
  width: 18px;
  height: 18px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
}
.habit-tag::after {
  content: "";
  position: absolute;
  top: calc(100% + 1px);
  left: 50%;
  height: 22px;
  border-left: 1px solid var(--accent);
  opacity: .8;
}
.closing {
  position: absolute;
  z-index: 8;
  bottom: 15%;
  left: 6%;
  max-width: 330px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(18px);
}
.closing.visible { visibility: visible; }
.closing p { font-size: clamp(17px, 1.45vw, 22px); line-height: 1.4; margin-bottom: 18px; color: #f6f7f0; }
.action {
  display: inline-flex;
  gap: 24px;
  justify-content: space-between;
  align-items: center;
  min-height: 47px;
  border: 1px solid #f4e9c8;
  border-radius: 100px;
  padding: 11px 18px;
  color: #10130d;
  background: #f4eddc;
  font-size: 14px;
  line-height: 1.2;
  white-space: nowrap;
}
.action:hover { background: var(--gold); border-color: var(--gold); }
.city-level {
  position: absolute;
  z-index: 4;
  bottom: 18%;
  right: 5%;
  display: grid;
  text-align: right;
  gap: 3px;
  opacity: 0;
}
.city-level span { color: #c7c8be; font-size: 12px; }
.city-level strong { font: 700 clamp(52px, 6vw, 100px)/.85 "Barlow Condensed", sans-serif; font-variant-numeric: tabular-nums; }
.experience-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 12;
  min-height: 75px;
  padding: 15px 4.5% 17px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.study-caption { font-size: 12px; color: #b5b7af; }
.study-caption i { font-style: normal; padding-inline: 6px; color: #555c52; }
.play-controls { display: flex; gap: 12px; align-items: center; }
.play-controls > button:not(.action) { min-height: 40px; background: none; border: 0; padding: 7px 3px; font-size: 13px; }
.play-controls > button:hover { color: var(--gold); }
.play-controls > button.action:hover { color: #111; }
.film-progress { position: absolute; z-index: 13; bottom: 0; left: 0; width: 100%; height: 2px; background: #ffffff12; }
.film-progress i { display: block; height: 100%; background: #f4c55b; width: 0; }
.load-status { position: absolute; bottom: 98px; left: 4.5%; font-size: 12px; color: #c3c6ba; z-index: 4; }
.no-script { position: fixed; inset: 45% 10% auto; z-index: 30; background: #050605; font-size: 28px; }
.no-script a { display: block; font-size: 18px; margin-top: 20px; }

/* The second study uses ordinary scrolling through a pinned scene. */
.levels .experience { height: 510svh; }
.levels .stage { position: sticky; top: 0; }
.levels .headline { top: 24%; left: 6%; }
.levels .headline h1 { font-size: clamp(75px, 10.8vw, 188px); }
.levels .scene { inset: -7% 8% -3% -16%; }
.level-rail {
  position: absolute;
  top: 21%;
  right: 4.5%;
  width: clamp(195px, 20vw, 280px);
  z-index: 6;
}
.level-rail > p { display: flex; justify-content: space-between; font-size: 12px; padding-bottom: 18px; border-bottom: 1px solid #ffffff2b; margin-bottom: 9px; }
.level-rail > p span { color: #a9aea1; font-size: 10px; }
.level-row { padding: 15px 0 13px; border-bottom: 1px solid #ffffff1c; }
.level-row-top { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; gap: 8px; font-size: 14px; }
.level-name { display: flex; align-items: center; gap: 8px; }
.level-name i { background: var(--accent); width: 7px; height: 7px; border-radius: 50%; }
.level-number { font-size: 12px; font-variant-numeric: tabular-nums; color: #c4c8be; }
.level-number b { color: #fff; font: 700 22px/.9 "Barlow Condensed", sans-serif; margin-left: 5px; }
.xp-track { height: 3px; background: #ffffff16; position: relative; overflow: hidden; }
.xp-track i { display: block; width: 100%; height: 100%; background: var(--accent); transform-origin: left; transform: scaleX(0); }
.level-row.pulse .level-number { color: var(--accent); }
.level-row.pulse .level-number b { color: var(--accent); }
.day-clock {
  position: absolute;
  left: 6%;
  bottom: 16%;
  z-index: 5;
  opacity: 0;
}
.day-clock span { display: block; font-size: 11px; color: #aeb7a7; letter-spacing: .1em; margin-bottom: 6px; }
.day-clock strong { font: 700 clamp(60px, 7vw, 112px)/.8 "Barlow Condensed", sans-serif; font-variant-numeric: tabular-nums; }
.level-story { position: absolute; z-index: 4; top: 18%; left: 6%; pointer-events: none; opacity: 0; }
.level-story span { display: block; font-size: 14px; color: var(--accent, #f4c55b); margin-bottom: 10px; }
.level-story strong { display: block; font: 700 clamp(65px, 10.5vw, 185px)/.83 "Barlow Condensed", sans-serif; letter-spacing: -.02em; }
.scroll-instruction { position: absolute; z-index: 7; left: 6%; bottom: 18%; display: flex; align-items: center; gap: 20px; font-size: 13px; }
.scroll-instruction span { font-size: 24px; }
.levels .closing { bottom: 18%; }
.levels .closing p { display: none; }
.levels .closing .action { font-size: 13px; }
.levels .habit-tag { font-size: 12px; }

/* The third study builds on habit-sized impulses. */
.ripple .headline { top: 25%; left: 6%; width: 88%; }
.ripple .headline h1 { font-size: clamp(75px, 12.7vw, 230px); }
.ripple .scene { inset: -12% -8% -18%; }
.impact { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.impact-ring { position: absolute; top: 53%; left: 50%; width: 24vw; aspect-ratio: 1; border: 1px solid var(--impact-color, #ef7649); border-radius: 50%; opacity: 0; transform: translate(-50%, -50%); box-shadow: 0 0 28px color-mix(in srgb, var(--impact-color), transparent 80%); }
.impact-word { position: absolute; top: 14%; left: 6%; font: 700 clamp(70px, 13vw, 225px)/.85 "Barlow Condensed", sans-serif; letter-spacing: -.025em; color: #fff; opacity: 0; white-space: nowrap; }
.ripple .closing { bottom: 17%; }
.ripple .city-level { right: 6%; bottom: 17%; }
.ripple .action#next-habit { background: #f4eddc; }
.ripple .habit-tag { font-size: 13px; }

/* A small, direct comparison page. */
.gallery { background: #090b09; min-height: 100svh; }
.gallery-header { display: flex; justify-content: space-between; align-items: center; padding: 26px 4%; border-bottom: 1px solid #ffffff23; font-size: 14px; }
.gallery-header a { font: 700 26px/1 "Barlow Condensed", sans-serif; }
.gallery-header span { color: #a8b09f; }
.study-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; padding: clamp(30px, 7vw, 120px) 4%; }
.study-preview { display: block; min-width: 0; }
.preview-art { position: relative; aspect-ratio: 1.22; border: 1px solid #ffffff25; overflow: hidden; background: #030503; border-radius: 4px; }
.preview-art img { position: relative; display: block; width: 100%; height: 100%; object-fit: cover; z-index: 1; transition: transform .5s; }
.preview-art img:not([src]),.preview-art img[src=""] { visibility: hidden; }
.study-preview:hover img { transform: scale(1.025); }
.preview-fallback { position: absolute; top: 20%; left: 9%; font: 700 4vw/.9 "Barlow Condensed", sans-serif; }
.preview-caption { padding-top: 20px; }
.preview-caption h1, .preview-caption h2 { font: 700 clamp(28px, 3vw, 49px)/1 "Barlow Condensed", sans-serif; letter-spacing: -.01em; }
.preview-caption p { color: #b8bfaf; font-size: 15px; margin-top: 9px; }
.preview-caption > span { display: inline-block; margin-top: 22px; padding: 10px 0; font-size: 13px; border-bottom: 1px solid #a0a68d; }
@media (min-width: 1600px) {
  .headline h1 { font-size: 206px; }
}
@media (max-width: 850px) and (min-width: 681px) {
  .study-header { padding-inline: 4%; }
  .level-rail { right: 4%; width: 180px; }
  .level-rail > p { font-size: 11px; }
  .level-rail > p span { display: none; }
  .levels .scene { inset: 4% 15% 3% -20%; }
  .levels .headline h1 { font-size: 11vw; }
}
@media (max-width: 680px) {
  .study-header { min-height: 95px; padding: 18px 5% 12px; align-content: start; flex-wrap: wrap; gap: 7px 12px; }
  .wordmark { font-size: 23px; }
  .all-studies { font-size: 12px; margin-left: auto; }
  .study-header nav { order: 3; width: 100%; gap: 22px; font-size: 12px; }
  .study-header nav a { padding-block: 4px; }
  .stage { min-height: 560px; }
  .headline, .ripple .headline { top: 28%; left: 6%; width: 88%; }
  .headline h1, .ripple .headline h1 { font-size: clamp(54px, 17vw, 108px); line-height: .87; }
  .scene { inset: 3% -12% -3%; }
  .scene .fallback { width: 97%; }
  .habit-tag { font-size: 11px; padding: 6px 9px; min-height: 29px; gap: 6px; }
  .habit-tag::before { width: 15px; height: 15px; font-size: 9px; }
  .habit-tag::after { height: 15px; }
  .closing { left: 6%; bottom: 15%; max-width: 245px; }
  .closing p { font-size: 16px; margin-bottom: 12px; }
  .action { font-size: 12px; min-height: 43px; gap: 16px; padding: 9px 15px; }
  .city-level { right: 6%; bottom: 16%; }
  .city-level strong { font-size: 52px; }
  .city-level span { font-size: 10px; }
  .experience-controls { padding: 10px 5% 12px; min-height: 67px; align-items: end; }
  .study-caption { font-size: 10px; max-width: 105px; line-height: 1.5; }
  .play-controls { gap: 9px; }
  .play-controls > button:not(.action) { font-size: 12px; }
  .load-status { left: 6%; bottom: 90px; font-size: 11px; }
  .levels .experience { height: 470svh; }
  .levels .headline { top: 23%; }
  .levels .headline h1 { font-size: 17vw; }
  .levels .scene { inset: 4% -18% 12%; }
  .level-rail { top: auto; bottom: 12%; left: 6%; right: 6%; width: auto; }
  .level-rail > p { padding-bottom: 10px; margin-bottom: 0; font-size: 11px; }
  #levels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; }
  .level-row { padding: 9px 0 8px; }
  .level-row-top { font-size: 11px; margin-bottom: 6px; gap: 3px; }
  .level-name { gap: 5px; }
  .level-name i { width: 5px; height: 5px; }
  .level-number { font-size: 0; }
  .level-number b { font-size: 19px; margin-left: 1px; }
  .levels .scroll-instruction { bottom: 40%; font-size: 12px; gap: 14px; }
  .day-clock { bottom: auto; top: 21%; left: auto; right: 6%; text-align: right; }
  .day-clock strong { font-size: 48px; }
  .day-clock span { font-size: 9px; }
  .level-story { top: 21%; left: 6%; }
  .level-story span { font-size: 12px; margin-bottom: 8px; }
  .level-story strong { font-size: 18vw; }
  .levels .closing { bottom: auto; top: 31%; }
  .levels .closing .action { font-size: 12px; }
  .levels .habit-tag { font-size: 10px; }
  .ripple .scene { inset: 0 -24% 1%; }
  .ripple .impact-word { top: 21%; left: 6%; font-size: 20vw; }
  .impact-ring { top: 53%; width: 48vw; }
  .ripple .closing { bottom: 16%; }
  .ripple .closing p { font-size: 15px; }
  .ripple .city-level { bottom: 17%; }
  .ripple .play-controls { gap: 10px; }
  .ripple .play-controls #next-habit { min-height: 37px; font-size: 11px; padding: 8px 11px; }
  .ripple .play-controls > button:not(.action) { font-size: 11px; }
  .ripple .study-caption { max-width: 80px; }
  .study-grid { grid-template-columns: 1fr; padding: 28px 5%; gap: 40px; }
  .preview-art { aspect-ratio: 1.4; }
  .preview-fallback { font-size: 13vw; }
  .preview-caption { padding-top: 13px; }
  .preview-caption h1, .preview-caption h2 { font-size: 35px; }
  .preview-caption p { font-size: 14px; }
  .preview-caption > span { margin-top: 12px; }
}
@media (max-width: 360px) {
  .ripple .study-caption { display: none; }
  .ripple .play-controls { width: 100%; justify-content: space-between; }
  .headline h1, .ripple .headline h1 { font-size: 16.5vw; }
}
@media (prefers-reduced-motion: reduce) {
  .preview-art img { transition: none; }
  .levels .experience { height: 100svh; }
}
.rise .stage-vignette {
  background: linear-gradient(90deg, #050605ee 0%, #050605b0 16%, transparent 47%),
              linear-gradient(180deg, #050605 0%, transparent 21%, transparent 78%, #050605 100%);
}
.city-level { text-shadow: 0 2px 14px #000; }
@media (max-width: 680px) {
  .rise .stage-vignette {
    background: linear-gradient(180deg, #050605 0%, #050605 20%, transparent 48%, transparent 76%, #050605 98%);
  }
}
.levels .level-story { top: 14%; }
.levels .level-story strong { font-size: clamp(64px, 8vw, 140px); }
.level-rail {
  padding: 16px 18px;
  margin: -16px -18px 0 0;
  border-radius: 3px;
  background: linear-gradient(90deg, #050605d9, #050605f5);
}
.day-clock { text-shadow: 0 3px 25px #000; }
.ripple .headline { text-align: center; transform-origin: 50% 0; }
.ripple .impact-word { width: 88%; text-align: center; }
.ripple .stage-vignette {
  background: linear-gradient(180deg, #050605 0%, #050605e0 16%, transparent 39%, transparent 78%, #050605 100%);
}
@media (max-width: 680px) {
  .level-rail { padding: 12px; margin: -12px; background: #050605e8; }
  .levels .level-story { top: 21%; }
  .levels .level-story strong { font-size: 17vw; }
}
@media (max-width: 680px) {
  .levels .day-clock { top: 12%; }
  .rise .stage-vignette {
    background: linear-gradient(180deg, #050605 0%, #050605 20%, transparent 45%, transparent 64%, #050605 87%);
  }
  .ripple .experience-controls { flex-wrap: wrap; gap: 3px; min-height: 86px; }
  .ripple .study-caption { order: 2; max-width: none; font-size: 9px; }
  .ripple .play-controls { order: 1; width: 100%; justify-content: flex-end; gap: 18px; }
  .ripple .play-controls > button { white-space: nowrap; }
}
.study-header { position: fixed; background: linear-gradient(#050605f5, #05060500); }
.gallery .preview-art { aspect-ratio: 1.44; }
.gallery .preview-art img { object-fit: contain; }

/* Minimal openings, with the city carrying the introduction. */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.study:not(.full-page) .study-header nav { display: none; }
.levels .experience { height: 100svh; }
.levels .stage { position: relative; }
.levels .closing p, .ripple .closing p { display: none; }
.levels .level-rail { top: 21%; }
.levels .day-clock { bottom: 15%; }
.levels .stage-vignette { background: linear-gradient(180deg,#050605 0%,transparent 18%,transparent 80%,#050605 100%); }
.ripple .stage-vignette { background: linear-gradient(180deg,#050605 0%,transparent 22%,transparent 79%,#050605 100%); }
.city-level strong { font-size: 36px; }
.city-level span { font-size: 10px; }
.city-level { gap: 5px; }
.study:not(.full-page) .closing .action { background: transparent; border: 0; border-radius: 0; color: #e5e6df; padding-inline: 0; border-bottom: 1px solid #e5e6df80; }
@media(max-width:680px) {
  .study:not(.full-page) .study-header { min-height: 65px; }
  .levels .level-rail { top: auto; }
  .levels .day-clock { top: 14%; bottom: auto; }
  .levels .closing { top: auto; bottom: 33%; }
  .city-level strong { font-size: 31px; }
}
