/* ============================================================
   LANDING PAGE STYLES (index.html)
   Animated hero, topic cards, nav strip, and scroll reveals.
   ============================================================ */

/* ===== HERO SECTION ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(160deg,
    #08080e 0%,
    #0a1520 40%,
    #0e0820 70%,
    #120818 100%);
}

/* Code rain canvas - fills the hero, behind the hero content */
.hero__rain {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  opacity: 0.35;
  pointer-events: none;
}

.hero__content {
  position: relative;
  z-index: 2;
  max-width: 720px;
  padding: 120px 24px 80px;
  text-align: center;
  animation: heroFadeIn 1s ease forwards;
}

@keyframes heroFadeIn {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--md-sys-color-primary);
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline-variant);
  margin-bottom: 24px;
  animation: heroFadeIn 1s ease 0.2s both;
}

.hero__title {
  font-family: var(--md-sys-typescale-display-font);
  font-size: clamp(2.2rem, 6vw, 3.8rem);
  font-weight: 800;
  line-height: 1.15;
  color: var(--md-sys-color-on-surface);
  margin-bottom: 24px;
  animation: heroFadeIn 1s ease 0.35s both;
}

.hero__accent {
  color: var(--md-sys-color-primary);
}

.hero__cursor {
  color: var(--md-sys-color-primary);
  font-weight: 300;
  animation: blink 0.8s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.hero__sub {
  font-size: clamp(1rem, 2vw, 1.15rem);
  line-height: 1.7;
  color: var(--md-sys-color-on-surface-variant);
  max-width: 600px;
  margin: 0 auto 36px;
  animation: heroFadeIn 1s ease 0.5s both;
}

.hero__actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  animation: heroFadeIn 1s ease 0.65s both;
}

.hero__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 28px;
  font-family: var(--md-sys-typescale-body-font);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hero__btn:hover {
  transform: translateY(-2px);
}

.hero__btn--primary {
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  box-shadow: 0 4px 20px rgba(0, 229, 255, 0.3);
}

.hero__btn--primary:hover {
  box-shadow: 0 8px 30px rgba(0, 229, 255, 0.45);
}

.hero__btn--outline {
  background: transparent;
  color: var(--md-sys-color-primary);
  border: 2px solid var(--md-sys-color-outline-variant);
}

.hero__btn--outline:hover {
  background: rgba(0, 229, 255, 0.08);
  border-color: var(--md-sys-color-primary);
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.15);
}

.hero__scroll-hint {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  animation: scrollBounce 2s ease infinite;
  color: var(--md-sys-color-outline);
  z-index: 2;
}

@keyframes scrollBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.5; }
  50%      { transform: translateX(-50%) translateY(10px); opacity: 1; }
}

/* ===== STATS BAR ===== */
.stats-bar {
  display: flex;
  justify-content: center;
  gap: 0;
  padding: 0;
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  overflow: hidden;
}

.stat {
  flex: 1;
  max-width: 200px;
  text-align: center;
  padding: 28px 16px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.stat:nth-child(1) { transition-delay: 0.1s; }
.stat:nth-child(2) { transition-delay: 0.2s; }
.stat:nth-child(3) { transition-delay: 0.3s; }
.stat:nth-child(4) { transition-delay: 0.4s; }

.stat.revealed {
  opacity: 1;
  transform: translateY(0);
}

.stat__num {
  display: block;
  font-family: var(--md-sys-typescale-display-font);
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 4px;
}

.stat__label {
  font-size: 0.75rem;
  font-weight: 500;
  opacity: 0.85;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===== LANDING SECTIONS ===== */
.landing-section {
  padding-top: 64px;
  padding-bottom: 64px;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.landing-section.revealed {
  opacity: 1;
  transform: translateY(0);
}

.landing-heading {
  font-family: var(--md-sys-typescale-display-font);
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 700;
  color: var(--md-sys-color-on-surface);
  text-align: center;
  margin-bottom: 12px;
}

.landing-intro {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--md-sys-color-on-surface-variant);
  text-align: center;
  max-width: 640px;
  margin: 0 auto 40px;
}

/* ===== TOPIC CARDS ===== */
.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.topic-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 32px 28px;
  border-radius: var(--md-sys-shape-corner-xl);
  background: var(--md-sys-color-surface-container-lowest);
  border: 1px solid var(--md-sys-color-outline-variant);
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  opacity: 0;
  transform: translateY(24px);
}

.topic-card.revealed {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.5s ease, transform 0.5s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.topic-card:nth-child(1).revealed { transition-delay: 0.05s; }
.topic-card:nth-child(2).revealed { transition-delay: 0.15s; }
.topic-card:nth-child(3).revealed { transition-delay: 0.25s; }

.topic-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.topic-card__glow {
  position: absolute;
  top: -50%;
  right: -30%;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  opacity: 0.08;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.topic-card:hover .topic-card__glow {
  opacity: 0.15;
}

.topic-card--html .topic-card__glow { background: #ff2d95; }
.topic-card--css .topic-card__glow  { background: #00e5ff; }
.topic-card--js .topic-card__glow   { background: #b8ff00; }

.topic-card--html:hover { border-color: #ff2d9544; box-shadow: 0 0 20px rgba(255,45,149,.15); }
.topic-card--css:hover  { border-color: #00e5ff44; box-shadow: 0 0 20px rgba(0,229,255,.15); }
.topic-card--js:hover   { border-color: #b8ff0044; box-shadow: 0 0 20px rgba(184,255,0,.15); }

.topic-card__icon {
  font-size: 36px;
  margin-bottom: 16px;
  color: var(--md-sys-color-primary);
}

.topic-card--html .topic-card__icon { color: #ff2d95; }
.topic-card--css .topic-card__icon  { color: #00e5ff; }
.topic-card--js .topic-card__icon   { color: #b8ff00; }

.topic-card__title {
  font-family: var(--md-sys-typescale-display-font);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--md-sys-color-on-surface);
  margin-bottom: 8px;
}

.topic-card__desc {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--md-sys-color-on-surface-variant);
  flex: 1;
}

.topic-card__footer {
  display: flex;
  gap: 16px;
  margin-top: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--md-sys-color-outline);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .hero__content { padding: 100px 20px 60px; }
  .stats-bar { flex-wrap: wrap; }
  .stat { min-width: 50%; padding: 20px 12px; }
  .topic-grid { grid-template-columns: 1fr; }
}

/* Light mode hero */
:root.light .hero {
  background: linear-gradient(160deg,
    #f0f8ff 0%,
    #e8f4fa 40%,
    #fce4ec 70%,
    #e8eaf6 100%);
}

:root.light .hero__btn--primary {
  box-shadow: 0 4px 20px rgba(0, 151, 167, 0.25);
}

:root.light .hero__btn--primary:hover {
  box-shadow: 0 8px 30px rgba(0, 151, 167, 0.35);
}

:root.light .hero__btn--outline:hover {
  background: rgba(0, 151, 167, 0.06);
  box-shadow: 0 0 15px rgba(0, 151, 167, 0.1);
}

:root.light .topic-card--html:hover { border-color: rgba(194,24,91,.3); box-shadow: 0 0 16px rgba(194,24,91,.1); }
:root.light .topic-card--css:hover  { border-color: rgba(0,151,167,.3); box-shadow: 0 0 16px rgba(0,151,167,.1); }
:root.light .topic-card--js:hover   { border-color: rgba(85,139,47,.3); box-shadow: 0 0 16px rgba(85,139,47,.1); }

:root.light .topic-card--html .topic-card__glow { background: #c2185b; }
:root.light .topic-card--css .topic-card__glow  { background: #0097a7; }
:root.light .topic-card--js .topic-card__glow   { background: #558b2f; }

:root.light .topic-card--html .topic-card__icon { color: #c2185b; }
:root.light .topic-card--css .topic-card__icon  { color: #0097a7; }
:root.light .topic-card--js .topic-card__icon   { color: #558b2f; }
