/* MattyCanny – base and layout */
@import url("https://fonts.googleapis.com/css2?family=Nunito:wght@800&display=swap");

:root {
  --color-bg: #0f0f12;
  --color-surface: #1a1a1f;
  --color-text: #e8e8ec;
  --color-text-muted: #9a9aa5;
  --color-accent: #9147ff;
  --color-accent-hover: #772ce8;
  --color-twitch: #9147ff;
  --color-discord: #5865f2;
  --font-sans: "Segoe UI", system-ui, sans-serif;
  --font-size-base: 1rem;
  --line-height: 1.6;
  --space: 1.25rem;
  --header-height: 3.5rem;
  --max-width: 56rem;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height);
  color: var(--color-text);
  background: var(--color-bg);
}

/* Parallax layer - hero image moves slower on scroll; gradient shows where image doesn't cover */
.parallax-layer {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: linear-gradient(180deg, #8b1538 0%, #1e3a5f 50%, #0d1b2a 100%);
}
.parallax-layer img {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%) translateY(var(--parallax-y, 0));
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  object-fit: cover;
  object-position: center top;
}

.skip-link {
  position: absolute;
  top: -3rem;
  left: var(--space);
  z-index: 100;
  padding: 0.5rem 0.75rem;
  background: var(--color-accent);
  color: #fff;
  text-decoration: none;
  border-radius: 0.25rem;
  transition: top 0.2s;
}
.skip-link:focus {
  top: var(--space);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 15, 18, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.75rem var(--space);
  gap: var(--space);
}

.logo {
  display: inline-flex;
  align-items: center;
  color: var(--color-text);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.25rem;
}
.logo img {
  display: block;
  height: 2rem;
  width: auto;
}
.logo-text {
  display: none;
}
.logo img[style*="display: none"] ~ .logo-text {
  display: inline;
}

.nav-toggle {
  display: none;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
  border-radius: 0.25rem;
  align-items: center;
  justify-content: center;
}
.nav-toggle::before {
  content: "";
  width: 1.25rem;
  height: 2px;
  background: currentColor;
  box-shadow: 0 -6px 0 currentColor, 0 6px 0 currentColor;
}
@media (max-width: 48rem) {
  .nav-toggle {
    display: flex;
  }
  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-surface);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }
  .nav.is-open {
    max-height: 20rem;
  }
  .nav-list {
    flex-direction: column;
    padding: var(--space);
  }
  .nav-list li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }
  .nav-list a {
    display: block;
    padding: 0.75rem 0;
  }
}

.nav-list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0.5rem;
}

.nav-list a {
  color: var(--color-text-muted);
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  border-radius: 0.25rem;
  font-weight: 700;
  transition: color 0.2s, background 0.2s;
}
.nav-list a:hover,
.nav-list a:focus-visible {
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.06);
}

/* Main */
.main {
  min-height: calc(100vh - var(--header-height));
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space);
}

/* Hero - empty spacer; parallax layer shows behind */
.hero {
  min-height: 70vh;
}

.main {
  position: relative;
  z-index: 0;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.65rem 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0.375rem;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}
.btn-primary {
  background: var(--color-accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--color-accent-hover);
}
.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
}
.btn-twitch {
  background: var(--color-twitch);
  color: #fff;
}
.btn-twitch:hover {
  background: var(--color-accent-hover);
}
.btn-discord {
  background: var(--color-discord);
  color: #fff;
}
.btn-discord:hover {
  background: #4752c4;
}

/* Sections - solid background so parallax only shows in hero */
.section {
  padding: 3rem 0;
  background: var(--color-bg);
}
.section.about,
.section.blog {
  background: #000;
}
.blog-banners {
  padding: 50px 0;
}
.blog-banners-list {
  display: flex;
  flex-direction: column;
}
@media (max-width: 48rem) {
  .blog-banners {
    padding: 24px 0;
  }
}
.section h2 {
  margin: 0 0 1rem;
  font-size: 1.5rem;
  font-weight: 600;
}
.section p {
  margin: 0 0 1rem;
  color: var(--color-text-muted);
  max-width: 40rem;
}
.section p:last-of-type {
  margin-bottom: 1.5rem;
}

.community-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.community-note {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}
.community-note code {
  padding: 0.15rem 0.35rem;
  background: var(--color-surface);
  border-radius: 0.25rem;
  font-size: 0.85em;
}

/* Merch banner - full width, between About and Blog, 50px spacing */
.merch-banners {
  padding: 50px 0;
}
.merch-banners-list {
  display: flex;
  flex-direction: column;
}

/* Merch banner on mobile - tighter spacing */
@media (max-width: 48rem) {
  .merch-banners {
    padding: 24px 0;
  }
}

/* Social banners - full width, stacked */
.social-banners {
  padding: 50px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.social-banners-list {
  display: flex;
  flex-direction: column;
}
/* Overlap each banner by 1px to remove hairline gap */
.social-banner + .social-banner {
  margin-top: -1px;
}
.social-banner {
  position: relative;
  display: block;
  width: 100%;
  line-height: 0;
  transition: opacity 0.2s;
}
.social-banner:hover {
  opacity: 0.95;
}
.social-banner:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: -2px;
}
.social-banner img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  vertical-align: top;
}

/* Blog listing page – same gradient feel as home, no social banners */
.blog-body {
  position: relative;
}
.blog-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, #8b1538 0%, #1e3a5f 50%, #0d1b2a 100%);
}
.blog-page {
  padding: 0;
}
.blog-hero {
  min-height: 28vh;
  background: transparent;
}
.blog-content {
  background: var(--color-bg);
  padding: 2.5rem 0 4rem;
}
.container--blog {
  max-width: 75rem;
}
.blog-page-header {
  margin-bottom: 2.5rem;
}
.blog-page-header h1 {
  margin: 0 0 0.5rem;
  font-family: "Nunito", var(--font-sans);
  font-size: 16pt;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--color-text);
}
.blog-page-desc {
  margin: 0;
  color: var(--color-text-muted);
}
.blog-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
@media (max-width: 56rem) {
  .blog-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}
.blog-card {
  background: #fff;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s, box-shadow 0.2s;
}
.blog-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.3);
}
.blog-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}
.blog-card-link:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}
.blog-card-image {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--color-surface);
}
.blog-card-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.blog-card-body {
  padding: 1.75rem 2rem;
}
.blog-card-meta {
  margin-top: 0.25rem;
  margin-bottom: 0;
  font-size: 0.9rem;
}
.blog-card-date {
  color: #666;
}
.blog-card-tag {
  display: inline-block;
  padding: 0.3rem 0.65rem;
  margin-bottom: 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: var(--color-accent);
  color: #fff;
  border-radius: 0.25rem;
}
.blog-card-title {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.35;
  color: #111;
}
.blog-card-excerpt {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  line-height: 1.55;
  color: #444;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Blog post page */
.post-page {
  padding: 2rem 0 4rem;
  background: var(--color-bg);
}
.post-article {
  outline: none;
}
.container--narrow {
  max-width: 68rem;
}
.post-back {
  display: inline-block;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  color: var(--color-accent);
  text-decoration: none;
}
.post-back:hover {
  text-decoration: underline;
}
.post-back:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}
.post-header {
  margin-bottom: 1.5rem;
}
.post-tag {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  margin-bottom: 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: var(--color-accent);
  color: #fff;
  border-radius: 0.25rem;
}
.post-title {
  margin: 0 0 0.25rem;
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-text);
}
.post-subtitle {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--color-text-muted);
}
.post-meta {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}
.post-meta time {
  margin-left: 0;
}
.post-featured {
  max-width: 22%;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 1.5rem;
  border-radius: 0.5rem;
  overflow: hidden;
  background: var(--color-surface);
  cursor: pointer;
}
.post-featured img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}
@media (max-width: 40rem) {
  .post-featured {
    max-width: 100%;
  }
}
.post-content {
  font-size: 1.0625rem;
  line-height: 1.7;
}
.post-content p {
  margin: 0 0 1rem;
  color: var(--color-text);
}
.post-content p:last-child {
  margin-bottom: 0;
}
.post-content a {
  color: var(--color-accent);
  text-decoration: none;
}
.post-content a:hover {
  text-decoration: underline;
}
.post-content a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}
.post-content ul {
  margin: 0 0 1rem;
  padding-left: 1.5rem;
  color: var(--color-text);
}
.post-content li {
  margin-bottom: 0.5rem;
}
.post-content li:last-child {
  margin-bottom: 0;
}
.post-actions {
  margin-top: 1.5rem;
  margin-bottom: 0;
}
.post-inline-figure {
  max-width: 22%;
  margin: 1.5rem auto;
  border-radius: 0.5rem;
  overflow: hidden;
  background: var(--color-surface);
  cursor: pointer;
}
.post-inline-figure img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}
.post-inline-figure figcaption {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  text-align: center;
}
@media (max-width: 40rem) {
  .post-inline-figure {
    max-width: 100%;
  }
}

/* Lightbox: click post image for larger preview */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.9);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}
.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}
.lightbox-backdrop {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  cursor: pointer;
}
.lightbox-backdrop img {
  display: block;
  max-width: 100%;
  max-height: 95vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 0.5rem;
  cursor: default;
  pointer-events: none;
}
.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.85;
}
.lightbox-close:hover {
  opacity: 1;
}
.lightbox-close:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}
