/* ==========================================================================
   Teiku Games — shared stylesheet
   Fonts are self-hosted (no third-party requests anywhere on this site).
   Fredoka and Nunito are licensed under the SIL Open Font License 1.1
   — see /assets/fonts/OFL.txt
   ========================================================================== */

@font-face {
  font-family: 'Fredoka';
  src: url('/assets/fonts/fredoka-var.woff2') format('woff2-variations');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Nunito';
  src: url('/assets/fonts/nunito-var.woff2') format('woff2-variations');
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
}

:root {
  --sage:        #93bc7b;
  --sage-deep:   #7aa564;
  --sage-dark:   #5f8a4d;
  --cream:       #f2ecdd;
  --cream-soft:  #f8f4e9;
  --card:        #fdfaf1;
  --amber:       #d9a13a;
  --amber-deep:  #b9821e;
  --coral:       #e8734a;
  --coral-deep:  #d15c34;
  --ink:         #383226;
  --ink-soft:    #5d5647;
  --muted:       #8b8474;
  --line:        #e0d8c4;

  --radius-sm: 10px;
  --radius:    16px;
  --radius-lg: 24px;

  --shadow-card: 0 2px 0 rgba(56,50,38,.06), 0 10px 30px -12px rgba(56,50,38,.22);
  --shadow-btn:  0 4px 0 var(--coral-deep);
  --wrap: 1080px;

  --font-display: 'Fredoka', 'Baloo 2', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Nunito', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--cream);
  background-image: repeating-linear-gradient(
    -45deg,
    rgba(255,255,255,.35) 0 2px,
    rgba(255,255,255,0) 2px 14px
  );
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--sage-dark); text-decoration-thickness: 1.5px; text-underline-offset: 2px; }
a:hover { color: var(--coral-deep); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.15;
  margin: 0 0 .5em;
  letter-spacing: -.01em;
}
h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 4vw, 2.3rem); }
h3 { font-size: 1.2rem; }
p  { margin: 0 0 1.1em; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.narrow { width: min(100% - 2.5rem, 760px); margin-inline: auto; }

/* ---------- skip link ---------- */
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--ink); color: #fff; padding: .7rem 1.1rem; border-radius: 0 0 8px 0;
}
.skip:focus { left: 0; color: #fff; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(242,236,221,.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; gap: 1.5rem;
  min-height: 68px;
}
.brand {
  display: flex; align-items: center; gap: .6rem;
  font-family: var(--font-display); font-weight: 600; font-size: 1.2rem;
  color: var(--ink); text-decoration: none; flex: 0 0 auto;
}
.brand:hover { color: var(--ink); }
.brand .diamond {
  width: 13px; height: 13px; background: var(--amber);
  transform: rotate(45deg); border-radius: 2px; flex: 0 0 auto;
}
.nav { margin-left: auto; display: flex; gap: 1.4rem; flex-wrap: wrap; }
.nav a {
  font-weight: 700; font-size: .95rem; color: var(--ink-soft); text-decoration: none;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--coral-deep); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: var(--font-display); font-weight: 600; font-size: 1.02rem;
  padding: .78rem 1.6rem; border-radius: 999px;
  background: var(--coral); color: #fff !important; text-decoration: none;
  box-shadow: var(--shadow-btn); border: none; cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn:hover { background: var(--coral-deep); transform: translateY(2px); box-shadow: 0 2px 0 var(--coral-deep); }
.btn:active { transform: translateY(4px); box-shadow: 0 0 0 var(--coral-deep); }
.btn-ghost {
  background: transparent; color: var(--ink) !important;
  box-shadow: inset 0 0 0 2px var(--line);
}
.btn-ghost:hover { background: rgba(255,255,255,.6); color: var(--ink) !important; box-shadow: inset 0 0 0 2px var(--sage); transform: none; }

/* ---------- hero ---------- */
.hero {
  background: linear-gradient(160deg, var(--sage) 0%, var(--sage-deep) 100%);
  background-image:
    repeating-linear-gradient(-45deg, rgba(255,255,255,.09) 0 3px, rgba(255,255,255,0) 3px 18px),
    linear-gradient(160deg, #9cc384 0%, #7aa564 100%);
  color: #fff;
  padding: clamp(3rem, 8vw, 5.5rem) 0 clamp(3.5rem, 9vw, 6rem);
  position: relative; overflow: hidden;
}
.hero-grid {
  display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.hero h1 { color: #fff; text-shadow: 0 2px 0 rgba(80,110,62,.35); margin-bottom: .35em; }
.hero .lede {
  font-size: clamp(1.05rem, 2.2vw, 1.28rem); font-weight: 600;
  color: rgba(255,255,255,.94); max-width: 30ch; margin-bottom: 1.8rem;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-display); font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; font-size: .78rem;
  background: rgba(255,255,255,.2); color: #fff;
  padding: .35rem .9rem; border-radius: 999px; margin-bottom: 1.2rem;
}
.eyebrow .diamond { width: 9px; height: 9px; background: #fbe9b8; transform: rotate(45deg); border-radius: 1px; }
.hero-art { display: flex; justify-content: center; }
.hero-art img {
  width: min(100%, 320px); border-radius: 28px;
  box-shadow: 0 30px 60px -25px rgba(45,66,34,.65), 0 0 0 8px rgba(255,255,255,.14);
}
.cta-row { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; }

/* store badges */
.badge-note {
  font-size: .86rem; font-weight: 700; color: rgba(255,255,255,.85);
  background: rgba(255,255,255,.16); padding: .5rem 1rem; border-radius: 999px;
}

/* ---------- sections ---------- */
.section { padding: clamp(3rem, 7vw, 5rem) 0; }
.section-alt { background: rgba(255,255,255,.5); border-block: 1px solid var(--line); }
.section-head { text-align: center; max-width: 44ch; margin: 0 auto clamp(2rem, 4vw, 3rem); }
.section-head p { color: var(--muted); font-weight: 600; margin: 0; }

/* ---------- cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.2rem; }
.cards-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); max-width: 900px; margin-inline: auto; }
@media (min-width: 900px) { .cards-3 { grid-template-columns: repeat(3, 1fr); } }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 1.6rem 1.5rem; box-shadow: var(--shadow-card);
}
.card h3 { margin-bottom: .35em; }
.card p { margin: 0; color: var(--ink-soft); font-size: .97rem; }
.card .pip {
  width: 30px; height: 30px; border-radius: 8px; background: rgba(217,161,58,.18);
  display: grid; place-items: center; margin-bottom: .9rem;
}
.card .pip span { width: 11px; height: 11px; background: var(--amber); transform: rotate(45deg); border-radius: 2px; }

/* ---------- shots ---------- */
.shots {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1.2rem; max-width: 900px; margin-inline: auto;
}
.shots img {
  border-radius: 20px; border: 1px solid var(--line);
  box-shadow: var(--shadow-card); background: var(--card);
}

/* ---------- game row ---------- */
.game-row {
  display: grid; grid-template-columns: 128px 1fr; gap: 1.5rem; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 1.6rem; box-shadow: var(--shadow-card);
}
.game-row img { width: 128px; border-radius: 26px; }
.game-row h3 { font-size: 1.5rem; margin-bottom: .2em; }
.game-row p { color: var(--ink-soft); margin-bottom: .9rem; }

/* ---------- legal / prose pages ---------- */
.page-head {
  background: linear-gradient(160deg, #9cc384 0%, #7aa564 100%);
  background-image:
    repeating-linear-gradient(-45deg, rgba(255,255,255,.09) 0 3px, rgba(255,255,255,0) 3px 18px),
    linear-gradient(160deg, #9cc384 0%, #7aa564 100%);
  color: #fff; padding: clamp(2.5rem, 6vw, 3.8rem) 0;
}
.page-head h1 { color: #fff; margin-bottom: .2em; text-shadow: 0 2px 0 rgba(80,110,62,.3); }
.page-head p { margin: 0; font-weight: 700; color: rgba(255,255,255,.9); font-size: .95rem; }

.prose {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 4vw, 3rem); box-shadow: var(--shadow-card);
  margin: clamp(2rem, 5vw, 3.5rem) auto;
}
.prose h2 {
  font-size: 1.45rem; margin-top: 2.2em; padding-top: 1.1em; border-top: 1px solid var(--line);
}
.prose > h2:first-of-type { margin-top: .4em; padding-top: 0; border-top: 0; }
.prose h3 { font-size: 1.08rem; margin-top: 1.8em; }
.prose ul, .prose ol { padding-left: 1.3rem; margin: 0 0 1.1em; }
.prose li { margin-bottom: .45em; }
.prose table {
  width: 100%; border-collapse: collapse; margin: 0 0 1.4em; font-size: .93rem;
}
.prose th, .prose td {
  text-align: left; padding: .7rem .8rem; border: 1px solid var(--line); vertical-align: top;
}
.prose th { background: rgba(217,161,58,.12); font-family: var(--font-display); font-weight: 600; }
.prose code {
  background: rgba(56,50,38,.07); padding: .1em .4em; border-radius: 5px; font-size: .92em;
}
.callout {
  background: rgba(147,188,123,.16); border-left: 4px solid var(--sage-deep);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 1rem 1.2rem; margin: 0 0 1.4em;
}
.callout p:last-child { margin-bottom: 0; }

.toc {
  background: rgba(255,255,255,.7); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.1rem 1.3rem; margin-bottom: 2rem;
}
.toc p { font-family: var(--font-display); font-weight: 600; margin: 0 0 .5em; }
.toc ol { margin: 0; padding-left: 1.2rem; font-size: .94rem; }
.toc li { margin-bottom: .25em; }

/* ---------- faq ---------- */
details.faq {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem 1.2rem; margin-bottom: .8rem;
}
details.faq summary {
  font-family: var(--font-display); font-weight: 600; cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; gap: 1rem; align-items: center;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after {
  content: "+"; font-size: 1.3rem; color: var(--amber-deep); line-height: 1;
}
details.faq[open] summary::after { content: "\2013"; }
details.faq > *:not(summary) { margin-top: .8rem; }
details.faq p:last-child { margin-bottom: 0; }

/* ---------- footer ---------- */
.site-footer {
  background: var(--ink); color: rgba(255,255,255,.72);
  padding: 3rem 0 2.2rem; font-size: .93rem; margin-top: auto;
}
.site-footer a { color: rgba(255,255,255,.86); text-decoration: none; }
.site-footer a:hover { color: #f3c465; text-decoration: underline; }
.footer-grid {
  display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 2rem;
  padding-bottom: 2rem; border-bottom: 1px solid rgba(255,255,255,.14);
}
.footer-grid .brand { color: #fff; margin-bottom: .6rem; }
.footer-grid .brand:hover { color: #fff; }
.footer-grid p { margin: 0; max-width: 34ch; color: rgba(255,255,255,.6); }
.footer-col h4 {
  color: #fff; font-size: .82rem; letter-spacing: .1em; text-transform: uppercase;
  margin-bottom: .8rem;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: .45em; }
.legal-line {
  padding-top: 1.5rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  color: rgba(255,255,255,.5); font-size: .87rem;
}

body { display: flex; flex-direction: column; min-height: 100vh; }
main { flex: 1 0 auto; }

/* ---------- responsive ---------- */
@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero .lede { margin-inline: auto; }
  .cta-row { justify-content: center; }
  .eyebrow { margin-inline: auto; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .site-header .wrap { flex-wrap: wrap; gap: .6rem 1rem; padding-block: .7rem; }
  .nav { margin-left: 0; width: 100%; gap: 1rem; }
  .game-row { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .prose table, .prose thead, .prose tbody, .prose th, .prose td, .prose tr { display: block; }
  .prose thead { display: none; }
  .prose td { border-top: 0; }
  .prose tr { margin-bottom: 1rem; border-top: 1px solid var(--line); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
