/* ===================================================================
   footprint.moe — field journal of an urban cartographer-skater
   The Tilted Pasteboard: rotated container, collaged rotated plates,
   footprint spine, wave-form ripple rings, sunrise spray gradient.
=================================================================== */

:root{
  --pulp:#f6efe1;
  --asphalt:#1c2238;
  --coral:#ff8a6b;
  --magenta:#e64aa1;
  --cyan:#56d3d6;
  --lemon:#f7e26b;
  --mint:#c8ebd0;
  --peach:#ffd9c4;
  --postal:#d8362b;
  --pencil:#6a665a;
  --gradient-spray:linear-gradient(118deg,#ff8a6b 0%,#e64aa1 38%,#56d3d6 71%,#f7e26b 100%);

  --f-display:'Archivo Black',system-ui,sans-serif;
  --f-ui:'Space Grotesk',system-ui,sans-serif;
  --f-hand:'Caveat',cursive;
  --f-mono:'DM Mono',monospace;
}

*{box-sizing:border-box;margin:0;padding:0;}

html{scroll-behavior:smooth;}

body{
  background:var(--pulp);
  color:var(--asphalt);
  font-family:var(--f-ui);
  overflow-x:hidden;
  position:relative;
}

/* paper grain over everything */
.grain-layer{
  position:fixed; inset:0; pointer-events:none; z-index:60;
  mix-blend-mode:multiply; opacity:1;
}
.grain-layer svg{display:block;width:100%;height:100%;}

/* ---------- the tilted pasteboard ---------- */
#pasteboard{
  position:relative;
  width:100%;
  margin:0 auto;
  transform:rotate(-3.2deg) scale(1.04);
  transform-origin:50% 0;
  /* a logical canvas tall enough for 5 collaged plates */
  min-height:4600px;
  padding:60px 0 200px;
  background:
    radial-gradient(60vw 40vh at 20% 6%, rgba(255,138,107,.10), transparent 70%),
    radial-gradient(50vw 35vh at 86% 40%, rgba(86,211,214,.10), transparent 70%),
    radial-gradient(55vw 40vh at 30% 78%, rgba(230,74,161,.09), transparent 70%);
}

/* ---------- footprint spine (fixed, behind plates) ---------- */
#spine{
  position:fixed; inset:0; width:100vw; height:100vh;
  z-index:1; pointer-events:none;
  transform:rotate(-3.2deg) scale(1.04);
  transform-origin:50% 0;
}
#spine .foot-glyph path,
#spine .foot-glyph ellipse{
  fill:url(#gradSprayV);
  fill-opacity:.35;
  stroke:var(--asphalt);
  stroke-width:1.5;
  paint-order:stroke;
}
#spine .foot-glyph{
  opacity:0;
  transition:opacity .55s ease;
}
#spine .foot-glyph.lit{opacity:1;}

#spine .ripple-ring{
  fill:none;
  stroke:url(#gradSpray);
  stroke-width:2.4;
  opacity:0;
  transform-box:fill-box;
  transform-origin:center;
  transform:scale(0);
}
#spine .foot-glyph.lit .ripple-ring{
  animation:ringOut 1100ms cubic-bezier(.16,.84,.34,1) forwards;
}
#spine .foot-glyph.lit .ripple-ring.r1{animation-delay:40ms;}
#spine .foot-glyph.lit .ripple-ring.r2{animation-delay:140ms;}
#spine .foot-glyph.lit .ripple-ring.r3{animation-delay:260ms;}
#spine .foot-glyph.lit .ripple-ring.r4{animation-delay:400ms;}

@keyframes ringOut{
  0%{opacity:0;transform:scale(0);stroke-dashoffset:600;}
  18%{opacity:.9;}
  100%{opacity:0;transform:scale(1);stroke-dashoffset:0;}
}

/* =====================================================
   PLATES — absolutely placed, individually rotated
===================================================== */
.plate{
  position:absolute;
  z-index:3;
  padding:clamp(1.4rem,3vw,3rem);
  background:rgba(246,239,225,.62);
  backdrop-filter:blur(.5px);
  box-shadow:0 14px 40px rgba(28,34,56,.12), 0 2px 6px rgba(28,34,56,.10);
}

/* washi-tape strips */
.washi{
  position:absolute;
  width:120px; height:34px;
  left:var(--wx); top:var(--wy);
  transform:rotate(var(--wr,1.4deg));
  box-shadow:0 4px 6px rgba(28,34,56,.12);
  pointer-events:none;
}
.washi-mint{background:rgba(200,235,208,.7);}
.washi-peach{background:rgba(255,217,196,.7);}

/* shared text bits */
.kicker{
  font-family:var(--f-ui); font-weight:600; letter-spacing:.04em;
  text-transform:uppercase; font-size:.78rem; color:var(--pencil);
}
.dm{font-family:var(--f-mono);}
.caveat{font-family:var(--f-hand);}

.plate-title{
  font-family:var(--f-display);
  font-size:clamp(2.6rem,6vw,5.2rem);
  line-height:.95;
  letter-spacing:-.01em;
  margin-bottom:.2em;
}
.plate-title.small-title{font-size:clamp(2rem,4.5vw,3.6rem);}
.gradient-text{
  background:var(--gradient-spray);
  -webkit-background-clip:text; background-clip:text;
  color:transparent;
  -webkit-text-stroke:1.5px var(--asphalt);
  paint-order:stroke fill;
}
.plate-label{
  font-family:var(--f-ui); font-weight:600; font-size:.74rem;
  letter-spacing:.04em; text-transform:uppercase; color:var(--pencil);
  margin-bottom:1.2rem;
}
.plate-label .dm{text-transform:none;letter-spacing:0;}

.marker-underline{
  position:relative; white-space:nowrap;
  background:linear-gradient(var(--gradient-spray)) bottom / 100% .28em no-repeat;
  background-color:transparent;
}

.margin-note{
  position:absolute;
  left:var(--mx); top:var(--my);
  transform:translate(-50%,-50%) rotate(var(--mr,-6deg));
  color:var(--pencil);
  font-size:1.25rem;
  pointer-events:none;
  z-index:5;
}

/* ---------- PLATE I — ARRIVAL ---------- */
.plate-arrival{
  left:6%; top:60px; width:70vw; max-width:980px;
  transform:rotate(-2deg);
  padding-bottom:3rem;
}
.wordmark-wrap{position:relative;margin:.6rem 0 1.4rem;}
.wordmark{width:100%;height:auto;display:block;overflow:visible;}
.wm-back{
  font-family:var(--f-display);
  font-size:150px;
  fill:var(--asphalt);
}
.wm-front{
  font-family:var(--f-display);
  font-size:150px;
  fill:url(#gradSpray);
  stroke:var(--asphalt); stroke-width:5; paint-order:stroke fill;
  /* offset slightly for screen-print misregistration; revealed by scanline clip in JS-less fallback */
  transform:translate(6px,-5px);
  clip-path:inset(0 0 0 0);
}
.wm-small{font-size:96px;}
.scanline{
  fill:none; stroke:var(--asphalt); stroke-width:4;
  opacity:.85;
  animation:scanMove 2.6s ease-in-out 1 forwards;
}
@keyframes scanMove{
  0%{transform:translateY(-10px);opacity:0;}
  10%{opacity:.85;}
  90%{opacity:.85;}
  100%{transform:translateY(280px);opacity:0;}
}
.dot-foot{
  position:absolute;
  width:46px; height:auto;
  /* sits roughly over the dot in ".moe" — second line, just after the period */
  left:6%; bottom:6%;
  transform:rotate(28deg);
}
.dot-foot path,.dot-foot ellipse{
  fill:url(#gradSprayV); fill-opacity:.4;
  stroke:var(--asphalt); stroke-width:1.5; paint-order:stroke;
}
.lede{font-size:1.6rem;color:var(--asphalt);max-width:46ch;line-height:1.5;}

/* ---------- PLATE II — THE MAP ---------- */
.plate-map{
  left:5%; top:1180px; width:62vw; max-width:880px;
  transform:rotate(4deg);
}
.block-sketch{width:100%;height:auto;display:block;margin:.4rem 0 1.4rem;filter:url(#feltTip);}
.block-sketch .ms{
  fill:none; stroke:var(--asphalt); stroke-width:4.2; stroke-linecap:round;
  transition:stroke-dasharray 1.4s ease;
}
.block-sketch .ms.thin{stroke-width:2.6;}
.block-sketch .node{fill:url(#gradSpray);stroke:var(--asphalt);stroke-width:2;}
.block-sketch .map-tag{font-family:var(--f-mono);font-size:13px;fill:var(--pencil);filter:url(#feltTip2);}

.legend-card{
  position:relative;
  display:inline-block;
  background:var(--pulp);
  padding:1rem 1.4rem 1.2rem;
  box-shadow:0 8px 22px rgba(28,34,56,.16);
  transform:rotate(-1.6deg);
  border:1px solid rgba(28,34,56,.12);
}
.legend-tape{left:30%;top:-16px;width:96px;height:26px;}
.legend-h{font-size:1.7rem;line-height:1;margin-bottom:.3rem;color:var(--asphalt);}
.legend-list{list-style:none;font-size:1.2rem;line-height:1.7;color:var(--asphalt);}
.legend-list li{display:flex;align-items:center;gap:.6rem;}
.lg-key{display:inline-block;width:34px;height:0;border-top:4px solid var(--asphalt);}
.lg-key.dashed{border-top-style:dashed;}
.lg-key.node-key{
  width:14px;height:14px;border:none;border-radius:50%;
  background:var(--gradient-spray);box-shadow:0 0 0 2px var(--asphalt) inset;
}
.legend-meta{font-size:.78rem;color:var(--pencil);margin-top:.7rem;}

/* ---------- PLATE III — THE CATALOGUE ---------- */
.plate-catalogue{
  left:24%; top:2120px; width:64vw; max-width:900px;
  transform:rotate(-1deg);
  padding-bottom:3rem;
}
.card-field{
  position:relative;
  margin-top:1.2rem;
  display:flex; flex-wrap:wrap; gap:34px 28px;
  align-items:flex-start;
}
.cat-card{
  position:relative;
  background:var(--pulp);
  border:1px solid rgba(28,34,56,.14);
  box-shadow:0 8px 20px rgba(28,34,56,.14);
  transform:rotate(var(--cr,0deg));
  transition:transform .35s cubic-bezier(.2,.8,.3,1), box-shadow .35s ease;
  padding:1rem .9rem 1.1rem;
  display:flex; flex-direction:column; gap:.4rem;
}
.cat-card.c1{width:220px;min-height:340px;}
.cat-card.c2{width:180px;min-height:260px;}
.cat-card.c3{width:280px;min-height:200px;}
.cat-card.c4{width:240px;min-height:300px;}
.cat-card:hover{
  transform:translateY(-6px) rotate(0deg);
  box-shadow:0 18px 40px rgba(28,34,56,.22);
}
.card-tape{
  left:50%; top:-15px; width:88px; height:24px;
  transform:translateX(-50%) rotate(1.4deg);
  transition:filter .35s ease, transform .35s ease;
}
.cat-card:hover .card-tape{filter:drop-shadow(0 8px 10px rgba(28,34,56,.3));transform:translateX(-50%) rotate(-2deg);}
.card-art{
  flex:1; display:flex; align-items:center; justify-content:center;
  background:rgba(255,138,107,.08);
}
.card-art svg{width:38px;height:auto;}
.card-art svg path,.card-art svg ellipse{
  fill:url(#gradSprayV);fill-opacity:.4;stroke:var(--asphalt);stroke-width:1.5;paint-order:stroke;
}
.card-num{font-size:.82rem;color:var(--postal);font-weight:400;}
.card-cap{font-size:1.18rem;line-height:1.3;color:var(--asphalt);}
.card-coord{font-size:.7rem;color:var(--pencil);}

/* ---------- PLATE IV — THE FIELD NOTES ---------- */
.plate-notes{
  right:6%; left:auto; top:3060px; width:48vw; max-width:660px;
  transform:rotate(-5deg);
  padding-bottom:2.6rem;
}
.ruled-paper{
  margin-top:1rem;
  padding:1.4rem 1.6rem 1.4rem 2.4rem;
  background:
    linear-gradient(var(--postal),var(--postal)) 6% 0 / 1.5px 100% no-repeat,
    repeating-linear-gradient(180deg, transparent 0 27px, rgba(86,211,214,.35) 27px 28px);
  background-color:#fffdf6;
  border:1px solid rgba(28,34,56,.12);
  box-shadow:0 8px 24px rgba(28,34,56,.14);
}
.fn{font-size:1.4rem;line-height:1.55;color:var(--asphalt);margin-bottom:.9rem;}
.fn-sign{color:var(--pencil);font-size:1.2rem;text-align:right;}

/* ---------- PLATE V — DEPARTURE ---------- */
.plate-departure{
  left:6%; top:3920px; width:46vw; max-width:620px;
  transform:rotate(2.6deg);
  padding-bottom:3rem;
  overflow:visible;
}
.exit-ripple{
  width:min(46vw,460px); height:auto; display:block;
  margin:1rem 0 1.2rem -4%;
  overflow:visible;
}
.exit-foot use{
  fill:url(#gradSprayV);fill-opacity:.4;stroke:var(--asphalt);stroke-width:1.5;paint-order:stroke;
}
.exit-ripple .er-ring{
  fill:none;stroke:url(#gradSpray);stroke-width:2.6;opacity:0;
  transform-box:fill-box;transform-origin:center;
}
.depart-note{font-size:1.5rem;line-height:1.5;color:var(--asphalt);max-width:34ch;}
.sig-stamp{
  display:inline-block;margin-top:1.4rem;
  font-size:.74rem;color:var(--postal);
  border:2px solid var(--postal);
  padding:.35rem .7rem;
  transform:rotate(-3deg);
  letter-spacing:.02em;
}

/* =====================================================
   responsive — keep the collage feel but un-stack a bit
===================================================== */
@media (max-width:900px){
  #pasteboard{transform:rotate(-2.4deg) scale(1.05);min-height:5200px;}
  #spine{transform:rotate(-2.4deg) scale(1.05);}
  .plate{position:absolute;}
  .plate-arrival{left:4%;width:90vw;}
  .plate-map{left:4%;width:90vw;top:1240px;}
  .plate-catalogue{left:4%;width:92vw;top:2380px;}
  .plate-notes{right:4%;width:88vw;top:3460px;}
  .plate-departure{left:4%;width:88vw;top:4400px;}
  .wm-back,.wm-front{font-size:120px;}
  .wm-small{font-size:78px;}
}
@media (max-width:560px){
  #pasteboard{min-height:6200px;}
  .plate-arrival{top:40px;}
  .plate-map{top:1100px;}
  .plate-catalogue{top:2300px;}
  .plate-notes{top:3700px;}
  .plate-departure{top:5000px;}
  .card-field{gap:28px 18px;}
  .cat-card.c3{width:240px;}
}

/* reduced motion: freeze ripples & scanline, keep static composition */
@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto;}
  .scanline{animation:none;opacity:0;}
  #spine .foot-glyph{transition:none;}
  #spine .foot-glyph .ripple-ring{opacity:.5;transform:scale(1);animation:none;}
  .block-sketch .ms{transition:none;}
}
