/* Hopetara Games — site styles
   Palette: indigo ink, mist, paper, star gold, tile blue, teal */
:root {
  --ink: #1f2452;
  --ink-soft: #4a4f78;
  --mist: #eef0f7;
  --paper: #ffffff;
  --tile: #dce2f2;
  --star: #f4b740;
  --teal: #2f7f7a;
  --line: #cfd5e8;

  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --body: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.625rem;
  --step-3: 2.25rem;
  --step-4: clamp(2.5rem, 6vw, 4rem);

  --wrap: 68rem;
  --gutter: clamp(1rem, 4vw, 2rem);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--mist);
  color: var(--ink);
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.6;
}

img, svg { display: block; max-width: 100%; }

a { color: var(--teal); text-underline-offset: 0.2em; }
a:hover { color: var(--ink); }

:focus-visible {
  outline: 3px solid var(--star);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--paper);
  padding: 0.5rem 1rem;
}
.skip:focus { left: 1rem; top: 1rem; z-index: 10; }

/* ---------- Header ---------- */
.site-header { padding: 1.25rem 0; }
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--display);
  font-weight: 700;
  font-size: var(--step-1);
  letter-spacing: -0.01em;
}
.brand-mark {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 0.5rem;
  background: var(--ink);
  display: grid;
  place-items: center;
}
.brand-mark svg { width: 1.2rem; height: 1.2rem; }

.site-nav ul {
  list-style: none;
  display: flex;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}
.site-nav a {
  display: block;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: var(--step--1);
}
.site-nav a:hover { background: var(--tile); }
.site-nav a[aria-current="page"] { background: var(--ink); color: var(--paper); }

/* ---------- Hero ---------- */
.hero { padding: clamp(2rem, 6vw, 5rem) 0 clamp(3rem, 7vw, 6rem); }
.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.hero h1 {
  font-family: var(--display);
  font-size: var(--step-4);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 800;
  margin: 0 0 1.25rem;
  max-width: 13ch;
}
.hero p {
  font-size: var(--step-1);
  color: var(--ink-soft);
  max-width: 34ch;
  margin: 0 0 2rem;
}

.button {
  display: inline-block;
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
  text-decoration: none;
  padding: 0.85rem 1.4rem;
  border-radius: 0.75rem;
  box-shadow: 0 4px 0 var(--star);
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.button:hover { color: var(--paper); transform: translateY(2px); box-shadow: 0 2px 0 var(--star); }

/* The board: HOPE / star / TARA */
.board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(0.4rem, 1.2vw, 0.7rem);
  padding: clamp(0.75rem, 2vw, 1.1rem);
  background: var(--ink);
  border-radius: 1.25rem;
  max-width: 26rem;
  justify-self: end;
  width: 100%;
}
.tile {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 0.6rem;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.6rem, 5vw, 2.6rem);
  box-shadow: inset 0 -5px 0 var(--tile);
}
.tile.empty { background: #2c3266; box-shadow: none; }
.tile.star { background: var(--star); box-shadow: inset 0 -5px 0 #d99a22; }
.tile.star svg { width: 55%; height: 55%; }

@media (prefers-reduced-motion: no-preference) {
  .tile { animation: flip 520ms cubic-bezier(.2,.8,.2,1) both; }
  .tile:nth-child(1) { animation-delay: 60ms; }
  .tile:nth-child(2) { animation-delay: 120ms; }
  .tile:nth-child(3) { animation-delay: 180ms; }
  .tile:nth-child(4) { animation-delay: 240ms; }
  .tile:nth-child(6) { animation-delay: 520ms; }
  .tile:nth-child(9) { animation-delay: 300ms; }
  .tile:nth-child(10) { animation-delay: 360ms; }
  .tile:nth-child(11) { animation-delay: 420ms; }
  .tile:nth-child(12) { animation-delay: 480ms; }
  .tile.empty { animation: none; }
  @keyframes flip {
    from { transform: rotateX(90deg); opacity: 0; }
    to { transform: rotateX(0); opacity: 1; }
  }
}

/* ---------- Sections ---------- */
.section { padding: clamp(3rem, 7vw, 5rem) 0; }
.section.paper { background: var(--paper); }

.section h2 {
  font-family: var(--display);
  font-size: var(--step-3);
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin: 0 0 0.75rem;
}
.section .lede {
  color: var(--ink-soft);
  max-width: 52ch;
  margin: 0 0 2.5rem;
}

.kinds {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem;
}
.kinds li { border-top: 3px solid var(--ink); padding-top: 1rem; }
.kinds h3 {
  font-family: var(--display);
  font-size: var(--step-1);
  margin: 0 0 0.4rem;
}
.kinds p { margin: 0; color: var(--ink-soft); }
.mini {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 0.9rem;
}
.mini span {
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 0.3rem;
  background: var(--tile);
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 800;
  font-size: 0.85rem;
}
.mini span.on { background: var(--star); }

/* Games */
.games {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 1.5rem;
}
.game {
  background: var(--paper);
  border-radius: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
}
.game img { border-radius: 0.75rem; aspect-ratio: 1; object-fit: cover; width: 100%; }
.game h3 { font-family: var(--display); margin: 0.9rem 0 0.25rem; font-size: var(--step-1); }
.game p { margin: 0 0 1rem; color: var(--ink-soft); font-size: var(--step--1); }
.store-links { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.store-links a {
  font-size: var(--step--1);
  font-weight: 700;
  padding: 0.45rem 0.8rem;
  border-radius: 0.5rem;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
}

.empty-state {
  border: 2px dashed var(--line);
  border-radius: 1rem;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  max-width: 44rem;
}
.empty-state h3 { font-family: var(--display); font-size: var(--step-2); margin: 0 0 0.5rem; letter-spacing: -0.02em; }
.empty-state p { margin: 0; color: var(--ink-soft); }

/* Prose pages (about, support, legal) */
.page-head { padding: clamp(2rem, 5vw, 3.5rem) 0 1.5rem; }
.page-head h1 {
  font-family: var(--display);
  font-size: var(--step-3);
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 0 0 0.5rem;
}
.page-head p { margin: 0; color: var(--ink-soft); }

.prose {
  background: var(--paper);
  border-radius: 1.25rem;
  padding: clamp(1.25rem, 4vw, 3rem);
  margin-bottom: clamp(3rem, 6vw, 5rem);
}
.prose > * { max-width: 70ch; }
.prose h2 {
  font-family: var(--display);
  font-size: var(--step-2);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 2.25rem 0 0.6rem;
}
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-family: var(--display); font-size: var(--step-1); margin: 1.5rem 0 0.4rem; }
.prose ul { padding-left: 1.25rem; }
.prose li { margin-bottom: 0.35rem; }
.prose table { border-collapse: collapse; width: 100%; font-size: var(--step--1); margin: 1rem 0; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--line); }
.prose th { font-family: var(--display); }
.table-scroll { overflow-x: auto; }

.contact-card {
  background: var(--mist);
  border-radius: 1rem;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}
.contact-card p { margin: 0.2rem 0; }

details { border-bottom: 1px solid var(--line); padding: 0.9rem 0; }
details summary { cursor: pointer; font-weight: 700; }
details p { margin: 0.6rem 0 0; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: #c9cdea;
  padding: 2.5rem 0;
  font-size: var(--step--1);
}
.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.site-footer a { color: var(--paper); }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; gap: 1.25rem; flex-wrap: wrap; }
.site-footer p { margin: 0 0 0.3rem; }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .board { justify-self: start; max-width: 20rem; }
  .kinds { grid-template-columns: 1fr; gap: 1.5rem; }
}
