:root {
  --cream: #fff8ef;
  --cream-2: #ffeedd;
  --choc: #3b2018;
  --choc-soft: #6b4a3e;
  --pink: #ff5a85;
  --pink-dark: #e23d6a;
  --yellow: #ffd166;
  --mint: #7fd8be;
  --blue: #6cb4ff;
  --card: #ffffff;
  --line: #f0dccb;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(59, 32, 24, 0.10);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--choc);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }

h1, h2, h3 {
  font-family: "Fredoka", "Inter", sans-serif;
  line-height: 1.1;
  margin: 0 0 .5em;
}
h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); font-weight: 700; }
h2 { font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 700; }
h3 { font-size: 1.4rem; font-weight: 600; }
p { margin: 0 0 1em; }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.pink { color: var(--pink); }
.eyebrow {
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .82rem;
  color: var(--pink-dark);
  margin-bottom: .6em;
}
.lead { font-size: 1.15rem; color: var(--choc-soft); max-width: 34em; }

/* Buttons */
.btn {
  display: inline-block;
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  text-decoration: none;
  padding: .8em 1.5em;
  border-radius: 999px;
  border: 2px solid var(--choc);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--pink); color: #fff; border-color: var(--pink); box-shadow: 0 4px 0 var(--pink-dark); }
.btn-primary:hover { box-shadow: 0 6px 0 var(--pink-dark); }
.btn-ghost { background: transparent; color: var(--choc); }
.btn-ghost:hover { background: var(--choc); color: var(--cream); }
.btn-small { padding: .5em 1.1em; font-size: .92rem; }
.btn-big { font-size: clamp(1rem, 3vw, 1.3rem); padding: .9em 1.8em; word-break: break-all; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 248, 239, .88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 1.25rem; }
.nav-links { display: flex; gap: 28px; }
.nav-links a { text-decoration: none; font-weight: 500; }
.nav-links a:hover { color: var(--pink-dark); }
.nav-toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--choc); margin: 5px 0; border-radius: 2px; }

/* Hero */
.hero { padding: 72px 0 56px; overflow: hidden; }
.hero-inner { display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: 40px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }
.hero-art { position: relative; }
.hero-art::before {
  content: ""; position: absolute; inset: 8% 4%;
  background: radial-gradient(circle, var(--yellow) 0%, transparent 65%);
  opacity: .55; z-index: -1;
}
.cake { width: 100%; max-width: 420px; margin-inline: auto; display: block; animation: bob 4s ease-in-out infinite; }
.plate { fill: #fff; stroke: var(--line); stroke-width: 2; }
.plate-shadow { fill: rgba(59,32,24,.08); }
.sponge { fill: #8a4f3a; }
.icing { fill: var(--pink); }
.candle { fill: var(--blue); }
.flame-outer { fill: #ff9f1c; }
.flame-inner { fill: var(--yellow); }
.flame { transform-origin: 160px 70px; animation: flicker 1.2s ease-in-out infinite alternate; }
.s1 { fill: var(--yellow); } .s2 { fill: var(--mint); } .s3 { fill: #fff; }

@keyframes bob { 50% { transform: translateY(-8px); } }
@keyframes flicker { from { transform: scale(1) rotate(-3deg); } to { transform: scale(1.08, .94) rotate(3deg); } }

/* Sections */
.section { padding: 88px 0; }
.section-alt { background: var(--cream-2); }

/* Games */
.games { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; margin-top: 32px; }
.game {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  display: flex; flex-direction: column;
  transition: transform .2s ease;
}
.game:hover { transform: translateY(-4px) rotate(-.4deg); }
.game-art { aspect-ratio: 16 / 9; position: relative; background-size: cover; background-position: center; }
/* Swap these gradients for real cover art, e.g. background-image: url("img/game1.jpg"); */
.art-1 { background-image: linear-gradient(135deg, var(--pink), var(--yellow)); }
.art-2 { background-image: linear-gradient(135deg, var(--mint), var(--blue)); }
.art-3 { background-image: repeating-linear-gradient(45deg, var(--choc) 0 14px, var(--choc-soft) 14px 28px); }
.tag {
  position: absolute; top: 14px; left: 14px;
  background: rgba(255,255,255,.92);
  font-family: "Fredoka", sans-serif; font-weight: 600; font-size: .8rem;
  padding: .3em .8em; border-radius: 999px;
}
.game-body { padding: 22px 24px 26px; display: flex; flex-direction: column; flex: 1; }
.game-body p { color: var(--choc-soft); }
.game-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; }

/* About */
.about { display: grid; grid-template-columns: 1.2fr 1fr; gap: 56px; align-items: center; }
.about p { color: var(--choc-soft); }
.values { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.values li {
  display: flex; gap: 16px; align-items: flex-start;
  background: var(--card); padding: 18px 20px; border-radius: var(--radius);
  border: 1px solid var(--line);
}
.value-icon { font-size: 1.8rem; line-height: 1; }

/* Contact */
.contact { text-align: center; }
.contact .lead { margin-inline: auto; }
.socials { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 32px; }
.socials a {
  text-decoration: none; font-weight: 500;
  padding: .45em 1em; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card);
}
.socials a:hover { border-color: var(--pink); color: var(--pink-dark); }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 28px 0; font-size: .92rem; color: var(--choc-soft); }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* Mobile */
@media (max-width: 820px) {
  .hero { padding-top: 40px; }
  .hero-inner, .about { grid-template-columns: 1fr; }
  .hero-art { order: -1; max-width: 300px; margin-inline: auto; }
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--cream); border-bottom: 1px solid var(--line);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 16px; border-top: 1px solid var(--line); }
  .section { padding: 64px 0; }
}

/* ---------- Test 58 feature ---------- */
.t58 {
  --t-bg: #0d1117;
  --t-panel: #161c25;
  --t-line: #263040;
  --t-text: #e8ecf2;
  --t-muted: #9aa6b8;
  --t-gold: #e3a43a;
  background: var(--t-bg);
  color: var(--t-text);
  padding: 96px 0;
}
.t58-eyebrow { color: var(--t-gold); }
.t58-head { display: grid; grid-template-columns: auto 1fr; gap: 48px; align-items: center; margin-bottom: 40px; }
.t58-logo { display: flex; align-items: center; gap: 16px; }
.t58-logo svg { width: 72px; height: 66px; flex: none; }
.t58-logo h2 {
  font-family: "Barlow Condensed", "Fredoka", sans-serif;
  font-size: clamp(3rem, 7vw, 4.6rem); font-weight: 700;
  margin: 0; line-height: .9;
}
.t58-sub { margin: 6px 0 0; color: var(--t-gold); letter-spacing: .3em; text-transform: uppercase; font-size: .8rem; font-weight: 600; }
.t58-logline { font-size: 1.2rem; margin: 0; max-width: 38em; }
.t58-shot { margin: 0 0 40px; }
.t58-shot img { width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--t-line); }
.t58-shot figcaption { color: var(--t-muted); font-size: .88rem; margin-top: 10px; }
.t58-story { columns: 2 320px; column-gap: 40px; color: var(--t-muted); margin-bottom: 56px; }
.t58-story strong { color: var(--t-text); }
.t58-h3 { font-family: "Barlow Condensed", "Fredoka", sans-serif; font-size: 2rem; text-transform: uppercase; }

.factions { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 20px; margin-top: 20px; }
.faction {
  background: var(--t-panel);
  border: 1px solid var(--t-line);
  border-top: 4px solid var(--f);
  border-radius: 14px;
  padding: 24px;
  display: flex; flex-direction: column;
}
.f-apex { --f: #1E6BFF; --f-text: #6fa0ff; }
.f-void { --f: #E02D2D; --f-text: #ff7070; }
.f-feed { --f: #8A2BE2; --f-text: #b77cff; }
.faction h4 { font-family: "Barlow Condensed", "Fredoka", sans-serif; font-size: 1.9rem; text-transform: uppercase; margin: 0 0 8px; color: #fff; }
.f-pitch { color: var(--f-text); font-weight: 600; margin: 0 0 4px; font-size: .95rem; }
.faction > p:not(.f-pitch) { color: var(--t-muted); }
.faction dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0 0 18px; font-size: .92rem; }
.faction dt { color: var(--t-muted); }
.faction dd { margin: 0; }
.faction blockquote {
  margin: auto 0 0; padding: 14px 16px;
  background: rgba(255,255,255,.04); border-left: 3px solid var(--f); border-radius: 6px;
  font-style: italic;
}
.faction cite { display: block; font-style: normal; color: var(--t-muted); font-size: .82rem; margin-top: 6px; }
.t58-cta { margin-top: 48px; display: flex; gap: 14px; flex-wrap: wrap; }
.btn-light { background: transparent; color: var(--t-text); border-color: var(--t-text); }
.btn-light:hover { background: var(--t-text); color: var(--t-bg); }

@media (max-width: 820px) {
  .t58 { padding: 64px 0; }
  .t58-head { grid-template-columns: 1fr; gap: 20px; }
}

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