:root {
  --bg: #f6f0e7;
  --ink: #141414;
  --muted: rgba(20,20,20,.65);
  --line: rgba(20,20,20,.18);
  --radius: 26px;
  --max: 1100px;
  --surface-grad-top: rgba(255,255,255,0.76);
  --surface-grad-bottom: rgba(255,255,255,0.56);
  --load-duration: 0.5s;
  --load-stagger: 40ms;
  --load-ease: cubic-bezier(.2,.8,.2,1);
  --font-body: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  --font-display: "Bricolage Grotesque", var(--font-body);
}

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/bricolage-grotesque.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 700px at 12% 8%, rgba(255,255,255,.60), transparent 60%),
    radial-gradient(780px 620px at 100% 20%, rgba(255,255,255,.52), transparent 60%),
    radial-gradient(860px 680px at 30% 110%, rgba(255,255,255,.46), transparent 60%),
    repeating-linear-gradient(0deg, rgba(20,20,20,.028), rgba(20,20,20,.028) 1px, transparent 1px, transparent 7px);
  opacity: .62;
  z-index: -2;
  mix-blend-mode: multiply;
}

a { color: inherit; }
a:hover { opacity: .9; }

h1, h2, h3, h4,
.brand-note,
.sticker {
  font-family: var(--font-display);
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px 18px 90px;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0 24px;
}

.brand {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  text-decoration: none;
}

.logo {
  width: 80px;
  --r: -3deg;
  transform: rotate(var(--r));
}

.logo img {
  display: block;
  width: 100%;
  height: auto;
}

.brand-title {
  display: grid;
  gap: 10px;
  padding-bottom: 6px;
}

/* A scribbled aside pointing back at the cat. */
.brand-note {
  display: flex;
  align-items: flex-start;
  gap: 2px;
  font-size: 14px;
  color: var(--muted);
  transform: rotate(-3deg);
  transform-origin: left;
}

.brand-note svg {
  width: 28px;
  height: 16px;
  margin-top: 2px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* The logo's own lettering, tinted to the theme's ink. */
.wordmark {
  display: block;
  width: 150px;
  aspect-ratio: 898.6 / 171.5;
  background: var(--ink);
  mask: url("/wordmark.svg") center / contain no-repeat;
}

.sticker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 2px solid var(--line);
  background: rgba(255,255,255,.62);
  box-shadow: 0 14px 28px rgba(20,20,20,.08);
  text-decoration: none;
  font-weight: 750;
  font-size: 14px;
  transform: rotate(var(--r, 0deg));
  white-space: nowrap;
  transition:
    background 0.4s cubic-bezier(.4,0,.2,1),
    opacity 0.4s cubic-bezier(.4,0,.2,1),
    transform 0.4s cubic-bezier(.4,0,.2,1);
  justify-content: center;
}

.sticker:hover {
  background: rgba(255,255,255,.78);
  transform: translateY(-1px) rotate(var(--r, 0deg));
  text-decoration: none;
}

.sticker:focus {
  outline: 3px solid rgba(20,20,20,.25);
  outline-offset: 3px;
}

/* Not live yet: a placeholder sticker, not a link. */
.sticker--soon {
  border-style: dashed;
  pointer-events: none;
}

main {
  display: grid;
  gap: 64px;
}

section { scroll-margin-top: 18px; }

.hero {
  padding-top: 28px;
}

.headline {
  max-width: 11em;
  margin: 0;
  font-size: clamp(40px, 5.6vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.intro {
  max-width: 52ch;
  margin: 22px 0 0;
  font-size: 18px;
  color: var(--muted);
}

.section-title {
  margin: 0 0 16px;
  font-size: 24px;
  letter-spacing: -0.2px;
}

/* The one card on the page: the game is the thing worth framing. */
.game {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 26px;
  align-items: center;
  padding: 26px;
  border-radius: calc(var(--radius) + 4px);
  border: 2px solid var(--line);
  background: linear-gradient(180deg, var(--surface-grad-top), var(--surface-grad-bottom));
  box-shadow: 0 20px 40px rgba(20,20,20,.10);
}

.game-icon {
  width: clamp(84px, 14vw, 132px);
  height: auto;
  transform: rotate(-4deg);
  transition: filter 0.4s cubic-bezier(.4,0,.2,1);
}

/* The Michimachi sign buzzes on like real neon while its card is hovered. */
.game:hover .game-icon {
  filter: brightness(1.08) saturate(1.1);
  animation: neon-flicker 0.9s step-end;
  transition: none; /* a running transition would mask the flicker; it eases back on the way out */
}

@keyframes neon-flicker {
  0%   { filter: brightness(1); }
  6%   { filter: brightness(.5) saturate(.5); }
  10%  { filter: brightness(1.15) saturate(1.2); }
  16%  { filter: brightness(.55) saturate(.5); }
  22%  { filter: brightness(1.15) saturate(1.2); }
  34%  { filter: brightness(.8) saturate(.8); }
  40%  { filter: brightness(1.12) saturate(1.15); }
  100% { filter: brightness(1.08) saturate(1.1); }
}

.game h3 {
  margin: 0 0 8px;
  font-size: 22px;
  letter-spacing: -0.2px;
}

.game h3 [lang="ja"] { white-space: nowrap; }

.game p {
  margin: 0 0 16px;
  max-width: 80ch;
  font-size: 15.5px;
  color: var(--muted);
}

.contact-line {
  margin: 0;
  font-size: 18px;
  color: var(--muted);
}

.contact-line a,
.privacy-link {
  text-decoration: none;
  border-bottom: 2px dashed rgba(20,20,20,.22);
}

.contact-line a:hover,
.privacy-link:hover { border-bottom-style: solid; }

footer {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px 24px;
  margin-top: 72px;
  padding-top: 26px;
  border-top: 2px dashed rgba(20,20,20,.18);
  color: rgba(20,20,20,.68);
  font-size: 12.5px;
}

/* The cat supervising QA, sitting on the footer line. */
.footer-cat {
  position: absolute;
  right: 40px;
  bottom: 100%;
  width: 40px;
}

.legal {
  display: grid;
  gap: 8px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

/* Load-in: blocks rise in turn (order from --i, default 0), then the stickers
   inside them land a beat later. Set both timings to 0s to turn it off. */
.wrap > header,
main > section,
.wrap > footer {
  animation: rise-in var(--load-duration) var(--load-ease) calc(var(--i, 0) * var(--load-stagger)) backwards;
}

.logo,
.wrap .sticker {
  animation: sticker-land var(--load-duration) var(--load-ease)
    calc(var(--i, 0) * var(--load-stagger) + var(--load-duration) / 3) backwards;
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(10px); }
}

@keyframes sticker-land {
  from { opacity: 0; transform: rotate(calc(var(--r, 0deg) - 12deg)) scale(1.15); }
  60% { opacity: 1; transform: rotate(calc(var(--r, 0deg) + 3deg)) scale(.97); }
}

/* Easter egg: every click boops the logo cat; five quick ones send it walking across the page. */
.logo.is-booped {
  animation: boop 0.45s var(--load-ease);
}

@keyframes boop {
  30% { transform: rotate(calc(var(--r) - 12deg)) scale(1.1); }
  60% { transform: rotate(calc(var(--r) + 6deg)) scale(.96); }
}

.paw-trail {
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow: hidden;
  pointer-events: none;
}

.paw-print {
  position: absolute;
  width: 22px;
  height: 22px;
  background: var(--muted);
  mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><ellipse cx='12' cy='16' rx='5' ry='4.2'/><circle cx='6.4' cy='10.6' r='2'/><circle cx='9.8' cy='6.6' r='2.1'/><circle cx='14.2' cy='6.6' r='2.1'/><circle cx='17.6' cy='10.6' r='2'/></svg>") center / contain no-repeat;
  transform: rotate(90deg);
  animation: paw-step 1.6s ease-out calc(var(--i) * 120ms) both;
}

@keyframes paw-step {
  0% { opacity: 0; transform: rotate(90deg) scale(.5); }
  12% { opacity: 1; transform: rotate(90deg) scale(1); }
  60% { opacity: 1; }
  100% { opacity: 0; }
}

#footer-line {
  display: inline-block;
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 0.4s cubic-bezier(.4,0,.2,1),
    transform 0.4s cubic-bezier(.4,0,.2,1);
  will-change: opacity, transform;
}

#footer-line.is-changing {
  opacity: 0;
  transform: translateY(4px);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.nl-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
}

.nl-modal[data-open="true"] {
  display: block;
  pointer-events: auto;
}

.nl-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.35);
  opacity: 0;
  transition: opacity .28s cubic-bezier(.4,0,.2,1);
}

.nl-modal__panel {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(680px, calc(100vw - 28px));
  max-height: min(86vh, 860px);
  transform: translate(-50%, -50%) translateY(10px) scale(.985);
  opacity: 0;
  border-radius: 26px;
  border: 2px solid var(--line, rgba(20,20,20,.18));
  background: #fdfbf7;
  box-shadow: 0 30px 80px rgba(0,0,0,.18);
  overflow: hidden;
  transition:
    transform .28s cubic-bezier(.4,0,.2,1),
    opacity .28s cubic-bezier(.4,0,.2,1);
  display: flex;
  flex-direction: column;
}

.nl-modal[data-open="true"] .nl-modal__backdrop { opacity: 1; }

.nl-modal[data-open="true"] .nl-modal__panel {
  opacity: 1;
  transform: translate(-50%, -50%) translateY(0) scale(1);
}

.nl-modal[data-closing="true"] .nl-modal__backdrop { opacity: 0; }

.nl-modal[data-closing="true"] .nl-modal__panel {
  opacity: 0;
  transform: translate(-50%, -50%) translateY(10px) scale(.985);
}

.nl-modal__close {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 2;
  cursor: pointer;
  color: var(--ink, #141414);
}

.nl-modal__header {
  padding: 16px 22px;
  border-bottom: 1px solid rgba(20,20,20,.10);
}

.nl-modal__header h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.2px;
}

.nl-modal__subtitle {
  margin: 0;
  color: var(--muted, rgba(20,20,20,.65));
  font-size: 14px;
  padding-right: 45px;
}

.nl-modal__body {
  padding: 18px 22px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.nl-policy h3 {
  margin: 18px 0 8px;
  font-size: 16.5px;
  letter-spacing: -0.1px;
}

.nl-policy h4 {
  margin: 14px 0 6px;
  font-size: 14.5px;
  letter-spacing: -0.1px;
  color: rgba(20,20,20,.85);
}

.nl-policy p,
.nl-policy li {
  color: var(--muted, rgba(20,20,20,.68));
  font-size: 15px;
  margin: 0 0 10px;
}

.nl-policy ul {
  margin: 8px 0 12px;
  padding-left: 18px;
}

.nl-policy a {
  color: inherit;
  text-decoration: none;
  border-bottom: 2px dashed rgba(20,20,20,.22);
}

.nl-policy a:hover { border-bottom-style: solid; }

body.nl-modal-open { overflow: hidden; }

@media (max-width: 560px) {
  .game {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 22px;
  }

  .game-icon { width: 84px; }
}

@media (max-width: 820px) {
  header {
    flex-direction: column;
    align-items: flex-start;
    padding-bottom: 16px;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141414;
    --ink: #f2f2f2;
    --muted: rgba(242,242,242,0.65);
    --line: rgba(255,255,255,0.18);
    --surface-grad-top: rgba(28,28,28,0.96);
    --surface-grad-bottom: rgba(20,20,20,0.92);
  }

  body { background: var(--bg); }

  body::before { opacity: 0.25; }

  .sticker {
    background: rgba(30,30,30,0.95);
    border-color: rgba(255,255,255,0.22);
    box-shadow: 0 14px 28px rgba(0,0,0,0.6);
  }

  .sticker:hover { background: rgba(38,38,38,0.98); }
  footer {
    color: rgba(242,242,242,0.78);
    border-top-color: rgba(242,242,242,0.26);
  }
  .privacy-link, .contact-line a { border-bottom-color: rgba(242,242,242,.26); }
  .nl-modal__backdrop { background: rgba(0,0,0,.55); }

  .nl-modal__panel {
    border-color: rgba(255,255,255,.18);
    background: rgb(28,28,28);
    box-shadow: 0 40px 90px rgba(0,0,0,.65);
  }

  .nl-modal__header { border-color: rgba(255,255,255,.10); }

  .nl-policy h4 { color: rgba(242,242,242,.88); }

  .nl-policy p,
  .nl-policy li,
  .nl-modal__subtitle {
    color: rgba(242,242,242,.70);
  }

  .nl-policy a { border-bottom-color: rgba(242,242,242,.26); }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
