/*
SUBJECT  a focus app where a painted cat lives in your room at night
ONE BOLD THING  the room itself: dark until you pull the cord, then the camera drifts to the desk
PALETTE  indigo night, deep wall, lamp amber, moonlight, dusk rose (used once)
TYPE     Fraunces (soft, optical) for everything said; Instrument Sans for small practical text
*/
:root {
  --night: #141b34; --wall: #1d2748; --lamp: #f3b562; --moon: #e3e8f6; --dim: #9aa4c4; --rose: #d79aa0;
  --serif: "Fraunces", Georgia, serif; --sans: "Instrument Sans", system-ui, sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
}
* { 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(--night); color: var(--moon); font: 400 17px/1.55 var(--sans); overflow-x: clip; }
body.loading { overflow: hidden; }
img { display: block; max-width: 100%; user-select: none; -webkit-user-drag: none; }
a { color: inherit; }
::selection { background: var(--lamp); color: var(--night); }

/* type */
.h1, .h2 { font-family: var(--serif); font-weight: 300; font-variation-settings: "SOFT" 100, "opsz" 144; letter-spacing: -.025em; margin: 0; }
.h1 { font-size: clamp(46px, 6.4vw, 112px); line-height: .98; }
.h2 { font-size: clamp(38px, 4.6vw, 80px); line-height: 1.02; }
.body { max-width: 38ch; margin: 1.4em 0 0; color: var(--dim); font-size: clamp(16px, 1.2vw, 19px); }
.line { display: block; overflow: hidden; padding-bottom: .14em; margin-bottom: -.14em; }
.line > span { display: inline-block; will-change: transform; }

/* cursor */
.cursor { position: fixed; left: 0; top: 0; z-index: 100; pointer-events: none; mix-blend-mode: difference; }
.cursor span { display: block; width: 12px; height: 12px; margin: -6px; border-radius: 50%; background: #fff; transition: transform .35s var(--ease); }
.cursor.big span { transform: scale(4.2); }
@media (hover: none) { .cursor { display: none; } }

/* intro: lights off */
.dark { position: fixed; inset: 0; z-index: 90; background: #090c18; display: grid; place-items: center; }
.switch { position: relative; width: 60px; height: 52vh; border: 0; background: none; cursor: grab; top: -18vh; }
.cord { position: absolute; left: 50%; top: 0; bottom: 30px; width: 1.5px; background: linear-gradient(#3c4566, #7b84a6); transform: translateX(-50%); }
.knob { position: absolute; left: 50%; bottom: 0; width: 22px; height: 30px; margin-left: -11px; border-radius: 11px 11px 9px 9px; background: #c9a36d;
  box-shadow: inset -3px -4px 0 rgba(0,0,0,.2), 0 0 30px rgba(243,181,98,.35); }
.pull { position: absolute; bottom: 14vh; margin: 0; font: italic 300 22px var(--serif); color: var(--dim); letter-spacing: .01em; }

/* bar */
.bar { position: fixed; inset: 0 0 auto; z-index: 60; display: flex; align-items: center; justify-content: space-between; padding: 22px clamp(18px, 3.4vw, 52px); pointer-events: none; }
.bar > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font: 400 22px var(--serif); font-variation-settings: "SOFT" 100; }
.brand img { height: 34px; width: auto; filter: drop-shadow(0 2px 8px rgba(0,0,0,.35)); }

/* buttons: magnetic, label rolls, fill grows from where you came in */
.btn { position: relative; display: inline-flex; align-items: center; height: 52px; padding: 0 26px; border-radius: 26px; overflow: hidden; isolation: isolate;
  font: 500 15px var(--sans); text-decoration: none; letter-spacing: .01em; will-change: transform; }
.btn.ghost { box-shadow: inset 0 0 0 1px rgba(227,232,246,.35); color: var(--moon); }
.btn.solid { height: 64px; padding: 0 34px; font-size: 17px; background: var(--lamp); color: var(--night); }
.btn .fill { position: absolute; z-index: -1; left: var(--fx, 50%); top: var(--fy, 50%); width: 300%; aspect-ratio: 1; border-radius: 50%; transform: translate(-50%, -50%) scale(0);
  background: var(--moon); transition: transform .6s var(--ease); }
.btn.solid .fill { background: var(--moon); }
.btn:hover .fill, .btn:focus-visible .fill { transform: translate(-50%, -50%) scale(1); }
.btn.ghost:hover { color: var(--night); }
.roll { position: relative; display: block; overflow: hidden; height: 1.3em; line-height: 1.3em; }
.roll > span { display: block; transition: transform .55s var(--ease); }
.roll::after { content: attr(data-t); position: absolute; left: 0; top: 100%; transition: transform .55s var(--ease); }
.btn:hover .roll > span, .btn:hover .roll::after { transform: translateY(-100%); }
.btn:focus-visible { outline: 2px solid var(--lamp); outline-offset: 4px; }

/* 1. room */
.room { position: relative; height: 100vh; overflow: hidden; }
.stage { position: absolute; left: 50%; top: 50%; width: max(100vw, 177.8vh); aspect-ratio: 16/9; transform: translate(-50%, -50%); transform-origin: 66% 50%; }
.layer { position: absolute; inset: 0; }
.sky { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.shelf { position: absolute; left: 3%; bottom: 4%; width: 21%; filter: brightness(.55) saturate(.8); }
.plant { position: absolute; left: 20%; bottom: 3%; width: 13%; filter: brightness(.6); }
.desk { position: absolute; left: 40%; bottom: -10%; width: 54%; }
.table { width: 100%; filter: brightness(.82); }
.cat { position: absolute; transform-origin: 50% 100%; }
.cat.sleep { left: 37%; bottom: 63.6%; width: 23%; }
.cat.yawn { left: 43%; bottom: 63.6%; width: 13.5%; opacity: 0; }
.cat.look { left: 43%; bottom: 63.6%; width: 12.5%; opacity: 0; }
.glow { position: absolute; left: 78%; top: -8%; width: 52%; aspect-ratio: 1; border-radius: 50%; pointer-events: none; mix-blend-mode: screen;
  background: radial-gradient(circle, rgba(255,205,130,.55), rgba(255,170,90,.14) 45%, rgba(255,170,90,0) 70%); }
.shade { position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(60% 70% at 72% 52%, transparent 0, rgba(9,12,24,.15) 45%, rgba(9,12,24,.82) 100%),
              linear-gradient(90deg, rgba(14,19,38,.9) 0, rgba(14,19,38,.55) 30%, transparent 55%); }
.copy { position: absolute; left: clamp(20px, 5vw, 80px); top: 50%; transform: translateY(-46%); max-width: 46vw; z-index: 2; }
.sub { position: absolute; left: 0; margin: 0; font: 300 clamp(22px, 2vw, 32px)/1.25 var(--serif); font-variation-settings: "SOFT" 100; color: var(--moon); }
.sub.one { top: calc(100% + 28px); color: var(--dim); }
.sub.two { text-shadow: 0 2px 30px rgba(10,14,30,.55); top: 0; font-size: clamp(46px, 6.4vw, 112px); line-height: .98; letter-spacing: -.025em; }
.scrollnote { position: absolute; left: 50%; bottom: 26px; margin: 0; transform: translateX(-50%); font: italic 300 17px var(--serif); color: var(--dim); }

/* 1b. story */
.story { position: relative; height: 100vh; overflow: hidden; background: #0b0f20; }
.frame { position: absolute; inset: 0; margin: 0; overflow: hidden; }
.frame img { width: 100%; height: 100%; object-fit: cover; will-change: transform; }
.frame::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(10,13,28,.82) 0, rgba(10,13,28,.35) 34%, transparent 58%); }
.caps { position: absolute; left: clamp(20px, 5vw, 80px); right: 20px; bottom: clamp(40px, 9vh, 100px); z-index: 2; }
.cap { position: absolute; left: 0; bottom: 0; text-shadow: 0 2px 30px rgba(0,0,0,.35); }
.ticks { position: absolute; right: clamp(20px, 5vw, 80px); bottom: clamp(46px, 9.5vh, 106px); z-index: 2; display: flex; gap: 8px; }
.ticks i { width: 34px; height: 2px; background: rgba(227,232,246,.25); overflow: hidden; position: relative; }
.ticks i::after { content: ""; position: absolute; inset: 0; background: var(--moon); transform: scaleX(var(--p, 0)); transform-origin: 0 50%; }

/* 2. fish */
.fish { position: relative; min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 6vw; padding: 0 clamp(20px, 6vw, 110px); background: var(--night); }
.fish-in { position: relative; width: min(42vw, 560px); aspect-ratio: 1; justify-self: center; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 2; }
.ring .track { stroke: rgba(227,232,246,.12); }
.ring .prog { stroke: var(--lamp); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.clock { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.clock span { font: 300 clamp(70px, 9vw, 150px)/1 var(--serif); font-variation-settings: "SOFT" 100, "opsz" 144; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.coin { position: absolute; left: 50%; top: 50%; width: 26%; margin: -13% 0 0 -13%; opacity: 0; pointer-events: none; filter: drop-shadow(0 16px 20px rgba(0,0,0,.45)); }
.clock em { font: italic 300 22px var(--serif); color: var(--lamp); opacity: 0; transform: translateY(10px); margin-top: 10px; }

/* 3. feelings */
.feel { position: relative; height: 100vh; overflow: hidden; }
.feel-in { position: absolute; inset: 0; background: #2a2440; clip-path: circle(0% at 50% 50%); display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; padding: 0 clamp(20px, 6vw, 110px); }
.feel .body { color: #c7bcd6; }
.sulker { position: relative; justify-self: center; width: min(26vw, 340px); cursor: grab; touch-action: none; }
.sulker img { width: 100%; transform-origin: 50% 100%; }
.hearts { position: absolute; left: 15%; right: 15%; bottom: -30px; width: 70%; height: 8px; }
.hearts line { stroke-width: 2; stroke-linecap: round; } .hearts .t { stroke: rgba(255,255,255,.15); } .hearts .f { stroke: var(--rose); stroke-dasharray: 1; stroke-dashoffset: 1; }
.fx { position: absolute; width: 56px; pointer-events: none; z-index: 3; }

/* 4. trips */
.trips { position: relative; height: 100vh; overflow: hidden; background: var(--wall); display: flex; flex-direction: column; justify-content: center; }
.trips-head { padding: 0 clamp(20px, 6vw, 110px); max-width: 980px; }
.rail { display: flex; gap: clamp(24px, 3vw, 54px); padding: 7vh clamp(20px, 6vw, 110px) 0; width: max-content; will-change: transform; }
.card { margin: 0; width: clamp(260px, 26vw, 420px); transform: rotate(var(--r)); }
.card .pic { overflow: hidden; border-radius: 4px; background: #11172e; box-shadow: 0 30px 50px -20px rgba(0,0,0,.6); }
.card img { width: 118%; max-width: none; margin-left: -9%; aspect-ratio: 3/2; object-fit: cover; will-change: transform; }
.card figcaption { margin-top: 14px; font: italic 300 20px var(--serif); color: var(--dim); }

/* 4b. friend */
.friend { position: relative; height: 100vh; overflow: hidden; background: var(--night); }
.friend-pic { position: absolute; inset: 0; clip-path: inset(22% 30% 22% 30% round 6px); }
.friend-pic img { width: 100%; height: 100%; object-fit: cover; }
.friend-pic::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(14,19,38,.9) 0, rgba(14,19,38,.55) 36%, transparent 62%); opacity: var(--o, 0); }
.friend-copy { position: absolute; left: clamp(20px, 6vw, 110px); top: 50%; transform: translateY(-50%); max-width: 44vw; z-index: 2; }
.card.wide { width: clamp(380px, 40vw, 640px); }
.card.wide img { aspect-ratio: 16/9; }

/* 5. kinds */
.kinds { position: relative; height: 100vh; overflow: hidden; display: grid; grid-template-columns: 1fr 1.2fr; align-items: center; padding: 0 clamp(20px, 6vw, 110px); background: var(--night); }
.deck { position: relative; height: min(56vh, 520px); perspective: 1400px; }
.deck img { position: absolute; left: 50%; top: 50%; width: min(14vw, 220px); aspect-ratio: 1; margin: calc(min(14vw, 220px) / -2); border-radius: 18px; box-shadow: 0 30px 60px -24px rgba(0,0,0,.7); backface-visibility: hidden; }

/* 5b. devices */
.devices { position: relative; height: 100vh; overflow: hidden; background: var(--night); display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); align-items: center; gap: clamp(24px, 4vw, 70px); padding: 8vh clamp(20px, 5vw, 90px); }
.devices > *:not(.nightfx):not(.hopper) { position: relative; z-index: 1; }
.dev-copy { max-width: 760px; min-width: 0; }
.dev-row { display: grid; grid-template-columns: minmax(0, 2.6fr) minmax(0, 1.15fr) minmax(0, .85fr); align-items: end; gap: clamp(12px, 1.4vw, 26px); min-width: 0; }
.dev { min-width: 0; margin: 0; display: flex; flex-direction: column; align-items: center; }
.dev figcaption { margin-top: 18px; font: italic 300 19px var(--serif); color: var(--dim); }
.bezel { background: #0a0d18; box-shadow: 0 0 0 1.5px rgba(227,232,246,.14), 0 40px 70px -30px rgba(0,0,0,.8); }
.screen { position: relative; overflow: hidden; background: #000; }
.screen .bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.in-cat { position: absolute; transform-origin: 50% 100%; }
.chip { position: absolute; padding: 3px 10px; border-radius: 99px; background: rgba(10,13,24,.6); backdrop-filter: blur(6px); color: var(--moon); font: 500 11px var(--sans); }
.mac .bezel { width: 88%; padding: 10px; border-radius: 16px 16px 6px 6px; }
.mac .screen { aspect-ratio: 16/10; border-radius: 6px; }
.mac .desk { position: absolute; left: 34%; bottom: -22%; width: 66%; }
.mac .in-cat { left: 52%; bottom: 34%; width: 15%; }
.mac .chip { right: 10px; top: 10px; }
.foot-mac { width: 100%; height: 12px; border-radius: 0 0 14px 14px; background: linear-gradient(#2a3150, #151a2e); }
.phone .bezel { width: 100%; padding: 7px; border-radius: 30px; }
.phone .screen { aspect-ratio: 9/19.5; border-radius: 24px; }
.phone .bg { object-position: 72% 50%; }
.phone .in-cat { left: 50%; bottom: 12%; width: 58%; margin-left: -29%; }
.phone .island { position: absolute; left: 50%; top: 8px; width: 34%; height: 12px; margin-left: -17%; border-radius: 99px; background: #000; }
.phone .chip { left: 50%; bottom: 4%; transform: translateX(-50%); background: var(--lamp); color: var(--night); }
.watch .bezel { width: 100%; padding: 7px; border-radius: 34px; }
.watch .screen { aspect-ratio: 41/50; border-radius: 27px; background: radial-gradient(circle at 50% 55%, #3b2c25, #0b0b12 70%); }
.wname { position: absolute; left: 0; right: 0; top: 10%; text-align: center; color: var(--moon); font: 600 11px var(--sans); }
.watch .in-cat { left: 50%; top: 30%; width: 70%; margin-left: -35%; }
.rings { position: absolute; left: 0; right: 0; bottom: 12%; display: flex; justify-content: center; gap: 3px; }
.rings i { width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--lamp); }
.rings i:nth-child(4) { border-color: rgba(243,181,98,.35); }
.hopper { position: absolute; left: 0; top: 0; width: clamp(110px, 10vw, 170px); pointer-events: none; z-index: 3 !important; opacity: 0; }

/* 6. end */
.end { position: relative; min-height: 100vh; display: flex; flex-direction: column; background: #0b0f20; overflow: hidden; }
.end-bg { position: absolute; inset: 0; }
.end-bg img { width: 100%; height: 100%; object-fit: cover; }
.end-bg::after { content: ""; position: absolute; inset: 0; background: radial-gradient(70% 70% at 50% 45%, rgba(11,15,32,.55), rgba(11,15,32,.92)); opacity: var(--dim2, .6); }
.end-in, .foot { position: relative; z-index: 1; }
.walker { position: absolute; bottom: 100%; left: 0; width: 120px; pointer-events: none; margin-bottom: -6px; }
.end-in { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 18vh 20px 10vh; }
.end-cat { width: min(30vw, 300px); margin-bottom: 40px; filter: drop-shadow(0 18px 30px rgba(0,0,0,.45)); }
.end .body { margin: 1.2em auto 2.2em; }
.foot { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 26px clamp(18px, 3.4vw, 52px); color: var(--dim); font-size: 14px; border-top: 1px solid rgba(227,232,246,.08); }
.foot nav { display: flex; gap: 26px; } .foot a { text-decoration: none; } .foot a:hover { color: var(--moon); }

@media (max-width: 820px) {
  .copy { max-width: none; right: 20px; top: auto; bottom: 16vh; transform: none; }
  .shade { background: linear-gradient(0deg, rgba(14,19,38,.95) 0, rgba(14,19,38,.6) 45%, transparent 75%); }
  .stage { left: calc(50vw - .64 * max(100vw, 177.8vh)); transform: translate(0, -50%); transform-origin: 64% 50%; }
  .fish, .kinds { grid-template-columns: 1fr; padding-top: 12vh; padding-bottom: 12vh; height: auto; min-height: 100vh; }
  .fish-in { width: 80vw; }
  .feel-in { grid-template-columns: 1fr; align-content: center; gap: 50px; }
  .sulker { width: 52vw; }
  .sub.two { font-size: 40px; }
  .deck { height: 60vw; }
  .devices { grid-template-columns: 1fr; align-content: center; gap: 5vh; padding: 10vh 20px 5vh; }
  .dev-row { gap: 14px; } .mac .bezel { width: 88%; } .foot-mac { width: 100%; } .phone .bezel { width: 100%; padding: 4px; border-radius: 18px; } .phone .screen { border-radius: 14px; } .watch .bezel { width: 100%; padding: 4px; border-radius: 18px; } .watch .screen { border-radius: 14px; } .rings i { width: 6px; height: 6px; border-width: 1.5px; } .wname, .chip { font-size: 8px; }
  .friend-copy { max-width: none; right: 20px; top: auto; bottom: 10vh; transform: none; }
  .card.wide { width: 80vw; }
  .deck img { width: 36vw; margin: -18vw; }
  .bar .btn { height: 42px; padding: 0 18px; font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) { .roll > span, .roll::after, .btn .fill { transition: none; } }

/* living backgrounds */
.nightfx { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.fish > *:not(.nightfx), .trips > *:not(.nightfx), .kinds > *:not(.nightfx) { position: relative; z-index: 1; }
.trips { transition: none; }
.paws { position: absolute !important; inset: 0; z-index: 0 !important; pointer-events: none; }
.paws img { position: absolute; width: 150px; opacity: 0; filter: invert(1) brightness(.9); mix-blend-mode: screen; }
.paws img:nth-child(1) { left: 6%; top: 78%; transform: rotate(-8deg); }
.paws img:nth-child(2) { left: 30%; top: 70%; transform: rotate(-14deg); }
.paws img:nth-child(3) { left: 54%; top: 82%; transform: rotate(-4deg); }
.rays { position: absolute; left: 72%; top: 50%; width: 140vmax; aspect-ratio: 1; transform: translate(-50%, -50%); pointer-events: none;
  background: repeating-conic-gradient(from 0deg, rgba(215,154,160,.10) 0 6deg, transparent 6deg 18deg);
  -webkit-mask: radial-gradient(circle, #000 0, rgba(0,0,0,.6) 25%, transparent 60%); mask: radial-gradient(circle, #000 0, rgba(0,0,0,.6) 25%, transparent 60%);
  animation: spin 80s linear infinite; }
@keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .rays { animation: none; } }
