/* ==========================================================================
   ComputeNest — site stylesheet
   Mobile-first. Breakpoints: 480px (large phone), 768px (tablet), 1080px (desktop)
   ========================================================================== */

:root {
  --color-bg: #faf9f6;
  --color-bg-alt: #f1eeff;
  --color-surface: #ffffff;
  --color-text: #211f36;
  --color-text-muted: #5a5770;
  --color-border: #e6e3f5;

  --color-primary: #5b3df5;
  --color-primary-dark: #4429d6;
  --color-primary-contrast: #ffffff;
  --color-accent: #ff9d2e;
  --color-accent-dark: #e4820f;
  --color-success: #1fa971;
  --color-soon: #9b96b8;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --shadow-card: 0 6px 20px rgba(37, 24, 110, 0.08);
  --shadow-card-hover: 0 12px 28px rgba(37, 24, 110, 0.14);

  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  --container-width: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  overflow-x: hidden;
}

img,
svg {
  max-width: 100%;
  display: block;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0 0 0.5em;
}

p {
  margin: 0 0 1em;
}

ul {
  margin: 0 0 1em;
  padding-left: 1.25em;
}

.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--color-primary);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  z-index: 100;
}

.skip-link:focus {
  left: 0;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 13px 24px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.98rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn--primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 8px 18px rgba(91, 61, 245, 0.28);
}

.btn--primary:hover {
  background: var(--color-primary-dark);
}

.btn--secondary {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn--secondary:hover {
  background: var(--color-bg-alt);
}

/* ---------- Header / Nav ---------- */

.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-header__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--color-text);
  flex-shrink: 0;
}

.brand__logo {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

@media (min-width: 480px) {
  .brand__logo {
    width: 36px;
    height: 36px;
  }
}

.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.nav-toggle__bar {
  display: block;
  height: 2px;
  width: 20px;
  margin: 0 auto;
  background: var(--color-text);
  border-radius: 2px;
}

.site-header__collapsible {
  display: none;
  width: 100%;
  flex-basis: 100%;
  flex-direction: column;
  gap: 14px;
}

.site-header__collapsible.is-open {
  display: flex;
}

.nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-links a {
  display: block;
  padding: 10px 4px;
  color: var(--color-text);
  font-weight: 600;
  border-bottom: 1px solid var(--color-border);
}

.nav-links a.active {
  color: var(--color-primary);
}

.search-form {
  display: flex;
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 4px 6px 4px 14px;
  background: var(--color-bg);
}

.search-form input {
  border: none;
  background: transparent;
  flex: 1;
  padding: 8px 4px;
  font-size: 0.95rem;
  outline: none;
  color: var(--color-text);
  min-width: 0;
}

.search-form button {
  border: none;
  background: var(--color-primary);
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

@media (min-width: 900px) {
  .nav-toggle {
    display: none;
  }

  .site-header__row {
    flex-wrap: nowrap;
  }

  .site-header__collapsible {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    width: auto;
    gap: 24px;
  }

  .nav-links {
    flex-direction: row;
    gap: 22px;
  }

  .nav-links a {
    border-bottom: none;
    padding: 6px 2px;
  }

  .search-form {
    width: 240px;
  }
}

/* ---------- Hero ---------- */

.hero {
  padding: 48px 0 40px;
  background: linear-gradient(180deg, var(--color-bg-alt) 0%, var(--color-bg) 100%);
}

.hero__row {
  display: grid;
  gap: 32px;
  align-items: center;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 10px;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
}

.hero__tagline {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-accent-dark);
  margin-bottom: 14px;
}

.hero__lead {
  font-size: 1.05rem;
  color: var(--color-text-muted);
  max-width: 46ch;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 22px;
}

.hero__card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 28px 20px;
}

.hero__canvas {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.hero__node {
  width: 100%;
  max-width: 220px;
  text-align: center;
  padding: 14px 10px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.95rem;
}

.hero__node--trigger {
  background: #fff1de;
  border: 2px solid var(--color-accent);
  color: var(--color-accent-dark);
}

.hero__node--action {
  background: #ece7ff;
  border: 2px solid var(--color-primary);
  color: var(--color-primary-dark);
}

.hero__node--result {
  background: #e3f8ee;
  border: 2px solid var(--color-success);
  color: #0d7a4d;
}

.hero__connector {
  width: 2px;
  height: 20px;
  background: var(--color-border);
}

@media (min-width: 860px) {
  .hero__row {
    grid-template-columns: 1.15fr 0.85fr;
  }
}

/* ---------- Sections ---------- */

.section {
  padding: 44px 0;
}

.section__heading {
  margin-bottom: 26px;
}

.section__heading p {
  color: var(--color-text-muted);
}

.who-for__grid {
  display: grid;
  gap: 18px;
  margin-top: 20px;
}

.who-for__card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 26px 22px;
}

.who-for__emoji {
  font-size: 2rem;
  display: block;
  margin-bottom: 10px;
}

@media (min-width: 700px) {
  .who-for__grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ---------- Level cards ---------- */

.level-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}

.level-card {
  display: block;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
  color: var(--color-text);
}

.level-card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}

.level-card__emoji {
  font-size: 1.8rem;
}

.level-card__meta {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 8px 0 6px;
}

.level-card p {
  color: var(--color-text-muted);
  margin-bottom: 0;
  font-size: 0.95rem;
}

@media (min-width: 700px) {
  .level-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1000px) {
  .level-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ---------- Featured video ---------- */

.featured-video {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 28px 24px;
  border: 2px solid var(--color-primary);
}

.featured-video__text h3 {
  font-size: 1.4rem;
  margin: 10px 0 8px;
}

.featured-video__text p {
  color: var(--color-text-muted);
}

/* ---------- Badges ---------- */

.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge--live {
  background: #e3f8ee;
  color: #0d7a4d;
}

.badge--soon {
  background: #eeecf7;
  color: var(--color-soon);
}

.badge--boss {
  background: #fff1de;
  color: var(--color-accent-dark);
  margin-top: 6px;
}

/* ---------- Page header (inner pages) ---------- */

.page-header {
  padding: 40px 0 28px;
  background: var(--color-bg-alt);
}

.page-header h1 {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
}

.page-header__lead {
  color: var(--color-text-muted);
  max-width: 62ch;
  font-size: 1.02rem;
}

.page-header .eyebrow a {
  color: inherit;
}

/* ---------- Curriculum controls ---------- */

.curriculum-controls {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#curriculumSearch {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  font-size: 1rem;
  background: var(--color-surface);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  color: var(--color-text);
}

.chip--active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.curriculum-controls__count {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* ---------- Level sections + video grid ---------- */

.level-section {
  padding: 40px 0 8px;
  scroll-margin-top: 90px;
}

.level-section__heading {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
}

.level-section__emoji {
  font-size: 1.8rem;
}

.level-section__heading p {
  color: var(--color-text-muted);
  margin-bottom: 0;
  font-size: 0.92rem;
}

.video-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}

.video-card {
  display: block;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-card);
  color: var(--color-text);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.video-card--live {
  border-color: var(--color-primary);
}

.video-card--live:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}

.video-card--soon {
  opacity: 0.82;
}

.video-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.video-card__number {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-text-muted);
}

.video-card h3 {
  font-size: 1.05rem;
  margin-bottom: 6px;
}

.video-card p {
  font-size: 0.92rem;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}

.video-card__cta {
  display: inline-block;
  margin-top: 6px;
  font-weight: 700;
  color: var(--color-primary);
  font-size: 0.9rem;
}

.no-results {
  text-align: center;
  padding: 40px 0;
  color: var(--color-text-muted);
}

@media (min-width: 620px) {
  .video-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1000px) {
  .video-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ---------- Video resource page ---------- */

.video-page {
  display: grid;
  gap: 28px;
  padding: 34px 0;
}

.video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #16142b;
  margin-bottom: 26px;
}

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

.video-embed--placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #cfc9f5;
  gap: 8px;
}

.video-embed__emoji {
  font-size: 2.4rem;
}

.learn-list li {
  margin-bottom: 6px;
}

.workflow-preview {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #16142b;
  margin: 16px 0 24px;
}

.workflow-preview img,
.workflow-preview video {
  display: block;
  width: 100%;
  height: auto;
}

.metaphor-box {
  background: var(--color-bg-alt);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-top: 20px;
}

.resource-box {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-card);
  margin-bottom: 20px;
}

.resource-box .btn {
  width: 100%;
}

.download-pending {
  font-size: 0.92rem;
  color: var(--color-text-muted);
}

@media (min-width: 860px) {
  .video-page {
    grid-template-columns: 2fr 1fr;
  }
}

/* ---------- Prev/next pagination ---------- */

.video-pagination {
  border-top: 1px solid var(--color-border);
  padding: 22px 0;
}

.video-pagination__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.video-pagination__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-size: 0.9rem;
}

.video-pagination__link:last-child {
  justify-content: flex-end;
  text-align: right;
}

.video-pagination__link small {
  display: block;
  color: var(--color-text-muted);
  font-weight: 600;
}

.video-pagination__link strong {
  display: block;
  font-size: 0.92rem;
}

.video-pagination__link--disabled {
  visibility: hidden;
}

.video-pagination__link--soon {
  color: var(--color-soon);
  border-style: dashed;
}

/* ---------- Prose pages (about / legal) ---------- */

.prose-section {
  padding-top: 0;
}

.prose {
  max-width: 74ch;
}

.prose h2 {
  margin-top: 1.6em;
  font-size: 1.3rem;
}

/* ---------- 404 ---------- */

.not-found {
  text-align: center;
  padding: 90px 0;
}

.not-found__emoji {
  font-size: 3rem;
  display: block;
  margin-bottom: 14px;
}

.not-found h1 {
  font-size: 1.6rem;
  max-width: 30ch;
  margin: 0 auto 12px;
}

.not-found p {
  color: var(--color-text-muted);
  margin-bottom: 22px;
}

.not-found .hero__actions {
  justify-content: center;
}

/* ---------- Ad slots ---------- */

.ad-slot {
  max-width: var(--container-width);
  margin: 30px auto;
  padding: 18px;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 90px;
  color: var(--color-text-muted);
}

.ad-slot__label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ---------- Footer ---------- */

.site-footer {
  background: #17152c;
  color: #d9d6ef;
  margin-top: 40px;
  padding: 40px 0 24px;
}

.footer__row {
  display: grid;
  gap: 24px;
}

.footer__brand {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.footer__brand strong {
  color: #fff;
}

.footer__brand p {
  flex-basis: 100%;
  color: #a8a3c9;
  font-size: 0.9rem;
  margin-top: 6px;
}

.footer__links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 14px 20px;
}

.footer__links a {
  color: #d9d6ef;
  font-size: 0.92rem;
}

.footer__links a:hover {
  color: #fff;
}

.footer__links--social {
  margin-top: 10px;
}

.footer__links--social a {
  font-weight: 700;
}

.footer__credit {
  margin-top: 4px;
}

.creator-links a {
  font-weight: 700;
}

.footer__bottom {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.8rem;
  color: #8f8ab3;
}

.footer__bottom p {
  margin-bottom: 6px;
}

@media (min-width: 760px) {
  .footer__row {
    grid-template-columns: 2fr 1fr;
    align-items: center;
  }
}
