/* Homepage — layout, animation, mobile */

.page-home {
  overflow-x: hidden;
}

.page-home .site-main {
  background-color: transparent;
}

/* Centered content width */
.home-inner {
  width: 100%;
  max-width: 72rem;
  margin-left: auto;
  margin-right: auto;
}

.home-section {
  padding: clamp(3rem, 8vw, 5rem) 0;
}

.home-section__head {
  text-align: center;
  max-width: 44rem;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: clamp(2rem, 5vw, 3rem);
}

.home-section__head .section-label,
.home-section__head .section-title,
.home-section__head .section-lead,
.home-section__head .badge-secondary-section {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

.home-section__head .section-label {
  display: block;
}

.home-section__head .section-lead {
  max-width: 40rem;
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-stagger > .reveal-child {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: calc(var(--i, 0) * 0.1s);
}

.reveal-stagger.is-visible > .reveal-child {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal-stagger > .reveal-child,
  .hero-home__orb,
  .hero-home__grid,
  .footer-code__cursor {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
  }
}

/* Hero */
.hero-home {
  position: relative;
  padding: clamp(3.5rem, 12vw, 6rem) 0 clamp(3rem, 8vw, 4.5rem);
  text-align: center;
  overflow: hidden;
  background: linear-gradient(165deg, #0b1220 0%, #0f172a 45%, #111827 100%);
  border-bottom: 1px solid var(--border-subtle);
}

.hero-home__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(56, 189, 248, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.07) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 20%, transparent 75%);
  animation: gridDrift 24s linear infinite;
  pointer-events: none;
}

@keyframes gridDrift {
  0% { background-position: 0 0, 0 0; }
  100% { background-position: 40px 40px, 40px 40px; }
}

.hero-home__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
  animation: orbFloat 10s ease-in-out infinite;
}

.hero-home__orb--1 {
  width: min(420px, 80vw);
  height: min(420px, 80vw);
  background: rgba(37, 99, 235, 0.28);
  top: -15%;
  right: -10%;
}

.hero-home__orb--2 {
  width: min(320px, 60vw);
  height: min(320px, 60vw);
  background: rgba(124, 58, 237, 0.22);
  bottom: -10%;
  left: -8%;
  animation-delay: -4s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-12px, 16px) scale(1.05); }
}

.hero-home__content {
  position: relative;
  z-index: 2;
  max-width: 44rem;
  margin: 0 auto;
}

.hero-home__title {
  font-size: clamp(1.75rem, 5.5vw, 2.75rem);
  line-height: 1.15;
  margin-bottom: 1rem;
}

.hero-home__lead {
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  color: var(--text-muted);
  margin-bottom: 1.75rem;
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
}

.hero-home__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-bottom: 2rem;
}

.hero-home__actions .btn {
  min-width: min(100%, 12rem);
}

/* Terminal snippet in hero */
.hero-terminal {
  max-width: 22rem;
  margin: 0 auto 2rem;
  text-align: left;
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid #334155;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2);
  background: #0f172a;
  animation: terminalPop 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both;
}

@keyframes terminalPop {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }
}

.hero-terminal__bar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.75rem;
  background: #1e293b;
  border-bottom: 1px solid #334155;
}

.hero-terminal__bar span:not(.hero-terminal__fname) {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
}

.hero-terminal__dot--r { background: #ff5f57; }
.hero-terminal__dot--y { background: #febc2e; }
.hero-terminal__dot--g { background: #28c840; }

.hero-terminal__fname {
  margin-left: auto;
  font-family: ui-monospace, monospace;
  font-size: 0.65rem;
  color: #94a3b8;
}

.hero-terminal__code {
  margin: 0;
  padding: 0.85rem 1rem;
  font-size: 0.72rem;
  line-height: 1.55;
  color: #e2e8f0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow-x: auto;
}

.hero-terminal__code .hl-kw { color: #c792ea; }
.hero-terminal__code .hl-fn { color: #82aaff; }
.hero-terminal__code .hl-str { color: #c3e88d; }
.hero-terminal__code .hl-cm { color: #546e7a; }

.hero-terminal__line--cursor::after {
  content: "▋";
  animation: blinkCursor 1s step-end infinite;
  color: #22d3ee;
  margin-left: 2px;
}

@keyframes blinkCursor {
  50% { opacity: 0; }
}

/* Stats row */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  max-width: 28rem;
  margin: 0 auto;
}

.hero-stat {
  padding: 1rem 0.5rem;
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.hero-stat:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(56, 189, 248, 0.45);
}

.hero-stat__value {
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  font-weight: 800;
  line-height: 1.1;
}

.hero-stat__label {
  font-size: 0.65rem;
  color: var(--text-muted);
  line-height: 1.3;
  margin-top: 0.25rem;
}

/* Format cards — centered on mobile */
.page-home .format-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.page-home .format-card ul {
  text-align: left;
  width: 100%;
  max-width: 18rem;
}

.page-home .format-card__icon {
  margin-left: auto;
  margin-right: auto;
}

/* About split — stack centered */
.home-about__text {
  text-align: center;
  max-width: 36rem;
  margin: 0 auto 1.5rem;
}

@media (min-width: 992px) {
  .home-about__text {
    text-align: left;
    margin: 0;
    max-width: none;
  }
}

.home-benefits {
  max-width: 24rem;
  margin: 0 auto;
}

@media (min-width: 992px) {
  .home-benefits {
    margin: 0;
    max-width: none;
  }
}

/* Steps — equal height */
.home-steps .step-card {
  text-align: center;
  height: 100%;
}

.home-steps .step-card__num {
  margin-left: auto;
  margin-right: auto;
}

/* Directions grid */
.home-directions .direction-card-light {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 7rem;
  padding: 1.25rem !important;
}

/* FAQ centered */
.home-faq {
  max-width: 40rem;
  margin: 0 auto;
}

/* Secondary sections */
.page-home .secondary-header {
  flex-direction: column;
  align-items: center !important;
  text-align: center;
  gap: 0.5rem;
}

.page-home .secondary-header h2 {
  font-size: 1.35rem;
}

.page-home #text-courses .row {
  justify-content: center;
}

.page-home .format-card,
.page-home .lp-why-card,
.page-home .lp-step,
.page-home .faq-item {
  text-align: left;
}

/* Course cards — centered titles, justified description */
.page-home .course-card-sm {
  text-align: center;
}

.page-home .course-card-sm .card-title {
  text-align: center;
  line-height: 1.35;
}

.page-home .course-card-sm .text-muted {
  text-align: justify;
  hyphens: auto;
  line-height: 1.55;
  width: 100%;
}

.page-home .course-card-sm .btn-link {
  align-self: center !important;
}

/* CTA */
.home-cta {
  padding: clamp(3rem, 8vw, 4.5rem) 0;
}

.home-cta .container {
  max-width: 36rem;
  text-align: center;
}

/* Coding footer */
.footer-code {
  background: #0b1220;
  color: #cbd5e1;
  padding: clamp(2.5rem, 6vw, 3.5rem) 0 1.5rem;
  border-top: 1px solid #1e293b;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.footer-code__container {
  max-width: 72rem;
}

.footer-code__grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .footer-code__grid {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

@media (min-width: 992px) {
  .footer-code__grid {
    grid-template-columns: 1.1fr 1fr;
  }

  .footer-code__panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }
}

.footer-code__terminal {
  border-radius: 0.65rem;
  overflow: hidden;
  border: 1px solid #334155;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.footer-code__titlebar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.85rem;
  background: #1e293b;
  border-bottom: 1px solid #334155;
}

.footer-code__dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
}

.footer-code__dot--red { background: #ff5f57; }
.footer-code__dot--yellow { background: #febc2e; }
.footer-code__dot--green { background: #28c840; }

.footer-code__filename {
  margin-left: auto;
  font-size: 0.7rem;
  color: #94a3b8;
}

.footer-code__pre {
  margin: 0;
  padding: 1rem 1.1rem;
  font-size: 0.75rem;
  line-height: 1.6;
  background: #0f172a;
  overflow-x: auto;
}

.footer-code__pre .c-kw { color: #c792ea; }
.footer-code__pre .c-var { color: #82aaff; }
.footer-code__pre .c-key { color: #89ddff; }
.footer-code__pre .c-str { color: #c3e88d; }

.footer-code__panel {
  padding: 1rem 1.1rem;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid #334155;
  border-radius: 0.65rem;
  transition: border-color 0.25s ease, background 0.25s ease;
}

.footer-code__panel:hover {
  border-color: #475569;
  background: rgba(30, 41, 59, 0.75);
}

.footer-code__comment {
  font-size: 0.7rem;
  color: #64748b;
  margin-bottom: 0.65rem;
}

.footer-code__cmds li {
  margin-bottom: 0.35rem;
}

.footer-code__cmds a {
  color: #e2e8f0;
  text-decoration: none;
  font-size: 0.8rem;
  transition: color 0.2s ease, padding-left 0.2s ease;
  display: inline-block;
}

.footer-code__cmds a:hover {
  color: #38bdf8;
  padding-left: 0.25rem;
}

.footer-code__cmds .c-prompt {
  color: #22d3ee;
  margin-right: 0.35rem;
}

.footer-code__muted {
  color: #64748b !important;
  font-size: 0.75rem;
}

.footer-code__bottom {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #1e293b;
  text-align: center;
}

.footer-code__status {
  font-size: 0.75rem;
  color: #94a3b8;
}

.footer-code__status .c-ok {
  color: #4ade80;
}

.footer-code__cursor {
  display: inline-block;
  width: 0.5rem;
  height: 1em;
  background: #22d3ee;
  margin-right: 0.35rem;
  vertical-align: text-bottom;
  animation: blinkCursor 1s step-end infinite;
}

.reveal-footer {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  transition-delay: calc(var(--d, 0) * 0.12s);
}

.footer-code.is-ready .reveal-footer {
  opacity: 1;
  transform: translateY(0);
}

/* Mobile tweaks */
@media (max-width: 575.98px) {
  .hero-stats {
    gap: 0.5rem;
  }

  .hero-stat__label {
    font-size: 0.6rem;
  }

  .hero-home__actions .btn-lg {
    width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .page-home .format-card {
    padding: 1.5rem 1.25rem;
  }

  .home-section {
    padding-left: 0;
    padding-right: 0;
  }
}

