@font-face {
  font-family: Patrick Hand;
  src: url("assets/fonts/patrick-hand.woff2") format("woff2");
  font-display: swap;
}

:root {
  color: #19432e;
  background: #fff8e8;
  font: 1rem/1.45 system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 3px solid #21628a; outline-offset: 3px; }

.entry-nav {
  width: min(100% - 2rem, 75rem);
  min-height: 4rem;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  font-size: .9rem;
  font-weight: 700;
}
.entry-brand { display: flex; align-items: center; gap: .5rem; text-decoration: none; }
.entry-layout {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  width: min(100% - 2rem, 75rem);
  margin: .35rem auto 2rem;
  min-height: 35rem;
  overflow: hidden;
  border: 1px solid #d4ddbb;
  border-radius: 1.5rem;
  background: #fffdf5;
  box-shadow: 0 .8rem 2.2rem #19432e14;
}
.entry-scene {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 35rem;
  background:
    radial-gradient(ellipse at 50% 47%, transparent 28%, #476b1d16 100%),
    #d8ecd1 url("assets/brain-story/picture-book-meadow.webp") center / cover;
}
.entry-window {
  position: absolute;
  inset: 12% 25% 23%;
  border: clamp(5px, 1vw, 12px) solid #f7d389;
  border-radius: 48% 48% .4rem .4rem / 35% 35% .4rem .4rem;
  background: #cceafb url("assets/brain-story/picture-book-meadow.webp") center bottom / cover;
  box-shadow: 0 0 0 2px #95602c, inset 0 0 0 2px #95602c, 0 0 1.3rem #fff8c6;
  perspective: 22rem;
}
.entry-window::before,
.entry-window::after {
  position: absolute;
  content: "";
  top: 15%;
  bottom: 0;
  width: 42%;
  border: .4rem double #a46a31;
  background: linear-gradient(90deg, transparent 48%, #f7d389 48% 52%, transparent 52%),
    linear-gradient(transparent 48%, #f7d389 48% 52%, transparent 52%), #e8f5f960;
}
.entry-window::before { left: 0; transform-origin: left; transform: rotateY(-145deg); }
.entry-window::after { right: 0; transform-origin: right; transform: rotateY(145deg); }
.entry-window span {
  position: absolute;
  inset: auto -12% -5% -12%;
  height: .65rem;
  border: 2px solid #a46a31;
  background: #f7d389;
  border-radius: .2rem;
}
.entry-runner {
  position: absolute;
  inset: auto 7% 3% 3%;
  height: 94%;
  transform-origin: 50% 62%;
}
.entry-runner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.entry-kick { opacity: 0; }
.intro-complete .entry-football { opacity: 0; }
.entry-football {
  position: absolute;
  z-index: 1;
  left: 68%;
  bottom: 27%;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: clamp(2.5rem, 6vw, 5rem);
  line-height: 1;
  filter: drop-shadow(0 .2rem .25rem #21372565);
}
.entry-content {
  position: relative;
  display: grid;
  align-items: center;
  padding: clamp(1.2rem, 3.1vw, 2.7rem);
}
.entry-panel { max-width: 28rem; width: 100%; margin-inline: auto; }
.entry-lockup { display: block; width: min(15rem, 74%); height: auto; margin: 0 auto .5rem; }
.entry-panel h1 {
  margin: .3rem 0 1rem;
  text-align: center;
  font: 700 clamp(2rem, 3.6vw, 3.15rem)/1 "Patrick Hand", system-ui, sans-serif;
}
.entry-panel form { display: grid; gap: .45rem; }
.entry-panel label { display: block; font-weight: 740; }
.entry-panel input,
.entry-panel select {
  width: 100%;
  min-height: 3rem;
  border: 1px solid #a1b49a;
  border-radius: .6rem;
  padding: .55rem .65rem;
  font: inherit;
  color: #17402a;
  background: #fff;
}
.entry-panel small { color: #4b6253; }
.entry-choices { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-block: .4rem; }
.entry-choices div { min-width: 0; }
.entry-choices label { margin-bottom: .35rem; }
.entry-submit,
.entry-skip,
.entry-guest {
  min-height: 44px;
  border: 1px solid #225a3c;
  border-radius: 999px;
  padding: .6rem 1rem;
  font: 750 1rem/1.2 system-ui, sans-serif;
  cursor: pointer;
}
.entry-submit { color: #fff; background: #225a3c; }
.entry-submit:hover { background: #17442d; }
.entry-skip {
  position: absolute;
  z-index: 1;
  justify-self: center;
  background: #fffdf5;
  color: #225a3c;
}
.entry-note { text-align: center; }
.entry-guest {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: .8rem;
  color: #225a3c;
  background: #fffdf5;
  text-decoration: none;
}
.entry-guest:hover { background: #eaf2e3; }

.entry-layout.is-playing .entry-panel { visibility: hidden; }
.entry-layout.is-playing .entry-runner { animation: window-run 2.05s both; }
.entry-layout.is-playing .entry-sparky { animation: run-pose 2.85s both; }
.entry-layout.is-playing .entry-kick { animation: kick-pose 2.85s both; }
.entry-layout.is-playing .entry-football { animation: football-shot 2.95s both; }
.entry-layout.intro-complete .entry-panel { animation: panel-reveal .42s ease-out both; }

@keyframes window-run {
  0% { transform: translateY(-7%) scale(.27); clip-path: inset(18% 12% 18% 12%); opacity: 0; }
  12% { opacity: 1; }
  36% { transform: translate(-2%, -9%) scale(.49) rotate(-3deg); }
  57% { transform: translate(0, -3%) scale(.72) rotate(3deg); clip-path: inset(0); }
  81% { transform: translate(0, 2%) scale(.94) rotate(-2deg); }
  100% { transform: none; opacity: 1; }
}
@keyframes run-pose {
  0%, 67% { opacity: 1; }
  73%, 100% { opacity: 0; }
}
@keyframes kick-pose {
  0%, 67% { opacity: 0; transform: rotate(-5deg); }
  73%, 100% { opacity: 1; transform: none; }
}
@keyframes football-shot {
  0%, 56% { transform: translate(12%, 105%); opacity: 1; }
  72% { transform: none; opacity: 1; }
  96%, 100% { transform: translate(-20%, -205%) scale(17) rotate(150deg); opacity: 1; }
}
@keyframes panel-reveal {
  from { clip-path: circle(1% at 50% 53%); }
  to { clip-path: circle(150% at 50% 53%); }
}

@media (max-width: 720px) {
  .entry-layout { grid-template-columns: 1fr; }
  .entry-scene { min-height: clamp(15rem, 77vw, 23rem); }
  .entry-content { min-height: 24rem; }
}
@media (max-width: 360px) {
  .entry-choices { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .entry-layout.is-playing .entry-runner,
  .entry-layout.is-playing .entry-sparky,
  .entry-layout.is-playing .entry-kick,
  .entry-layout.is-playing .entry-football,
  .entry-layout.intro-complete .entry-panel { animation: none; }
}
