/* BornaCode shared visual system: calm surfaces, clear learning hierarchy. */
:root {
  --bg: #f7f5fc;
  --bg-soft: #f0edf7;
  --card: #ffffff;
  --card-2: #f9f7fd;
  --border: rgba(101, 80, 168, 0.16);
  --text: #22212b;
  --muted: #6f6b7a;
  --primary: #7c5ce0;
  --primary-2: #6550a8;
  --accent: #4d8af5;
  --radius: 20px;
  --shadow: 0 18px 48px rgba(46, 35, 88, 0.09);
  --max: 1180px;
  color-scheme: light;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
}

body {
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(ellipse at 8% 0%, rgba(196, 180, 244, 0.24), transparent 34%),
    radial-gradient(ellipse at 94% 15%, rgba(190, 215, 255, 0.19), transparent 30%),
    var(--bg);
}

body::before {
  background-image: radial-gradient(rgba(101, 80, 168, 0.09) 0.65px, transparent 0.65px);
  background-size: 21px 21px;
  opacity: 0.42;
}

::selection {
  color: #fff;
  background: var(--primary);
}

:where(a, button, input, textarea, select, summary, [tabindex]):focus-visible {
  outline: 3px solid rgba(124, 92, 224, 0.58);
  outline-offset: 3px;
}

a {
  transition: color 0.2s ease;
}

.gradient-text {
  color: transparent;
  background: linear-gradient(110deg, #6550a8 4%, #7c5ce0 52%, #4d8af5 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: transparent;
}

.hero::before {
  background:
    radial-gradient(560px circle at 87% 12%, rgba(124, 92, 224, 0.16), transparent 64%),
    radial-gradient(470px circle at 13% 38%, rgba(77, 138, 245, 0.10), transparent 64%);
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 340px;
  height: 340px;
  right: 18%;
  bottom: -270px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(196, 180, 244, 0.34), transparent 70%);
  pointer-events: none;
}

.hero-inner {
  padding-top: clamp(62px, 8vw, 104px);
  padding-bottom: clamp(56px, 7vw, 88px);
}

.hero-text h1 {
  max-width: 800px;
  color: var(--text);
  font-size: clamp(2.35rem, 5.1vw, 4.35rem);
  letter-spacing: -0.035em;
  line-height: 1.32;
}

.hero-sub {
  max-width: 660px;
  color: var(--muted);
  font-size: clamp(1rem, 1.45vw, 1.14rem);
  line-height: 2;
}

.badge,
.eyebrow,
.school-label {
  color: var(--primary-2);
  background: rgba(231, 221, 251, 0.62);
  border-color: rgba(101, 80, 168, 0.16);
}

.btn {
  color: var(--text);
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.8);
}

.btn:hover {
  border-color: rgba(124, 92, 224, 0.38);
  box-shadow: 0 10px 25px rgba(46, 35, 88, 0.10);
}

.btn-primary {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(125deg, #7c5ce0, #6550a8);
  box-shadow: 0 10px 24px rgba(101, 80, 168, 0.22);
}

.btn-primary:hover {
  color: #fff;
  box-shadow: 0 14px 32px rgba(101, 80, 168, 0.29);
  transform: translateY(-2px);
}

.btn-outline {
  color: var(--text);
  background: rgba(255, 255, 255, 0.56);
}

.hero-stats {
  gap: 14px;
}

.hero-stats > div {
  min-width: 132px;
  padding: 10px 14px;
  border-inline-start: 2px solid rgba(124, 92, 224, 0.32);
}

.hero-stats strong {
  color: var(--text);
  font-size: 17px;
}

.hero-stats span {
  color: var(--muted);
  font-size: 12px;
}

/* Keep learning cards readable; reserve translucent glass for a few highlights. */
.hub-card,
.feature-card,
.module-card,
.panel,
.game-card,
.grade-card,
.book-slot,
.lesson-card,
.course-card,
.path-card,
.tool-card,
.tutorial-panel,
.tutorial-lesson-head,
.tutorial-sidebar,
.tutorial-chapter-card,
.tutorial-all-lessons,
.tutorial-index-list a {
  color: var(--text);
  background: rgba(255, 255, 255, 0.94);
  border-color: var(--border);
  outline: none;
  box-shadow: 0 12px 32px rgba(46, 35, 88, 0.065);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.glass,
.school-new-hero,
.school-hero,
.cta-inner,
.tutorial-heading {
  color: var(--text);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(243, 239, 251, 0.88));
  border-color: rgba(255, 255, 255, 0.92);
  outline: 1px solid rgba(101, 80, 168, 0.12);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.hub-card,
.feature-card,
.module-card,
.game-card,
.grade-card,
.book-slot,
.course-card,
.path-card,
.tool-card {
  border-radius: 21px;
  transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
}

.hub-card:hover,
.feature-card:hover,
.module-card:hover,
.game-card:hover,
.grade-card:hover,
.course-card:hover,
.path-card:hover,
.tool-card:hover {
  border-color: rgba(124, 92, 224, 0.38);
  box-shadow: 0 20px 42px rgba(46, 35, 88, 0.12);
  transform: translateY(-4px);
}

.hub-icon,
.feature-icon,
.game-icon {
  color: var(--primary-2);
  background: linear-gradient(135deg, rgba(231, 221, 251, 0.82), rgba(221, 233, 255, 0.75));
  border: 1px solid rgba(101, 80, 168, 0.12);
  border-radius: 14px;
}

.hub-card h3,
.feature-card h3,
.module-card strong,
.game-card h3,
.grade-card h3,
.book-slot h2 {
  color: var(--text);
}

.hub-card p,
.feature-card p,
.module-card .desc,
.game-card p,
.grade-card p,
.book-slot p {
  color: var(--muted);
}

.hub-link,
.module-card .open,
.tutorial-chapter-card a,
.tutorial-index-list a:hover {
  color: var(--primary-2);
}

.code-card {
  border-color: rgba(101, 80, 168, 0.14);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 22px 54px rgba(46, 35, 88, 0.13);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.code-card-bar {
  background: #f2eef9;
  border-color: var(--border);
}

.code-card-body {
  color: #353044;
  background: rgba(255, 255, 255, 0.76);
}

.code-card-body code {
  color: #353044;
}

.c-key { color: #815ec5; }
.c-var { color: #277da1; }
.c-str { color: #23816c; }
.c-fn { color: #a26022; }

.hub,
.features,
.courses,
.roadmap {
  background: transparent;
}

.section-head h2,
.section-head h3 {
  color: var(--text);
}

.section-head p {
  color: var(--muted);
}

.cta {
  position: relative;
  overflow: hidden;
  border-block: 1px solid var(--border);
  background: linear-gradient(125deg, rgba(231, 221, 251, 0.56), rgba(221, 233, 255, 0.42));
}

.cta h2,
.cta-inner h2 {
  color: var(--text);
}

.cta p,
.cta-inner p {
  color: var(--muted);
}

.source-note {
  color: #69552f;
  background: rgba(255, 248, 233, 0.9);
  border-color: rgba(186, 143, 62, 0.22);
}

input,
textarea,
select {
  color: var(--text) !important;
  background-color: #fff !important;
  border-color: var(--border) !important;
}

input::placeholder,
textarea::placeholder {
  color: #8a8494;
}

hr {
  border-color: var(--border);
}

[hidden] {
  display: none !important;
}

/* Illustration cards keep a deeper surface so their captions stay legible. */
.showcase-section {
  position: relative;
  padding: clamp(56px, 7vw, 92px) 0;
}

.showcase-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
}

.showcase-card {
  position: relative;
  z-index: 0;
  grid-column: span 4;
  min-height: 290px;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid rgba(101, 80, 168, 0.20);
  border-radius: 24px;
  background: linear-gradient(150deg, #4d4670, #252337);
  transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

.showcase-card:nth-child(1),
.showcase-card:nth-child(4) {
  grid-column: span 6;
}

.showcase-card:hover {
  border-color: rgba(124, 92, 224, 0.56);
  box-shadow: 0 20px 44px rgba(46, 35, 88, 0.17);
  transform: translateY(-5px);
}

.showcase-art {
  position: absolute;
  z-index: -1;
  inset: 0;
  opacity: 0.82;
  transition: transform 0.6s ease, opacity 0.3s ease;
}

.showcase-card:hover .showcase-art {
  opacity: 0.96;
  transform: scale(1.045);
}

.showcase-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.showcase-card::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  background: linear-gradient(0deg, rgba(28, 25, 40, 0.94), rgba(28, 25, 40, 0.06) 88%);
}

.showcase-copy {
  display: flex;
  min-height: 290px;
  padding: 24px;
  flex-direction: column;
  justify-content: flex-end;
}

.showcase-copy .eyebrow {
  align-self: flex-start;
  color: #fff;
  background: rgba(124, 92, 224, 0.24);
  border-color: rgba(255, 255, 255, 0.3);
  font-size: 0.78rem;
}

.showcase-copy h3 {
  margin: 12px 0 5px;
  color: #fff;
  font-size: 1.35rem;
}

.showcase-copy p {
  max-width: 42ch;
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
}

.showcase-number {
  position: absolute;
  top: 18px;
  left: 20px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 2rem;
  font-weight: 800;
}

.scroll-progress {
  position: fixed;
  z-index: 1000;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  pointer-events: none;
}

.scroll-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #6550a8, #7c5ce0, #4d8af5);
  box-shadow: 0 0 12px rgba(124, 92, 224, 0.36);
}

/* Content remains visible if JavaScript or IntersectionObserver is unavailable. */
.reveal {
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.motion-ready .reveal {
  opacity: 0;
}

.motion-ready .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.tutorial-heading h1,
.tutorial-lesson-head h1,
.tutorial-content h2,
.tutorial-content h3 {
  color: var(--text);
}

.tutorial-heading p,
.tutorial-lesson-head p,
.tutorial-content p,
.tutorial-content li {
  color: #514d5d;
}

.tutorial-sidebar-title,
.tutorial-group > summary,
.tutorial-nav-link,
.tutorial-index-list .index-text > span {
  color: #514d5d;
}

.tutorial-nav-link:hover,
.tutorial-nav-link.active,
.tutorial-index-list a:hover {
  background: #f0eafd;
  border-color: rgba(124, 92, 224, 0.24);
  color: var(--primary-2) !important;
}

.tutorial-nav-no,
.tutorial-nav-link.active .tutorial-nav-no {
  color: var(--primary-2);
  background: #e7ddfb;
}

.tutorial-nav-link.active .tutorial-nav-no {
  color: #fff;
  background: var(--primary);
}

.tutorial-mobile-sidebar {
  color: var(--primary-2);
  background: #f0eafd;
  border-color: var(--border);
}

.tutorial-code-editor {
  color: #e0edff !important;
  background-color: #101c30 !important;
}

.tutorial-notebook {
  color: #4f4125 !important;
  background-color: #fffdf7 !important;
}

.tutorial-progress-track {
  background: #e6e1ef;
}

.tutorial-progress-track span {
  background: linear-gradient(90deg, #6550a8, #7c5ce0);
}

.tutorial-nav-buttons a {
  color: var(--primary-2) !important;
  background: #f0eafd;
}

.tutorial-nav-buttons a.next {
  color: #fff !important;
  background: var(--primary);
}

@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .hero-visual {
    max-width: 680px;
  }
}

@media (max-width: 760px) {
  .showcase-card,
  .showcase-card:nth-child(1),
  .showcase-card:nth-child(4) {
    grid-column: span 12;
    min-height: 250px;
  }

  .showcase-copy {
    min-height: 250px;
  }

  .hero-inner {
    padding-top: 54px;
  }

  .hub-card {
    padding: 20px;
  }

  .code-card {
    transform: none;
  }
}

@media (max-width: 650px) {
  .hero-text h1 {
    font-size: clamp(2rem, 9vw, 2.7rem);
  }

  .hero-stats > div {
    min-width: min(42vw, 132px);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .reveal,
  .motion-ready .reveal {
    opacity: 1;
    transform: none;
  }
}

@media print {
  body {
    color: #111;
    background: #fff;
  }

  .bc-global-header,
  .bc-global-footer,
  .scroll-progress,
  .hero-actions {
    display: none !important;
  }

  .glass,
  .panel,
  .lesson-card,
  .tutorial-panel {
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    break-inside: avoid;
  }
}


/* Compact mobile layout: prioritize useful content and avoid oversized code previews. */
@media (max-width: 650px) {
  body { overflow-x: hidden; }
  .container, .wrap { width: calc(100% - 24px); max-width: 100%; }
  .hero { padding: 18px 0 22px; }
  .hero-inner { padding-top: 10px; gap: 14px; }
  .hero-visual { order: 2 !important; width: 100%; max-width: 100%; padding: 5px; margin-top: 4px; }
  .hero-text { order: 1; min-width: 0; }
  .hero-text h1 { font-size: clamp(25px, 7.2vw, 34px); line-height: 1.45; margin: 9px 0 11px; letter-spacing: 0; }
  .hero-sub { font-size: 14px; line-height: 1.9; }
  .hero-actions { gap: 8px; margin: 15px 0; }
  .hero-actions .btn { padding: 9px 12px; font-size: 12px; }
  .hero-stats { gap: 7px; margin-top: 14px; }
  .hero-stats .stat-pill { min-width: 0; flex: 1 1 135px; gap: 8px; padding: 8px 10px; border-radius: 13px; }
  .hero-stats .stat-pill .stat-num { font-size: 17px; }
  .hero-stats .stat-pill .stat-ic { width: 31px; height: 31px; flex: 0 0 31px; font-size: 15px; border-radius: 10px; }
  .code-card { width: 100%; max-width: 100%; border-radius: 15px; transform: none !important; }
  .code-card:after { inset: -3px; border-radius: 17px; animation: none; }
  .code-card-bar { padding: 8px 11px; }
  .code-card-body { max-height: 112px; overflow: auto; padding: 10px 12px; font-size: 11px; line-height: 1.65; white-space: pre; }
  .code-card-body code { overflow-wrap: normal; }
  .hub, .features, .cta, .page-section { padding: 25px 0 30px; }
  .section-head h2 { font-size: 23px; line-height: 1.5; }
  .section-head p { font-size: 13px; }
  .hub-grid, .features-grid, .modules-grid, .grades-grid, .books-grid, .games-grid { gap: 11px; }
  .hub-card, .feature-card, .module-card, .game-card, .grade-card, .book-slot { padding: 15px; border-radius: 17px; }
  pre, .code-block, .lesson-card pre { max-width: 100%; overflow-x: auto; }
  img, video, iframe, canvas { max-width: 100%; }
  table { display: block; max-width: 100%; overflow-x: auto; }
  input, select, textarea, button { max-width: 100%; }
}
@media (max-width: 380px) {
  .hero-text h1 { font-size: 25px; }
  .hero-sub { font-size: 13px; }
  .hero-actions .btn { flex: 1 1 auto; }
  .hero-stats .stat-pill { flex-basis: 100%; }
}
