/* The Town: a side-scrolling clay diorama. Scrolling is the camera. Each layer is built from separate cut-out pieces and moves at its own depth.
   --u is the unit of the world (1vh on desktop, smaller on phones). The camera x (--cam, in units) is set by town.js. */
body.town { background: #f3c4b0; overflow-x: clip; }
#journey { position: relative; height: calc(var(--runway, 600) * 1vh + 100svh); }
.viewport { position: sticky; top: 0; height: 100svh; overflow: hidden; background: linear-gradient(#bfd7ee 0%, #f3c9d5 46%, #f7c8a8 70%); }

.layer { position: absolute; inset: 0; will-change: transform; pointer-events: none;
  transform: translate3d(calc(var(--cam, 0) * var(--k, 1) * var(--u) * -1 + var(--mx, 0) * var(--d, 1) * var(--u)), calc(var(--my, 0) * var(--d, 1) * var(--u) * .55), 0); }
.layer > * { position: absolute; }
.layer img { display: block; user-select: none; -webkit-user-drag: none; }
.piece { left: calc(var(--x) * var(--u)); bottom: calc(var(--b, 0) * var(--u)); height: calc(var(--h) * var(--u)); width: calc(var(--w) * var(--u)); transform: translateX(-50%); }
.piece > img { height: 100%; width: 100%; }
.piece.flip { transform: translateX(-50%) scaleX(-1); }
.a, .hot { pointer-events: auto; cursor: pointer; display: block; }
.a:hover > img { animation: pop .36s steps(3) 1; filter: brightness(1.07) saturate(1.05); }
.a::after { content: attr(data-tip); position: absolute; left: 50%; top: -6px; transform: translate(-50%, -100%) scale(.9); white-space: nowrap; padding: 8px 15px; border-radius: 999px; background: var(--cream);
  font: 600 15px/1 var(--display); color: var(--navy); box-shadow: inset 0 2px 0 #fff, 0 4px 0 var(--edge), 0 12px 18px rgba(10, 21, 48, .28); opacity: 0; transition: opacity .15s, transform .15s; pointer-events: none; }
.a:hover::after, .a:focus-visible::after { opacity: 1; transform: translate(-50%, -100%) scale(1); }
@keyframes pop { 0% { transform: rotate(0); } 33% { transform: rotate(-.8deg); } 66% { transform: rotate(.7deg); } 100% { transform: rotate(0); } }

#L-plate img { position: absolute; bottom: calc(var(--pb, 12) * var(--u)); left: calc(var(--pl, 0) * var(--u)); height: calc(var(--ph, 82) * var(--u)); width: calc(var(--pw, 123) * var(--u)); max-width: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 24%); mask-image: linear-gradient(to bottom, transparent 0, #000 24%); }
#L-plate img.mir { transform: scaleX(-1); }
.cloud { animation: drift var(--t, 90s) ease-in-out infinite alternate; }
@keyframes drift { from { transform: translateX(-50%) translateX(calc(var(--u) * -12)); } to { transform: translateX(-50%) translateX(calc(var(--u) * 14)); } }
.plane { left: calc(var(--u) * -30); animation: fly 46s linear infinite; }
@keyframes fly { from { transform: translateX(0); } to { transform: translateX(calc(100vw + var(--u) * 60)); } }
.bird { animation: glide var(--g, 44s) linear infinite; }
@keyframes glide { from { transform: translateX(calc(var(--u) * (var(--x) * -1 - 12))); } to { transform: translateX(calc(100vw + var(--u) * 12 - var(--x) * var(--u))); } }
.bird > img { animation: flap var(--t, 1.4s) steps(4) infinite alternate; transform-origin: 50% 60%; }
@keyframes flap { from { transform: translateY(0) rotate(-4deg); } to { transform: translateY(calc(var(--u) * -1.3)) rotate(4deg); } }
.plane > img { animation: bank 5s ease-in-out infinite alternate; }
@keyframes bank { from { transform: translateY(0) rotate(-.6deg); } to { transform: translateY(calc(var(--u) * -.7)) rotate(.6deg); } }
.wheel-rim > img { animation: spin 130s linear infinite; transform-origin: 50.15% 41.74%; }
@keyframes spin { to { transform: rotate(360deg); } }
.hill { background-repeat: no-repeat; background-size: 100% 100%; }

.ground-far { position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--u) * 17); background: linear-gradient(#a8c08a, #8fb07a); }

/* the street, built in CSS so it never ends: grass, a stone sidewalk, a curb, the road with a dashed center line. It scrolls with the camera. */
.ground { position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--u) * 17); pointer-events: none; }
.ground i { position: absolute; left: 0; right: 0; background-position-x: calc(var(--cam, 0) * var(--u) * -1); }
.ground .grass { bottom: calc(var(--u) * 12); height: calc(var(--u) * 5); background:
   radial-gradient(circle at 50% 100%, #7fae67 0 calc(var(--u) * .9), transparent calc(var(--u) * .95)) 0 0 / calc(var(--u) * 3.2) calc(var(--u) * 2) repeat-x,
   linear-gradient(#8bba6f, #77a45f); box-shadow: 0 calc(var(--u) * -.4) 0 #a6cf8a inset; }
.ground .walk { bottom: calc(var(--u) * 7); height: calc(var(--u) * 5.2); background-image: var(--stones); background-size: calc(var(--u) * 22) calc(var(--u) * 5); background-color: #ecd9b9;
   box-shadow: inset 0 calc(var(--u) * .5) 0 #f6e8cd, inset 0 calc(var(--u) * -.4) 0 #d6bf98; }
.ground .curb { bottom: calc(var(--u) * 6.2); height: calc(var(--u) * 1.1); background: #e4d2b2; box-shadow: 0 calc(var(--u) * .45) 0 #c6ad84; }
.ground .road { bottom: 0; height: calc(var(--u) * 6.3);
   background: repeating-linear-gradient(90deg, transparent 0 calc(var(--u) * 9), rgba(255, 244, 214, .85) calc(var(--u) * 9) calc(var(--u) * 15), transparent calc(var(--u) * 15) calc(var(--u) * 24)) 0 calc(var(--u) * 3) / 100% calc(var(--u) * .55) no-repeat, linear-gradient(#7d7380, #6a6070);
   background-position-x: calc(var(--cam, 0) * var(--u) * -1), 0; }
.ground::after { content: ""; position: absolute; inset: 0; background: var(--grain); mix-blend-mode: multiply; opacity: .16; }

/* the barrier arm and the robot are real moving parts: a human lifts the gate, then the robot goes through */
.arm { position: absolute; z-index: 3; width: calc(var(--u) * 24); height: calc(var(--u) * 2.1); border-radius: calc(var(--u) * 1.1); transform-origin: calc(100% - var(--u) * 1.2) 50%;
  background: repeating-linear-gradient(90deg, #fffaf0 0 calc(var(--u) * 3), #e63a2f calc(var(--u) * 3) calc(var(--u) * 6)); box-shadow: inset 0 calc(var(--u) * .35) 0 rgba(255,255,255,.5), 0 calc(var(--u) * .5) 0 rgba(0,0,0,.22), 0 calc(var(--u) * 1.2) calc(var(--u) * 1.6) rgba(0,0,0,.2);
  transition: transform 1.1s cubic-bezier(.4, 1.4, .5, 1); }
body.gate-open .arm { transform: rotate(78deg); }
.robot { transition: left 3.8s steps(28); }
body.gate-open .robot { left: calc(var(--x2) * var(--u)); }
.robot > img { animation: wobble .5s steps(2) infinite alternate; transform-origin: 50% 100%; }
@keyframes wobble { from { transform: rotate(-.8deg); } to { transform: rotate(.8deg); } }
body:not(.gate-open) .robot > img { animation: none; }

.glow { position: absolute; inset: 0; pointer-events: none; z-index: 5; background: radial-gradient(ellipse at 50% 38%, transparent 55%, rgba(60, 20, 30, .22) 100%), linear-gradient(180deg, rgba(255, 214, 160, .1), rgba(255, 150, 120, .08)); mix-blend-mode: soft-light; }

/* header sits on top of the world */
header.top { position: fixed; z-index: 60; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 14px; padding: 16px max(22px, 3vw); transition: background .25s, box-shadow .25s, padding .25s; }
header.top.scrolled { padding-block: 10px; background: rgba(255, 250, 240, .92); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: 0 5px 0 var(--edge), 0 20px 30px rgba(30, 15, 0, .16); }
.brand { display: flex; align-items: center; gap: 10px; padding: 8px 20px 8px 10px; border-radius: 999px; background: var(--cream); font: 600 22px/1 var(--display); letter-spacing: -.01em; box-shadow: inset 0 2px 0 #fff, 0 5px 0 var(--edge), 0 14px 22px rgba(10, 21, 48, .2); }
header.top.scrolled .brand { box-shadow: none; background: none; padding: 0; } .brand img { width: 38px; height: 38px; } .brand b { color: var(--blue-btn); font-weight: 600; }
.links { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.links a:not(.btn) { padding: 14px 18px; border-radius: 999px; background: var(--cream); font: 600 16px/1 var(--display); box-shadow: inset 0 2px 0 #fff, 0 4px 0 var(--edge), 0 10px 14px rgba(10, 21, 48, .18); transition: transform .12s; }
.links a:not(.btn):hover { transform: translateY(-2px); }
header.top.scrolled .links a:not(.btn) { background: none; box-shadow: none; } header.top.scrolled .links a:not(.btn):hover { background: #f6ead3; transform: none; }
.menu-cta { display: none; }
.menu-btn { display: none; margin-left: auto; width: 48px; height: 48px; border-radius: 16px; border: 0; background: var(--cream); cursor: pointer; box-shadow: inset 0 2px 0 #fff, 0 4px 0 var(--edge); }
.menu-btn span, .menu-btn span::before, .menu-btn span::after { display: block; width: 20px; height: 2.5px; border-radius: 2px; background: var(--navy); position: relative; margin: auto; content: ""; }
.menu-btn span::before { position: absolute; top: -7px; left: 0; } .menu-btn span::after { position: absolute; top: 7px; left: 0; }
@media (max-width: 980px) {
  .links { display: none; position: absolute; left: 14px; right: 14px; top: calc(100% + 8px); flex-direction: column; align-items: stretch; gap: 4px; padding: 14px; margin: 0; background: var(--cream); border-radius: 24px; box-shadow: 0 0 0 1px var(--edge), 0 6px 0 var(--edge), 0 30px 50px rgba(30, 15, 0, .25); }
  .links.open { display: flex; } .links a:not(.btn) { padding: 15px 16px; font-size: 18px; box-shadow: none; background: none; } .menu-cta { display: inline-flex; margin-top: 6px; }
  .top-cta { display: none; } .menu-btn { display: block; }
}

/* the opening line, in clay letters in the sky; it leaves as you start walking */
.hello { position: absolute; z-index: 20; left: 50%; top: clamp(86px, 13svh, 140px); transform: translateX(-50%); margin: 0; width: min(92vw, 1100px); text-align: center; pointer-events: none; transition: opacity .4s, transform .4s; }
.hello .claytext { display: block; font: 600 clamp(38px, 6.6vw, 104px)/.98 var(--display); letter-spacing: -.015em; text-wrap: balance; }
body.walking .hello { opacity: 0; transform: translateX(-50%) translateY(-24px); }

/* the trail: where you are on the street */
.trail { position: absolute; z-index: 30; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; gap: 8px; padding: 6px 8px 8px; opacity: 1; max-width: calc(100vw - 20px); overflow-x: auto; scrollbar-width: none; }
.trail::-webkit-scrollbar { display: none; } body.walking .trail { opacity: 1; }
.trail a { --c: var(--blue); flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px 7px 7px; border-radius: 999px; background: var(--cream); font: 600 14px/1 var(--display); white-space: nowrap; cursor: pointer;
  box-shadow: inset 0 2px 0 #fff, 0 4px 0 var(--edge), 0 10px 14px rgba(10, 21, 48, .22); transition: transform .12s; }
.trail a:hover { transform: translateY(-2px); }
.trail a i { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--c); color: #fff; font: 600 12px/1 var(--display); font-style: normal; }
.trail a.on { outline: 3px solid var(--c); outline-offset: 1px; }
.trail a[data-id="studio"] i, .trail a[data-id="teardown"] i { color: var(--navy); }

/* signs stand in the street. In the wide layout they move with the world; on narrow screens the active one becomes a bottom sheet. */
.signs { position: absolute; inset: 0; z-index: 25; pointer-events: none; }
.post { position: absolute; left: 0; bottom: calc(var(--u) * 11.5); width: min(440px, 44vw); display: flex; flex-direction: column; align-items: center; opacity: 0; transition: opacity .22s; will-change: transform; }
.post.on { opacity: 1; } .post.on .sign { pointer-events: auto; }
/* The sign is sized by its own text and NEVER scrolls (Ben: scrolling inside a billboard is unnatural and fights the page scroll that walks the camera).
   town.js measures the room above the street and shrinks the sign (--fit, never below .8), then sets the extras aside (.lite), then the paragraph
   (.micro) on very short screens. Set-aside text stays readable to screen readers. */
.post .sign { --min: 11.5px; font-size: calc(16px * var(--fit, 1)); width: 100%; padding: 1.75em 1.875em 1.875em; border-width: 10px; overflow: visible; }
.post .legs { display: flex; justify-content: space-between; width: 58%; height: var(--legs, calc(var(--u) * 14)); }
.post .legs i { width: calc(var(--u) * 3.2); min-width: 18px; height: 100%; background: linear-gradient(90deg, var(--wood-light), var(--wood) 55%, var(--wood-deep)); border-radius: 0 0 6px 6px; box-shadow: inset 0 4px 0 rgba(255,255,255,.18), 2px 0 0 rgba(0,0,0,.12); }
.post .sign .chip { font-size: max(12px, .875em); }
.post .sign .chip i { width: 1.9em; height: 1.9em; font-size: .9em; }
.post .sign h2 { font-size: clamp(1.875em, 3.2vw, 2.75em); margin-top: .4em; padding-right: 0; }
.post .sign p { font-size: max(var(--min), .97em); margin-top: .8em; }
.post .sign ul { margin: .9em 0 0; padding: 0; list-style: none; display: grid; gap: .45em; }
.post .sign li { display: flex; gap: .65em; color: var(--navy-2); font-size: max(var(--min), .94em); line-height: 1.4; }
.post .sign li::before { content: ""; flex: none; width: .65em; height: .65em; margin-top: .4em; border-radius: 50%; background: var(--c); box-shadow: inset 0 2px 0 rgba(255,255,255,.4), 0 2px 0 rgba(0,0,0,.15); }
.post .sign .row { margin-top: 1.25em; gap: .75em; } .post .sign .btn { padding: .8em 1.4em; font-size: max(12.5px, 1em); }
.shopchips { display: flex; flex-wrap: wrap; gap: .45em; margin-top: .9em; }
.shopchips a { padding: .55em .85em; border-radius: 999px; background: #f6ead3; font-family: var(--sans); font-weight: 500; font-size: max(var(--min), .82em); line-height: 1; box-shadow: inset 0 2px 0 #fff, 0 3px 0 var(--edge); } .shopchips a:hover { background: #fff; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: .56em; margin-top: 1em; }
.facts div { padding: .62em .75em; border-radius: .9em; background: #f6ead3; box-shadow: inset 0 2px 0 #fff; }
.facts b { display: block; font-family: var(--display); font-weight: 600; font-size: 1em; line-height: 1.1; } .facts span { display: block; margin-top: .2em; font-size: max(var(--min), .8em); color: var(--sub); line-height: 1.35; }
.post .sign .try { font-size: max(var(--min), .8em); color: var(--sub); margin-top: .75em; }
/* set-aside text: gone from the picture, still there for screen readers (anything focusable is removed instead) */
.post.lite .sign ul, .post.lite .sign .facts, .post.lite .sign .try, .post.micro .sign p { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.post.lite .sign .shopchips { display: none; }

body.compact .post { left: 0 !important; right: 0; bottom: auto; top: 70px; width: 100%; transform: none !important; align-items: stretch; transition: opacity .35s, transform .45s; padding: 0 10px; }
body.compact .post:not(.on) { transform: translateY(-20px) !important; pointer-events: none; }
body.compact .post .legs { display: none; }
body.compact .post .sign { border-radius: 24px; border-width: 8px; padding: 1.4em 1.25em 1.5em; }
body.compact.land .post { right: auto; left: 10px !important; top: 70px; width: min(66vw, 600px); padding: 0; }
body.compact.land .post .sign { padding: 1.1em 1.5em 1.2em; }
body.compact .trail { bottom: 8px; }
body.compact .hello .claytext { font-size: clamp(38px, 12vw, 60px); }

.places { position: absolute; left: -9999px; }
.places:focus-within { left: 14px; top: 70px; z-index: 90; padding: 14px; border-radius: 18px; background: var(--cream); display: flex; flex-wrap: wrap; gap: 10px; }

@media (prefers-reduced-motion: reduce) { .cloud, .plane, .bird, .bird > img, .plane > img, .wheel-rim > img, .robot img { animation: none !important; } .layer, .arm, .robot { transition: none !important; } }


.foot { background: var(--paper); color: var(--sub); font-size: 14.5px; padding: 8px 0 44px; position: relative; z-index: 2; }
.foot .stones { margin-bottom: 18px; }
.foot .wrap-f { max-width: 1240px; margin: 0 auto; padding-inline: 28px; display: flex; flex-wrap: wrap; gap: 14px 30px; align-items: center; justify-content: space-between; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 22px; } .foot a:hover { color: var(--navy); }

/* pictures arrive after the street is already laid out: they fade in as they land */
.piece > img, .layer img, .plate img { opacity: 0; transition: opacity .5s ease; } .piece > img.in, .layer img.in, .plate img.in { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .piece > img, .layer img, .plate img { transition: none; } }

/* buttons on the signs shrink with the sign, but never below a comfortable thumb target */
.post .btn { min-height: 40px; }

/* a sign arrives with three small stop-motion beats (rise, settle, rest); nothing moves for visitors who prefer reduced motion */
@keyframes arrive { 0% { transform: translateY(18px) scale(.96) rotate(-.9deg); } 38% { transform: translateY(-4px) scale(1.012) rotate(.7deg); } 68% { transform: translateY(1px) scale(1) rotate(-.3deg); } 100% { transform: none; } }
body:not(.compact) .post.on .sign, body:not(.compact) .post.on .legs { animation: arrive .62s cubic-bezier(.3, .9, .4, 1) both; transform-origin: 50% 100%; }
@media (prefers-reduced-motion: reduce) { body:not(.compact) .post.on .sign, body:not(.compact) .post.on .legs { animation: none; } }

/* on an upright phone the opening screen keeps one plain button (the header button hides in the menu there); everyone else sees the header button */
.hello-cta { display: none; }
body.compact:not(.land) .hello-cta { display: inline-flex; position: absolute; z-index: 21; left: 50%; top: min(40svh, 330px); transform: translateX(-50%); width: max-content; max-width: 90vw; padding: 13px 24px; font-size: 16px; transition: opacity .4s; }
body.walking .hello-cta { opacity: 0; pointer-events: none; }
