@font-face { font-family: Phantom; src: url(fonts/Phantom-Regular.woff2); font-weight: 400; font-display: swap; }
@font-face { font-family: Phantom; src: url(fonts/Phantom-Med.woff2); font-weight: 500; font-display: swap; }
@font-face { font-family: Phantom; src: url(fonts/Phantom-Bold.woff2); font-weight: 700; font-display: swap; }
/* Working Man Sans: licensed, capitals only, for titles */
@font-face { font-family: 'Working Man Sans'; src: url(fonts/wm.woff2); font-display: swap; }

:root {
  --bench: #dfe3e8;
  --ink: #16181d;
  --red: #ec3750;
  --gutter: clamp(1.1rem, 7vw, 8rem);
  /* space either side of the content, which stops growing at 86rem */
  --inset: max(var(--gutter), calc((100% - 86rem) / 2));
  --gap: clamp(2rem, 6vw, 6.5rem); /* between the two columns */
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  overflow-x: clip;
  font: 400 1.125rem/1.5 Phantom, system-ui, sans-serif;
  color: var(--ink);
  position: relative;
  background: var(--bench) url(baked/dots-big.webp) 0 0 / 256px;
}
/* Living stipple: big dots on the page, two paper-coloured clouds sliding over them, small dots on top.
   Where both clouds are thin the dots look bigger. Only transforms move, so nothing is repainted. */
.clouds { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.clouds canvas { --tile: 50vmax; position: absolute; left: 0; top: 0; width: calc(3 * var(--tile)); height: calc(3 * var(--tile)); will-change: transform; animation: drift 80s linear infinite; }
.clouds canvas + canvas { --tile: 64vmax; animation: drift-back 115s linear infinite; }
@keyframes drift { from { transform: translate(calc(-1 * var(--tile)), 0); } to { transform: translate(0, calc(-1 * var(--tile))); } }
@keyframes drift-back { from { transform: translate(0, 0); } to { transform: translate(calc(-1 * var(--tile)), 0); } }
.dots { position: absolute; inset: 0; z-index: -1; pointer-events: none; background: url(baked/dots-small.webp) 0 0 / 256px; }
a { color: inherit; }
:focus-visible { outline: 3px solid #1f6fd1; outline-offset: 3px; }

/* The laptop stays put beside the first two steps. --f is the width of the pre-rendered frame; its lid
   is 56.25% of that, centred 50% across and 31.1% down. It has two fixed resting points, the middle of
   the right column and the middle of the left one, and moves in a straight line between them. */
#stage { position: absolute; inset: 0 var(--inset) auto; container-type: inline-size; z-index: -1; height: 200svh; pointer-events: none; }
/* placed stickers sit above everything, and stay grabbable over the form, video and links */
#desk { position: absolute; inset: 0 0 auto; z-index: 10; height: 0; pointer-events: none; }
#desk img { pointer-events: auto; }
.grabbing iframe { pointer-events: none; }
.pin { position: sticky; top: 0; height: 100svh; }
#laptop {
  --col: calc((100cqw - var(--gap)) / 2);
  --f: min(1.66 * var(--col), 112svh);
  position: absolute;
  left: calc(100cqw - (var(--col) + var(--f)) / 2);
  /* the open laptop is centred on the text: its middle is 0.128f below the middle of its lid */
  top: calc(50svh - 0.365 * var(--f));
  width: var(--f);
  aspect-ratio: 2400 / 1830;
  pointer-events: none;
  transform-origin: 50% 31.1%;
  will-change: transform;
  /* crosses over in the middle of the turn, while neither text is level with it */
  --cross: clamp(0, (var(--turn, 0) - 0.2) / 0.6, 1);
  transform: translate(calc(var(--cross) * -1 * (var(--col) + var(--gap))), calc(var(--turn, 0) * 0.11 * var(--f)));
}
#laptop > img, #spin { position: absolute; inset: 0; width: 100%; height: 100%; visibility: hidden; user-select: none; }
[data-pose='front'] > .front, [data-pose='mid'] > #spin, [data-pose='back'] > .back { visibility: visible !important; }
#lid { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
#lid { width: 900px; height: 590px; overflow: hidden; }



/* the single canvas that draws whichever sticker is being peeled */
#peel { position: fixed; left: 0; top: 0; z-index: 11; width: 560px; height: 560px; pointer-events: none; }

@property --ring { syntax: '<length>'; inherits: false; initial-value: 0px; }
#ripples { position: absolute; inset: 0; z-index: 0; overflow: clip; pointer-events: none; }
.ripple {
  position: absolute;
  width: 1100px;
  height: 1100px;
  margin: -550px 0 0 -550px;
  background: radial-gradient(circle, #7c8698 3.2px, transparent 3.8px) 0 0 / 8px 8px;
  mask: radial-gradient(circle, transparent calc(var(--ring) - 70px), #000 var(--ring), transparent calc(var(--ring) + 50px));
  animation: ring 0.9s ease-out forwards;
}
@keyframes ring { from { --ring: 40px; } to { --ring: 500px; opacity: 0; } }
body.grab { cursor: grab; }
body.grabbing, body.grabbing * { cursor: grabbing !important; user-select: none; }

header {
  position: absolute;
  inset: 0 0 auto;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0 var(--inset);
}
.flag img { display: block; width: clamp(6rem, 9vw, 8.75rem); height: auto; }
nav { display: flex; align-items: center; gap: clamp(0.9rem, 2vw, 2rem); padding-top: 1.35rem; font-weight: 500; }
nav a { text-decoration: none; }
nav a:hover { text-decoration: underline; text-underline-offset: 0.3em; }
.solid, .pitch button { color: #fff; background: var(--ink); border-radius: 0.6rem; }
.solid { padding: 0.4rem 0.95rem; }
.solid:hover, .pitch button:hover { background: #343a46; text-decoration: none; }

.piles { --u: clamp(90px, 9vw, 160px); --lift: 0px; position: absolute; inset: 0; z-index: 2; overflow-x: clip; pointer-events: none; }
.pile { position: absolute; bottom: calc(-1.2 * var(--u) + var(--lift)); width: calc(3.8 * var(--u)); height: auto; }
.pile.left { left: calc(-0.6 * var(--u)); }
.pile.right { right: calc(-0.6 * var(--u)); }
.live { position: absolute; max-width: none; height: auto; filter: drop-shadow(2px 3px 3px #080a1477); user-select: none; }

/* spans the whole page, so the stickers scroll with it; each falls from the very top to the very bottom */
.falling { position: absolute; inset: 0; z-index: -1; overflow: hidden; container-type: size; pointer-events: none; }
@keyframes appear { from { opacity: 0; } }
.falling.in { animation: appear 1s; }
.falling img { position: absolute; left: var(--x); top: 0; width: calc(var(--s) * clamp(4.5rem, 7.5vw, 9rem)); height: auto; will-change: transform; animation: sink var(--d) linear var(--t) infinite; }
@keyframes sink { from { transform: translate(-50%, -14rem) rotate(var(--a)); } to { transform: translate(-50%, calc(100cqh + 5rem)) rotate(var(--b)); } }

.hero {
  position: relative;
  height: 100svh;
  min-height: 38rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: clamp(1rem, 3svh, 2rem);
  padding-top: 4.5rem;
}
h1 {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: min(22vw, 30svh);
  font-style: italic;
  line-height: 0.86;
  letter-spacing: -0.055em;
  color: var(--red);
  user-select: none;
}
.video { position: relative; z-index: 3; display: grid; place-items: center; width: min(64svh, 40vw); aspect-ratio: 16 / 9; overflow: hidden; color: #c3c9d3; background: var(--ink); border-radius: 0.9rem; box-shadow: 0 10px 30px #16181d40; }
.soon { display: grid; justify-items: center; gap: 0.8rem; }
.soon p { margin: 0; text-align: center; }
.soon strong { font-size: 1.3rem; color: #fff; }
.video iframe { width: 100%; height: 100%; border: 0; }
.pitch { position: relative; z-index: 3; width: min(27rem, calc(100% - 2rem)); padding-bottom: clamp(1.2rem, 3.5svh, 2.2rem); text-align: center; }
.pitch p { margin: 0 0 0.7rem; font-size: 1.4rem; font-weight: 700; letter-spacing: -0.01em; }
.pitch form { position: relative; display: flex; padding: 0.35rem; background: #fff; border-radius: 0.95rem; box-shadow: 0 1px 2px #16181d33, 0 10px 30px #16181d26; }
/* email list note: hover RSVP, or focus the form (phones have no hover). The padding bridges the gap to the bubble */
.tip { position: absolute; right: 0; bottom: 100%; width: min(19rem, 100%); padding-bottom: 0.6rem; font-size: 0.95rem; line-height: 1.4; text-align: left; opacity: 0; visibility: hidden; transition: opacity 0.15s, visibility 0.15s; }
.tip > span { display: block; padding: 0.7rem 0.9rem; color: #fff; background: var(--ink); border: 1px solid #596170; border-radius: 0.6rem; }
.pitch button:hover + .tip, .tip:hover, .pitch form:focus-within .tip { opacity: 1; visibility: visible; }
.pitch form:focus-within { outline: 3px solid #1f6fd1; }
.pitch input { flex: 1; min-width: 0; padding: 0.65rem 0.85rem; font: inherit; color: inherit; background: none; border: 0; outline: 0; }
.pitch input::placeholder { color: #69707c; opacity: 1; }
.pitch button { padding: 0 1.4rem; font: 700 1.05rem Phantom, sans-serif; border: 0; cursor: pointer; }

.how { position: relative; z-index: 3; overflow-x: clip; padding: 0 var(--inset); pointer-events: none; }
.how article { display: flex; flex-direction: column; justify-content: center; width: calc((100% - var(--gap)) / 2); height: 100svh; }
.how h2, .faq h2 { margin: 0; font-size: clamp(2.5rem, 5vw, 5rem); line-height: 0.98; letter-spacing: -0.035em; text-wrap: balance; }
.how h2 { position: relative; z-index: 1; width: fit-content; }
.how p, .how h2, .pitch p { text-shadow: 0 0 4px var(--bench), 0 0 4px var(--bench), 0 0 8px var(--bench), 0 0 12px var(--bench); }
.how .links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.6rem; font-weight: 700; }
.how a, .how button { pointer-events: auto; }
.how a { text-underline-offset: 0.2em; }
.how p { width: fit-content; max-width: 25em; margin: 1.3rem 0 0; font-size: 1.3rem; line-height: 1.42; }

.how .mail, .how .world, .how .start { display: grid; grid-template-columns: 1fr 1fr; align-items: center; column-gap: var(--gap); width: 100%; }
.world > .globe { order: -1; }
.how .start { height: auto; padding: 2rem 0 15rem; }
.how .join { justify-self: center; width: min(100%, 28rem); padding: 1.8rem; background: #fff; border: 4px solid var(--red); border-radius: 1.2rem; box-shadow: 0 14px 34px #16181d33; pointer-events: auto; }
.join h3 { margin: 0 0 1rem; font: 400 2.3rem/1 'Working Man Sans', Phantom, sans-serif; text-transform: uppercase; }
.join input, .join button { display: block; width: 100%; padding: 0.8rem 1rem; font: inherit; border-radius: 0.6rem; }
.join input { color: inherit; background: #f1f3f6; border: 2px solid #8a92a0; }
.join input::placeholder { color: #626976; opacity: 1; }
.join button { margin-top: 0.7rem; font-weight: 700; color: #fff; background: #d42a42; border: 0; cursor: pointer; }
.join button:hover { background: var(--ink); }
.how .join p { max-width: none; margin: 0.9rem 0 0; font-size: 0.95rem; text-shadow: none; }
.how .join p + p { margin-top: 0.35rem; }
.how article:nth-of-type(2) { margin-left: auto; }
#resend { margin-top: 1.6rem; padding: 0.6rem 1.2rem; font: 700 1.05rem Phantom, sans-serif; color: #fff; background: var(--ink); border: 0; border-radius: 0.6rem; cursor: pointer; opacity: 0; visibility: hidden; transition: opacity 0.3s; }
#resend:hover { background: #343a46; }
.sent #resend { opacity: 1; visibility: visible; }

/* Mailer, from EnvelopeAnimation.svelte in hackclub/stickers: stickers drop in, the flap shuts,
   a stamp lands and it flies off. main.js adds the state classes in order. */
.mail > .mailer { justify-self: center; width: min(90%, 38rem, 62svh); }
.mailer { position: relative; aspect-ratio: 1200 / 862; margin: 10svh 0 0; container-type: inline-size; perspective: 1600px; }
.flip { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform 0.8s cubic-bezier(0.5, 0, 0.3, 1); }
.envelope, .address { position: absolute; inset: 0; width: 100%; height: 100%; backface-visibility: hidden; }
.envelope { perspective: 900px; filter: drop-shadow(0 14px 18px #16181d55); }
.address { transform: rotateY(180deg); box-shadow: 0 14px 34px #16181d55; border-radius: 2px; }
.paper { position: absolute; inset: 0; background: linear-gradient(var(--tint), var(--tint)), url(mail/paper.webp) center / cover; --tint: #f02a4d66; }
.back { --tint: #7d1428b8; }
.pocket { z-index: 4; clip-path: polygon(0 100%, 0 35%, 50% 78%, 100% 35%, 100% 100%); }
.drop { position: absolute; inset: 0; z-index: 3; clip-path: polygon(0 -1000%, 100% -1000%, 100% 100%, 0 100%); }
.drop img { position: absolute; left: var(--x); top: var(--y); width: 27cqw; translate: -50% -50%; transform: translateY(-120svh) rotate(var(--from)); opacity: 0; }
.flap { position: absolute; inset: 0 0 auto; height: 78%; z-index: 5; transform-origin: top; transition: transform 0.7s cubic-bezier(0.55, 0.05, 0.4, 1), z-index 0s 0.3s; }
.flap .paper { --tint: #f5355780; clip-path: polygon(0 0, 100% 0, 100% 44.87%, 50% 100%, 0 44.87%); }
.flap::before { content: ''; position: absolute; inset: 0; top: 1.5cqw; background: #0003; clip-path: polygon(0 0, 100% 0, 100% 44.87%, 50% 100%, 0 44.87%); }
.stamp { position: absolute; z-index: 6; left: 50%; top: 66%; width: 32cqw; transform: translate(-50%, -50%) rotate(-9deg) scale(2.2); opacity: 0; }

.open .flap { transform: rotateX(178deg); z-index: 2; }
.loading .drop img { animation: fall 1.15s cubic-bezier(0.45, 0, 0.75, 0.6) calc(var(--i) * 0.38s) forwards; }
.shut .drop img { transform: rotate(var(--to)); opacity: 1; animation: none; }
.shut .flap { transform: rotateX(0deg); z-index: 5; }
.stamped .stamp { animation: slap 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
.turned .flip { transform: rotateY(180deg); }
.flying .mailer { animation: fly 1.35s forwards; }
.sent .mailer { animation: arrive 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
@keyframes fall { 8% { opacity: 1; } 100% { opacity: 1; transform: rotate(var(--to)); } }
@keyframes slap { to { opacity: 1; transform: translate(-50%, -50%) rotate(-9deg); } }
@keyframes fly {
  0% { animation-timing-function: cubic-bezier(0.4, 0, 0.4, 1); }
  30% { transform: translateX(-5vw) scale(1.1, 0.9); animation-timing-function: cubic-bezier(0.5, 0, 0.7, 0.45); }
  55% { transform: translateX(22vw) scale(1.06, 0.95); animation-timing-function: linear; }
  100% { transform: translateX(170vw); }
}
@keyframes arrive { from { opacity: 0; transform: rotate(-10deg) scale(0.4); } to { transform: rotate(-4deg); } }

.globe { position: relative; justify-self: center; width: min(100%, 44rem, 84svh); aspect-ratio: 1; }
/* the globe hovers just above the page */
.globe::before { content: ''; position: absolute; left: 20%; right: 20%; bottom: 1%; height: 11%; background: radial-gradient(closest-side, #16181d55, #16181d00); }
.globe canvas { position: relative; display: block; width: 100%; height: 100%; }
.letter { position: absolute; left: 0; top: 0; width: 11%; height: auto; opacity: 0; transition: opacity 0.2s; box-shadow: 0 4px 8px #16181d66; }

/* rock-strata top of the dark section */
.edge { position: relative; z-index: 4; height: 120px; margin: -120px 0 -1px; background: url(edge.svg) 50% 0 repeat-x; pointer-events: none; }

.faq {
  position: relative;
  z-index: 4;
  overflow: clip;
  min-height: 100svh;
  padding: clamp(4rem, 9vw, 8rem) var(--gutter) 0;
  color: #f1f3f6;
  background: var(--ink);
}
.faq h2, .answers, .faq footer { position: relative; z-index: 2; width: min(46rem, 100%); margin-inline: auto; }
.answers { margin-top: clamp(2rem, 4vw, 3.5rem); }
details { border-top: 1px solid #3a404c; }
details:last-child { border-bottom: 1px solid #3a404c; }
summary { display: flex; justify-content: space-between; gap: 1rem; padding: 1.1rem 0; font-size: 1.35rem; font-weight: 700; cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::after { content: '+'; font: 700 1.6rem/1.2 Phantom, sans-serif; color: #ff7085; }
details[open] summary::after { content: '-'; }
details p { max-width: 38em; margin: 0 0 1.5rem; color: #c3c9d3; }
.faq footer { padding: 5rem 0 clamp(13rem, 24vw, 20rem); text-align: center; color: #c3c9d3; }
/* the pile's true corner is 15.8% in from the image's edges (see pile() in bake.html) */
.heap { --w: clamp(15rem, 38vw, 44rem); position: absolute; bottom: calc(-0.158 * var(--w)); z-index: 1; width: var(--w); height: auto; }
.footer-live, .peel-me { --u: calc(clamp(15rem, 38vw, 44rem) / 3.8); position: absolute; pointer-events: none; }
.footer-live { inset: 0; z-index: 1; }
.peel-me { right: calc(2.1 * var(--u)); bottom: calc(1.05 * var(--u)); z-index: 2; width: calc(1.45 * var(--u)); height: auto; user-select: none; }
.heap.left { left: calc(-0.158 * var(--w)); }
.heap.right { right: calc(-0.158 * var(--w)); }

/* pack the sections as close as they go without touching (the envelope's open flap needs the room above it) */
@media (min-width: 761px) {
  .how .mail { margin-top: -30svh; }
  .how .world { margin-top: -30svh; }
}
.photo { display: none; }
@media (hover: none) { .peel-me { display: none; } }

/* titles */
h1, .how h2, .faq h2 { font-family: 'Working Man Sans', Phantom, sans-serif; font-weight: 400; font-style: normal; font-synthesis: none; text-transform: uppercase; letter-spacing: 0; }
h1 { display: flex; align-items: center; gap: 0.226em; letter-spacing: -0.106em; font-size: min(18.6vw, 25.5svh); }
.logo { position: relative; top: -0.008em; width: 0.776em; height: auto; margin: -0.024em; }
/* die-cut like a sticker: the logo's matching 0.024em edge is part of logo-sticker.webp */
h1 { -webkit-text-stroke: 0.048em #fff; paint-order: stroke fill; stroke-linejoin: round; }
/* each letter is its own sticker, put down by hand: a bit crooked, a bit uneven (values are in the html) */
.word { display: flex; }
.word b { position: relative; font-weight: 400; transform: translate(var(--x), var(--y)) rotate(var(--r)) scale(var(--k)); }
.word b, .logo { filter: drop-shadow(0 0.012em 0.014em #16181d66); }
.logo { rotate: 5deg; }
/* draggable with a mouse (peel.js). Once something has moved, the title sits above the page but under placed stickers */
@media (hover: hover) and (min-width: 761px) {
  h1 { pointer-events: none; }
  .word b, .logo { pointer-events: auto; cursor: grab; transition: scale 0.15s, filter 0.15s; }
  h1.loose { z-index: 9; }
  .word .up, .logo.up { scale: 1.08; filter: drop-shadow(0 0.05em 0.05em #16181d73); }
}
.how h2, .faq h2 { font-size: clamp(2rem, 4.4vw, 4.1rem); line-height: 1.02; }

@media (max-width: 760px) {
  .edge { height: 78px; margin-top: -78px; background-size: auto 78px; }
  .falling img:nth-child(even) { display: none; }
  #stage, .peel-me, #peel { display: none; }
  .photo { display: block; width: 100%; height: auto; margin-bottom: 2rem; }
  .piles { --u: 13.5vw; }
  .how h2 { font-size: 2rem; }
  nav a:not(.solid) { display: none; }
  h1 { font-size: 17.7vw; }
  .hero { padding-bottom: 12svh; }
  .video { width: calc(100% - 2rem); }
  .how article { width: 100%; height: auto; padding: 3rem 0; }
  .how article:first-of-type { padding-top: 7rem; }
  .how .mail, .how .world, .how .start { grid-template-columns: 1fr; row-gap: 2rem; height: auto; padding: 4rem 0; }
  .world > .globe { order: 0; }
  .how .start { padding: 1rem 0 8rem; }
  .how .join { width: 100%; padding: 1.3rem; }
  .mail > .mailer { width: min(60vw, 20rem); }
  .mailer { margin: min(33vw, 11rem) auto 0; }
  .how p { margin-top: 0.8rem; font-size: 1.15rem; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .clouds canvas, .clouds canvas + canvas { animation: none; } .falling img { animation-play-state: paused; } }
