/* hapi shibunki — warm shiba palette */
:root {
  --bg: #f6efe4;
  --bg2: #efe4d6;
  --cream: #fdf8f0;
  --orange: #e07a2f;
  --orange-deep: #c45f1a;
  --tan: #c9a574;
  --ink: #1f1812;
  --ink-muted: #5c4a3c;
  --ring: rgba(224, 122, 47, 0.35);
  --shadow: 0 12px 40px rgba(31, 24, 18, 0.12);
  --radius: 1.25rem;
  --radius-sm: 0.75rem;
  --font-display: "Fredoka", system-ui, sans-serif;
  --font-body: "DM Sans", system-ui, sans-serif;
  --max: 68rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--ink);
  background: linear-gradient(165deg, var(--bg) 0%, var(--cream) 45%, var(--bg2) 100%);
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 0;
}

/* Above main/header (z:2) so bones are visible; pointer-events: none = clicks go through to the page. */
.bone-snow {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 50;
  pointer-events: none;
}

.shiba-cursor {
  display: none;
  position: fixed;
  left: 0;
  top: 0;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  z-index: 10000;
  pointer-events: none;
  border-radius: 50%;
  background: url("public/hapi-shibunki.png") center / cover no-repeat;
  border: 2.5px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 12px var(--ring), 0 0 0 1px rgba(31, 24, 18, 0.1);
  will-change: transform;
}

body.has-shiba-cursor {
  cursor: none;
}

body.has-shiba-cursor .shiba-cursor {
  display: block;
}

body.has-shiba-cursor a,
body.has-shiba-cursor button,
body.has-shiba-cursor [role="button"],
body.has-shiba-cursor .btn,
body.has-shiba-cursor label[for] {
  cursor: none;
}

.header {
  position: relative;
  z-index: 2;
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.logo__img {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 4px 14px var(--ring);
  border: 2px solid rgba(255, 255, 255, 0.7);
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav__link {
  color: var(--ink-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  transition: color 0.2s, background 0.2s;
}

.nav__link:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.5);
}

.nav__link--pump {
  background: linear-gradient(135deg, var(--orange) 0%, var(--orange-deep) 100%);
  color: #fff;
  box-shadow: 0 4px 16px var(--ring);
}

.nav__link--pump:hover {
  color: #fff;
  filter: brightness(1.05);
}

main {
  position: relative;
  z-index: 2;
}

.hero {
  padding: 2rem 1.5rem 3.5rem;
  max-width: var(--max);
  margin: 0 auto;
}

.hero__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: center;
}

@media (min-width: 900px) {
  .hero__grid {
    grid-template-columns: 1.05fr 1fr;
    gap: 3rem;
  }
}

.hero__art {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero__ring {
  position: absolute;
  width: min(100%, 420px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, var(--ring) 0%, transparent 70%);
  filter: blur(0px);
  z-index: 0;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.hero__mascot {
  position: relative;
  z-index: 1;
  width: min(100%, 400px);
  height: auto;
  border-radius: 28px;
  box-shadow: var(--shadow);
  border: 4px solid #fff;
}

.hero__caption {
  margin: 1rem 0 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--orange-deep);
  font-weight: 500;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--tan);
  margin: 0 0 0.5rem;
}

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 3.75rem);
  line-height: 1.1;
  margin: 0 0 1rem;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.hero__lead {
  margin: 0 0 1.75rem;
  color: var(--ink-muted);
  max-width: 52ch;
  font-size: 1.08rem;
}

.hero__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  padding: 0.8rem 1.35rem;
  border-radius: 999px;
  transition: transform 0.15s ease, box-shadow 0.2s, background 0.2s, color 0.2s;
}

.btn:active {
  transform: scale(0.98);
}

.btn--primary {
  background: linear-gradient(135deg, var(--orange) 0%, var(--orange-deep) 100%);
  color: #fff;
  box-shadow: 0 6px 24px var(--ring);
}

.btn--primary:hover {
  filter: brightness(1.05);
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.65);
  color: var(--ink);
  border: 2px solid rgba(201, 165, 116, 0.5);
}

.btn--ghost:hover {
  background: #fff;
  border-color: var(--tan);
}

.ca {
  padding: 0 1.5rem 3.5rem;
}

.ca__inner {
  max-width: var(--max);
  margin: 0 auto;
  background: var(--cream);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid rgba(201, 165, 116, 0.25);
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.section-title--center {
  text-align: center;
}

.section-sub {
  margin: 0 0 1.5rem;
  color: var(--ink-muted);
  font-size: 0.95rem;
}

.ca .section-title {
  margin-bottom: 0.35rem;
}

.ca__box {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: stretch;
}

@media (min-width: 640px) {
  .ca__box {
    flex-direction: row;
    align-items: center;
  }
}

.ca__code {
  flex: 1;
  display: block;
  word-break: break-all;
  font-family: ui-monospace, "Cascadia Code", "Consolas", monospace;
  font-size: 0.85rem;
  line-height: 1.5;
  padding: 1rem 1.1rem;
  background: #fff;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(201, 165, 116, 0.35);
  color: var(--ink);
}

.btn--copy {
  flex-shrink: 0;
  background: var(--ink);
  color: #fff;
  min-width: 7rem;
}

.btn--copy:hover {
  background: #2d2419;
}

.btn--copy .btn__success {
  color: #b8f5c8;
}

.ca__status {
  min-height: 1.25rem;
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  color: var(--orange-deep);
}

.ca__links {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

@media (min-width: 500px) {
  .ca__links {
    grid-template-columns: 1fr 1fr;
  }
}

.link-tile {
  display: block;
  padding: 1.1rem 1.25rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--ink);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(246, 239, 228, 0.95) 100%);
  border: 1px solid rgba(201, 165, 116, 0.3);
  transition: border-color 0.2s, transform 0.15s;
}

.link-tile:hover {
  border-color: var(--orange);
  transform: translateY(-2px);
}

.link-tile__label {
  display: block;
  font-weight: 700;
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.link-tile__meta {
  display: block;
  font-size: 0.88rem;
  color: var(--ink-muted);
  margin-top: 0.2rem;
}

.section-sub--center {
  text-align: center;
  max-width: 40rem;
  margin-left: auto;
  margin-right: auto;
}

.play {
  padding: 0 1.5rem 2.5rem;
  max-width: var(--max);
  margin: 0 auto;
}

.play__inner {
  background: var(--cream);
  border-radius: var(--radius);
  padding: 1.75rem 1.25rem 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid rgba(201, 165, 116, 0.25);
}

.play__board {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

#hapi-game-canvas {
  display: block;
  width: min(100%, 540px);
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  background: #0d0814;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2);
}

.play__hud {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink-muted);
  margin: 0;
  text-align: center;
}

.play__restart {
  margin: 0;
}

.moonsheet {
  padding: 0 1.5rem 3rem;
  max-width: var(--max);
  margin: 0 auto;
}

.moonsheet__inner {
  background: var(--cream);
  border-radius: var(--radius);
  padding: 1.75rem 1.25rem 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid rgba(201, 165, 116, 0.25);
}

.moonsheet__hapi {
  text-align: center;
  font-size: 1.05rem;
  margin: 0.5rem 0 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0.4rem 0.75rem;
  font-weight: 600;
}

.moonsheet__label {
  color: var(--ink-muted);
  font-weight: 500;
  font-size: 0.95rem;
}

.moonsheet__val {
  font-family: var(--font-display);
  color: var(--orange-deep);
  font-size: 1.2rem;
}

.moonsheet__meta {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--ink-muted);
}

.moonsheet__tablewrap {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(201, 165, 116, 0.28);
  background: #fff;
}

.moonsheet__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.moonsheet__table th,
.moonsheet__table td {
  padding: 0.7rem 0.9rem;
  text-align: left;
  border-bottom: 1px solid rgba(201, 165, 116, 0.2);
}

.moonsheet__table th {
  background: rgba(224, 122, 47, 0.12);
  font-family: var(--font-display);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.moonsheet__table tbody tr:hover {
  background: rgba(246, 239, 228, 0.6);
}

.moonsheet__x {
  font-weight: 600;
  color: var(--orange-deep);
  white-space: nowrap;
}

.moonsheet__err {
  margin: 0.75rem 0 0;
  font-size: 0.88rem;
  color: #a34;
  text-align: center;
}

.shill {
  padding: 0 1.5rem 3rem;
  max-width: var(--max);
  margin: 0 auto;
}

.shill__inner {
  background: var(--cream);
  border-radius: var(--radius);
  padding: 1.75rem 1.25rem 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid rgba(201, 165, 116, 0.25);
}

.shill__label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-muted);
  margin: 0.5rem 0 0.45rem;
}

.shill__textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 8.5rem;
  padding: 1rem 1.1rem;
  font-family: var(--font-body);
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--ink);
  background: #fff;
  border: 1px solid rgba(201, 165, 116, 0.35);
  border-radius: var(--radius-sm);
  resize: none;
  box-sizing: border-box;
}

.shill__textarea:focus {
  outline: 2px solid rgba(224, 122, 47, 0.45);
  outline-offset: 1px;
}

.shill__hint {
  margin: 0.45rem 0 0.85rem;
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.shill__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}

.shill__status {
  margin: 0;
  min-height: 1.2rem;
  font-size: 0.9rem;
  color: var(--orange-deep);
}

.bento {
  padding: 0 1.5rem 4rem;
  max-width: var(--max);
  margin: 0 auto;
}

.bento__grid {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 700px) {
  .bento__grid {
    grid-template-columns: 1fr 1fr;
  }

  .bento__card--wide {
    grid-column: 1 / -1;
  }
}

.bento__card {
  background: rgba(255, 255, 255, 0.55);
  border-radius: var(--radius);
  padding: 1.5rem 1.4rem;
  border: 1px solid rgba(201, 165, 116, 0.22);
  box-shadow: 0 4px 20px rgba(31, 24, 18, 0.06);
}

.bento__card h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin: 0 0 0.5rem;
}

.bento__card p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.98rem;
}

.bento__card a {
  color: var(--orange-deep);
  font-weight: 600;
}

.bento__card--accent {
  background: linear-gradient(145deg, rgba(224, 122, 47, 0.12) 0%, rgba(255, 255, 255, 0.5) 100%);
  border-color: rgba(224, 122, 47, 0.2);
}

.footer {
  text-align: center;
  padding: 2.5rem 1.5rem 3rem;
  border-top: 1px solid rgba(201, 165, 116, 0.25);
  background: rgba(255, 255, 255, 0.25);
  position: relative;
  z-index: 2;
}

.footer__brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  margin: 0 0 0.5rem;
}

.footer__disclaimer {
  margin: 0;
  max-width: 32rem;
  margin-inline: auto;
  font-size: 0.85rem;
  color: var(--ink-muted);
  line-height: 1.5;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .btn:active {
    transform: none;
  }

  .bone-snow {
    display: none;
  }
}
