/* ══════════════════════════════════════
   SHARED DESIGN SYSTEM
   AI on a Shoestring — Ashraf Mizo
══════════════════════════════════════ */

/* ── Design Tokens ── */
:root {
  --color-orange: #E87420;
  --color-orange-dark: #d4681a;
  --color-orange-burnt: #c25510;
  --color-orange-deep: #c45e10;
  --color-brown: #8B3A0F;
  --color-blue: #2C4685;
  --color-blue-bright: #2563eb;
  --color-blue-dark: #1d4ed8;
  --color-purple: #7c3aed;
  --color-purple-dark: #5b21b6;
  --color-bg-light: #f5f2ee;
  --color-bg-dark: #111;
  --color-text: #1a1a1a;
  --color-text-muted: #999;
  --color-text-mid: #555;
  --font-sans: 'DM Sans', sans-serif;
  --font-serif: 'Fraunces', serif;
  --radius-card: 24px;
  --radius-pill: 50px;
  --radius-tile: 18px;
  --radius-small: 12px;
  --pad-section: clamp(32px, 5vw, 80px);
  --pad-section-v: clamp(80px, 10vw, 140px);
}

/* ── Reset ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--color-bg-light);
  overflow-x: hidden;
  color: var(--color-text);
}

/* ── Shared Utilities ── */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Fallback: ensure content is never permanently hidden */
@media (prefers-reduced-motion: reduce) {
  .fade-in {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

.section-pad {
  padding-left: var(--pad-section);
  padding-right: var(--pad-section);
}

.mobile-br { display: none; }

/* ── Site Logo (top-left on all pages) ── */
.site-logo {
  position: absolute;
  top: clamp(24px, 4vh, 48px);
  left: var(--pad-section);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  z-index: 40;
  text-decoration: none;
}

.site-logo svg { display: block; }

.site-logo-text {
  font-family: 'Podkova', serif;
  font-weight: 700;
  font-size: 19px;
  color: var(--color-text);
  letter-spacing: -0.5px;
  opacity: 0;
}

.site-logo-dot { color: var(--color-orange); }

/* Logo SVG part animations — start hidden, animate in staggered */
.site-logo .logo-anim-bar,
.site-logo .logo-anim-hbar,
.site-logo .logo-anim-circle {
  opacity: 0;
}

.site-logo .logo-anim-bar {
  transform-origin: 28px 44px;
  animation: logo-barSwing 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s both;
}

.site-logo .logo-anim-hbar {
  animation: logo-hbarSlide 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.5s both;
}

.site-logo .logo-anim-circle {
  transform-origin: 49.5px 63px;
  animation: logo-circlePop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.75s both;
}

.site-logo .site-logo-text {
  animation: logo-textReveal 0.6s cubic-bezier(0.16, 1, 0.3, 1) 1.1s both;
}

@keyframes logo-barSwing {
  0% { opacity: 0; transform: rotate(-70deg) translateY(-20px); }
  100% { opacity: 1; transform: rotate(0deg) translateY(0); }
}

@keyframes logo-hbarSlide {
  0% { opacity: 0; transform: translateX(30px); }
  100% { opacity: 1; transform: none; }
}

@keyframes logo-circlePop {
  0% { opacity: 0; transform: translateY(20px) scale(0); }
  100% { opacity: 1; transform: none; }
}

@keyframes logo-textReveal {
  0% { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: none; }
}

/* Light variant (for dark backgrounds) */
.site-logo--light .site-logo-text { color: #fff; }

/* ── Nav Pill ── */
.nav-pill {
  position: fixed;
  top: 24px;
  left: 50%;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--color-bg-dark);
  color: #fff;
  padding: 10px 18px 10px 20px;
  border-radius: var(--radius-pill);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.02em;
  opacity: 0;
  transform: translateX(-50%) translateY(-10px);
  transition: opacity 0.7s ease, transform 0.7s ease;
  pointer-events: auto;
}

.nav-pill.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.nav-pill-name {
  text-decoration: none;
  color: #fff;
  font-weight: 500;
}

a.nav-pill-name {
  cursor: pointer;
}

.nav-pill-links {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
}

.nav-link {
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  font-size: 13px;
  font-weight: 400;
  padding: 4px 10px;
  border-radius: 20px;
  transition: color 0.2s ease, background 0.2s ease;
  line-height: 1;
  height: 24px;
  display: inline-flex;
  align-items: center;
}

.nav-link:hover,
.nav-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.nav-pill-menu {
  display: none;
  flex-direction: column;
  gap: 3px;
  cursor: pointer;
  padding: 2px;
  background: none;
  border: none;
}

.nav-pill-menu span {
  display: block;
  width: 16px;
  height: 1.5px;
  background: #fff;
  border-radius: 1px;
}

/* Mobile nav dropdown */
.nav-mobile-menu {
  display: none;
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-bg-dark);
  border-radius: 20px;
  padding: 20px 16px;
  z-index: 49;
  min-width: 260px;
  flex-direction: column;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.nav-mobile-menu.open {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}

.nav-mobile-menu .nav-link {
  font-size: 15px;
  padding: 14px 24px;
  display: block;
  border-radius: 12px;
  letter-spacing: 0.01em;
}

/* ── Lessons Dropdown (desktop) ── */
.nav-lessons-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.nav-lessons-wrap > .nav-link {
  display: flex;
  align-items: center;
}

.nav-lessons-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-bg-dark);
  border-radius: 16px;
  padding: 12px 8px;
  min-width: 240px;
  flex-direction: column;
  gap: 2px;
  z-index: 60;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.nav-lessons-dropdown.open {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}

.nav-lessons-dropdown a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  font-size: 13px;
  font-weight: 400;
  border-radius: 10px;
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-lessons-dropdown a:hover,
.nav-lessons-dropdown a.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.nav-lessons-dropdown .dropdown-num {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-orange);
  min-width: 18px;
}

.nav-lessons-dropdown .dropdown-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 4px 8px;
}

/* ── Mobile lessons sub-menu ── */
.nav-mobile-lessons-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
}

.nav-mobile-lessons-toggle svg {
  width: 12px;
  height: 12px;
  stroke: rgba(255, 255, 255, 0.4);
  transition: transform 0.2s ease;
}

.nav-mobile-lessons-toggle.expanded svg {
  transform: rotate(180deg);
}

.nav-mobile-lessons {
  display: none;
  flex-direction: column;
  padding: 4px 8px 6px;
  gap: 4px;
}

.nav-mobile-lessons.open {
  display: flex;
}

.nav-mobile-lessons a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  font-size: 14px;
  border-radius: 10px;
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-mobile-lessons a:hover,
.nav-mobile-lessons a.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.nav-mobile-lessons .dropdown-num {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-orange);
  min-width: 18px;
}

/* ── Grain Texture (reusable) ── */
.grain-overlay {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.4;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 180px 180px;
}

/* ── Gradient Blobs (reusable) ── */
.glow-container {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.blob {
  position: absolute;
  border-radius: 9999px;
  filter: blur(120px);
  opacity: 0.45;
}

/* ── Gradient Text ── */
.gradient-text {
  background: linear-gradient(135deg, var(--color-orange) 0%, var(--color-orange-deep) 25%, var(--color-blue) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 600;
}

/* ── Footer ── */
.site-footer {
  background: var(--color-bg-light);
  color: var(--color-text);
  padding: clamp(48px, 6vw, 80px) var(--pad-section);
  position: relative;
  z-index: 2;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 60px;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-left {
  flex: 0 0 40%;
}

.footer-logo {
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
}

.footer-tagline {
  font-size: 14px;
  color: rgba(0, 0, 0, 0.45);
  line-height: 1.6;
  font-weight: 300;
  max-width: 300px;
}

.footer-right {
  display: flex;
  gap: clamp(40px, 5vw, 80px);
}

.footer-col h4 {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.35);
  margin-bottom: 20px;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-col a {
  font-size: 14px;
  color: rgba(0, 0, 0, 0.55);
  text-decoration: none;
  font-weight: 300;
  transition: color 0.3s ease;
}

.footer-col a:hover {
  color: var(--color-text);
}

.footer-bottom {
  max-width: 1200px;
  margin: 48px auto 0;
  padding-top: 32px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  font-size: 13px;
  color: rgba(0, 0, 0, 0.3);
  font-weight: 300;
}

/* ── Mobile ── */
@media (max-width: 768px) {
  .nav-pill {
    font-size: 13px;
    padding: 8px 14px 8px 16px;
    gap: 10px;
  }

  .nav-pill-links {
    display: none;
  }

  .nav-pill-menu {
    display: flex;
  }

  .site-logo {
    top: 24px;
    left: 16px;
  }

  .site-logo svg {
    width: 14px;
    height: 14px;
  }

  .site-logo-text {
    font-size: 10px !important;
    letter-spacing: -0.3px;
  }

  .mobile-br { display: inline; }

  .footer-inner {
    flex-direction: column;
    gap: 32px;
  }

  .footer-right {
    flex-wrap: wrap;
    gap: 32px;
  }

  .footer-left {
    flex: none;
  }
}
