/* John Felice · a scroll film in painted rooms.
   Layout idea after human-md.ai; every drawing, word and line of code here is John's own. */

:root {
  --ink: #1f1d1e;
  --paper: #f4efe6;
  --cobalt: #0c3fc4;
  --sky: #5f9fca;
  --pink: #ffadc6;
  --sand: #d8c8ae;
  --green: #235230;
  --lilac: #c9a2f5;
  --mustard: #c9962f;
  --yellow: #f7d766;
  --tomato: #e5402b;
  --terracotta: #c9562c;
  --night: #171a3a;
  --dot: #fc4a12;
  --wa: #25d366;

  --f-display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --f-serif: "Instrument Serif", Georgia, serif;
  --f-mono: "Cutive Mono", ui-monospace, Menlo, monospace;

  --pad: clamp(16px, 2.4vw, 40px);
  --u: min(1vw, 1.7vh); /* the unit every drawing is sized in */
  --fs-cap: clamp(24px, 3.1vw, 56px);
  --fs-head: clamp(30px, 4.4vw, 84px);
  --fs-say: clamp(34px, 5vw, 96px);
  --fs-mono: clamp(13px, 1.15vw, 19px);
  --cap-w: min(21em, 42vw);
  --cap-top: max(14vh, 104px);
}

/* a phone held upright */
@media (max-aspect-ratio: 4/5) {
  :root {
    --u: min(2.05vw, 1.12vh);
    --fs-cap: clamp(23px, 6.6vw, 40px);
    --fs-head: clamp(30px, 9vw, 52px);
    --fs-say: clamp(32px, 9.2vw, 60px);
    --fs-mono: 13px;
    --cap-w: calc(100vw - 2 * var(--pad));
    --cap-top: max(12vh, 96px);
  }
}

*,
*::before,
*::after { box-sizing: border-box; }

html { background: var(--ink); -webkit-text-size-adjust: 100%; }
body {
  visibility: visible;
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--f-display);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
button { font: inherit; color: inherit; }

.skip { position: fixed; left: 12px; top: -80px; z-index: 100; background: var(--paper); color: var(--ink); padding: 10px 14px; border-radius: 8px; }
.skip:focus { top: 12px; }

/* ------------------------------------------------------------------ the plain file */
.read {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.reading .read {
  position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal;
  max-width: 40em; margin: 0 auto; padding: max(15vh, 120px) var(--pad) 14vh;
  font-size: clamp(17px, 1.3vw, 21px); line-height: 1.5; letter-spacing: -0.005em; color: var(--paper);
}
.reading .read__by,
.reading .read blockquote,
.reading .read__foot { font-family: var(--f-mono); }
.reading .read blockquote { margin: 0 0 2em; }
.reading .read blockquote p { margin: 0; }
.reading .read h1 { font-size: clamp(64px, 12vw, 180px); font-weight: 800; letter-spacing: -0.05em; line-height: 0.9; margin: 0.2em 0 0.35em; }
.reading .read h2,
.reading .read h3 { color: var(--dot); font-weight: 700; letter-spacing: -0.015em; margin: 2.4em 0 0.8em; font-size: 1.05em; }
.reading .read p,
.reading .read ul { margin: 0 0 1.2em; }
.reading .read ul { padding-left: 1.4em; }
.reading .read a { color: inherit; text-decoration-color: var(--dot); text-underline-offset: 0.18em; }
.reading .read hr { border: 0; border-top: 1px solid; opacity: 0.4; margin: 3em 0; }
.reading .read__foot { font-size: 0.8em; opacity: 0.7; }
.reading .read__film { margin-top: 3em; }
.reading #stage,
.reading #scroll,
.reading .hud-watch,
.reading .hud-index,
.reading .hud-crumb,
.reading .read__film { display: none !important; }

/* ------------------------------------------------------------------ HUD */
.hud {
  position: fixed; z-index: 60; inset: 0 0 auto 0;
  display: flex; justify-content: space-between; align-items: center;
  padding: calc(var(--pad) * 0.75) var(--pad);
  padding-top: max(calc(var(--pad) * 0.75), env(safe-area-inset-top));
  color: var(--hud-fg, var(--paper));
  pointer-events: none;
  transition: color 0.35s;
}
[data-hud="light"] .hud { --hud-fg: var(--ink); }
.index-open .hud, .reading .hud { --hud-fg: var(--ink); }
.reading .hud { --hud-fg: var(--paper); background: linear-gradient(var(--ink) 45%, #1f1d1e00); padding-bottom: 28px; }
.hud .hud-film { display: none; }
.reading .hud .hud-film { display: inline-flex; }
.hud__l, .hud__r { display: flex; align-items: center; gap: 4px; pointer-events: auto; min-width: 0; }
.pill {
  display: inline-flex; align-items: center; gap: 0.6em; height: 42px; padding: 0 17px;
  border: 0; border-radius: 999px; background: none; color: inherit;
  font-family: var(--f-display); font-size: 15px; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap;
  text-decoration: none; cursor: pointer;
}
button.pill:focus-visible, .hud-home:focus-visible, .card:focus-visible, a.pill:focus-visible { outline: 3px solid var(--dot); outline-offset: 3px; }
.pill--pink { background: var(--pink); color: var(--ink); }
.pill--wa { background: var(--wa); color: #06280f; }
.pill--paper { background: var(--paper); color: var(--ink); }
.pill--line { box-shadow: inset 0 0 0 1.5px currentColor; }
.hud-home {
  width: 54px; height: 54px; flex: none; margin-right: 6px; padding: 0; border: 0; border-radius: 50%;
  background: var(--paper); cursor: pointer; overflow: hidden; box-shadow: 0 4px 10px #0003;
}
.hud-home img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hud-file i { width: 7px; height: 7px; border-radius: 50%; background: var(--dot); }
.hud-crumb { gap: 0.45em; opacity: 0; transition: opacity 0.3s; overflow: hidden; text-overflow: ellipsis; }
.hud-crumb.is-on { opacity: 1; }
.hud-index__i { display: grid; gap: 4px; width: 14px; }
.hud-index__i i { height: 2px; background: currentColor; border-radius: 2px; transition: transform 0.3s; }
.index-open .hud-index__i i:first-child { transform: translateY(3px) rotate(45deg); }
.index-open .hud-index__i i:last-child { transform: translateY(-3px) rotate(-45deg); }
@media (max-width: 720px) {
  .pill { height: 38px; padding: 0 13px; font-size: 14px; }
  .hud-home { width: 46px; height: 46px; }
  .hud-crumb { display: none; }
}

/* ------------------------------------------------------------------ index */
.index {
  position: fixed; inset: 0; z-index: 55; overflow: auto; overscroll-behavior: contain;
  background: var(--mustard); color: var(--ink);
  padding: max(16vh, 110px) var(--pad) 8vh;
}
.index[hidden] { display: none; }
.index__track {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); gap: 30px 14px;
  max-width: 1240px; margin: 0 auto;
}
.card {
  display: block; padding: 8px 8px 16px; border: 0; border-radius: 6px; background: #efe7d8; color: var(--ink);
  text-align: left; cursor: pointer; transform: rotate(var(--r, 0deg)); box-shadow: 0 8px 18px #0002;
  transition: transform 0.25s cubic-bezier(0.3, 1.4, 0.5, 1);
  animation: card-in 0.5s cubic-bezier(0.3, 1.3, 0.5, 1) backwards; animation-delay: calc(var(--i) * 35ms);
}
.card:hover { transform: rotate(0deg) translateY(-6px); }
.card__pic { position: relative; display: block; aspect-ratio: 1; background: linear-gradient(var(--wall) 0 72%, var(--floor) 72%); outline: 1px solid #e5402b88; outline-offset: -1px; }
.card__pic::after { content: ""; position: absolute; left: var(--dx, 50%); top: 14%; width: 9%; aspect-ratio: 1; border-radius: 50%; background: var(--dot); }
.card__pic img { position: absolute; left: 50%; bottom: 9%; height: 70%; width: auto; max-width: 86%; object-fit: contain; transform: translateX(-50%); filter: drop-shadow(0 3px 3px #0003); }
.card__pic img[src*="/sites/"], .card__pic img[src*="/photos/"] { border-radius: 3px; bottom: 16%; height: auto; width: 78%; max-width: none; }
.card__pic img[src*="building"] { bottom: 27%; width: 86%; }
.card__pic img[src*="/icons/"] { bottom: 14%; height: 46%; border-radius: 22%; }
.card__pic svg { position: absolute; left: 50%; bottom: 12%; width: 62%; height: 62%; transform: translateX(-50%); overflow: visible; filter: drop-shadow(0 3px 3px #0003); }
.card__n { display: block; margin: 8px 2px 2px; font-family: var(--f-serif); font-style: italic; font-size: 26px; line-height: 1; color: var(--tomato); }
.card__t { display: block; margin: 0 2px; font-size: 13px; font-weight: 700; line-height: 1.15; letter-spacing: -0.01em; }
@keyframes card-in { from { opacity: 0; transform: translateY(30px) rotate(0deg); } }

/* ------------------------------------------------------------------ grain */
.grain {
  position: fixed; inset: -50%; z-index: 80; pointer-events: none; opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 1.3 -0.2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 0.9s steps(6, end) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -4%); }
  60% { transform: translate(-2%, 3%); } 80% { transform: translate(4%, 1%); } 100% { transform: translate(0, 0); }
}

/* ------------------------------------------------------------------ the stage and its rooms */
#stage { position: fixed; inset: 0; overflow: hidden; background: var(--ink); transition: opacity 0.6s; }
.is-loading #stage, .is-loading .hud { opacity: 0; }
.index-open #stage { visibility: hidden; }

.room { position: absolute; inset: 0; visibility: hidden; --fl: 24%; --enter: 0; --show: 0; --p: 0; color: var(--fg); overflow: hidden; }
.room.is-on { visibility: visible; }
.wall, .floor { position: absolute; left: 0; right: 0; will-change: transform; }
.wall { top: 0; bottom: var(--fl); background: var(--wall); transform: translateY(calc((var(--enter) - 1) * 101%)); }
.floor { bottom: 0; height: var(--fl); background: var(--floor); transform: translateY(calc((1 - var(--enter)) * 101%)); }
/* paint: a soft mottle on every wall and floor, and a little shade where they meet */
.wall::before, .floor::before {
  content: ""; position: absolute; inset: 0; opacity: 0.16; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='600'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.011 0.02' numOctaves='4' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.35 0 0 0 0 0.35 0 0 0 0 0.35 0 0 0 1.6 -0.55'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)'/%3E%3C/svg%3E");
}
.wall::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 9%; background: linear-gradient(#0000, #0000001c); }
.floor::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 14%; background: linear-gradient(#00000026, #0000); }
.set { position: absolute; inset: 0; opacity: var(--show); }
.art { position: absolute; display: block; overflow: visible; }
/* a print: a real photo with a paper border, stuck on the wall a little crooked */
.print { position: relative; margin: 0; padding: calc(0.8 * var(--u)) calc(0.8 * var(--u)) calc(2.9 * var(--u)); background: #fbf8f1; box-shadow: 0 calc(0.9 * var(--u)) calc(1.8 * var(--u)) #00000040; transform: rotate(var(--r, 0deg)); }
.print img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; background: #d8c8ae; user-select: none; -webkit-user-drag: none; }
.print figcaption { position: absolute; left: 0; right: 0; bottom: calc(0.75 * var(--u)); text-align: center; font-family: var(--f-mono); font-size: calc(1.15 * var(--u)); letter-spacing: 0.08em; color: var(--ink); white-space: nowrap; }
.print--s { padding: calc(0.45 * var(--u)); }
.prints .print { opacity: 0; transform: translateY(-50vh) rotate(calc(var(--r, 0deg) * 6)); transition: transform 0.7s cubic-bezier(0.3, 1.35, 0.5, 1), opacity 0.15s, scale 0.35s cubic-bezier(0.3, 1.6, 0.5, 1); }
.prints .print.on { opacity: 1; transform: rotate(var(--r, 0deg)); }
.shadow { position: absolute; height: calc(3 * var(--u)); border-radius: 50%; background: radial-gradient(closest-side, #0000004d, #0000); }

/* ------------------------------------------------------------------ captions: typed on, the dot leads */
.cap {
  position: absolute; left: var(--pad); top: var(--cap-top); width: var(--cap-w); margin: 0;
  font-size: var(--fs-cap); font-weight: 400; line-height: 1.08; letter-spacing: -0.028em;
  opacity: calc(1 - var(--o, 0));
}
.cap em, .end__say em { font-family: var(--f-serif); font-style: italic; font-size: 1.1em; letter-spacing: -0.01em; line-height: 0.9; }
.cap--h { font-size: var(--fs-head); font-weight: 700; letter-spacing: -0.035em; line-height: 1; }
.cap--mid {
  left: 50%; top: 43%; width: min(15em, calc(100vw - 2 * var(--pad))); transform: translate(-50%, -50%);
  font-size: var(--fs-say); text-align: center; line-height: 1.02; letter-spacing: -0.035em;
}
.w { display: inline-block; white-space: nowrap; }
.c { opacity: 0; }
.c.on { opacity: 1; }
.c.caret, .c.stop { position: relative; }
.c.caret::after {
  content: ""; position: absolute; left: calc(100% + 0.07em); bottom: 0.17em; width: 0.26em; height: 0.26em;
  border-radius: 50%; background: var(--dot);
}
/* a sentence's last full stop is the dot itself */
.c.stop { color: transparent; }
.c.stop::before {
  content: ""; position: absolute; left: 0.04em; bottom: 0.17em; width: 0.26em; height: 0.26em;
  border-radius: 50%; background: var(--dot);
}

/* ------------------------------------------------------------------ 0 · home */
.h-title { position: absolute; left: 50%; top: 8vh; transform: translateX(-50%); display: flex; align-items: baseline; white-space: nowrap; font-size: min(12vw, 26vh); line-height: 0.8; color: var(--paper); }
.h-john { font-weight: 800; letter-spacing: -0.045em; font-variation-settings: "opsz" 96; }
.h-dot { flex: none; width: 0.15em; height: 0.15em; margin: 0 0 0 0.05em; border-radius: 50%; background: var(--dot); }
.h-sur { margin-left: 0.14em; font-family: var(--f-serif); font-weight: 400; letter-spacing: -0.02em; }
.h-prints { position: absolute; right: 5%; bottom: 13%; width: calc(62 * var(--u)); height: calc(27 * var(--u)); }
.h-prints .print { position: absolute; width: calc(23 * var(--u)); }
.h-prints .print:nth-child(1) { left: 0; top: calc(5 * var(--u)); }
.h-prints .print:nth-child(2) { left: calc(19.5 * var(--u)); top: 0; z-index: 1; }
.h-prints .print:nth-child(3) { left: calc(39 * var(--u)); top: calc(6 * var(--u)); }
/* the flamingo: the one made-up thing on the page, standing among the real photos */
.bird { --lean: skewX(calc(var(--sw, 0) * 9deg)); transform: var(--lean); transform-origin: 50% 97%; filter: drop-shadow(0 0.5vh 0.6vh #00000038); user-select: none; -webkit-user-drag: none; cursor: pointer; -webkit-tap-highlight-color: transparent; animation: sway 4.6s ease-in-out infinite; }
.h-bird { left: 9%; bottom: calc(var(--pad) * 0.8 + 44px + 5.25 * var(--fs-mono) + 2 * var(--u)); height: calc(30 * var(--u)); transform: scaleX(-1) var(--lean); }
.h-bird-sh { left: calc(9% + 4 * var(--u)); bottom: calc(var(--pad) * 0.8 + 44px + 5.25 * var(--fs-mono) + 0.8 * var(--u)); width: calc(12 * var(--u)); }
.i-bird { left: 0; bottom: 4%; height: calc(30 * var(--u)); transform: translateX(calc(var(--p) * (100vw + 40 * var(--u)) - 22 * var(--u))) translateY(calc(sin(var(--p) * 150) * sin(var(--p) * 150) * -1.5 * var(--u))) rotate(calc(sin(var(--p) * 150) * 3.5deg)) var(--lean); animation: none; }
.i-bird-sh { left: 0; bottom: 2.8%; width: calc(12 * var(--u)); transform: translateX(calc(var(--p) * (100vw + 40 * var(--u)) - 18 * var(--u))); }
.ht-bird { right: calc(6% + 53 * var(--u)); bottom: 7%; height: calc(24 * var(--u)); transform: scaleX(-1) var(--lean); }
.ht-bird-sh { right: calc(6% + 53.4 * var(--u)); bottom: calc(7% - 1.2 * var(--u)); width: calc(10 * var(--u)); }
.end__bird { right: 7%; bottom: 8%; height: calc(26 * var(--u)); opacity: var(--t, 0); animation: breathe 3.6s ease-in-out infinite; }
.h-quote { position: absolute; left: var(--pad); bottom: calc(var(--pad) * 0.8 + 44px); font-family: var(--f-mono); font-size: var(--fs-mono); line-height: 1.75; letter-spacing: 0.12em; color: var(--ink); }
.h-quote p { margin: 0; white-space: nowrap; }
.tick { display: inline-block; width: 0.42em; height: 0.42em; margin-right: 1.1em; border-radius: 50%; background: var(--dot); vertical-align: 0.12em; }
.h-meta { position: absolute; bottom: calc(var(--pad) * 0.8); margin: 0; font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.24em; color: #1f1d1ecc; }
.h-meta--l { left: var(--pad); }
.h-meta--r { right: var(--pad); }
.hint { position: absolute; right: var(--pad); bottom: calc(var(--pad) * 0.8 + 26px); margin: 0; display: grid; justify-items: end; gap: 8px; font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.14em; color: #1f1d1ecc; }
.hint i { width: 1px; height: 34px; background: currentColor; transform-origin: top; animation: hint 1.8s ease-in-out infinite; }
@keyframes hint { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* ------------------------------------------------------------------ 1 · what this file is */

/* ------------------------------------------------------------------ 2 · the hotel */
.ht-prints { position: absolute; right: 6%; top: 16%; display: grid; grid-template-columns: repeat(2, calc(21.5 * var(--u))); gap: calc(2.2 * var(--u)) calc(2.4 * var(--u)); }
.hotel__n { position: absolute; left: var(--pad); bottom: 5%; margin: 0; font-family: var(--f-mono); font-size: var(--fs-mono); letter-spacing: 0.12em; opacity: min(1, calc(var(--t, 0) * 12)); }
.hotel__n b { display: inline-block; min-width: 1.25em; margin-right: 0.12em; font-family: var(--f-display); font-size: var(--fs-say); font-weight: 800; letter-spacing: -0.05em; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ 3 · the apartments */

.bld { position: absolute; right: 5%; bottom: calc(var(--fl) - 1.2%); width: calc(52 * var(--u)); opacity: calc(min(1, var(--t, 0) * 3) * (1 - var(--o, 0))); transform: translateY(calc((1 - var(--t, 0)) * 6vh)); }
.bld img { position: relative; display: block; width: 100%; height: auto; filter: drop-shadow(0 calc(0.5 * var(--u)) calc(0.9 * var(--u)) #00000040); }
.bld__sh { left: -4%; right: -4%; bottom: calc(-1.8 * var(--u)); height: calc(4 * var(--u)); }
.lets { position: absolute; right: 6%; top: 19%; display: grid; grid-template-columns: repeat(4, calc(11.5 * var(--u))); gap: calc(1.5 * var(--u)); }

/* ------------------------------------------------------------------ 4 · websites */
.strip { position: absolute; left: 0; right: 0; bottom: 5.5%; }
.strip__track { display: flex; align-items: flex-end; gap: calc(3 * var(--u)); width: max-content; padding: 0 var(--pad) 0 52vw; transform: translateX(calc(var(--t, 0) * var(--dist, 0px))); will-change: transform; }
.site { flex: none; display: block; width: min(36vw, 500px); padding-bottom: 14px; border-radius: 10px; background: var(--paper); color: var(--ink); text-decoration: none; transform: rotate(var(--r, 0deg)); box-shadow: 0 16px 34px #00000040; overflow: hidden; }
.site__bar { display: flex; align-items: center; gap: 5px; padding: 9px 11px; font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.06em; }
.site__bar i { width: 8px; height: 8px; border-radius: 50%; background: #d7cfc0; }
.site__bar i:first-child { background: var(--dot); }
.site__bar span { margin-left: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: 0.75; }
.site img { display: block; width: 100%; aspect-ratio: 960 / 640; object-fit: cover; object-position: top; background: #101820; }
.site__cat { display: block; margin: 12px 14px 3px; font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.65; }
.site__name { display: block; margin: 0 14px; font-size: clamp(17px, 1.5vw, 24px); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }

/* ------------------------------------------------------------------ 5 · tools */
.stickies { --s: calc(14.5 * var(--u)); position: absolute; right: 6%; top: 24%; display: grid; grid-template-columns: repeat(3, var(--s)); gap: calc(2 * var(--u)); }
.stickies p { margin: 0; aspect-ratio: 1; padding: calc(1.7 * var(--u)) calc(1.5 * var(--u)); color: var(--ink); font-family: var(--f-mono); font-size: calc(1.22 * var(--u)); line-height: 1.3; background: var(--c); box-shadow: 0 calc(0.7 * var(--u)) calc(1.2 * var(--u)) #00000033; transform: rotate(var(--r)) translateY(calc(-4 * var(--u))) scale(0.6); opacity: 0; transition: transform 0.5s cubic-bezier(0.3, 1.5, 0.5, 1), opacity 0.2s; }
.stickies p.on { transform: rotate(var(--r)); opacity: 1; }
.stickies b { display: block; margin-bottom: calc(0.7 * var(--u)); font-family: var(--f-display); font-size: calc(1.85 * var(--u)); line-height: 1; letter-spacing: -0.03em; }

.apps { position: absolute; left: var(--pad); bottom: 6%; margin: 0; display: flex; gap: calc(1.4 * var(--u)); }
.apps img { display: block; width: calc(8 * var(--u)); height: calc(8 * var(--u)); border-radius: 22.5%; box-shadow: 0 calc(0.6 * var(--u)) calc(1.2 * var(--u)) #0000004d; opacity: 0; transform: translateY(calc(2 * var(--u))) scale(0.6); transition: transform 0.45s cubic-bezier(0.3, 1.5, 0.5, 1), opacity 0.2s; }
.apps img.on { opacity: 1; transform: none; }

/* ------------------------------------------------------------------ 7 · the notepad */
.room--notes .wall { --rule: clamp(34px, 3.4vw, 60px); background-image: linear-gradient(90deg, #0000 calc(var(--pad) + 5.5vw), #e5402b73 0 calc(var(--pad) + 5.5vw + 1px), #0000 0), repeating-linear-gradient(#0000 0 calc(var(--rule) - 1px), #5f9fca66 0 var(--rule)); }
.room--notes .wall::after, .room--notes .floor::after { display: none; }
.pad { position: absolute; left: calc(var(--pad) + 8vw); right: var(--pad); top: max(17vh, 118px); display: grid; grid-template-columns: 1fr 1fr; gap: 5vw; color: var(--ink); }
.pad h3 { margin: 0 0 0.9em; font-size: clamp(21px, 2.6vw, 46px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; }
.pad ul { list-style: none; margin: 0; padding: 0; }
.pad li { position: relative; padding: 0.42em 0 0.42em 1.75em; font-size: clamp(18px, 2.3vw, 40px); line-height: 1.15; letter-spacing: -0.02em; opacity: 0; transform: translateX(-0.6em); transition: opacity 0.3s, transform 0.3s; }
.pad li.on { opacity: 1; transform: none; }
.pad li::before { content: ""; position: absolute; left: 0; top: 0.5em; width: 0.9em; height: 0.9em; border: 2px solid var(--ink); border-radius: 0.22em; }
.pad__more li::after { content: ""; position: absolute; left: 0.22em; top: 0.72em; width: 0.46em; height: 0.46em; border-radius: 50%; background: var(--dot); transform: scale(0); transition: transform 0.35s 0.25s cubic-bezier(0.3, 1.8, 0.5, 1); }
.pad__more li.on::after { transform: scale(1); }

/* ------------------------------------------------------------------ 8 · the end */
.room--end .wall::after, .room--end .floor::after { display: none; }
.stars { position: absolute; inset: 0; }
.stars i { position: absolute; border-radius: 50%; background: #fff; animation: twinkle var(--d, 3s) ease-in-out infinite; animation-delay: var(--w, 0s); }
.shoot { position: absolute; left: 68%; top: 14%; width: 15vmin; height: 2px; border-radius: 2px; background: linear-gradient(90deg, #fff, #fff0); rotate: -20deg; opacity: 0; animation: shoot 8s linear infinite 2.5s; }
@keyframes twinkle { 0%, 100% { opacity: 0.25; scale: 0.7; } 50% { opacity: 1; scale: 1.3; } }
@keyframes shoot { 0%, 91% { opacity: 0; translate: 0 0; } 92% { opacity: 1; translate: 0 0; } 100% { opacity: 0; translate: -47vmin 17vmin; } }
.zz { position: absolute; right: calc(7% + 8.5 * var(--u)); bottom: calc(8% + 24 * var(--u)); width: 1em; height: 1em; margin: 0; opacity: var(--t, 0); font-family: var(--f-serif); font-size: calc(3.4 * var(--u)); color: var(--paper); pointer-events: none; }
.zz i { position: absolute; left: 0; bottom: 0; opacity: 0; animation: zz 3.6s ease-out infinite; }
.zz i:nth-child(2) { animation-delay: 1.2s; }
.zz i:nth-child(3) { animation-delay: 2.4s; }
@keyframes zz { 0% { opacity: 0; translate: 0 0; scale: 0.5; rotate: 0deg; } 18% { opacity: 0.9; } 100% { opacity: 0; translate: calc(3.5 * var(--u)) calc(-9 * var(--u)); scale: 1.4; rotate: 16deg; } }
.end { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3.4vh; padding: 12vh var(--pad) 9vh; text-align: center; opacity: var(--t, 0); transform: translateY(calc((1 - var(--t, 0)) * 5vh)); }
.end__title { position: static; transform: none; font-size: min(11vw, 20vh); }
.end__say { width: min(17em, 100%); margin: 0; font-size: var(--fs-cap); line-height: 1.08; letter-spacing: -0.028em; }
.end__cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 0; }
.end__cta a { height: 48px; padding: 0 22px; font-size: 16px; opacity: 0; transform: translateY(14px) scale(0.9); transition: transform 0.45s cubic-bezier(0.3, 1.5, 0.5, 1), opacity 0.2s; }
.end__cta a.on { opacity: 1; transform: none; }
.end__print { position: absolute; left: 5%; bottom: 9%; width: calc(21 * var(--u)); opacity: var(--t, 0); }
.end__foot { position: absolute; left: 0; right: 0; bottom: calc(var(--pad) * 0.8); margin: 0; text-align: center; font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.2em; opacity: calc(var(--t, 0) * 0.75); }

/* ------------------------------------------------------------------ a phone held upright */
@media (max-aspect-ratio: 4/5) {
  .h-title { top: 15vh; font-size: 16.5vw; }
  .h-quote { left: var(--pad); bottom: auto; top: calc(15vh + 17vw + 12px); color: var(--paper); letter-spacing: 0.06em; font-size: 12.5px; }
  .tick { margin-right: 0.8em; }
  .h-prints { right: auto; left: 50%; bottom: 9%; width: calc(44 * var(--u)); height: calc(48 * var(--u)); margin-left: calc(-22 * var(--u)); }
  .h-prints .print { width: calc(25 * var(--u)); }
  .h-prints .print:nth-child(1) { left: 0; top: 0; }
  .h-prints .print:nth-child(2) { left: auto; right: 0; top: calc(12 * var(--u)); }
  .h-bird { left: auto; right: 4%; bottom: 6%; height: calc(18 * var(--u)); transform: var(--lean); }
  .h-bird-sh { left: auto; right: calc(4% + 2.1 * var(--u)); bottom: calc(6% - 1.2 * var(--u)); width: calc(8 * var(--u)); }
  .ht-bird, .ht-bird-sh { display: none; }
  .end__bird { right: auto; left: 50%; bottom: 7.5%; height: calc(19 * var(--u)); margin-left: calc(-5.8 * var(--u)); }
  .zz { right: auto; left: calc(50% - 0.6 * var(--u)); bottom: calc(7.5% + 17.5 * var(--u)); font-size: calc(3 * var(--u)); }
  .h-prints .print:nth-child(3) { left: calc(3 * var(--u)); top: calc(28 * var(--u)); }
  .h-meta--r { display: none; }
  .hint { right: var(--pad); bottom: calc(var(--pad) * 0.8); grid-auto-flow: column; align-items: center; }
  .hint i { height: 18px; }

  .ht-prints { right: auto; left: 50%; top: auto; bottom: 19%; transform: translateX(-50%); grid-template-columns: repeat(2, calc(20.5 * var(--u))); gap: calc(2 * var(--u)); }
  .hotel__n { bottom: 3.5%; }

  .bld { right: auto; left: 50%; width: calc(45 * var(--u)); margin-left: calc(-22.5 * var(--u)); }
  .lets { right: auto; left: 50%; top: auto; bottom: 13%; transform: translateX(-50%); grid-template-columns: repeat(3, calc(13.5 * var(--u))); gap: calc(1.4 * var(--u)); }

  .strip { bottom: 9%; }
  .strip__track { padding-left: 60vw; }
  .site { width: 70vw; }

  .room--tools { --fl: 15%; }
  .stickies { --s: calc(17 * var(--u)); right: auto; left: 50%; top: auto; bottom: 17%; transform: translateX(-50%); grid-template-columns: repeat(2, var(--s)); gap: calc(2 * var(--u)); }
  .stickies p { aspect-ratio: 5 / 4; font-size: calc(1.5 * var(--u)); }
  .stickies b { font-size: calc(2.2 * var(--u)); }
  .apps { left: 50%; bottom: 3.5%; transform: translateX(-50%); }
  .apps img { width: calc(7 * var(--u)); height: calc(7 * var(--u)); }


  .pad { left: calc(var(--pad) + 11vw); grid-template-columns: 1fr; gap: 26px; top: max(13vh, 100px); }
  .pad h3 { font-size: 6.6vw; }
  .pad li { font-size: 5.3vw; padding-top: 0.5em; padding-bottom: 0.5em; }
  .room--notes .wall { background-image: linear-gradient(90deg, #0000 calc(var(--pad) + 7vw), #e5402b73 0 calc(var(--pad) + 7vw + 1px), #0000 0), repeating-linear-gradient(#0000 0 calc(var(--rule) - 1px), #5f9fca66 0 var(--rule)); }

  .end__title { font-size: 15.5vw; }
  .end__foot { font-size: 10.5px; letter-spacing: 0.06em; white-space: nowrap; }
  .end__print { display: none; }
}

/* a short phone: keep the photos off the three lines, and the flamingo off the buttons */
@media (max-aspect-ratio: 4/5) and (max-height: 700px) {
  .h-prints { transform: scale(0.86); transform-origin: 50% 100%; }
  .end__bird { height: calc(13 * var(--u)); margin-left: calc(-4 * var(--u)); }
  .zz { left: calc(50% - 0.4 * var(--u)); bottom: calc(7.5% + 12 * var(--u)); }
}

/* ================================================================== play
   Everything below is motion laid over the rooms. It uses the separate
   translate / rotate / scale properties, so it adds to each drawing's own
   transform instead of replacing it.
   --sw  the swing: scroll speed on a loose spring, about -1 … 1 (film.js)
   --mx, --my  where the pointer is, -1 … 1 (mouse only)                     */

/* things hang, so they swing when the film moves and settle when it stops */
.print { transform-origin: 50% -6%; rotate: calc(var(--sw, 0) * var(--k, 6deg)); transition: scale 0.35s cubic-bezier(0.3, 1.6, 0.5, 1); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.print:nth-child(even) { --k: 4deg; }
.print:nth-child(3n) { --k: 8deg; }
.stickies p { transform-origin: 50% 0; rotate: calc(var(--sw, 0) * var(--k, 7deg)); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.stickies p:nth-child(even) { --k: 10deg; }
.site { rotate: calc(var(--sw, 0) * -4deg); transition: scale 0.35s cubic-bezier(0.3, 1.6, 0.5, 1); }
.hotel__n b { rotate: calc(var(--sw, 0) * -8deg); cursor: pointer; }
.bld { transform-origin: 50% 100%; rotate: calc(var(--sw, 0) * 1.6deg); scale: 1 calc(1 + sin(var(--t, 0) * 3.1416) * 0.08); cursor: pointer; }
.pad li { translate: calc(var(--sw, 0) * 0.7em) 0; transition: opacity 0.3s, transform 0.5s cubic-bezier(0.3, 1.6, 0.5, 1); }
.h-dot { translate: 0 calc(var(--sw, 0) * -0.55em); cursor: pointer; }
.apps img { cursor: pointer; }
.apps img.on { animation: jiggle 0.26s ease-in-out infinite alternate; }
.apps img:nth-child(even).on { animation-delay: -0.13s; animation-duration: 0.3s; }
@keyframes jiggle { from { rotate: -2.4deg; } to { rotate: 2.4deg; } }
@keyframes sway { 0%, 100% { rotate: -1.6deg; } 50% { rotate: 1.6deg; } }
@keyframes breathe { 0%, 100% { scale: 1 1; } 50% { scale: 1.02 1.035; } }

/* captions: each letter pops as it is typed */
.c { display: inline-block; }
.c.on { animation: letter 0.3s cubic-bezier(0.3, 1.7, 0.5, 1) backwards; }
@keyframes letter { from { opacity: 0; translate: 0 0.4em; scale: 0.5; } }

/* the title: letters drop in one by one, then the dot falls and bounces */
.l { display: inline-block; cursor: pointer; }
body:not(.is-loading) .room--home.is-on .l { animation: drop 0.75s cubic-bezier(0.3, 0.7, 0.3, 1) backwards; animation-delay: calc(0.1s + var(--i) * 60ms); }
body:not(.is-loading) .room--home.is-on .h-dot { animation: fall 1.25s linear backwards; animation-delay: calc(0.25s + var(--i) * 60ms); }
@keyframes drop { 0% { translate: 0 -1.5em; rotate: -16deg; opacity: 0; } 55% { translate: 0 0.09em; rotate: 4deg; opacity: 1; } 78% { translate: 0 -0.03em; rotate: -1deg; } 100% { translate: 0 0; rotate: 0deg; } }
@keyframes fall {
  0% { translate: 0 -70vh; scale: 1 1; animation-timing-function: cubic-bezier(0.5, 0, 1, 0.6); }
  30% { translate: 0 0; scale: 1.5 0.55; animation-timing-function: cubic-bezier(0, 0.5, 0.4, 1); }
  48% { translate: 0 -1.1em; scale: 0.92 1.1; animation-timing-function: cubic-bezier(0.6, 0, 1, 0.6); }
  66% { translate: 0 0; scale: 1.3 0.7; animation-timing-function: cubic-bezier(0, 0.5, 0.4, 1); }
  78% { translate: 0 -0.4em; scale: 1 1; animation-timing-function: cubic-bezier(0.6, 0, 1, 0.6); }
  90% { translate: 0 0; scale: 1.15 0.85; }
  100% { translate: 0 0; scale: 1 1; }
}
.h-dot { transform-origin: 50% 100%; }
/* home: the photos are dealt onto the wall, the flamingo pops up, the three lines slide in */
body:not(.is-loading) .room--home.is-on .h-prints .print { animation: deal 0.9s cubic-bezier(0.2, 0.9, 0.3, 1) backwards, drift 6s ease-in-out infinite; animation-delay: calc(0.55s + var(--n, 0) * 0.14s), calc(1.9s + var(--n, 0) * 0.7s); animation-duration: 0.9s, calc(6s + var(--n, 0) * 0.8s); }
.h-prints .print:nth-child(2) { --n: 1; }
.h-prints .print:nth-child(3) { --n: 2; }
@keyframes drift { 0%, 100% { translate: 0 0; } 50% { translate: 0 calc(-0.7 * var(--u)); } }
@keyframes deal { 0% { translate: 45vw 35vh; rotate: 70deg; opacity: 0; } 30% { opacity: 1; } 70% { translate: -0.6vw -0.4vh; rotate: -5deg; } 100% { translate: 0 0; } }
body:not(.is-loading) .room--home.is-on .h-bird { animation: pop 0.7s 1s cubic-bezier(0.3, 1.5, 0.5, 1) backwards, sway 4.6s 1.7s ease-in-out infinite; }
body:not(.is-loading) .room--home.is-on .h-bird-sh { animation: fade 0.5s 1.1s backwards; }
@keyframes pop { from { scale: 0; opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
body:not(.is-loading) .room--home.is-on .h-quote p { animation: slide 0.6s cubic-bezier(0.3, 1.4, 0.5, 1) backwards; animation-delay: 1.2s; }
body:not(.is-loading) .room--home.is-on .h-quote p:nth-child(2) { animation-delay: 1.32s; }
body:not(.is-loading) .room--home.is-on .h-quote p:nth-child(3) { animation-delay: 1.44s; }
@keyframes slide { from { translate: -2em 0; opacity: 0; } }
/* the end: the title does a slow wave and its dot keeps bouncing */
.end__title .l { animation: wave 3.4s ease-in-out infinite; animation-delay: calc(var(--i) * 90ms); }
.end__title .h-dot { animation: dribble 3.4s infinite; }
@keyframes wave { 0%, 26%, 100% { translate: 0 0; } 13% { translate: 0 -0.13em; } }
@keyframes dribble {
  0%, 58%, 100% { translate: 0 0; scale: 1 1; }
  63% { translate: 0 0; scale: 1.3 0.7; animation-timing-function: cubic-bezier(0, 0.5, 0.4, 1); }
  74% { translate: 0 -0.5em; scale: 0.94 1.08; animation-timing-function: cubic-bezier(0.6, 0, 1, 0.6); }
  84% { translate: 0 0; scale: 1.25 0.75; animation-timing-function: cubic-bezier(0, 0.5, 0.4, 1); }
  91% { translate: 0 -0.16em; scale: 1 1; animation-timing-function: cubic-bezier(0.6, 0, 1, 0.6); }
  96% { translate: 0 0; scale: 1.1 0.9; }
}
.end__cta .pill--wa.on { animation: nudge 2.8s 1s ease-in-out infinite; }
@keyframes nudge { 0%, 14%, 100% { rotate: 0deg; scale: 1; } 3% { rotate: -5deg; scale: 1.06; } 7% { rotate: 4deg; scale: 1.06; } 11% { rotate: -2deg; } }

/* the dot that bounces from one room into the next */
.bounce { position: absolute; inset: 0; z-index: 6; pointer-events: none; opacity: var(--bo, 0); --bs: calc(1 - min(1, var(--by, 0) * 6)); }
.ball, .ball-sh { position: absolute; left: 0; bottom: 21vh; width: calc(4.6 * var(--u)); aspect-ratio: 1; border-radius: 50%; }
.ball { background: var(--dot); transform-origin: 50% 100%;
  transform: translate(calc(var(--bx, 0) * (100vw + 100%) - 100%), calc(var(--by, 0) * -40vh)) scale(calc(1 + var(--bs) * 0.3), calc(1 - var(--bs) * 0.32)); }
.ball-sh { bottom: calc(21vh - 0.7 * var(--u)); height: calc(1.4 * var(--u)); aspect-ratio: auto; background: radial-gradient(closest-side, #00000059, #0000);
  transform: translateX(calc(var(--bx, 0) * (100vw + 100%) - 100%)) scale(calc(1.3 - var(--by, 0) * 0.8)); opacity: calc(1 - var(--by, 0) * 0.7); }

/* bits that fly: feathers, paint, the flamingo's friends */
.fx { position: fixed; inset: 0; z-index: 70; overflow: hidden; pointer-events: none; }
.reading .fx, .reading .cur { display: none; }
.bit { position: absolute; will-change: transform; }
.march { position: absolute; left: 0; bottom: 1.5vh; height: 17vh; transform-origin: 50% 97%; filter: drop-shadow(0 0.5vh 0.6vh #00000038); animation: march 0.42s ease-in-out infinite alternate; animation-delay: var(--w, 0s); }
@keyframes march { from { transform: translateY(0) rotate(-3deg); } to { transform: translateY(-1.4vh) rotate(3deg); } }

/* buttons give a little */
.pill, .hud-home, .card { -webkit-tap-highlight-color: transparent; }
.pill, .hud-home { transition: scale 0.35s cubic-bezier(0.3, 1.8, 0.5, 1); }
.pill:active, .hud-home:active { scale: 0.92; }
.hud-home img { transition: rotate 0.4s cubic-bezier(0.3, 1.8, 0.5, 1); }

/* a mouse: the trailing dot, a little depth, and things lift when you point at them */
.cur { position: fixed; left: 0; top: 0; z-index: 90; pointer-events: none; opacity: 0; transition: opacity 0.3s; }
.cur.is-on { opacity: 1; }
.cur::before { content: ""; position: absolute; left: -6px; top: -6px; width: 12px; height: 12px; border-radius: 50%; background: var(--dot); transition: scale 0.35s cubic-bezier(0.3, 1.6, 0.5, 1), opacity 0.25s; }
.cur.is-hot::before { scale: 3.6; opacity: 0.38; }
@media (hover: hover) and (pointer: fine) {
  .h-title, .h-prints, .h-bird, .h-bird-sh, .h-quote, .ht-prints, .ht-bird, .ht-bird-sh, .lets, .stickies, .apps, .pad, .end, .end__bird, .end__print, .stars, .cap {
    translate: calc(var(--mx, 0) * var(--dz, 0) * var(--u)) calc(var(--my, 0) * var(--dz, 0) * 0.6 * var(--u));
  }
  .h-title, .end { --dz: -1.4; }
  .cap, .stars { --dz: -0.6; }
  .h-quote, .pad { --dz: 0.5; }
  .h-prints, .ht-prints, .lets, .stickies, .end__print { --dz: 1.5; }
  .apps { --dz: 2; }
  .h-bird, .h-bird-sh, .ht-bird, .ht-bird-sh, .end__bird { --dz: 2.6; }
  .print:hover { scale: 1.07; z-index: 3; }
  .stickies p:hover { scale: 1.07; }
  .site:hover { scale: 1.04; }
  .pill:hover, .hud-home:hover { scale: 1.07; }
  .hud-home:hover img { rotate: -14deg; }
  .bld { translate: calc(var(--mx, 0) * 1.2 * var(--u)) 0; }
}

@media (prefers-reduced-motion: reduce) {
  .grain, .hint i, .bird, .apps img.on, .stars i, .shoot, .zz i, .end__title .l, .end__title .h-dot, .end__cta .pill--wa.on { animation: none; }
}
