/* =====================================================================================
   THE HOME PAGE STREET (a preview, built 25 Nov 2026 for Suzi King's review; not on the home page)
   Her idea, 24 Nov 2026: one snowy old street at the top of the home page, where each shop door is
   a menu item, the signs sway so people know they can click, Pip and Pockets walk down the street,
   a door opens with its own sound, and then the page changes.

   How the layout works: every piece sits on a "stage" whose picture is 1600 units wide and 900 tall.
   One unit is --u. Positions are given in units through --x, --y and --w on each piece, so the
   whole street grows and shrinks together. On a phone the stage is wider than the screen and the
   visitor slides it sideways.
   ===================================================================================== */

.st-hero {
  position: relative;
  background: #2a3350;
  /* never less than 72 percent of the street's own height, so a short window still shows the road and the dogs */
  --st-h: max(300px, 40.5vw, min(calc(100svh - 205px), max(56.25vw, 560px)));
}
.st-view {
  position: relative;
  height: var(--st-h);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.55) rgba(0,0,0,.25);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
.st-zoom {
  /* the piece that zooms toward a door when it is chosen */
  width: max(100%, calc(var(--st-h) * 16 / 9));
  transform-origin: 50% 60%;
  will-change: transform;
}
.st-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  container-type: inline-size;
  overflow: hidden;
  isolation: isolate;
}
/* What is drawn on top of what. The order of the pieces in the page is the order the Tab key visits them,
   so the drawing order is set here instead. */
.st-plate { z-index: 0; }
.st-door-open, .st-far { z-index: 1; }
.st-post { z-index: 2; }
.st-glow { z-index: 3; }
.st-shadow { z-index: 4; }
.st-dog { z-index: 5; }
.st-rabbit, .st-cat { z-index: 6; }
.st-door { z-index: 7; }
/* A nearer sign hangs in front of the one behind it, on both sides of the street (25 Nov 2026: on the left side
   the farther signs were drawn over the nearer ones, because they come later in the page). */
.st-sign { z-index: 8; }
.st-sign[data-shop="videos"], .st-sign[data-shop="about"] { z-index: 9; }
.st-sign[data-shop="websites"], .st-sign[data-shop="free-tools"] { z-index: 10; }
.st-sign[data-shop="learn"], .st-sign[data-shop="blog"] { z-index: 11; }
.st-snow { z-index: 12; }
/* On wide screens the stage is taller than the view. Lift it, so a little sky and a little road
   are left out instead of all of the road. */
.st-zoom { margin-top: min(0px, calc((var(--st-h) - 56.25vw) * 0.3)); }

.st-stage > * { position: absolute; }
.st-stage { --u: calc(100cqw / 1600); }

.st-plate {
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  max-width: none;
  user-select: none;
  -webkit-user-drag: none;
}

/* A piece placed by its top left corner and width, in stage units */
.st-at {
  left: calc(var(--x) * var(--u));
  top: calc(var(--y) * var(--u));
  width: calc(var(--w) * var(--u));
}

/* ---------- open doors ---------- */
.st-door-open {
  height: calc(var(--h) * var(--u));
  opacity: 0;
  /* closing: the empty doorway stays until the door has swung shut */
  transition: opacity .2s ease .62s;
  pointer-events: none;
  max-width: none;
}
.st-door-open.is-open { opacity: 1; transition: opacity .14s ease 0s; }

/* ---------- the doors themselves: each painted door swings into its shop on its hinge side ---------- */
.st-leaf {
  height: calc(var(--h) * var(--u));
  z-index: 1;
  pointer-events: none;
  /* the mask is the door's own shape, so the swinging door never shows outside its doorway
     or over the small tree or the cart standing in front of it */
  -webkit-mask-size: 100% 100%; mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
}
.st-leaf img {
  position: absolute; inset: 0; width: 100%; height: 100%; max-width: none;
  /* every handle is on the right, so every hinge is on the left; the far edge of the swinging door shrinks
     toward the street's horizon (--py). The depth is written inside the transform, because Safari ignores
     a "perspective" set on a masked box. */
  transform-origin: 0 calc(var(--py) * var(--u));
  transform: perspective(calc(900 * var(--u))) rotateY(0deg);
  transition: transform .78s cubic-bezier(.33, .08, .3, 1), filter .78s ease;
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
}
.st-leaf.is-open img { transform: perspective(calc(900 * var(--u))) rotateY(58deg); filter: brightness(.8); }
.st-door {
  /* the clickable area over a door */
  height: calc(var(--h) * var(--u));
  cursor: pointer;
  border-radius: calc(4 * var(--u));
}

/* ---------- glows ---------- */
.st-glow {
  left: calc(var(--x) * var(--u));
  top: calc(var(--y) * var(--u));
  width: calc(var(--r) * 2 * var(--u));
  height: calc(var(--r) * 2 * var(--u));
  margin: calc(var(--r) * -1 * var(--u)) 0 0 calc(var(--r) * -1 * var(--u));
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,226,160,.95) 0%, rgba(255,205,120,.55) 28%, rgba(255,190,100,0) 70%);
  mix-blend-mode: screen;
  pointer-events: none;
  opacity: .25;
  animation: st-twinkle var(--d, 3.1s) ease-in-out var(--delay, 0s) infinite;
}
@keyframes st-twinkle {
  0%, 100% { opacity: .12; }
  45% { opacity: .95; }
  60% { opacity: .55; }
}

/* ---------- the far end: someone crossing ---------- */
.st-far {
  left: calc(716 * var(--u));
  top: calc(484 * var(--u));
  width: calc(184 * var(--u));
  height: calc(84 * var(--u));
  overflow: hidden;
  pointer-events: none;
}
/* The walker and the car cross on the side street in front of the far building. They are sized against that
   building's shop windows (Suzi, 25 Nov 2026: they looked "super short" and sat below the store). */
.st-far > * { position: absolute; bottom: calc(15 * var(--u)); left: 0; }
.st-walker { width: calc(28 * var(--u)); height: auto; transform: translateX(calc(-40 * var(--u))); }
.st-car { width: calc(96 * var(--u)); height: auto; bottom: calc(12 * var(--u)); transform: translateX(calc(-120 * var(--u))); }
.st-walker.is-going { animation: st-cross 15s linear forwards; }
.st-walker.is-going.is-back { animation-name: st-cross-back; }
.st-car.is-going { animation: st-cross-car 6.5s linear forwards; }
.st-walker .st-leg-a, .st-walker .st-leg-b { transform-box: fill-box; transform-origin: 50% 0; }
.st-walker.is-going .st-leg-a { animation: st-leg .55s ease-in-out infinite alternate; }
.st-walker.is-going .st-leg-b { animation: st-leg .55s ease-in-out infinite alternate-reverse; }
@keyframes st-leg { from { transform: rotate(-16deg); } to { transform: rotate(16deg); } }
@keyframes st-cross { from { transform: translateX(calc(-30 * var(--u))); } to { transform: translateX(calc(196 * var(--u))); } }
@keyframes st-cross-back { from { transform: translateX(calc(196 * var(--u))) scaleX(-1); } to { transform: translateX(calc(-30 * var(--u))) scaleX(-1); } }
@keyframes st-cross-car { from { transform: translateX(calc(-110 * var(--u))); } to { transform: translateX(calc(200 * var(--u))); } }

/* ---------- the dogs, the cat and the rabbit ---------- */
.st-dog, .st-cat, .st-rabbit {
  left: 0; top: 0;
  background-repeat: no-repeat;
  pointer-events: none;
  will-change: transform;
}
.st-dog {
  width: calc(var(--fw) * var(--u));
  height: calc(var(--fh) * var(--u));
  background-size: 1600% 100%;
  animation: st-frames16 var(--stride, 1.19s) steps(16) infinite;
  transform-origin: 0 0;
}
.st-dog.is-still { animation-play-state: paused; }
@keyframes st-frames16 { from { background-position: 0 0; } to { background-position: calc(100% * 16 / 15) 0; } }
.st-pip { background-image: url("pip-walk.webp"); }
.st-pockets { background-image: url("pockets-walk.webp"); }
.st-shadow {
  left: 0; top: 0;
  width: calc(150 * var(--u));
  height: calc(34 * var(--u));
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(40,20,20,.38) 0%, rgba(40,20,20,.16) 45%, rgba(40,20,20,0) 72%);
  pointer-events: none;
  transform-origin: 0 0;
}
.st-cat {
  width: calc(var(--fw) * var(--u));
  height: calc(var(--fh) * var(--u));
  background-image: url("cat-walk.webp");
  background-size: 400% 100%;
  animation: st-frames4 .62s steps(4) infinite;
  opacity: 0;
  transform-origin: 0 0;
}
@keyframes st-frames4 { from { background-position: 0 0; } to { background-position: calc(100% * 4 / 3) 0; } }
.st-rabbit {
  width: calc(64 * var(--u));
  height: calc(32 * var(--u));
  background-image: url("rabbit.webp");
  background-size: 100% 100%;
  opacity: 0;
  transform-origin: 0 0;
}

/* ---------- the hanging signs (each one is a link) ---------- */
/* hidden until the street picture and the sign board have arrived (street.js adds .is-ready), so a slow
   connection never shows the words floating on an empty street */
.st-hero:not(.is-ready) .st-sign, .st-hero:not(.is-ready) .st-post { visibility: hidden; }
.st-sign {
  display: block;
  aspect-ratio: 640 / 446;
  text-decoration: none;
  color: #3a2314;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}
.st-sign img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  max-width: none; display: block; pointer-events: none; user-select: none;
}
.st-sign.st-right img { transform: scaleX(-1); }
.st-board {
  position: absolute; inset: 0;
  transform-origin: 53% 27%;
  animation: st-sway var(--sway, 4.6s) ease-in-out var(--delay, 0s) infinite alternate;
  filter: drop-shadow(0 calc(4 * var(--u)) calc(5 * var(--u)) rgba(20,10,10,.35));
}
.st-sign.st-right .st-board { transform-origin: 47% 27%; }
@keyframes st-sway { from { transform: rotate(-2.6deg); } to { transform: rotate(2.6deg); } }
.st-sign:hover .st-board, .st-sign:focus-visible .st-board, .st-sign.is-hot .st-board {
  animation-duration: .9s;
}
.st-label {
  position: absolute;
  left: 13%; top: 60.5%; width: 81%; height: 32%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif, 'Boska', Georgia, serif);
  font-weight: 600;
  font-size: calc(var(--w) * var(--fs, .135) * var(--u));
  line-height: 1;
  letter-spacing: .03em;
  text-transform: uppercase;
  white-space: nowrap;
  text-shadow: 0 1px 0 rgba(255,245,225,.6);
}
.st-sign.st-right .st-label { left: 6%; }
.st-sign:focus-visible .st-label, .st-post:focus-visible .st-post-label {
  /* a dark ring with a light ring around it, so the mark shows on the pale board and on the dark street */
  outline: max(2px, calc(3 * var(--u))) solid #2b1d18;
  outline-offset: max(2px, calc(3 * var(--u)));
  box-shadow: 0 0 0 max(5px, calc(8 * var(--u))) #fff;
  border-radius: calc(3 * var(--u));
}
.st-sign:hover .st-label, .st-sign.is-hot .st-label { color: #7a2e22; }

/* ---------- the signpost for Mara's Town ---------- */
.st-post {
  display: block;
  aspect-ratio: 1038 / 2403;
  text-decoration: none;
  color: #3a2314;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
.st-post img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; pointer-events: none; }
.st-post-label {
  position: absolute;
  left: 4%; top: 22.5%; width: 78%; height: 10.6%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif, 'Boska', Georgia, serif);
  font-weight: 600;
  font-size: calc(var(--w) * .135 * var(--u));
  line-height: 1;
  white-space: nowrap;
  letter-spacing: 0;
}
.st-post:hover .st-post-label { color: #7a2e22; }
/* the lantern on top of the post: a warm halo that flickers a little */
.st-post-lamp {
  position: absolute; left: 38.2%; top: 11.6%; width: 130%; aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,216,134,.8) 0%, rgba(255,198,106,.36) 24%, rgba(255,186,90,0) 66%);
  pointer-events: none;
  animation: st-lamp 4.3s ease-in-out infinite;
}
@keyframes st-lamp {
  0%, 100% { opacity: .8; } 12% { opacity: 1; } 31% { opacity: .72; } 47% { opacity: .95; } 63% { opacity: .78; } 78% { opacity: 1; }
}
/* the lantern's light falling on the sign board and the top of the pole (kept to the painted post by a mask) */
.st-post-spill {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 95% 26% at 38% 16%, rgba(255,206,120,.42) 0%, rgba(255,196,104,.2) 55%, rgba(255,190,100,0) 100%);
  -webkit-mask: url(signpost.webp) 0 0 / 100% 100% no-repeat;
  mask: url(signpost.webp) 0 0 / 100% 100% no-repeat;
  pointer-events: none;
}
/* the small bulbs wound around the pole */
.st-post-bulb {
  position: absolute; width: 15%; aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,236,180,.95) 0%, rgba(255,212,130,.5) 30%, rgba(255,190,100,0) 70%);
  pointer-events: none;
  opacity: .3;
  animation: st-twinkle var(--d, 2.6s) ease-in-out var(--delay, 0s) infinite;
}
.st-post { animation: st-post-nod 5.5s ease-in-out infinite alternate; transform-origin: 50% 100%; }
@keyframes st-post-nod { from { transform: rotate(-.7deg); } to { transform: rotate(.7deg); } }

/* ---------- snow ---------- */
.st-snow { inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* ---------- the picture of the inside of a shop, shown as its door opens ---------- */
.st-inside {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: 0; pointer-events: none;
  transition: opacity .5s ease;
  z-index: 6;
}
.st-inside.is-on { opacity: 1; }

/* ---------- the buttons on top of the street ---------- */
.st-ui {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: space-between; align-items: flex-end;
  padding: 0 14px 14px;
  pointer-events: none;
  z-index: 5;
}
.st-btn {
  pointer-events: auto;
  font-family: var(--font-sans, 'Josefin Sans', sans-serif);
  font-size: .82rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: #2b1d18; background: rgba(250,244,236,.92);
  border: 1px solid rgba(60,35,25,.35); border-radius: 999px;
  padding: 11px 18px 9px; min-height: 44px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,.28);
}
.st-btn:hover { background: #fff; }
.st-btn:focus-visible { outline: 3px solid #2b1d18; outline-offset: 2px; box-shadow: 0 0 0 6px #fff; }
.st-btn:disabled { opacity: .45; cursor: default; }
.st-look { display: none; gap: 8px; pointer-events: none; }
.st-hero.can-slide .st-look { display: flex; }
.st-look .st-btn { min-width: 44px; padding: 11px 14px 9px; font-size: 1.05rem; line-height: 1; }

/* ---------- Suzi's own words, under the street (unchanged from the home page) ---------- */
.st-intro { padding: 56px 24px 64px; text-align: center; }
.st-intro .hero-text { max-width: 720px; margin: 0 auto; padding: 0; }
.st-intro .hero-sub { justify-content: center; }
.st-intro .hero-sub::before { display: none; }
.st-intro .hero-body { max-width: 560px; margin-left: auto; margin-right: auto; }
.st-intro .hero-btns { justify-content: center; align-items: center; }

/* ---------- a note that only shows on this preview ---------- */
.st-preview-note {
  background: #fff7d6; color: #3b2f12; text-align: center;
  font-family: var(--font-sans, 'Josefin Sans', sans-serif); font-size: .9rem; padding: 9px 14px; margin: 0;
}

/* ---------- nothing sways or twinkles while the street is out of view or the tab is hidden ---------- */
.st-hero.is-paused .st-board, .st-hero.is-paused .st-post, .st-hero.is-paused .st-glow,
.st-hero.is-paused .st-post-lamp, .st-hero.is-paused .st-post-bulb,
.st-hero.is-paused .st-dog, .st-hero.is-paused .st-cat { animation-play-state: paused; }

/* ---------- narrow screens: a taller street, so the far signs can be read ---------- */
@media (max-width: 700px) {
  .st-hero { --st-h: max(300px, min(calc(100svh - 130px), max(56.25vw, 620px))); }
  .st-btn { font-size: .78rem; }
}

/* ---------- less movement for people who ask for it ---------- */
@media (prefers-reduced-motion: reduce) {
  .st-board, .st-post, .st-glow, .st-dog, .st-cat, .st-post-lamp, .st-post-bulb { animation: none !important; }
  .st-glow, .st-post-bulb { opacity: .6; }
  .st-door-open, .st-door-open.is-open, .st-inside, .st-leaf img { transition: none; }
}

/* ---------- the preview of the picture inside each shop (street-preview-inside.html) ---------- */
.st-inside-page { margin: 0 0 8px; }
.st-inside-top { position: relative; height: min(62svh, 56.25vw); min-height: 260px; overflow: hidden; background: #2b1d18; }
.st-inside-top img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 60%; max-width: none; }
.st-inside-top::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 0% 100%, rgba(25,14,10,.82) 0%, rgba(25,14,10,.45) 28%, rgba(25,14,10,0) 55%); }
.st-inside-name {
  position: absolute; left: 0; bottom: 22px; z-index: 1; margin: 0; padding: 0 clamp(20px, 5vw, 64px);
  text-align: left; color: #fff8ee; text-shadow: 0 2px 14px rgba(0,0,0,.7);
}
.st-inside-words { max-width: 720px; margin: 0 auto; padding: 32px 24px 48px; text-align: center; }
.st-inside-words p { margin-bottom: 20px; }
