/* Home page styles */

.home-container {
  min-height: 100vh;
  position: relative;
  background: var(--bg);
  overflow-x: hidden;
}

/* FLAWLESS graffiti */
.flawless-graffiti {
  position: fixed;
  top: 20px;
  right: 30px;
  z-index: 100;
  pointer-events: none;
}

.graffiti-svg {
  width: 300px;
  height: 60px;
  display: block;
  overflow: visible;
}

.graffiti-text {
  font-family: 'Courier New', monospace;
  font-size: 42px;
  font-weight: 900;
  fill: #e8dcff;
  letter-spacing: 0.15em;
  opacity: 0.7;
}

.graffiti-text-2 {
  font-family: 'Courier New', monospace;
  font-size: 42px;
  font-weight: 900;
  fill: #c4a7ff;
  letter-spacing: 0.15em;
  opacity: 0.4;
}

.drip {
  fill: #d7c0ff;
  opacity: 0.5;
}

/* Header */
.home-header {
  text-align: center;
  padding: 60px 20px 40px;
  position: relative;
}

.home-title {
  margin: 0;
  color: #b69aff;
  font-family: "Courier New", monospace;
  font-size: clamp(48px, 10vw, 72px);
  font-weight: 1000;
  letter-spacing: 0.08em;
  line-height: 1;
  text-shadow: 4px 4px 0 #6249a6, 8px 8px 0 #34264f;
  -webkit-text-stroke: 0.8px #e0d3ff;
  position: relative;
}

.home-title::before {
  content: '';
  position: absolute;
  top: -10px;
  left: -15px;
  right: -15px;
  bottom: -10px;
  background: linear-gradient(135deg, #a78bfa22 0%, transparent 50%);
  z-index: -1;
  transform: rotate(-2deg);
}

.home-tagline {
  margin: 20px auto 0;
  max-width: 500px;
  color: #c4bdd4;
  font-size: 15px;
  line-height: 1.6;
  font-weight: 400;
}

/* Decorative elements */
.decoration {
  position: absolute;
  pointer-events: none;
  opacity: 0.3;
}

.decoration-1 {
  top: 120px;
  left: 5%;
}

.decoration-2 {
  top: 200px;
  right: 8%;
}

.decoration-3 {
  bottom: 100px;
  left: 10%;
}

.deco-svg {
  width: 100px;
  height: 100px;
}

.deco-line {
  fill: none;
  stroke: #a78bfa;
  stroke-width: 2;
  stroke-linecap: round;
}

.deco-circle {
  fill: none;
  stroke: #c4a7ff;
  stroke-width: 2;
}

.deco-shape {
  fill: #a78bfa33;
  stroke: #c4a7ff;
  stroke-width: 1.5;
}

.deco-rect {
  fill: #a78bfa22;
  stroke: #c4a7ff;
  stroke-width: 1.5;
}

.deco-triangle {
  fill: #c4a7ff33;
  stroke: #c4a7ff;
  stroke-width: 1.5;
}

.deco-wave {
  fill: none;
  stroke: #a78bfa;
  stroke-width: 2;
  stroke-linecap: round;
}

.deco-dot {
  fill: #c4a7ff;
}

/* Main layout */
.home-layout {
  display: grid;
  grid-template-columns: minmax(280px, 320px) minmax(0, 1fr);
  gap: 50px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 30px 40px 80px;
  align-items: start;
  min-height: calc(100vh - 200px);
}

/* Bio section */
.home-bio {
  position: relative;
}

.bio-content {
  background: linear-gradient(145deg, #191820 0%, #15141b 100%);
  border: 1px solid #302c3b;
  border-radius: 8px;
  padding: 32px 28px;
  position: relative;
}

.bio-content::before {
  content: '';
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  background: linear-gradient(135deg, #a78bfa44, #6249a644);
  border-radius: 10px;
  z-index: -1;
  opacity: 0.5;
}

.bio-title {
  margin: 0 0 20px;
  color: #e1d5ff;
  font-family: "Courier New", monospace;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: lowercase;
}

.bio-text {
  margin: 0 0 16px;
  color: #c4bdd4;
  font-size: 14px;
  line-height: 1.7;
}

.bio-divider {
  height: 1px;
  background: linear-gradient(90deg, #a78bfa66, transparent);
  margin: 20px 0;
}

.bio-small {
  margin: 0;
  color: #a39bb8;
  font-size: 13px;
  font-style: italic;
}

/* Mode cards section */
.home-modes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding: 20px 0;
}

.mode-card {
  background: linear-gradient(145deg, #191820 0%, #15141b 100%);
  border: 2px solid #302c3b;
  border-radius: 16px;
  padding: 32px 24px 24px;
  position: relative;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.22, 0.8, 0.25, 1);
  overflow: hidden;
  min-height: 180px;
  display: flex;
  flex-direction: column;
}

.mode-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, var(--mode-glow) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.mode-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--mode-glow);
  opacity: 0.6;
  box-shadow: 0 0 15px var(--mode-glow);
}

.mode-card:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: var(--mode-glow);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4), 0 0 20px var(--mode-glow33);
}

.mode-card:hover::before {
  opacity: 0.15;
}

.mode-card:hover::after {
  opacity: 1;
  box-shadow: 0 0 25px var(--mode-glow);
}

.mode-number {
  position: absolute;
  top: 12px;
  right: 16px;
  font-family: "Courier New", monospace;
  font-size: 56px;
  font-weight: 1000;
  color: var(--mode-glow);
  opacity: 0.25;
  line-height: 1;
  letter-spacing: -0.03em;
  text-shadow: 0 0 10px var(--mode-glow);
}

.mode-card:hover .mode-number {
  opacity: 0.5;
  text-shadow: 0 0 30px var(--mode-glow);
}

.mode-name {
  margin: 0 0 12px;
  color: #e1d5ff;
  font-family: "Courier New", monospace;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}

.mode-description {
  margin: 0;
  color: #a39bb8;
  font-size: 13px;
  line-height: 1.5;
  flex-grow: 1;
  position: relative;
  z-index: 1;
}

.mode-preview {
  width: 100%;
  height: 60px;
  margin-top: 16px;
  background: #111016;
  border: 1px solid #211e2a;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  opacity: 0.7;
}

.mode-preview::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 4px,
    #211e2a 4px,
    #211e2a 5px
  );
  opacity: 0.3;
}

/* Modes 2-6 are placeholders until their training modules are built. */
.mode-card-locked {
  cursor: pointer;
}

.mode-card-locked:hover {
  transform: none;
  border-color: #302c3b;
  box-shadow: none;
}

.mode-card-locked:hover::before {
  opacity: 0;
}

.mode-card-locked:hover::after {
  opacity: 0.6;
  box-shadow: 0 0 15px var(--mode-glow);
}

.mode-card-locked .mode-number {
  opacity: 0.25;
}

.mode-question {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--mode-glow);
  font-family: "Courier New", monospace;
  font-size: 72px;
  font-weight: 1000;
  line-height: 1;
  text-shadow:
    0 0 6px var(--mode-glow),
    0 0 16px var(--mode-glow),
    0 0 32px var(--mode-glow),
    0 0 54px var(--mode-glow);
  filter: drop-shadow(0 0 8px var(--mode-glow));
  opacity: 0.95;
  user-select: none;
}

.mode-card-shake {
  animation: mode-card-shake 0.32s ease-in-out;
}

@keyframes mode-card-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

/* Mode-specific glow colors */
.mode-card[data-mode="1"] {
  --mode-glow: #a78bfa;
}

.mode-card[data-mode="2"] {
  --mode-glow: #818cf8;
}

.mode-card[data-mode="3"] {
  --mode-glow: #67e8f9;
}

.mode-card[data-mode="4"] {
  --mode-glow: #f472b6;
}

.mode-card[data-mode="5"] {
  --mode-glow: #fb923c;
}

.mode-card[data-mode="6"] {
  --mode-glow: #4ade80;
}

/* Mini-game guide books */
.mode-book {
  position: absolute;
  right: 14px;
  bottom: 12px;
  width: 68px;
  height: 84px;
  z-index: 5;
  perspective: 500px;
}

.book-cover {
  width: 68px;
  height: 84px;
  padding: 7px 6px;
  border: 1px solid color-mix(in srgb, var(--mode-glow) 70%, #17151d);
  border-radius: 3px 7px 7px 3px;
  background:
    linear-gradient(90deg, rgba(0,0,0,.25) 0 5px, transparent 5px),
    linear-gradient(145deg, color-mix(in srgb, var(--mode-glow) 82%, #241d31), color-mix(in srgb, var(--mode-glow) 38%, #17151d));
  color: #fff;
  font-family: "Courier New", monospace;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  position: relative;
  cursor: pointer;
  box-shadow: 3px 4px 0 rgba(0,0,0,.35), 0 0 14px color-mix(in srgb, var(--mode-glow) 35%, transparent);
  transform: rotate(2deg);
  transition: transform .2s ease, box-shadow .2s ease;
}

.book-cover::before {
  content: '';
  position: absolute;
  inset: 5px 5px 5px 8px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 2px 5px 5px 2px;
  pointer-events: none;
}

.book-cover:hover {
  transform: rotate(0deg) translateY(-3px);
  box-shadow: 4px 7px 0 rgba(0,0,0,.35), 0 0 22px color-mix(in srgb, var(--mode-glow) 55%, transparent);
}

.book-cover-small {
  font-size: 8px;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: .8;
}

.book-cover-title {
  font-size: 22px;
  font-weight: 1000;
  line-height: .9;
  text-shadow: 0 0 8px rgba(255,255,255,.35);
}

.book-cover-subtitle {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .12em;
}

.book-cover-star {
  font-size: 9px;
  opacity: .8;
  margin-top: 3px;
}

.book-cover-future {
  cursor: default;
  opacity: .72;
}

.book-cover-future:hover {
  transform: rotate(2deg);
  box-shadow: 3px 4px 0 rgba(0,0,0,.35), 0 0 14px color-mix(in srgb, var(--mode-glow) 35%, transparent);
}

.book-cover-mark {
  font-size: 30px;
  font-weight: 1000;
  line-height: 1;
  text-shadow: 0 0 12px var(--mode-glow);
}

.book-cover-number {
  font-size: 8px;
  opacity: .7;
}

.book-pages {
  position: absolute;
  inset: -18px -92px -18px -92px;
  width: 252px;
  min-height: 120px;
  padding: 18px 24px 12px;
  background: #eee7d5;
  color: #332d3b;
  border: 1px solid #b8ad96;
  border-radius: 3px;
  box-shadow: 5px 7px 0 rgba(0,0,0,.35), 0 0 22px color-mix(in srgb, var(--mode-glow) 25%, transparent);
  transform: rotate(-1deg);
  z-index: 20;
}

.book-pages::before,
.book-pages::after {
  content: '';
  position: absolute;
  top: 9px;
  bottom: 9px;
  width: 1px;
  background: #d1c5ad;
}

.book-pages::before { left: 50%; }
.book-pages::after { display: none; }

.book-close {
  position: absolute;
  top: 4px;
  right: 7px;
  border: 0;
  background: transparent;
  color: #756a78;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.book-page-content {
  position: relative;
  z-index: 1;
  min-height: 78px;
  padding: 7px 2px 5px;
  font-family: Georgia, serif;
  font-size: 11px;
  line-height: 1.45;
}

.book-page-controls {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 3px;
  border-top: 1px solid #d1c5ad;
  padding-top: 5px;
}

.book-page-controls button {
  width: 24px;
  height: 22px;
  padding: 0;
  border: 1px solid #c0b49e;
  border-radius: 4px;
  background: #e2dac8;
  color: #4b4252;
  font-size: 17px;
  line-height: 18px;
  cursor: pointer;
}

.book-page-controls button:disabled {
  opacity: .3;
  cursor: default;
}

.book-page-number {
  font-family: "Courier New", monospace;
  font-size: 8px;
  color: #81768a;
}

/* Trainer link */
.trainer-link {
  text-align: center;
  padding: 40px 20px;
}

.trainer-button {
  display: inline-block;
  padding: 14px 32px;
  background: linear-gradient(145deg, #a78bfa, #8b5cf6);
  color: #f3f0ff;
  font-family: "Courier New", monospace;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-decoration: none;
  border-radius: 6px;
  border: 1px solid #c4a7ff;
  box-shadow: 0 4px 0 #6249a6, 0 6px 20px rgba(167, 139, 250, 0.3);
  transition: all 0.2s;
}

.trainer-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #6249a6, 0 8px 25px rgba(167, 139, 250, 0.4);
}

.trainer-button:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #6249a6, 0 4px 15px rgba(167, 139, 250, 0.3);
}

/* Responsive */
@media (max-width: 1100px) {
  .home-modes {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .home-layout {
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 20px 24px 40px;
  }
  
  .home-modes {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .flawless-graffiti {
    top: 15px;
    right: 20px;
  }
  
  .graffiti-svg {
    width: 240px;
    height: 48px;
  }
  
  .graffiti-text,
  .graffiti-text-2 {
    font-size: 32px;
  }
}

@media (max-width: 600px) {
  .home-modes {
    grid-template-columns: 1fr;
  }
  
  .mode-card {
    min-height: 160px;
  }
}

@media (max-width: 600px) {
  .home-header {
    padding: 40px 16px 30px;
  }
  
  .home-title {
    font-size: 36px;
  }
  
  .decoration {
    opacity: 0.2;
  }
  
  .decoration-1 {
    top: 100px;
    left: 3%;
  }
  
  .decoration-2 {
    top: 150px;
    right: 5%;
  }
  
  .bio-content {
    padding: 24px 20px;
  }
  
  .mode-card {
    padding: 24px 20px;
  }

  .mode-book {
    right: 10px;
    bottom: 10px;
    transform: scale(.9);
    transform-origin: bottom right;
  }

  .book-pages {
    inset: -14px -70px -14px -170px;
    width: 232px;
  }
}
