/* ============================================================
   LEARNIME.COM — shared stylesheet for all pages
   Deep-space dark theme · warm accents · phone + desktop
   ============================================================ */

:root {
  --bg:        #0a0e1c;   /* deep space background */
  --bg-soft:   #131a33;   /* slightly lighter panels */
  --ink:       #f2efe9;   /* main text */
  --muted:     #b9b3c9;   /* secondary text */
  --amber:     #ffc266;
  --coral:     #ff8a70;
  --gold:      #ffd76e;
  --turquoise: #5fe3d0;
  --maxwidth:  920px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 1.06rem;
  line-height: 1.65;
}

/* ---------- HEADER ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 14, 28, 0.95);
  border-bottom: 1px solid #232a4a;
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.logo {
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 0.06em;
  text-decoration: none;
  color: var(--gold);
  margin-right: auto;
}

/* pure-CSS phone menu (no JavaScript) */
.nav-toggle { display: none; }

.nav-toggle-label {
  font-size: 1.6rem;
  cursor: pointer;
  color: var(--ink);
  padding: 0 0.4rem;
  user-select: none;
}

.nav-menu {
  display: none;
  width: 100%;
  flex-direction: column;
  gap: 0.15rem;
  padding-top: 0.4rem;
}

.nav-toggle:checked ~ .nav-menu { display: flex; }

.nav-menu a {
  color: var(--ink);
  text-decoration: none;
  padding: 0.55rem 0.6rem;
  border-radius: 8px;
}

.nav-menu a:hover,
.nav-menu a:focus { background: var(--bg-soft); color: var(--gold); }

.nav-menu a.current { color: var(--turquoise); font-weight: 700; }

.nav-menu a.cta {
  background: linear-gradient(90deg, var(--coral), var(--amber));
  color: #1a1030;
  font-weight: 800;
  text-align: center;
  margin-top: 0.3rem;
}

/* desktop: menu always visible in one row */
@media (min-width: 940px) {
  .nav-toggle-label { display: none; }
  .nav-menu {
    display: flex !important;
    width: auto;
    flex-direction: row;
    align-items: center;
    padding-top: 0;
  }
  .nav-menu a.cta { margin-top: 0; margin-left: 0.4rem; }
}

/* ---------- LAYOUT ---------- */

main {
  max-width: var(--maxwidth);
  margin: 0 auto;
  padding: 1.2rem 1rem 3rem;
}

.section { margin: 3rem 0; }

h1 {
  font-size: clamp(1.9rem, 5vw, 3rem);
  line-height: 1.2;
  margin: 0.4rem 0;
  background: linear-gradient(90deg, var(--gold), var(--coral), var(--turquoise));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

h2 {
  font-size: clamp(1.4rem, 3.5vw, 1.9rem);
  color: var(--amber);
  margin: 0 0 0.8rem;
}

h3 { color: var(--turquoise); margin: 1.4rem 0 0.5rem; }

.kicker {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 700;
  color: var(--turquoise);
  font-size: 0.85rem;
}

.lead { font-size: 1.15rem; color: var(--ink); }

.note { color: var(--muted); font-size: 0.95rem; }

.fable-quote {
  background: var(--bg-soft);
  border-left: 3px solid var(--turquoise);
  border-radius: 0 14px 14px 0;
  padding: 1rem 1.4rem;
  margin: 1rem 0;
}

.fable-quote p {
  color: var(--muted);
  line-height: 1.75;
  margin: 0.5rem 0;
}

.fable-quote p:first-child { margin-top: 0; }
.fable-quote p:last-child { margin-bottom: 0; }

blockquote {
  border-left: 4px solid var(--coral);
  margin: 1.2rem 0;
  padding: 0.6rem 1rem;
  background: var(--bg-soft);
  border-radius: 0 10px 10px 0;
  color: var(--ink);
  font-style: italic;
}

/* ---------- IMAGES ---------- */

.figure { margin: 1.5rem 0; }

.figure img,
.hero-img {
  width: 100%;
  height: auto;
  border-radius: 14px;
  display: block;
  border: 1px solid #232a4a;
}

.figure figcaption {
  color: var(--muted);
  font-size: 0.92rem;
  text-align: center;
  padding-top: 0.5rem;
  font-style: italic;
}

/* ---------- BUTTONS ---------- */

.btn-row { display: flex; flex-wrap: wrap; gap: 0.7rem; margin: 1.2rem 0; }

.btn {
  display: inline-block;
  padding: 0.65rem 1.2rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  background: var(--bg-soft);
  color: var(--gold);
  border: 1px solid #2c3560;
}

.btn:hover, .btn:focus { border-color: var(--gold); }

.btn.primary {
  background: linear-gradient(90deg, var(--coral), var(--amber));
  color: #1a1030;
  border: none;
}

/* ---------- SERIES CARDS (home page) ---------- */

.cards { display: grid; gap: 1.3rem; grid-template-columns: 1fr; margin: 1.5rem 0; }

@media (min-width: 720px) { .cards { grid-template-columns: 1fr 1fr 1fr; } }

.card {
  background: var(--bg-soft);
  border: 1px solid #232a4a;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card img { width: 100%; height: auto; display: block; }

.card .card-body { padding: 1rem 1.1rem 1.3rem; display: flex; flex-direction: column; flex: 1; }

.card h3 { margin: 0 0 0.2rem; }

.card .genre { color: var(--muted); font-size: 0.85rem; margin-bottom: 0.6rem; }

.card p { flex: 1; margin: 0 0 1rem; }

/* ---------- "EXPLAIN THAT WORD" (tap-based, built into browser) ---------- */

details.explain {
  display: inline;
}

details.explain summary {
  display: inline;
  cursor: pointer;
  color: var(--turquoise);
  text-decoration: underline dotted;
  list-style: none;
}

details.explain summary::-webkit-details-marker { display: none; }

details.explain .explain-text {
  display: block;
  background: var(--bg-soft);
  border: 1px solid #2c3560;
  border-radius: 10px;
  padding: 0.5rem 0.8rem;
  margin: 0.4rem 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* ---------- BEGINNER INFO BOXES (Blender / MCP explainers, etc.) ---------- */

details.info-box {
  background: var(--bg-soft);
  border: 1px solid #232a4a;
  border-radius: 14px;
  padding: 0.9rem 1.3rem;
  margin: 1rem 0;
}

details.info-box summary {
  cursor: pointer;
  color: var(--gold);
  font-weight: 700;
  list-style: none;
}

details.info-box summary::-webkit-details-marker { display: none; }

details.info-box p {
  color: var(--muted);
  margin: 0.7rem 0 0;
  line-height: 1.7;
}

/* ---------- PICTURE GALLERIES + LIGHTBOX (gallery.js) ---------- */

.evo-block {
  background: var(--bg-soft);
  border: 1px solid #232a4a;
  border-radius: 14px;
  padding: 1.1rem 1.3rem;
  margin: 1.3rem 0;
}

.evo-block h3 { color: var(--turquoise); margin-top: 0; }

.evo-block p { color: var(--muted); line-height: 1.7; }

/* thumbnail grid — every .gallery block is its own separate gallery */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.7rem;
  margin: 1rem 0 0.3rem;
}

@media (max-width: 520px) {
  .gallery { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 0.55rem; }
}

.gal-item {
  display: block;
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #2c3560;
  background: #0a0e1c;
  line-height: 0;
  cursor: zoom-in;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  -webkit-tap-highlight-color: rgba(255, 215, 110, 0.25);
}

.gal-item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  height: auto;
  object-fit: cover;
  display: block;
}

.gal-item:hover,
.gal-item:focus-visible {
  transform: translateY(-2px) scale(1.03);
  border-color: var(--gold);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  outline: none;
}

/* little magnifier hint in the corner of each thumbnail */
.gal-item::after {
  content: "⤢";
  position: absolute;
  right: 0.3rem;
  bottom: 0.25rem;
  font-size: 0.85rem;
  line-height: 1;
  padding: 0.2rem 0.32rem;
  border-radius: 6px;
  color: var(--gold);
  background: rgba(10, 14, 28, 0.72);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.gal-item:hover::after { opacity: 1; }

.gallery-hint {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0.15rem 0 0;
}

/* ---------- the lightbox itself ---------- */

body.lb-open {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  overflow: hidden;
}

.lb {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.lb[hidden] { display: none; }

.lb.is-open { opacity: 1; }

.lb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 7, 18, 0.94);
  cursor: zoom-out;
}

.lb-stage {
  position: relative;
  z-index: 1;
  margin: 0;
  max-width: 96vw;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  pointer-events: none;    /* clicks beside the picture fall through and close */
}

.lb-imgwrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 70px;
  min-height: 70px;
}

.lb-img {
  display: block;
  /* leave room at the sides so the arrows never sit on top of the picture */
  max-width: min(96vw, calc(100vw - 9rem));
  max-height: 78vh;
  border-radius: 12px;
  border: 1px solid #2c3560;
  background: #0a0e1c;
  pointer-events: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

.lb-imgwrap.is-loading .lb-img { opacity: 0.15; }

.lb-spinner {
  position: absolute;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(255, 215, 110, 0.25);
  border-top-color: var(--gold);
  animation: lb-spin 0.8s linear infinite;
  opacity: 0;
}

.lb-imgwrap.is-loading .lb-spinner { opacity: 1; }

@keyframes lb-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .lb { transition: none; }
  .lb-spinner { animation: none; }
  .gal-item { transition: none; }
}

.lb-bar {
  pointer-events: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0.5rem 0.9rem;
  max-width: 92vw;
  text-align: center;
  font-size: 0.92rem;
  color: var(--muted);
  background: rgba(19, 26, 51, 0.88);
  border: 1px solid #232a4a;
  border-radius: 12px;
  padding: 0.55rem 0.9rem;
}

.lb-count { color: var(--gold); font-weight: 700; white-space: nowrap; }

.lb-caption { max-width: 62ch; }

.lb-full { color: var(--turquoise); white-space: nowrap; }

/* buttons: close / previous / next */
.lb-btn {
  position: absolute;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  background: rgba(19, 26, 51, 0.92);
  border: 1px solid #2c3560;
  border-radius: 50%;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
  transition: background 0.15s ease, transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.lb-btn:hover,
.lb-btn:focus-visible { background: #223061; transform: scale(1.08); outline: none; }

.lb-btn[hidden] { display: none; }

.lb-close {
  top: max(0.8rem, env(safe-area-inset-top));
  right: 0.8rem;
  width: 2.8rem;
  height: 2.8rem;
  font-size: 1.35rem;
}

.lb-prev, .lb-next {
  top: 50%;
  transform: translateY(-50%);
  width: 3rem;
  height: 3rem;
  font-size: 1.3rem;
}

.lb-prev:hover, .lb-prev:focus-visible,
.lb-next:hover, .lb-next:focus-visible { transform: translateY(-50%) scale(1.08); }

.lb-prev { left: 0.7rem; }
.lb-next { right: 0.7rem; }

@media (max-width: 620px) {
  .lb-img { max-width: 96vw; max-height: 68vh; }
  .lb-prev, .lb-next { width: 2.6rem; height: 2.6rem; font-size: 1.1rem; }
  .lb-prev { left: 0.35rem; }
  .lb-next { right: 0.35rem; }
  .lb-bar { font-size: 0.85rem; padding: 0.45rem 0.7rem; }
}

/* ---------- PROGRESS DISPLAYS ---------- */

.progress {
  background: var(--bg-soft);
  border: 1px solid #232a4a;
  border-radius: 14px;
  padding: 1rem 1.3rem;
  margin: 1.2rem 0;
}

.progress ul { list-style: none; padding: 0; margin: 0.4rem 0; }

.progress li { padding: 0.35rem 0; border-bottom: 1px dashed #232a4a; }

.progress li:last-child { border-bottom: none; }

/* ---------- SONGS / YOUTUBE ---------- */

.video-wrap {
  aspect-ratio: 16 / 9;
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid #232a4a;
  border-radius: 14px;
  overflow: hidden;
  margin: 0.8rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--muted);
}

.video-wrap iframe { width: 100%; height: 100%; border: 0; }

.lyrics {
  background: var(--bg-soft);
  border: 1px solid #232a4a;
  border-radius: 14px;
  padding: 1.2rem 1.5rem;
  margin: 1rem 0 2rem;
  line-height: 1.85;
  color: var(--muted);
  font-size: 0.95rem;
}

.lyrics h4 {
  color: var(--gold);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 1.2rem 0 0.3rem;
}

.lyrics h4:first-child { margin-top: 0; }

/* ---------- FOOTER ---------- */

.site-footer {
  border-top: 1px solid #232a4a;
  background: #070a15;
  text-align: center;
  padding: 2rem 1rem 2.5rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.9;
}

.site-footer .foot-title { color: var(--gold); font-weight: 800; }

.site-footer .foot-quote { color: var(--turquoise); font-style: italic; }

.site-footer a { color: var(--amber); text-decoration: none; }

.site-footer a:hover, .site-footer a:focus { text-decoration: underline; }

/* ---------- FOOTER SOCIAL ICONS ---------- */

.footer-social {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 18px;
  margin: 20px 0 24px;
}
.social-icon {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  outline: none;
}
.social-icon img {
  width: 34px;
  height: 34px;
  display: block;
  transition: transform 0.18s ease;
}
.social-icon:hover img,
.social-icon:focus-visible img {
  transform: translateY(-3px) scale(1.14);
}
.social-label {
  display: none;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1;
}

/* Desktop / mouse: tooltip bubble on hover or keyboard focus */
@media (hover: hover) {
  .social-icon::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: var(--bg-soft);
    color: var(--ink);
    padding: 6px 11px;
    border-radius: 9px;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 20;
  }
  .social-icon::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    border: 6px solid transparent;
    border-top-color: var(--bg-soft);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 20;
  }
  .social-icon:hover::after,
  .social-icon:focus-visible::after,
  .social-icon:hover::before,
  .social-icon:focus-visible::before {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* Touch / smartphones: show label under every icon */
@media (hover: none) {
  .social-label {
    display: block;
  }
  .footer-social {
    gap: 16px 22px;
  }
}