/* Rootbound Exchange. Lumberyard at lantern-light: planed pine, dark walnut,
   brass fittings, ledger paper. */
:root {
  --ink: #140e09;
  --walnut: #22170f;
  --walnut-2: #2f2016;
  --pine: #c99a5f;
  --pine-lt: #e4bd84;
  --paper: #f3e7cb;
  --paper-dim: #cbbb99;
  --muted: #9a8a6f;
  --brass: #e2b25c;
  --ember: #f0833a;
  --sap: #6fe0c4;
  --wax: #a8262b;
  --line: rgba(243, 231, 203, .14);
  --display: "IM Fell English SC", Georgia, serif;
  --serif: "IM Fell English", Georgia, serif;
  --sans: "Alegreya Sans", "Segoe UI", system-ui, sans-serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--ink); color: var(--paper); font: 400 17px/1.55 var(--sans); overflow-x: hidden; }
img { display: block; max-width: 100%; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--sap); outline-offset: 3px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.axe { width: 28px; height: 28px; }

/* ------------------------------------------------------------ top bar */
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 18px; padding: 10px max(16px, calc((100vw - 1240px) / 2)); background: rgba(20, 14, 9, .82); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top__brand { display: flex; align-items: center; gap: 10px; font: 24px var(--display); text-decoration: none; }
.top__where { font: italic 17px var(--serif); color: var(--brass); }
.voice { margin-left: auto; display: flex; align-items: center; gap: 8px; padding: 7px 14px; background: none; border: 1px solid var(--line); border-radius: 99px; cursor: pointer; font-size: 14px; color: var(--paper-dim); }
.voice__icon { width: 16px; height: 16px; background: currentColor; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 9h4l5-4v14l-5-4H3z'/%3E%3Cpath d='M16 8l6 8M22 8l-6 8' stroke='black' stroke-width='2'/%3E%3C/svg%3E") center/contain no-repeat; }
.voice[aria-pressed="true"] { color: var(--sap); border-color: var(--sap); }
.voice[aria-pressed="true"] .voice__icon { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 9h4l5-4v14l-5-4H3z'/%3E%3Cpath d='M16 8a5 5 0 0 1 0 8M19 5a9 9 0 0 1 0 14' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E"); }

/* ------------------------------------------------------------ yard banner */
.yard { position: relative; height: clamp(300px, 46vh, 460px); overflow: hidden; display: flex; align-items: flex-end; }
.yard__bg { position: absolute; inset: -8% -4% -4%; background: url(/art/store_yard.webp) center 60% / cover; will-change: transform; animation: settle 2.4s var(--ease) both; }
@keyframes settle { from { transform: scale(1.12); filter: brightness(.4); } }
.yard::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20, 14, 9, .2), transparent 40%, rgba(20, 14, 9, .75) 80%, var(--ink)); }
.yard__dust { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
.yard__copy { position: relative; z-index: 2; width: min(1240px, calc(100vw - 32px)); margin: 0 auto 34px; text-shadow: 0 2px 20px rgba(0, 0, 0, .7); animation: up 1.2s var(--ease) .3s both; }
@keyframes up { from { opacity: 0; transform: translateY(30px); } }
.yard__kicker { margin: 0; font: 700 13px var(--sans); letter-spacing: .3em; text-transform: uppercase; color: var(--brass); }
.yard h1 { margin: 4px 0 6px; font: 400 clamp(44px, 7vw, 88px)/.95 var(--display); }
.yard h1 em { font-family: var(--serif); color: var(--pine-lt); }
.yard__copy p:last-child { margin: 0; max-width: 560px; color: var(--paper-dim); font-size: 18px; }

/* ------------------------------------------------------------ layout */
.shop { width: min(1240px, calc(100vw - 32px)); margin: 30px auto 80px; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: 44px; align-items: start; }

/* ------------------------------------------------------------ booth */
.booth { position: sticky; top: 76px; }
.booth__frame {
  position: relative; padding: 14px;
  background: linear-gradient(135deg, #5b3b22, #3a2515 40%, #5b3b22);
  border-radius: 14px;
  box-shadow: inset 0 0 0 2px #7c5634, inset 0 0 0 5px #2a1a0e, 0 40px 80px rgba(0, 0, 0, .6);
  transform: perspective(1100px) rotateY(var(--ry, 0deg)) rotateX(var(--rx, 0deg));
  transition: transform .6s var(--ease);
}
.booth__frame::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: repeating-linear-gradient(88deg, transparent 0 14px, rgba(0, 0, 0, .12) 14px 15px, transparent 15px 37px); pointer-events: none; }
.booth__screen { position: relative; aspect-ratio: 1280 / 714; border-radius: 6px; overflow: hidden; background: #000; box-shadow: 0 0 0 2px #1b110a; }
.booth__poster, .clip { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.clip { opacity: 0; transition: opacity .45s ease; }
.clip.is-on { opacity: 1; }
.booth__glass { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 120%, transparent 55%, rgba(0, 0, 0, .45)), linear-gradient(115deg, rgba(255, 240, 210, .08), transparent 40%); pointer-events: none; }
.booth__plate { position: absolute; left: 50%; bottom: -16px; translate: -50% 0; padding: 6px 22px 7px; text-align: center; background: linear-gradient(180deg, #f0cf86, #b98734); color: #2a1706; border-radius: 4px; box-shadow: 0 6px 16px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .5); white-space: nowrap; }
.booth__plate b { display: block; font: 22px/1 var(--display); letter-spacing: .08em; }
.booth__plate span { font: italic 13px var(--serif); }

.bubble {
  position: relative; margin: 34px 10px 0; padding: 18px 22px; min-height: 96px;
  background: var(--paper); color: #2a1a0e; border-radius: 6px 18px 18px 18px;
  font: 21px/1.4 var(--serif);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .45);
  transform-origin: 30px 0;
}
.bubble::before { content: ""; position: absolute; left: 34px; top: -12px; border: 12px solid transparent; border-top: 0; border-bottom-color: var(--paper); }
.bubble p { margin: 0; }
.bubble.pop { animation: pop .45s var(--ease); }
@keyframes pop { from { transform: scale(.94) translateY(6px); opacity: .4; } }
.bubble__caret { display: inline-block; width: 9px; height: 18px; margin-left: 2px; vertical-align: -2px; background: #7c5634; animation: caret 1s steps(1) infinite; }
.bubble.is-done .bubble__caret { opacity: 0; animation: none; }
@keyframes caret { 50% { opacity: 0; } }
.bubble .who { color: var(--wax); font-style: normal; font-family: var(--display); }

/* ------------------------------------------------------------ counter steps */
.step { position: relative; padding: 26px 26px 24px; margin-bottom: 26px; background: linear-gradient(180deg, var(--walnut-2), var(--walnut)); border: 1px solid var(--line); border-radius: 10px; }
.step__head { display: flex; align-items: center; gap: 14px; }
.step__num { width: 40px; height: 40px; display: grid; place-items: center; flex: none; font: 20px var(--display); color: var(--ink); background: radial-gradient(circle at 35% 30%, #f7d898, var(--brass) 60%, #9b6d27); border-radius: 50%; box-shadow: inset 0 -2px 3px rgba(0, 0, 0, .35); }
.step h2 { margin: 0; font: 400 30px var(--display); }
.step__hint { margin: 10px 0 18px; color: var(--paper-dim); }
.step.is-locked { opacity: .55; }

.ledger { display: flex; gap: 12px; align-items: stretch; }
.ledger__field { position: relative; flex: 1; }
.ledger input {
  width: 100%; height: 56px; padding: 0 16px;
  font: 24px var(--serif); color: #2a1a0e;
  background: repeating-linear-gradient(180deg, var(--paper) 0 27px, #d9c8a2 27px 28px), var(--paper);
  border: 0; border-radius: 4px; box-shadow: inset 0 2px 6px rgba(0, 0, 0, .25);
}
.ledger input::placeholder { color: #9d8b68; font-style: italic; }
.ledger__rule { position: absolute; left: 12px; right: 12px; bottom: 10px; height: 2px; background: var(--wax); transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease); }
.ledger input:focus + .ledger__rule { transform: scaleX(1); }
.btn { min-width: 120px; padding: 0 22px; border: 0; border-radius: 4px; cursor: pointer; font-weight: 800; letter-spacing: .03em; color: #2a1406; background: linear-gradient(180deg, #f6c16e, #d8792f); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 6px 18px rgba(216, 121, 47, .25); transition: transform .2s var(--ease), filter .2s; }
.btn:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.08); }
.btn:disabled { cursor: progress; filter: grayscale(.5) brightness(.8); }

.account { position: relative; display: flex; align-items: center; gap: 16px; margin-top: 16px; padding: 14px 16px; background: rgba(243, 231, 203, .06); border: 1px dashed rgba(226, 178, 92, .5); border-radius: 8px; animation: up .6s var(--ease); }
.account img { width: 64px; height: 64px; image-rendering: pixelated; border-radius: 4px; box-shadow: 0 4px 12px rgba(0, 0, 0, .5); }
.account__label { display: block; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.account b { font: 28px var(--display); }
.linkish { margin-left: auto; background: none; border: 0; color: var(--brass); text-decoration: underline; cursor: pointer; }
.seal { position: absolute; right: 90px; top: 50%; width: 56px; height: 56px; margin-top: -28px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #d2443f, var(--wax) 55%, #6d1418); box-shadow: 0 4px 10px rgba(0, 0, 0, .5); animation: stamp .6s var(--ease) .15s both; }
.seal::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; font: 26px var(--display); color: rgba(255, 220, 200, .85); }
@keyframes stamp { from { transform: scale(2.4) rotate(-20deg); opacity: 0; } 60% { transform: scale(.9); opacity: 1; } }
.error { min-height: 1.4em; margin: 10px 0 0; color: #ff9d86; }

/* ------------------------------------------------------------ goods */
.goods { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 22px; margin-top: 20px; }
.good {
  position: relative; padding: 42px 18px 18px; text-align: center;
  background: linear-gradient(180deg, #e8c48f, #cf9f62 60%, #b9864a);
  color: #2a1a0e; border-radius: 8px 8px 12px 12px;
  box-shadow: inset 0 0 0 2px rgba(255, 240, 210, .35), 0 20px 40px rgba(0, 0, 0, .45);
  transform-origin: 50% -30px;
  animation: hang 5s ease-in-out infinite; animation-delay: calc(var(--i, 0) * -1.3s);
  transition: filter .3s;
}
.good::before { content: ""; position: absolute; left: 50%; top: -30px; width: 2px; height: 34px; background: #6b4a2b; }
.good::after { content: ""; position: absolute; left: 50%; top: 10px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--walnut); box-shadow: inset 0 0 0 3px #8b6337; }
@keyframes hang { 50% { transform: rotate(1.6deg); } }
.good:hover { animation-play-state: paused; filter: brightness(1.06); }
.good__art { height: 150px; display: grid; place-items: center; margin-bottom: 8px; }
.good__art img { max-height: 150px; width: auto; filter: drop-shadow(0 10px 12px rgba(60, 30, 10, .45)); transition: transform .6s var(--ease); }
.good:hover .good__art img { transform: translateY(-6px) rotate(-3deg) scale(1.04); }
.good__tag { position: absolute; top: 34px; left: 12px; padding: 2px 8px; font: 700 11px var(--sans); letter-spacing: .12em; text-transform: uppercase; background: #2a1a0e; color: var(--pine-lt); border-radius: 3px; }
.good h3 { margin: 0 0 6px; font: 24px/1.05 var(--display); }
.good p { margin: 0 0 14px; font-size: 15px; color: #4a3220; }
.good__buy { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.good__price { font: 26px var(--display); }
.good .btn { min-width: 0; height: 42px; }
.good.is-out { filter: saturate(.55) brightness(.85); }
.good.is-out::after { background: #3a2a1d; }
.stamp { position: absolute; top: 118px; left: 50%; translate: -50% -50%; rotate: -14deg; padding: 4px 14px; font: 22px var(--display); letter-spacing: .08em; color: var(--wax); border: 3px double var(--wax); border-radius: 4px; background: rgba(243, 231, 203, .7); pointer-events: none; }

/* ------------------------------------------------------------ how + foot */
.how { padding: 22px 26px; border-left: 3px solid var(--brass); background: rgba(243, 231, 203, .04); border-radius: 0 8px 8px 0; }
.how h3 { margin: 0 0 8px; font: 22px var(--display); }
.how ol { margin: 0; padding-left: 20px; color: var(--paper-dim); }
.foot { padding: 34px 16px 50px; text-align: center; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.foot__small { font-size: 12px; }

/* ------------------------------------------------------------ thanks page */
.thanks { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 60px 16px; }
.thanks h1 { font: 400 clamp(40px, 6vw, 70px)/1 var(--display); margin: 0 0 16px; }
.thanks p { max-width: 560px; margin: 0 auto 14px; color: var(--paper-dim); }
.thanks .btn { display: inline-flex; align-items: center; height: 50px; text-decoration: none; margin-top: 14px; }

@media (max-width: 900px) {
  .shop { grid-template-columns: 1fr; gap: 26px; }
  .booth { position: relative; top: 0; }
  .bubble { font-size: 19px; }
}
@media (max-width: 520px) {
  .ledger { flex-direction: column; }
  .ledger .btn { height: 50px; }
  .top__where { display: none; }
  .seal { display: none; }
  .step { padding: 20px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
}
