/* =========================================================
   Anupam says hi: shared styles
   Palette: cobalt (lanyard), paper (sticker), red (name tag),
   yellow (highlighter), ink (marker), mint (online dot)
   ========================================================= */

@font-face {
  font-family: "Anybody";
  src: url("../fonts/anybody.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 50% 150%;
  font-display: swap;
}
@font-face {
  font-family: "Permanent Marker";
  src: url("../fonts/permanent-marker.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  --cobalt: #2337ff;
  --cobalt-deep: #1424c4;
  --paper: #fffbf2;
  --red: #e31b23;
  --yellow: #ffe14d;
  --ink: #000;
  --mint: #2ee59d;
  --night: #04051a;

  --sans: "Anybody", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --hand: "Permanent Marker", "Marker Felt", "Comic Sans MS", cursive;

  --pad: clamp(16px, 3vw, 44px);
  --topbar: 76px;

  --t-s: 14px;
  --t-m: 18px;
  --t-l: clamp(21px, 2.1vw, 28px);
  --t-xl: clamp(46px, 7.4vw, 118px);
  --t-hero: clamp(110px, 20vw, 360px);

  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --out: cubic-bezier(.16, 1, .3, 1);
}

/* ---------- reset-ish ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { overflow-x: hidden; }
@supports (overflow: clip) { html, body { overflow-x: clip; } }
body {
  font-family: var(--sans);
  font-size: var(--t-m);
  line-height: 1.45;
  font-variation-settings: "wdth" 100, "wght" 520;
  color: var(--paper);
  background: var(--cobalt);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}
img, svg { display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul { list-style: none; }
::selection { background: var(--yellow); color: var(--ink); }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 4px; border-radius: 8px; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip {
  position: fixed; left: 12px; top: -60px; z-index: 200;
  background: var(--paper); color: var(--ink); padding: 10px 16px; border-radius: 999px;
  text-decoration: none; font-variation-settings: "wdth" 100, "wght" 700;
}
.skip:focus { top: 12px; }

.hand { font-family: var(--hand); font-weight: 400; font-variation-settings: normal; }

/* =========================================================
   Top bar
   ========================================================= */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 60;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 16px calc(var(--pad) + 30px) 0 var(--pad);
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.pill {
  display: inline-flex; align-items: center; gap: 9px;
  height: 44px; padding: 0 16px 0 14px;
  background: var(--paper); color: var(--ink);
  border-radius: 999px;
  font-size: 15px; line-height: 1;
  font-variation-settings: "wdth" 104, "wght" 720;
  text-decoration: none;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .18);
}
.me { white-space: nowrap; }
.me-dot {
  width: 10px; height: 10px; border-radius: 50%; flex: none;
  background: var(--mint);
  animation: ping 2.4s ease-out infinite;
}
@keyframes ping {
  0% { box-shadow: 0 0 0 0 rgba(46, 229, 157, .75); }
  70%, 100% { box-shadow: 0 0 0 9px rgba(46, 229, 157, 0); }
}
.me-status {
  display: inline-block; position: relative; overflow: hidden;
  height: 1.2em; line-height: 1.2em; vertical-align: middle;
  font-variation-settings: "wdth" 100, "wght" 480;
  color: rgba(0, 0, 0, .62);
}
.me-status span { display: block; transition: transform .45s var(--out), opacity .3s; }
.me-status span.is-leaving { transform: translateY(-110%); opacity: 0; }
.me-status span.is-entering { transform: translateY(110%); opacity: 0; }

.right { display: flex; align-items: center; gap: 8px; }
.nav { padding: 0 5px; gap: 2px; }
.nav a {
  position: relative; display: grid; place-items: center;
  height: 36px; padding: 0 13px; border-radius: 999px;
  text-decoration: none;
}
.nav a:hover { background: rgba(0, 0, 0, .07); }
.nav a .loop {
  position: absolute; left: -5px; top: -7px;
  width: calc(100% + 10px); height: calc(100% + 14px);
  overflow: visible; pointer-events: none;
}
.nav a .loop path {
  fill: none; stroke: var(--red); stroke-width: 3; stroke-linecap: round;
  stroke-dasharray: 300; stroke-dashoffset: 300;
  animation: draw 1s .6s var(--out) forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }

.icon-btn {
  width: 44px; padding: 0; justify-content: center; gap: 0;
}
.icon-btn svg { width: 22px; height: 22px; }
.sound .on { display: none; }
.sound[aria-pressed="true"] .on { display: block; }
.sound[aria-pressed="true"] .off { display: none; }

/* ---------- pull cord (light switch) ---------- */
.cord {
  position: fixed; top: 0; right: max(6px, calc(var(--pad) - 10px)); z-index: 66;
  width: 34px; padding: 0 0 10px;
  display: flex; flex-direction: column; align-items: center;
  touch-action: none; user-select: none; -webkit-user-select: none;
}
.cord:focus-visible { outline-offset: 0; }
.cord-line {
  display: block; width: 2px; height: calc(70px + var(--pull, 0px));
  background: repeating-linear-gradient(180deg, var(--paper) 0 5px, #e8e1cf 5px 7px);
  transition: height .55s var(--spring);
}
.cord.is-pulling .cord-line { transition: none; }
.cord-bead {
  display: block; width: 15px; height: 24px; border-radius: 8px;
  background: var(--red);
  box-shadow: inset -3px -4px 0 rgba(0, 0, 0, .22), inset 3px 3px 0 rgba(255, 255, 255, .25);
}
.cord-hint {
  position: absolute; top: 74px; right: 28px;
  font-family: var(--hand); font-size: 15px; line-height: 1; white-space: nowrap;
  color: var(--yellow); transform: rotate(-9deg);
  transition: opacity .4s;
  pointer-events: none;
}
.cord.used .cord-hint { opacity: 0; }

/* =========================================================
   Kinetic (stretchy) type
   ========================================================= */
.kinetic { font-weight: normal; user-select: none; -webkit-user-select: none; }
.kinetic .line { display: block; width: fit-content; white-space: nowrap; }
.kinetic .ch {
  display: inline-block;
  font-variation-settings: "wdth" var(--w, 112), "wght" var(--g, 860);
  transform-origin: 50% 88%;
}
.kinetic .ch.sp { width: .22em; }
.anim .kinetic[data-enter] .ch {
  opacity: 0;
  transform: translateY(-75%) rotate(var(--r, 0deg)) scale(.9);
}
.anim .kinetic[data-enter].is-in .ch {
  opacity: 1; transform: none;
  transition: transform .95s var(--spring), opacity .25s linear;
  transition-delay: calc(var(--i) * 55ms);
}
.kinetic .ch.squash { animation: squash .55s var(--out); }
@keyframes squash {
  0% { transform: scale(1, 1); }
  25% { transform: scale(1.25, .62); }
  55% { transform: scale(.9, 1.18); }
  100% { transform: scale(1, 1); }
}

/* =========================================================
   Hero (shared bits)
   ========================================================= */
.hero {
  position: relative;
  min-height: 100vh; min-height: 100svh;
  padding: calc(var(--topbar) + 4vh) var(--pad) clamp(40px, 9vh, 110px);
  display: flex; flex-direction: column; justify-content: center;
  overflow-x: clip;
}
.hero-title {
  font-size: var(--t-hero);
  line-height: .84;
  letter-spacing: -.015em;
  margin-left: -.035em;
  color: var(--paper);
  position: relative; z-index: 4;
}
.scribble {
  font-family: var(--hand);
  font-size: clamp(32px, 4.7vw, 74px);
  line-height: 1.05;
  color: var(--yellow);
  position: relative; z-index: 4;
  align-self: flex-start;
  margin-top: .42em;
  transform: rotate(-3.5deg);
  transform-origin: 0 50%;
}
.scribble .ink { display: inline-block; }
.scribble svg.under {
  position: absolute; left: -2%; bottom: -.32em; width: 104%; height: .5em;
  overflow: visible;
}
.scribble svg.under path {
  fill: none; stroke: var(--red); stroke-width: 7; stroke-linecap: round;
  stroke-dasharray: 700; stroke-dashoffset: 700;
}
.anim .scribble .ink { clip-path: inset(-20% 100% -30% 0); }
.anim .scribble.is-in .ink {
  clip-path: inset(-20% -5% -30% 0);
  transition: clip-path 1.25s cubic-bezier(.55, .05, .3, 1);
}
.scribble.is-in svg.under path,
html:not(.anim) .scribble svg.under path {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset .8s 1.1s var(--out);
}

/* =========================================================
   Stickers (draggable)
   ========================================================= */
.sticker {
  position: absolute; left: var(--x); top: var(--y);
  width: var(--size, 120px);
  z-index: 6;
  touch-action: none; user-select: none; -webkit-user-select: none;
  cursor: grab;
  transform: translate(var(--dx, 0px), var(--dy, 0px)) rotate(var(--rot, 0deg)) scale(var(--sc, 1));
  filter: drop-shadow(0 3px 0 rgba(0, 0, 10, .25));
  transition: filter .25s;
}
.sticker svg { width: 100%; height: auto; overflow: visible; pointer-events: none; }
.sticker:hover { filter: drop-shadow(0 10px 10px rgba(0, 0, 10, .3)); }
.sticker.is-dragging { cursor: grabbing; filter: drop-shadow(0 22px 18px rgba(0, 0, 10, .35)); }
.anim .sticker[data-enter] { --sc: 0; }
.anim .sticker[data-enter].is-in { --sc: 1; transition: transform .7s var(--spring), filter .25s; transition-delay: var(--delay, 0s); }
.anim .sticker[data-enter].is-in.is-settled, .sticker.is-settled { transition: filter .25s; }

.st-note {
  padding: .7em .9em .75em;
  background: var(--yellow); color: var(--ink);
  border: 5px solid var(--paper); border-radius: 12px;
  font-size: 15px; line-height: 1.1;
  font-variation-settings: "wdth" 88, "wght" 800;
  text-align: center;
}

/* =========================================================
   Big push button
   ========================================================= */
.big-btn {
  --face: var(--paper); --text: var(--ink); --base: var(--ink);
  position: relative; display: inline-flex; align-items: center; gap: 12px;
  padding: 20px 30px 22px;
  background: var(--face); color: var(--text);
  border-radius: 999px;
  border: 3px solid var(--base);
  font-size: clamp(19px, 1.8vw, 24px); line-height: 1;
  font-variation-settings: "wdth" 112, "wght" 850;
  text-decoration: none;
  box-shadow: 0 9px 0 var(--base);
  transform: translateY(0);
  transition: transform .12s, box-shadow .12s;
}
.big-btn:hover { transform: translateY(-2px); box-shadow: 0 11px 0 var(--base); }
.big-btn:active, .big-btn.is-pressed { transform: translateY(7px); box-shadow: 0 2px 0 var(--base); }
.big-btn .wave { display: inline-block; transform-origin: 70% 80%; }
.big-btn:hover .wave { animation: wave 1s ease-in-out infinite; }
@keyframes wave {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(16deg); }
  40% { transform: rotate(-10deg); }
  60% { transform: rotate(14deg); }
  80% { transform: rotate(-6deg); }
}

/* =========================================================
   Tapes (diagonal marquees)
   ========================================================= */
.tapes {
  position: relative; z-index: 5;
  height: clamp(120px, 16vw, 230px);
  margin: calc(clamp(120px, 16vw, 230px) / -2) 0;
  pointer-events: none;
  overflow: hidden;
}
.tape {
  position: absolute; left: -8%; width: 116%; top: 50%;
  padding: .55em 0 .6em;
  overflow: hidden; white-space: nowrap;
  font-size: clamp(18px, 2.2vw, 32px); line-height: 1;
  font-variation-settings: "wdth" 125, "wght" 880;
  box-shadow: 0 3px 0 rgba(0, 0, 0, .2);
}
.tape-a { background: var(--ink); color: var(--yellow); transform: translateY(-50%) rotate(-3.2deg); }
.tape-b { background: var(--paper); color: var(--red); transform: translateY(-50%) rotate(2.6deg); }
.tape-track { display: inline-flex; align-items: center; will-change: transform; }
.tape-track > span { display: inline-flex; align-items: center; gap: .7em; padding-right: .7em; }
.tape-track svg { width: 1.05em; height: 1.05em; flex: none; }

/* =========================================================
   Footer
   ========================================================= */
.bye {
  position: relative;
  background: var(--red); color: var(--paper);
  padding: clamp(90px, 14vw, 190px) var(--pad) 22px;
  overflow: hidden;
}
.bye-lead {
  font-size: var(--t-xl); line-height: .92;
  font-variation-settings: "wdth" 80, "wght" 900;
  letter-spacing: -.01em;
  max-width: 11ch;
}
.bye-note {
  font-family: var(--hand); font-size: var(--t-l);
  margin: 22px 0 40px; transform: rotate(-2deg); transform-origin: 0 50%;
  color: var(--yellow);
}
.bye .big-btn { --base: var(--ink); }
.bye-word {
  font-size: min(26vw, 620px); /* "bye!" is 3.53em wide fully stretched */
  line-height: .74;
  margin: clamp(40px, 7vw, 90px) 0 0 -.04em;
  padding-bottom: .2em;
  color: var(--paper);
}
.bye-word .ch { --g: 900; }
.bye-bottom {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px;
  margin-top: clamp(18px, 3vw, 34px);
  padding-top: 16px; border-top: 2px solid rgba(255, 251, 242, .35);
  font-size: var(--t-s);
  font-variation-settings: "wdth" 100, "wght" 560;
}
.to-top {
  text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px;
  font-variation-settings: "wdth" 100, "wght" 700;
}

/* =========================================================
   Lights-off mode (pull the cord)
   ========================================================= */
.lights {
  position: fixed; inset: 0; z-index: 70;
  pointer-events: none; overflow: hidden;
  opacity: 0; visibility: hidden;
}
.lights-beam {
  position: absolute; left: 0; top: 0;
  width: 360vmax; height: 360vmax; margin: -180vmax 0 0 -180vmax;
  background: radial-gradient(circle closest-side,
    rgba(4, 5, 26, 0) 0,
    rgba(4, 5, 26, 0) 3.4%,
    rgba(4, 5, 26, .55) 5.2%,
    rgba(4, 5, 26, .955) 8.5%);
  transform: translate3d(50vw, 50vh, 0);
  will-change: transform;
}
.lights-off .lights { opacity: 1; visibility: visible; }
.lights.flicker { visibility: visible; animation: flicker .6s steps(1) forwards; }
@keyframes flicker {
  0% { opacity: 1; } 15% { opacity: .15; } 30% { opacity: .9; } 45% { opacity: .05; }
  60% { opacity: .6; } 75% { opacity: 0; } 100% { opacity: 0; }
}
.lights-off .topbar { z-index: 72; }
.lights-off .topbar .pill { box-shadow: 0 0 0 2px rgba(46, 229, 157, .5), 0 0 22px rgba(46, 229, 157, .45); }
.lights-off .cord { z-index: 73; }
.lights-off .cord-line { background: var(--mint); box-shadow: 0 0 8px var(--mint); }
.lights-off .cord-bead { background: var(--mint); box-shadow: 0 0 14px var(--mint); }
.lights-off .glow { z-index: 74; }

/* =========================================================
   Cursor
   ========================================================= */
.cursor { position: fixed; inset: 0; z-index: 1000; pointer-events: none; display: none; }
.has-cursor .cursor { display: block; }
.has-cursor, .has-cursor * { cursor: none !important; }
.c-dot, .c-ring { position: absolute; left: 0; top: 0; will-change: transform; }
.c-dot {
  width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%;
  background: var(--paper); mix-blend-mode: difference;
}
.c-ring-in {
  width: 42px; height: 42px; margin: -21px 0 0 -21px; border-radius: 50%;
  border: 1.5px solid var(--paper);
  mix-blend-mode: difference;
  display: grid; place-items: center;
  transition: width .35s var(--out), height .35s var(--out), margin .35s var(--out),
              background-color .25s, border-color .25s, transform .2s var(--out);
}
.c-ring-in span {
  font-size: 13px; line-height: 1; color: var(--ink); white-space: nowrap;
  font-variation-settings: "wdth" 110, "wght" 800;
  opacity: 0; transform: scale(.6); transition: opacity .2s, transform .3s var(--spring);
}
.cursor.is-link .c-ring-in { width: 58px; height: 58px; margin: -29px 0 0 -29px; border-width: 2.5px; }
.cursor.is-label .c-dot { opacity: 0; }
.cursor.is-label .c-ring-in {
  width: 78px; height: 78px; margin: -39px 0 0 -39px;
  background: var(--yellow); border-color: var(--ink); mix-blend-mode: normal;
}
.cursor.is-label .c-ring-in span { opacity: 1; transform: none; }
.cursor.is-down .c-ring-in { transform: scale(.78); }
.cursor.is-hidden .c-dot, .cursor.is-hidden .c-ring { opacity: 0; }
.lights-off .cursor .c-ring-in { border-color: var(--mint); }

/* =========================================================
   FX canvas, toast
   ========================================================= */
.fx { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 90; pointer-events: none; }
.toast {
  position: fixed; left: 50%; bottom: max(22px, env(safe-area-inset-bottom)); z-index: 95;
  max-width: calc(100vw - 32px);
  padding: 13px 20px 14px;
  background: var(--paper); color: var(--ink);
  border: 3px solid var(--ink); border-radius: 16px;
  font-family: var(--hand); font-size: 19px; line-height: 1.15; text-align: center;
  transform: translate(-50%, calc(100% + 60px)) rotate(-2deg);
  visibility: hidden;
  transition: transform .55s var(--spring), visibility 0s .55s;
  pointer-events: none;
}
.toast.show { transform: translate(-50%, 0) rotate(-2deg); visibility: visible; transition: transform .55s var(--spring); }

/* =========================================================
   Loader (first visit) + page curtain
   ========================================================= */
.loader {
  position: fixed; inset: 0; z-index: 100;
  display: none; place-items: center; align-content: center;
  background: var(--yellow); color: var(--ink);
  text-align: center;
}
.first .loader { display: grid; }
.loader-count {
  font-size: clamp(120px, 30vw, 430px); line-height: .8;
  font-variation-settings: "wdth" var(--w, 50), "wght" 900;
  font-variant-numeric: tabular-nums;
}
.loader-note { font-family: var(--hand); font-size: var(--t-l); margin-top: 18px; min-height: 1.3em; }
.loader.is-out { transform: translateY(-101%); transition: transform .85s var(--out); }

.curtain { position: fixed; inset: 0; z-index: 99; display: flex; pointer-events: none; visibility: hidden; }
.wipe .curtain, .curtain.is-cover, .curtain.is-uncover { visibility: visible; }
.curtain i { flex: 1; transform: translateY(101%); }
.curtain i:nth-child(1) { --i: 0; background: var(--cobalt); }
.curtain i:nth-child(2) { --i: 1; background: var(--yellow); }
.curtain i:nth-child(3) { --i: 2; background: var(--red); }
.curtain i:nth-child(4) { --i: 3; background: var(--paper); }
.wipe .curtain i { transform: translateY(0); }
.curtain.is-cover i { transform: translateY(0); transition: transform .5s var(--out) calc(var(--i) * 55ms); }
.curtain.is-uncover i { transform: translateY(-101%); transition: transform .65s var(--out) calc(var(--i) * 70ms); }

/* =========================================================
   Responsive + reduced motion
   ========================================================= */
@media (max-width: 760px) {
  :root { --topbar: 68px; }
  .topbar { padding-top: 12px; }
  .pill { height: 40px; font-size: 14px; padding: 0 13px 0 11px; gap: 7px; }
  .nav { padding: 0 3px; }
  .nav a { height: 32px; padding: 0 9px; }
  .icon-btn { width: 40px; padding: 0; }
  .me-status { display: none; }
  .cord-line { height: calc(62px + var(--pull, 0px)); }
  .cord-hint { top: 66px; }
}
@media (max-width: 380px) {
  .topbar { gap: 6px; }
  .right { gap: 6px; }
  .nav a { padding: 0 7px; }
}

/* phones held sideways: keep the big words inside the screen */
@media (orientation: landscape) and (max-height: 520px) {
  .hero-title { font-size: 15vw !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; transition-delay: 0s !important;
  }
}
