/* =========================================
   1. VARIABLES & CONFIGURATION
   ========================================= */
:root {
  /* STRAWBERRY MILK (LIGHT) */
  --bg-light: #fff6ee;
  --card-bg: #ffffff;
  --text-main: #4b3a32;
  --text-muted: #8d7b72;

  /* ACCENTS */
  --accent-pink: #ff86b6;
  --accent-blue: #bfe8ff;
  --accent-peach: #ffb38a;
  --accent-lightpeach: #ffe8dc;
  --bg-gradient: linear-gradient(135deg, #fff6ee 0%, #ffeaf2 100%);

  /* DIMENSIONS */
  --grid-gap: 20px;
  --row-height: 200px;

  /* THEMEABLE SURFACE STYLING */
  --card-border: var(--accent-lightpeach);
  --card-shadow: 0 8px 24px rgba(255, 134, 182, 0.15);
  --card-shadow-hover: 0 15px 35px rgba(255, 134, 182, 0.2);

  /* ICON TREATMENT */
  --icon-filter: invert(74%) sepia(80%) saturate(466%) hue-rotate(306deg) brightness(100%) contrast(101%);
  --icon-opacity: 0.45;

  /* BADGES */
  --badge-bg: var(--text-main);
  --badge-text: #ffffff;
}

/* Allow browser UI to respect user scheme (forms/scrollbars), while your CSS controls the page */
html { color-scheme: light dark; }

/* =========================================
   2. GLOBAL RESET & BODY
   ========================================= */
* { box-sizing: border-box; }

body {
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: 'Quicksand', 'Varela Round', sans-serif;

  /* Layout: sticky footer + responsive vertical centering behavior */
  display: flex;
  flex-direction: column;

  min-height: 100vh;
  min-height: 100svh;

  margin: 0;

  /* Consistent padding + safe areas */
  padding: 20px;
  padding-top: calc(20px + env(safe-area-inset-top));
  padding-bottom: calc(20px + env(safe-area-inset-bottom));

  /* Center horizontally only (vertical handled by grid track alignment) */
  align-items: center;
  justify-content: flex-start;
}

a {
  text-decoration: none;
  color: inherit;
  display: flex;

  /* No underlines anywhere by default (all link states) */
a:link,
a:visited,
a:hover,
a:active,
a:focus {
  text-decoration: none;
}

/* Hard guarantee for clickable cards (your <a class="card ..."> elements) */
a.card,
a.card:link,
a.card:visited,
a.card:hover,
a.card:active,
a.card:focus {
  text-decoration: none !important;
}

/* If you ever want an underline, opt-in explicitly */
.u-underline { text-decoration: underline !important; }

/* Accessibility: keep a clear focus indicator without underlines */
a.card:focus-visible {
  outline: 3px solid var(--accent-pink);
  outline-offset: 4px;
  border-radius: 24px;
}

}

/* =========================================
   3. BASE CARD PHYSICS (Shared Styles)
   ========================================= */
.card {
  background-color: var(--card-bg);
  border: 2px solid var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: 24px;
  padding: 20px;

  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease-in-out;

  position: relative;
  overflow: hidden;
  color: var(--text-main);
}

.card h3 {
  font-weight: 800;
  margin: 0 0 5px 0;
  background: linear-gradient(to right, var(--accent-pink), var(--accent-peach));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  display: inline-block;
}

.card p {
  font-family: 'Quicksand', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  margin: 0;
  line-height: 1.4;
  z-index: 2;
  position: relative;
}

.card:hover {
  transform: translateY(-5px) scale(1.02);
  border-color: rgba(255, 134, 182, 0.4);
  box-shadow: var(--card-shadow-hover);
}

/* =========================================
   4. DESKTOP GRID SYSTEM
   ========================================= */
.bento-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: var(--row-height);
  gap: var(--grid-gap);

  max-width: 1000px;
  width: 100%;

  /* Horizontal centering only */
  margin: 0 auto;

  /* Makes footer stick to bottom on tall screens */
  flex: 1;

  /* Default: top-align tracks */
  align-content: start;
}

/* Desktop: vertically center grid tracks inside available space */
@media (min-width: 769px) {
  .bento-container { align-content: center; }
}

/* =========================================
   5. INDIVIDUAL CARD MODULES
   ========================================= */

/* --- A. HERO CARDS --- */

/* VIDEO PLAYER */
.card-video {
  grid-column: span 2;
  grid-row: span 2;
  padding: 0;
}

/* Live Mode Pulse */
.card-video.is-live {
  border-color: #ff4646 !important;
  box-shadow: 0 0 30px rgba(255, 0, 0, 0.4) !important;
  animation: pulse-red 2s infinite;
  z-index: 5;
}

/* BIO CARD */
.card-bio {
  grid-column: span 1;
  grid-row: span 2;
  background-color: #2d2d2d;
  padding: 0;
  border: none;
}

.card-bio .bio-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  transition: transform 0.5s ease;
}

.card-bio:hover .bio-image { transform: scale(1.05); }

.card-bio .bio-content {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 20px;
  z-index: 2;
  background: linear-gradient(to top, rgba(75, 58, 50, 0.8), transparent);
}

.card-bio h2 {
  color: white;
  margin: 0 0 5px 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.card-bio p {
  color: white !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  opacity: 0.9;
}

/* --- B. SOCIAL CARDS --- */

.card-social .card-icon {
  position: absolute;
  right: -20px;
  bottom: -20px;
  width: 120px;
  height: 120px;
  filter: var(--icon-filter);
  opacity: var(--icon-opacity);
  transform: rotate(-15deg);
  transition: all 0.3s ease;
  z-index: 1;
}

.card-social:hover .card-icon {
  opacity: 0.30;
  transform: rotate(0deg) scale(1.1);
}

.card-social:hover {
  border-color: var(--accent-pink) !important;
  box-shadow: 0 12px 30px rgba(255, 134, 182, 0.25);
}

/* Support both class-based and id-based targeting */
.card-twitter:hover,
#card-twitter:hover { background-color: rgba(248, 248, 248, 1); }

.card-insta:hover,
#card-insta:hover { background-color: rgba(253, 245, 250, 1); }

.card-discord:hover,
#card-discord:hover { background-color: rgba(245, 247, 255, 1); }

#side-stage:has(img[src*="twitch"]):hover { background-color: rgba(253, 250, 255, 1); }
#side-stage:has(img[src*="youtube"]):hover { background-color: rgba(255, 250, 250, 1); }

.card-patreon:hover,
#card-patreon:hover { background-color: rgba(255, 245, 245, 1); }

/* --- C. BUSINESS CARDS (WIDE) --- */

/* WORK WITH ME */
.card-contact {
  grid-column: span 2;
  background-color: var(--bg-light);
  background-image:
    linear-gradient(rgba(255, 134, 182, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 134, 182, 0.1) 1px, transparent 1px);
  background-size: 20px 20px;

  border: 2px solid var(--accent-pink);
}

.card-contact .card-content {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card-contact h3 {
  background: none;
  -webkit-text-fill-color: var(--text-main);
  color: var(--text-main);
}

.card-contact .cta-text {
  color: #d63384;
  font-weight: 800;
  text-transform: uppercase;
  margin-top: auto;
}

.card-contact .mascot-img {
  position: absolute;
  bottom: -10px;
  right: -10px;
  width: 100px;
  height: auto;
  transform: scaleX(-1) rotate(-10deg);
  opacity: 0.9;
  transition: transform 0.3s ease;
}

.card-contact:hover .mascot-img {
  transform: scale(-1.1, 1.1) rotate(0deg) translateY(-10px);
}

/* SHOP */
.card-shop {
  grid-column: span 3;
  background-color: var(--bg-light);
  background-image: repeating-linear-gradient(
    -45deg,
    rgba(255, 246, 238, 1),
    rgba(255, 246, 238, 1) 20px,
    rgba(255, 224, 235, 0.281) 20px,
    rgba(255, 224, 235, 0.288) 40px
  );
  border: 2px solid var(--accent-pink);
}

.card-shop .shop-arrow {
  align-self: flex-end;
  font-size: 2rem;
  color: var(--accent-pink);
  transition: transform 0.3s ease;
  margin-top: auto;
}

.card-shop:hover .shop-arrow { transform: translateX(10px); }

/* =========================================
   6. STATES (Live, Disabled, Etc)
   ========================================= */
.card.disabled {
  filter: grayscale(0.8) opacity(0.7);
  pointer-events: none;
  cursor: default;
  transform: none !important;
  box-shadow: none !important;
  border-color: #ddd !important;
}

.coming-soon-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-10deg);
  background: var(--badge-bg);
  color: var(--badge-text);
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 0.9rem;
  white-space: nowrap;
  z-index: 100;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.85);
}

.live-badge {
  position: absolute;
  top: 15px;
  left: 15px;
  background: #ff0000;
  color: white;
  font-weight: 800;
  padding: 6px 12px;
  border-radius: 50px;
  font-size: 0.85rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  z-index: 100;
  pointer-events: none;
}

/* =========================================
   7. FOOTER
   ========================================= */
.ghost-footer {
  margin-top: 24px;
  width: 100%;
  text-align: center;
  z-index: 10;
}

.ghost-footer p {
  font-size: 0.75rem;
  color: var(--text-main);
  opacity: 0.3;
  font-weight: 500;
}

/* =========================================
   8. MOBILE LAYOUT (The Stack)
   ========================================= */
@media (max-width: 768px) {
  .bento-container {
    flex: 0;

    grid-template-columns: 1fr;
    grid-auto-rows: auto;
    width: 100%;
    gap: 20px;

    align-content: start;
  }

  .card {
    width: 100%;
    height: 180px;
    min-height: 0;
    margin-bottom: 0;
    grid-column: span 1 !important;

    flex-direction: row;
    align-items: center;
  }

  .card-video { height: 250px; }
  .card-bio { height: 450px; }

  .card-contact,
  .card-shop {
    height: 180px;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
  }

  /* Mobile sequence (supports id or class for these cards) */
  .card-video { order: 1; }
  .card-bio { order: 2; }
  #side-stage { order: 3; }

  .card-discord, #card-discord { order: 4; }
  .card-twitter, #card-twitter { order: 5; }
  .card-insta,   #card-insta   { order: 6; }
  .card-patreon, #card-patreon { order: 7; }

  .card-contact { order: 8; }
  .card-shop { order: 9; }

  .ghost-footer {
    margin-top: 40px;
    margin-bottom: 20px;
  }
}

/* =========================================
   9. DARK MODE (PRESENT, BUT MIRRORS LIGHT FOR NOW)
   ========================================= */
@media (prefers-color-scheme: dark) {
  :root {
    /* Mirror the LIGHT palette exactly */
    --bg-light: #fff6ee;
    --card-bg: #ffffff;
    --text-main: #4b3a32;
    --text-muted: #8d7b72;

    --accent-pink: #ff86b6;
    --accent-blue: #bfe8ff;
    --accent-peach: #ffb38a;
    --accent-lightpeach: #ffe8dc;
    --bg-gradient: linear-gradient(135deg, #fff6ee 0%, #ffeaf2 100%);

    --grid-gap: 20px;
    --row-height: 200px;

    --card-border: var(--accent-lightpeach);
    --card-shadow: 0 8px 24px rgba(255, 134, 182, 0.15);
    --card-shadow-hover: 0 15px 35px rgba(255, 134, 182, 0.2);

    --icon-filter: invert(74%) sepia(80%) saturate(466%) hue-rotate(306deg) brightness(100%) contrast(101%);
    --icon-opacity: 0.45;

    --badge-bg: var(--text-main);
    --badge-text: #ffffff;
  }
}

/* =========================================
   10. ANIMATIONS
   ========================================= */
@keyframes pulse-red {
  0%   { box-shadow: 0 0 20px rgba(255, 0, 0, 0.4); }
  50%  { box-shadow: 0 0 40px rgba(255, 0, 0, 0.7); }
  100% { box-shadow: 0 0 20px rgba(255, 0, 0, 0.4); }
}
