:root {
  --bg: #050608;
  --bg-alt: #0b0f16;
  --card-bg: #101520;
  --accent: #8a5bff;
  --accent-soft: rgba(138, 91, 255, 0.15);
  --text: #f5f5f7;
  --muted: #a0a4b5;
  --border-subtle: #1f2433;
  --shadow-soft: 0 18px 35px rgba(0, 0, 0, 0.7);
  --radius-lg: 18px;
  --radius-pill: 999px;

  /* enough room for 3 rows (6 designs) */
  --rb-grid-min: 560px;
  --book-cover-min: 560px;
}

*,
*::before,
*::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #151b2f, var(--bg));
  color: var(--text);
  line-height: 1.5;
}

/* Header */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 7vw;
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
  background: linear-gradient(to bottom, rgba(5, 6, 8, 0.95), rgba(5, 6, 8, 0.7));
}

.logo-wrap { display: flex; align-items: center; gap: 0.9rem; }

.logo-mark {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-soft);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.logo-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.logo-text h1 { margin: 0; font-size: 1.3rem; }
.logo-text p { margin: 0.15rem 0 0; font-size: 0.8rem; color: var(--muted); }

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.9rem;
}

.main-nav a {
  text-decoration: none;
  color: var(--muted);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-pill);
  transition: background 0.2s ease, color 0.2s ease;
}

.main-nav a:hover { background: var(--accent-soft); color: var(--text); }

/* Banner */
.banner {
  width: 100%;
  height: 230px;
  background-image: url("./assets/background.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
}

@media (max-width: 640px) {
  .banner { height: 160px; }
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.5fr);
  gap: 2rem;
  padding: 3rem 7vw 2rem;
  align-items: center;
}

.hero-text h2 { margin-top: 0; font-size: clamp(2rem, 3vw, 2.6rem); }
.hero-text p { max-width: 34rem; color: var(--muted); }

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 1.5rem;
}

.hero-side { display: flex; justify-content: flex-end; }

.hero-card {
  background: radial-gradient(circle at top left, #262c4b, #101320);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.6rem;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border-subtle);
  max-width: 320px;
}

.hero-card h3 { margin-top: 0; margin-bottom: 0.6rem; }
.hero-card ul { margin: 0; padding-left: 1.1rem; font-size: 0.9rem; color: var(--muted); }

/* Sections */
.section { padding: 2.5rem 7vw; }

.section.alt {
  background: linear-gradient(to bottom, rgba(11, 15, 22, 0.98), rgba(5, 6, 8, 1));
}

.section-header { margin-bottom: 1.5rem; }
.section-header h2 { margin: 0 0 0.2rem; }
.section-header p { margin: 0; color: var(--muted); }

/* Grid and cards */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.4rem;
}

.card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 1.2rem 1.3rem;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
}

.card h3 { margin-top: 0; margin-bottom: 0.4rem; }
.card p { margin: 0 0 0.8rem; color: var(--muted); }

/* Card images */
.card-image {
  width: 100%;
  display: block;
  border-radius: 12px;
  margin-bottom: 0.75rem;
  border: 1px solid var(--border-subtle);
}

/* Game tile artwork links */
.game-tile {
  display: block;
  margin: 0.75rem auto;
  width: min(320px, 100%);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  transition: transform 0.12s ease, border-color 0.12s ease, filter 0.12s ease;
}

.game-tile img { display: block; width: 100%; height: auto; }

.game-tile:hover {
  transform: translateY(-2px);
  border-color: rgba(138, 91, 255, 0.45);
  filter: brightness(1.05);
}

/* Merch layout */
@media (min-width: 900px) {
  .merch-grid {
    grid-template-columns: 1.35fr 1fr 1fr;
    align-items: stretch;
  }

  /* key: make all merch cards flex columns so preview can fill and button sits at bottom */
  .rb-card,
  .book-card {
    display: flex;
    flex-direction: column;
    height: 100%;
  }
}

/* --- REDBUBBLE GRID FIX --- */

/* the preview area must be allowed to be tall enough for 3 rows */
.rb-grid-link {
  display: block;
  text-decoration: none;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.12);

  /* THIS is the important change */
  flex: 1;
  min-height: var(--rb-grid-min);
}

/* 2 columns x 3 rows always */
.rb-grid {
  height: 100%;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 0;
}

.rb-grid img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background: rgba(0, 0, 0, 0.25);
  display: block;

  /* slightly smaller padding so all 6 fit comfortably */
  padding: 10px;

  border-right: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);

  transition: transform 0.12s ease, filter 0.12s ease;
}

.rb-grid img:nth-child(2n) { border-right: none; }
.rb-grid img:nth-last-child(-n + 2) { border-bottom: none; }

.rb-grid-link:hover .rb-grid img { filter: brightness(1.05); }
.rb-grid img:hover { transform: translateY(-1px); }

/* --- BOOK COVER PREVIEW --- */
.book-link {
  display: block;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.12);

  flex: 1;
  min-height: var(--book-cover-min);
}

.book-cover {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background: rgba(0, 0, 0, 0.25);
  border: none;
  border-radius: 0;
  margin: 0;
  display: block;
}

/* CTA row pinned at bottom */
.merch-cta-row {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
}

/* Flex rows */
.flex-row {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.3fr);
  gap: 1.6rem;
}

.flex-col p { margin-top: 0; }

.link-list {
  list-style: none;
  padding-left: 0;
  margin: 0 0 0.8rem;
}

.link-list li { margin-bottom: 0.3rem; }
.link-list a { color: var(--accent); text-decoration: none; }
.link-list a:hover { text-decoration: underline; }

/* About */
.about-row { grid-template-columns: 1fr; }

/* 3 columns: Profile / Dogs / Socials */
.about-split {
  grid-template-columns: 1fr 1fr 1.5fr;
  align-items: start;
  gap: clamp(20px, 3vw, 40px);
}

/* Utility to center specific columns in the About section */
.center-col {
  text-align: center;
}

/* When an image wrap is inside a centered column, center the flexbox too */
.center-col .about-pic-wrap {
  justify-content: center;
}

.about-pic-wrap { display: flex; justify-content: flex-start; margin-top: 1.1rem; }

.about-pic {
  width: min(300px, 85%);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.55);
  object-fit: cover;
}

/* Socials */
/* Pulling the column up to align "Socials" text with "Sonic..." and "Oh..." text */
.about-socials {
  margin-top: -0.4rem;
}

.mini-title { margin: 0 0 6px; font-size: 1.25rem; }

/* Pushing the grid back down to maintain original spacing */
.mini-sub {
  margin: 0 0 1.4rem;
  opacity: 0.85;
  color: var(--muted);
}

.socials-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.social-card {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  /* Enforce left align inside social cards, even if parent column is centered */
  text-align: left;
  transition: transform 0.12s ease, border-color 0.12s ease, filter 0.12s ease;
}

.social-card:hover {
  transform: translateY(-2px);
  border-color: rgba(138, 91, 255, 0.45);
  filter: brightness(1.05);
}

.social-card:active { transform: translateY(-1px); }

.social-card:focus-visible {
  outline: 2px solid rgba(138, 91, 255, 0.65);
  outline-offset: 3px;
}

.social-cta {
  display: inline-block;
  margin-top: 0.2rem;
  color: var(--accent);
  font-size: 0.9rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.2rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn.primary {
  background: linear-gradient(to right, #ff4e8a, #8a5bff);
  border-color: #ff4e8a;
  color: #fff;
  box-shadow: var(--shadow-soft);
}

.btn.ghost {
  background: transparent;
  border-color: var(--border-subtle);
  color: var(--text);
}

.btn.ghost:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.btn.small { padding: 0.45rem 1rem; font-size: 0.85rem; }
.btn.big { padding: 0.7rem 1.35rem; font-size: 0.95rem; }

.btn.purple {
  background: rgba(138, 91, 255, 0.95);
  border-color: rgba(138, 91, 255, 0.95);
  color: #fff;
}

.btn.purple:hover { background: rgba(138, 91, 255, 1); }

/* Embeds */
.spotify-embed,
.video-embed {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
}

/* Misc */
.note { font-size: 0.85rem; color: var(--muted); }
.center { text-align: center; }

#contact a { color: var(--accent); text-decoration: none; }
#contact a:hover { text-decoration: underline; }

/* Footer */
.site-footer {
  padding: 1.2rem 7vw 1.8rem;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
}

/* Responsive */
@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-side { justify-content: flex-start; }
  .flex-row { grid-template-columns: minmax(0, 1fr); }
  .about-split { grid-template-columns: 1fr; }
  .socials-grid { grid-template-columns: 1fr; }

  :root {
    --rb-grid-min: 520px;
    --book-cover-min: 520px;
  }
}

@media (max-width: 640px) {
  .site-header { padding: 1rem 5vw; }
  .section { padding: 2rem 5vw; }

  :root {
    --rb-grid-min: 480px;
    --book-cover-min: 480px;
  }
}
