@font-face { font-family: "League Gothic"; src: url("fonts/league-gothic.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Libre Franklin"; src: url("fonts/libre-franklin.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }

:root {
  --door: #aa141a;
  --ink: #170c0c;
  --cream: #f4efe6;
  --curb: #f2c81e;
  --slate: #2c4a6e;
  --brown: #33211a;
  --step-h: 88px;
  --lamp: cubic-bezier(0.16, 1, 0.3, 1);
  --sign: "League Gothic", "Oswald", "Arial Narrow", sans-serif;
  --read: "Libre Franklin", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
  scrollbar-color: var(--door) var(--ink);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--ink); }
body {
  margin: 0;
  color: var(--cream);
  background: #2c1a15 url("brick.webp") center top / 620px auto;
  font: 400 1.0625rem/1.5 var(--read);
  overflow-x: clip;
}
::selection { background: var(--curb); color: var(--ink); }
:focus-visible { outline: 3px solid var(--cream); outline-offset: 3px; }
h1, h2, p { margin: 0; }
img, svg { display: block; }

/* The evening: darkness over the brick, lights washing down from the eave */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(90% 62% at 50% -8%, rgba(255, 176, 92, .34), transparent 70%),
    linear-gradient(rgba(23, 12, 12, .38), rgba(23, 12, 12, .74));
}
.dusk {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  background: #0d0508;
  opacity: 0;
  animation: dusk 2.4s var(--lamp) .2s backwards;
}
@keyframes dusk { from { opacity: .62; } to { opacity: 0; } }

.scene { position: relative; min-height: 100svh; display: flex; flex-direction: column; }
.stage {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(28px, 4vw, 72px);
  padding: 14px clamp(24px, 4vw, 64px) 0;
}

/* Sign */
.sign { display: grid; gap: 18px; justify-items: start; max-width: 460px; justify-self: end; }
.neon { position: relative; width: min(100%, 400px); }
.neon::before {
  content: "";
  position: absolute;
  inset: -16% -12%;
  background: radial-gradient(closest-side, rgba(255, 90, 44, .62), rgba(242, 200, 30, .2) 58%, transparent);
  animation: neon 1.9s linear .5s backwards, hum 6s ease-in-out 2.4s infinite;
}
.neon img { position: relative; width: 100%; height: auto; animation: neon-sign 1.9s linear .5s backwards; }
@keyframes neon { 0%, 30% { opacity: 0; } 33% { opacity: 1; } 37%, 52% { opacity: .1; } 55% { opacity: 1; } 59% { opacity: .4; } 64%, 100% { opacity: 1; } }
@keyframes neon-sign { 0%, 30% { filter: brightness(.42) saturate(.6); } 33% { filter: brightness(1.12); } 37%, 52% { filter: brightness(.55) saturate(.7); } 55% { filter: brightness(1.14); } 59% { filter: brightness(.74); } 64%, 100% { filter: none; } }
@keyframes hum { 50% { opacity: .78; } }

h1 {
  font: 400 clamp(3.25rem, 5.6vw, 5.4rem)/.96 var(--sign);
  text-transform: uppercase;
  letter-spacing: .005em;
  text-wrap: balance;
  text-shadow: 0 2px 10px rgba(23, 12, 12, .55);
}
.lede { font-size: 1.1875rem; line-height: 1.45; max-width: 26em; text-wrap: balance; text-shadow: 0 1px 6px rgba(23, 12, 12, .7); }

/* The door */
.door {
  --door-h: max(540px, calc(100svh - var(--step-h) - 14px));
  position: relative;
  align-self: end;
  height: var(--door-h);
  aspect-ratio: .6;
  max-width: 42vw;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 1.5% 1.2%;
  border: 11px solid #0e0808;
  border-bottom: 0;
  background: var(--door);
  box-shadow: 0 0 0 3px #4a2a20, 0 18px 54px 8px rgba(13, 5, 8, .62);
}
.door-top { position: absolute; top: 2.4%; left: 0; right: 0; height: 13%; }
.window {
  position: absolute;
  left: 36%;
  width: 28%;
  height: 72%;
  top: 14%;
  animation: lamp-on 1.3s var(--lamp) 1s backwards;
}
@keyframes lamp-on { from { filter: brightness(.25); } }
.plate {
  position: absolute;
  right: 4%;
  top: 0;
  width: 15%;
  aspect-ratio: .72;
  border: 2px solid var(--ink);
  background: #b9b6b0 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14'%3E%3Cpath d='M3 5l2-2M10 12l2-2M9 3l2 2M2 9l2 2' stroke='%23170c0c' stroke-opacity='.6' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
}
.handle { position: absolute; left: 5%; top: 22%; width: 6%; height: auto; }
.art { position: relative; width: 100%; aspect-ratio: 2680 / 3840; }
.art > img, .art > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ember {
  position: absolute;
  left: 2%;
  right: 2%;
  bottom: 0;
  height: 11%;
  background: radial-gradient(50% 50% at 50% 60%, rgba(255, 150, 40, .58), transparent);
  animation: ember 3.8s ease-in-out infinite;
}
@keyframes ember { 50% { opacity: .5; } }

.lick { transform-box: fill-box; transform-origin: 50% 100%; animation: lick 3.2s ease-in-out infinite alternate; }
.lick-b { animation-duration: 2.7s; animation-delay: -.8s; }
.lick-c { animation-duration: 3.6s; animation-delay: -1.5s; }
.lick-d { animation-duration: 2.9s; animation-delay: -2.1s; }
@keyframes lick {
  from { transform: skewX(-1.5deg) scaleY(.985); }
  to { transform: skewX(1.8deg) scaleY(1.035); }
}
.door.resting .lick, .door.resting .ember { animation-play-state: paused; }
.pupil { will-change: transform; }

/* Plaques: screwed to the wall like the ones on the door */
.plaques { display: grid; gap: 16px; justify-items: start; align-content: center; max-width: 420px; }
.plaque {
  --screw: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, .62) 0 1.6px, rgba(0, 0, 0, .45) 2.4px, transparent 3px);
  padding: 16px 22px 17px;
  background:
    var(--screw) 6px 6px / 8px 8px no-repeat,
    var(--screw) calc(100% - 6px) 6px / 8px 8px no-repeat,
    var(--screw) 6px calc(100% - 6px) / 8px 8px no-repeat,
    var(--screw) calc(100% - 6px) calc(100% - 6px) / 8px 8px no-repeat,
    var(--bg);
  color: var(--fg);
  box-shadow: 0 3px 4px rgba(13, 5, 8, .4), 0 12px 26px rgba(13, 5, 8, .42);
}
.plaque h2 { font: 400 clamp(1.85rem, 2.65vw, 2.5rem)/1.02 var(--sign); text-transform: uppercase; letter-spacing: .012em; text-wrap: balance; margin-bottom: 7px; }
.plaque p { font-size: 1rem; line-height: 1.42; }
.plaque a { color: inherit; text-underline-offset: .18em; font-weight: 600; white-space: nowrap; }
.blue { --bg: var(--slate); --fg: var(--cream); }
.brown { --bg: var(--brown); --fg: #f6e2b8; width: 94%; }
.cream { --bg: var(--cream); --fg: var(--ink); width: 88%; }

/* The story: a card table under a hanging lamp */
html { scroll-behavior: smooth; }
.story { position: relative; padding: clamp(44px, 7vw, 92px) 20px clamp(48px, 7vw, 96px); background: radial-gradient(70% 90% at 50% 0, #2f6a4d, #1d4631 62%, #143324); box-shadow: inset 0 10px 22px rgba(13, 5, 8, .5); }
.table { max-width: 1080px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: clamp(28px, 5vw, 72px); align-items: center; }
.story-text { display: grid; gap: 18px; max-width: 36rem; font-size: 1.1875rem; line-height: 1.5; }
.story h2 { font: 400 clamp(3rem, 7vw, 5rem)/1 var(--sign); text-transform: uppercase; letter-spacing: .005em; }
.story .punch { font: 400 clamp(2.5rem, 6vw, 3.75rem)/1 var(--sign); text-transform: uppercase; letter-spacing: .01em; color: var(--curb); text-wrap: balance; }
.story .toast { font: 400 clamp(1.85rem, 3.4vw, 2.5rem)/1 var(--sign); text-transform: uppercase; letter-spacing: .012em; }

.hand { --w: clamp(84px, 11vw, 132px); position: relative; width: calc(var(--w) * 3.7); height: calc(var(--w) * 2); }
.card {
  position: absolute;
  left: calc(50% - var(--w) / 2);
  bottom: 0;
  width: var(--w);
  height: calc(var(--w) * 1.4);
  display: grid;
  place-items: center;
  background: var(--cream);
  border: 1px solid rgba(23, 12, 12, .55);
  box-shadow: 0 2px 3px rgba(13, 5, 8, .4), 0 10px 18px rgba(13, 5, 8, .4);
  transform-origin: 50% 130%;
  transform: rotate(var(--r));
  transition: transform .9s var(--lamp) var(--d);
}
.card > svg { width: 36%; }
.card .rank { position: absolute; top: 6%; left: 8%; display: grid; justify-items: center; gap: 2px; width: 22%; font: 400 calc(var(--w) * .2)/1 var(--sign); }
.card .rank b { font-weight: 400; }
.card .rank.flip { top: auto; left: auto; bottom: 6%; right: 8%; transform: rotate(180deg); }
.card .rank svg { width: 100%; }
.c1 { --r: -30deg; --d: 0s; }
.c2 { --r: -15deg; --d: .05s; }
.c3 { --r: 0deg; --d: .1s; }
.c4 { --r: 15deg; --d: .15s; }
.c5 { --r: 30deg; --d: .2s; }
.wild { z-index: 1; transform: translateY(-9%); }
.wild img { width: 78%; height: auto; }
.hand.dealt-out .card { transform: rotate(-4deg); transition: none; }

/* Designer credit, on the wall above the step */
.credit { position: relative; margin: 0; padding: 20px 16px 22px; text-align: center; font: 400 1rem/1.4 var(--read); }
.credit a { color: var(--cream); text-decoration: none; text-shadow: 0 1px 6px rgba(23, 12, 12, .7); }
.credit .heart { color: var(--curb); }
@media (hover: hover) { .credit a:hover { text-decoration: underline; text-underline-offset: .2em; } }

/* The yellow step */
.step {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: 12px;
  min-height: var(--step-h);
  padding: 13px clamp(14px, 3vw, 40px) calc(13px + env(safe-area-inset-bottom));
  background: linear-gradient(#f7d43a, var(--curb) 22%, #dcb013);
  box-shadow: 0 -2px 0 #fbe88c, 0 -12px 28px rgba(13, 5, 8, .5);
}
.act {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .32em;
  min-height: 56px;
  padding: 2px 26px 0;
  font: 400 1.8rem/1 var(--sign);
  text-transform: uppercase;
  letter-spacing: .02em;
  white-space: nowrap;
  color: var(--ink);
  text-decoration: none;
  border: 3px solid var(--ink);
  transition: background-color .16s, color .16s, transform .12s;
}
.act.primary { background: var(--ink); color: var(--curb); }
.act:focus-visible { outline-color: var(--ink); }
.act:active { transform: translateY(1px) scale(.985); }
@media (hover: hover) {
  .act:hover { background: var(--ink); color: var(--curb); }
  .act.primary:hover { background: var(--door); color: var(--cream); border-color: var(--door); }
}

/* Landscape tablets: the door keeps its full height beside everything else */
@media (min-width: 761px) and (max-width: 1100px) and (min-height: 501px) and (orientation: landscape) {
  .stage { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto 1fr; align-items: start; gap: 18px 32px; padding: 14px 24px 24px; }
  .sign { grid-column: 1; grid-row: 1; justify-self: start; max-width: none; gap: 10px; }
  .neon { width: 210px; }
  h1 { font-size: 3.1rem; }
  .plaques { grid-column: 1; grid-row: 2; max-width: none; gap: 12px; }
  .plaque, .brown, .cream { width: 100%; }
  .plaque h2 { font-size: 1.9rem; }
  .door { grid-column: 2; grid-row: 1 / span 2; position: sticky; top: 14px; align-self: start; max-width: none; }
}

/* Phones and portrait tablets: logo, door at full width, plaques, step always in reach */
@media (max-width: 760px), (max-width: 1100px) and (orientation: portrait), (max-height: 500px) {
  :root { --step-h: 74px; }
  body { background-size: 420px auto; }
  body::before { background: radial-gradient(120% 40% at 50% -6%, rgba(255, 176, 92, .32), transparent 70%), linear-gradient(rgba(23, 12, 12, .46), rgba(23, 12, 12, .7)); }
  .stage { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 16px 16px 30px; }
  .sign { display: contents; }
  .neon { width: min(52vw, 320px); }
  h1 { text-align: center; margin-top: -8px; }
  .door { order: 1; }
  .lede { order: 2; text-align: center; position: relative; z-index: 1; }
  .plaques { order: 3; }
  h1 { font-size: clamp(2.75rem, 12.5vw, 4.5rem); }
  .lede { font-size: 1.0625rem; }
  .door { height: auto; width: min(100%, 560px); max-width: none; aspect-ratio: auto; align-self: center; padding: 15% 1.5% 2%; border-width: 8px; border-bottom: 8px solid #0e0808; }
  .door-top { top: 2%; height: auto; aspect-ratio: 8.5; }
  .plate { width: 11%; }
  .handle { top: 13%; width: 5.4%; }
  .plaques { width: min(100%, 560px); max-width: none; gap: 14px; }
  .plaque, .brown, .cream { width: 100%; }
  .plaque h2 { font-size: clamp(2rem, 8.6vw, 2.75rem); }
  .plaque p { font-size: 1.0625rem; }
  .step { gap: 8px; padding: 9px 10px calc(9px + env(safe-area-inset-bottom)); }
  .act { flex: 0 1 auto; min-height: 54px; padding: 2px 12px 0; font-size: 1.5rem; }
}
@media (max-width: 600px) {
  .act.primary { flex: 1 1 auto; }
}
@media (max-height: 500px) {
  .neon { width: 150px; }
  h1 { font-size: 2.5rem; }
}
@media (max-width: 860px) {
  .table { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .hand { --w: min(25vw, 110px); order: -1; margin: 8px 0 14px; }
  .story-text { width: 100%; }
}
@media (max-width: 420px) {
  .act { font-size: 1.32rem; padding: 2px 8px 0; }
}
@media (max-width: 350px) {
  .act.primary span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .card { transition: none; }
  html { scroll-behavior: auto; }
  .dusk { display: none; }
  .neon::before, .neon img, .window, .ember, .lick { animation: none; }
  .act { transition: none; }
}
