:root{
  --bg: #060607;
  --bg-elevated: #16161a;
  --border: #2a2a2f;
  --text: #f2f0ec;
  --text-muted: #a8a5a0;
  --tan: #c9a875;
  --red: #e2342c;
  --red-glow: #ff4a3d;
  --glow-1: rgba(226,52,44,0.14);
  --glow-2: rgba(201,168,117,0.05);
  --radius: 14px;
  --max-width: 1180px;
  font-size: 16px;
}

html[data-theme="light"]{
  --bg: #f7f5f1;
  --bg-elevated: #ffffff;
  --border: #e2ddd4;
  --text: #1c1b1a;
  --text-muted: #6b6660;
  --tan: #9c7a45;
  --red: #d92a22;
  --red-glow: #e5372c;
  --glow-1: rgba(217,42,34,0.07);
  --glow-2: rgba(156,122,69,0.08);
}

*{ box-sizing: border-box; }

html,body{
  margin:0;
  padding:0;
  min-height: 100%;
  background:
    radial-gradient(ellipse 900px 520px at 50% -120px, var(--glow-1), transparent 70%),
    radial-gradient(ellipse 700px 420px at 100% 0%, var(--glow-2), transparent 65%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: "slight-chance", Calibri, "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s ease, color .25s ease;
}

a{ color: inherit; text-decoration: none; }

/* ---------- Shared entrance animation ---------- */
@keyframes fadeInUp{
  from{ opacity: 0; transform: translateY(18px); }
  to{ opacity: 1; transform: translateY(0); }
}

/* ---------- Random energy streak (spawned by energy-streak.js) ---------- */
.energy-streak{
  position: fixed;
  left: -45vw;
  width: 45vw;
  height: 2px;
  pointer-events: none;
  z-index: 0;
  background: linear-gradient(90deg, transparent, var(--red-glow) 45%, #fff 50%, var(--red-glow) 55%, transparent);
  box-shadow: 0 0 10px 3px var(--red-glow), 0 0 34px 9px rgba(255,74,61,0.6);
  opacity: 0;
  animation-name: streakMove;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}

@keyframes streakMove{
  0%{ transform: rotate(var(--streak-angle, 0deg)) translateX(0); opacity: 0; }
  6%{ opacity: 1; }
  88%{ opacity: 1; }
  100%{ transform: rotate(var(--streak-angle, 0deg)) translateX(210vw); opacity: 0; }
}

/* ---------- Actions row (Pronto / Dashboard / Log In) ---------- */
.header-actions{
  display:flex;
  align-items:center;
  justify-content:center;
  gap: 14px;
  margin: 72px auto 0;
  animation: fadeInUp .6s ease .35s both;
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 8px 18px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background .15s ease, transform .15s ease, box-shadow .15s ease;
}

.btn-ghost{
  color: var(--text);
  background: transparent;
}

.btn-ghost:hover{
  border-color: var(--red);
  color: var(--red-glow);
  transform: translateY(-2px);
  box-shadow: 0 8px 18px -10px rgba(226,52,44,0.45);
}

/* ---------- Hero ---------- */
.hero{
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 96px 24px 48px;
  text-align: center;
  animation: fadeInUp .7s ease both;
}

.hero-mark{
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  margin: 0;
  cursor: pointer;
}

@keyframes floatLogo{
  0%, 100%{ transform: translateX(-3px) translateY(0); }
  50%{ transform: translateX(-3px) translateY(-6px); }
}

.hero-logo{
  height: clamp(4rem, 10vw, 6.6rem);
  width: auto;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.55)) drop-shadow(0 0 10px rgba(0,0,0,0.35));
  animation: floatLogo 6s ease-in-out infinite;
}

/* Swap logo variant by theme — dark-bg version shows by default, the
   flat black version takes over in light mode. No JS needed, so there's
   no flash: the [data-theme] attribute is already set before paint. */
.hero-logo-light{ display: none; }

html[data-theme="light"] .hero-logo-dark{ display: none; }
html[data-theme="light"] .hero-logo-light{ display: block; }
html[data-theme="light"] .hero-logo-light{
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
}

.hero-subtitle{
  font-family: "slight-chance", sans-serif;
  font-size: clamp(0.85rem, 1.6vw, 1.15rem);
  font-weight: 600;
  letter-spacing: 13px;
  text-transform: uppercase;
  color: var(--red-glow);
  text-shadow: 0 0 18px rgba(255,74,61,0.35);
  transition: color .3s ease, text-shadow .3s ease;
}

html[data-theme="light"] .hero-subtitle{
  text-shadow: none;
}

/* ---------- Subpage top / title (same hero prominence as RDLN University on the homepage) ---------- */
.page-top{
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 96px 24px 48px;
  text-align: center;
  animation: fadeInUp .6s ease both;
}

.page-actions{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 28px;
  animation: fadeInUp .5s ease both;
}

.back-link{
  display: inline-block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 28px;
  transition: color .15s ease;
}

.back-link:hover{
  color: var(--red-glow);
}

.page-title{
  font-family: "slight-chance", sans-serif;
  font-size: clamp(3.4rem, 9vw, 5.8rem);
  font-weight: 700;
  letter-spacing: 1px;
  line-height: 1;
  margin: 0;
  color: var(--red-glow);
  text-shadow:
    0 0 14px rgba(255,74,61,0.3),
    0 6px 4px rgba(0,0,0,0.45),
    0 14px 22px rgba(0,0,0,0.4);
}

html[data-theme="light"] .page-title{
  text-shadow: none;
}

/* ---------- Modules grid ---------- */
.modules{
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 24px 72px;
}

.modules-banner{
  display: block;
  margin: 0 0 20px;
  padding: 20px 24px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  box-shadow: 0 1px 0 rgba(255,255,255,0.03) inset, 0 18px 36px -26px rgba(0,0,0,0.6);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
  animation: fadeInUp .6s ease .05s both;
}

.modules-banner:hover{
  transform: translateY(-5px) scale(1.01);
  border-color: var(--red);
  box-shadow: 0 1px 0 rgba(255,255,255,0.05) inset, 0 16px 32px -18px rgba(226,52,44,0.4);
}

.modules-banner h2{
  font-family: "slight-chance", sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 2px;
  margin: 0;
  color: var(--text);
  text-shadow: 0 0 0 rgba(255,74,61,0);
  transition: color .2s ease, text-shadow .2s ease;
}

.modules-banner:hover h2{
  color: var(--red-glow);
  text-shadow: 0 0 16px rgba(255,74,61,0.5);
}

.modules-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.module-card{
  position: relative;
  overflow: hidden;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  box-shadow: 0 1px 0 rgba(255,255,255,0.03) inset, 0 18px 36px -26px rgba(0,0,0,0.6);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
  animation: fadeInUp .5s ease both;
}

/* ---------- "Coming soon" tile: not clickable, still hoverable ---------- */
.module-card.is-coming-soon{
  cursor: not-allowed;
}

.module-card.is-coming-soon h2{
  opacity: 0.3;
}

.card-tape{
  position: absolute;
  top: 50%;
  left: -14%;
  width: 128%;
  transform: translateY(-50%) rotate(-8deg);
  background: repeating-linear-gradient(45deg, var(--red) 0 18px, #240705 18px 36px);
  color: rgba(255,255,255,0.55);
  text-align: center;
  font-family: "slight-chance", sans-serif;
  font-weight: 700;
  font-size: clamp(0.95rem, 2.4vw, 1.15rem);
  letter-spacing: 3px;
  text-transform: uppercase;
  padding: 10px 0;
  box-shadow: 0 6px 14px rgba(0,0,0,0.45);
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

/* Light theme keeps the original yellow/black caution-tape look */
html[data-theme="light"] .card-tape{
  background: repeating-linear-gradient(45deg, #f2c230, #f2c230 14px, #171512 14px, #171512 28px);
  color: #171512;
  text-shadow: 0 1px 0 rgba(255,255,255,0.4);
}

.module-card:nth-child(1){ animation-delay: .12s; }
.module-card:nth-child(2){ animation-delay: .18s; }
.module-card:nth-child(3){ animation-delay: .24s; }
.module-card:nth-child(4){ animation-delay: .30s; }
.module-card:nth-child(5){ animation-delay: .36s; }
.module-card:nth-child(6){ animation-delay: .42s; }

.module-card:hover{
  transform: translateY(-6px) scale(1.015);
  border-color: var(--red);
  box-shadow: 0 1px 0 rgba(255,255,255,0.05) inset, 0 16px 32px -18px rgba(226,52,44,0.4);
}

.module-card h2{
  font-family: "slight-chance", sans-serif;
  font-size: 1.15rem;
  margin: 0;
  transition: color .2s ease;
}

.module-card:hover h2{
  color: var(--red-glow);
}

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

@media (max-width: 640px){
  .modules-grid{ grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------- Real auth guard: hide everything until auth.js confirms a
   valid Supabase session (or redirects to login.html). See auth.js. ---------- */
html[data-auth-checking="true"] body{
  visibility: hidden;
}

/* ---------- Copyright footer: quiet, low-contrast, out of the way ---------- */
.site-footer{
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 28px 24px 36px;
  text-align: center;
}

.site-footer p{
  margin: 0;
  font-size: 0.7rem;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  opacity: 0.55;
}
