/* Subject area pages (/learn/<area>): a full-width banner, then sections. Themes (area-page--space) change the look.
   Teacher cards use the Explore card styles (explore-common.css) and the photo cards the hub styles (subject-pages.css). */

.area-page {
  --area-ink: #130f19;
  --area-muted: #5b5568;
  --area-surface: #ffffff;
  --area-line: rgba(19, 15, 25, 0.1);
  --area-accent: #f94e10;
  --area-accent-ink: #ffffff;
  --area-link: #c2410c;
  --area-chip: #fff1e8;
  width: 100%;
  color: var(--area-ink);
}

/* ---- Banner ---- */

.area-hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: clamp(520px, 78vh, 760px);
  overflow: hidden;
  background: #130f19;
  color: #fff;
  isolation: isolate;
}

.area-hero__photo,
.area-hero__stars,
.area-hero__shade,
.area-hero__planet {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.area-hero__photo {
  object-fit: cover;
  z-index: -3;
}

.area-hero__stars {
  z-index: -2;
  pointer-events: none;
}

.area-hero__shade {
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(10, 8, 20, 0.55) 0%, rgba(10, 8, 20, 0.15) 35%, rgba(10, 8, 20, 0.8) 100%),
    linear-gradient(90deg, rgba(10, 8, 20, 0.6) 0%, rgba(10, 8, 20, 0) 65%);
}

.area-hero__content {
  position: relative;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 8rem 1.25rem 3.5rem;
  box-sizing: border-box;
}

.area-breadcrumb {
  margin: 0 0 1.5rem;
  font-size: 0.95rem;
}

.area-breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.area-breadcrumb li {
  color: rgba(255, 255, 255, 0.75);
}

.area-breadcrumb li + li::before {
  content: "\203A";
  margin: 0 0.5rem;
  color: rgba(255, 255, 255, 0.5);
}

.area-breadcrumb a {
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

.area-breadcrumb a:hover,
.area-breadcrumb a:focus-visible {
  text-decoration: underline;
}

.area-hero__eyebrow {
  display: inline-block;
  margin: 0 0 1rem;
  padding: 0.35rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* desktop.css sizes every h1 with !important, so this needs the same weight. */
.area-page .area-hero__title {
  max-width: 18ch;
  margin: 0 0 1rem;
  padding: 0;
  color: #fff !important;
  font-size: clamp(2.2rem, 6vw, 4.2rem) !important;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-align: left;
  text-wrap: balance;
}

.area-hero__intro {
  max-width: 60ch;
  margin: 0 0 1.75rem;
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  line-height: 1.55;
}

.area-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.area-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.area-button--primary {
  background: var(--area-accent);
  color: var(--area-accent-ink);
  box-shadow: 0 10px 24px rgba(249, 78, 16, 0.35);
}

.area-button--ghost {
  border: 1.5px solid currentColor;
  color: inherit;
}

.area-button:hover,
.area-button:focus-visible {
  transform: translateY(-2px);
  text-decoration: none;
}

.area-button--primary:hover,
.area-button--primary:focus-visible {
  color: var(--area-accent-ink);
  box-shadow: 0 14px 30px rgba(249, 78, 16, 0.45);
}

.area-hero .area-button--ghost {
  color: #fff;
}

.area-hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.95rem;
}

.area-hero__stats strong {
  color: #fff;
  font-size: 1.15rem;
}

.area-hero__credit {
  position: absolute;
  right: 1rem;
  bottom: 0.6rem;
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.75rem;
}

.area-hero__credit a {
  color: inherit;
}

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

.area-page__body {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 1.25rem 4rem;
  box-sizing: border-box;
}

.area-section {
  margin: 0 0 3.5rem;
}

/* desktop.css adds padding-bottom and an !important size to every h2. */
.area-page .area-section__title,
.area-page .area-cta__title {
  margin: 0 0 1.25rem;
  padding-bottom: 0;
  color: var(--area-ink);
  font-size: clamp(1.5rem, 3vw, 2rem) !important;
  font-weight: 800;
  text-align: left;
}

.area-section__note {
  margin: 1rem 0 0;
}

.area-section__note a,
.area-teachers__more a {
  color: var(--area-link);
  font-weight: 600;
}

.area-pitch {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
}

.area-pitch__body {
  margin: 0;
  color: var(--area-muted);
  font-size: 1.1rem;
  line-height: 1.65;
}

.area-pitch__points {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.area-pitch__points li {
  padding: 1rem 1.15rem;
  border: 1px solid var(--area-line);
  border-radius: 14px;
  background: var(--area-surface);
  color: var(--area-muted);
  line-height: 1.5;
}

.area-pitch__points strong {
  display: block;
  color: var(--area-ink);
}

.area-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.area-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--area-line);
  border-radius: 16px;
  background: var(--area-surface);
  color: var(--area-ink);
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.area-card:hover,
.area-card:focus-visible {
  transform: translateY(-3px);
  border-color: var(--area-accent);
  box-shadow: 0 12px 28px rgba(19, 15, 25, 0.12);
  color: var(--area-ink);
  text-decoration: none;
}

.area-card__photo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.area-card__name {
  padding: 0.8rem 1rem 0.15rem;
  font-weight: 700;
  font-size: 1.05rem;
}

.area-card__count {
  padding: 0 1rem 0.9rem;
  color: var(--area-muted);
  font-size: 0.9rem;
}

.area-first {
  margin-top: 1.75rem;
}

.area-page .area-first__title {
  margin: 0 0 0.75rem;
  padding: 0;
  color: var(--area-ink);
  font-size: 1.1rem !important;
  font-weight: 700;
}

.area-first__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.area-first__chip {
  padding: 0.45rem 1rem;
  border: 1.5px dashed color-mix(in srgb, var(--area-accent) 45%, transparent);
  border-radius: 999px;
  background: var(--area-chip);
  color: var(--area-ink);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.area-first__chip::after {
  content: " +";
  color: var(--area-accent);
}

.area-first__chip:hover,
.area-first__chip:focus-visible {
  border-style: solid;
  border-color: var(--area-accent);
  transform: translateY(-2px);
}

.area-first__more {
  margin-top: 0.75rem;
}

.area-first__more summary {
  margin-bottom: 0.75rem;
  color: var(--area-link);
  font-weight: 600;
  cursor: pointer;
}

.area-teachers__cards {
  padding: 0;
}

.area-teachers__more {
  margin: 1.25rem 0 0;
}

.area-empty {
  padding: 2rem;
  border: 1.5px dashed var(--area-line);
  border-radius: 16px;
  text-align: center;
}

.area-empty p {
  margin: 0 0 1.25rem;
  color: var(--area-muted);
  font-size: 1.1rem;
}

.area-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: area-step;
}

.area-steps li {
  position: relative;
  padding: 3.25rem 1.25rem 1.25rem;
  border: 1px solid var(--area-line);
  border-radius: 16px;
  background: var(--area-surface);
  color: var(--area-muted);
  line-height: 1.5;
  counter-increment: area-step;
}

.area-steps li::before {
  content: counter(area-step);
  position: absolute;
  top: 1rem;
  left: 1.25rem;
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  background: var(--area-accent);
  color: var(--area-accent-ink);
  font-weight: 800;
}

.area-steps strong {
  color: var(--area-ink);
}

.area-cta {
  padding: 2.5rem 2rem;
  border-radius: 24px;
  background: #130f19;
  color: #fff;
}

.area-page .area-cta__title {
  color: #fff;
}

.area-cta__text {
  max-width: 55ch;
  margin: 0 0 1.5rem;
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.1rem;
}

.area-cta .area-button--ghost {
  color: #fff;
}

/* Photo credits come after the closing box here, not before it as on the /learn hub (subject-pages.css). */
.area-page .subject-photo-credits {
  max-width: none;
  margin: 1.25rem 0 0;
  color: var(--area-muted);
}

/* Space: who supports us, and the founder's link to the space sector. */
.area-supporters__logos {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
}

/* Logos are made for white backgrounds, so each sits on its own white tile. */
.area-supporters__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 220px;
  height: 100px;
  padding: 1rem 1.5rem;
  box-sizing: border-box;
  border-radius: 14px;
  background: #fff;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.area-supporters__logo:hover,
.area-supporters__logo:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(91, 76, 196, 0.35);
}

.area-supporters__logo img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
}

.area-supporters__founder {
  max-width: 62ch;
  margin: 0;
  color: var(--area-muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

/* Subject pages: the link to the subject's primary area, under the intro. */
.subject-hero__area {
  margin: 0.75rem 0 0;
  color: #5b5568;
}

.subject-hero__area a {
  color: #c2410c;
  font-weight: 700;
}

@media (max-width: 767px) {
  .area-hero {
    min-height: 0;
  }

  .area-hero__content {
    padding: 6.5rem 1rem 2.5rem;
  }

  .area-hero__actions .area-button {
    flex: 1 1 100%;
  }

  .area-page__body {
    padding: 2.25rem 1rem 3rem;
  }

  .area-pitch,
  .area-steps {
    grid-template-columns: minmax(0, 1fr);
  }

  .area-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .area-card__name {
    padding: 0.6rem 0.75rem 0.1rem;
    font-size: 0.95rem;
  }

  .area-card__count {
    padding: 0 0.75rem 0.7rem;
  }

  .area-cta {
    padding: 2rem 1.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .area-button,
  .area-card,
  .area-first__chip {
    transition: none;
  }

  .area-button:hover,
  .area-card:hover,
  .area-first__chip:hover {
    transform: none;
  }
}

/* ==== Space theme ======================================================================================== */

/* On the page itself rather than the body: the site's base styles make the body transparent. */
.area-page.area-page--space {
  background-color: #04050d;
  /* A faint, fixed field of stars behind every section; the banner has its own moving sky on a canvas. */
  background-image:
    radial-gradient(1px 1px at 12% 18%, rgba(255, 255, 255, 0.55), transparent 60%),
    radial-gradient(1px 1px at 72% 34%, rgba(255, 255, 255, 0.45), transparent 60%),
    radial-gradient(1.5px 1.5px at 38% 72%, rgba(255, 255, 255, 0.5), transparent 60%),
    radial-gradient(1px 1px at 88% 82%, rgba(200, 215, 255, 0.5), transparent 60%),
    radial-gradient(1px 1px at 55% 8%, rgba(255, 255, 255, 0.4), transparent 60%),
    radial-gradient(1.5px 1.5px at 22% 55%, rgba(255, 230, 210, 0.45), transparent 60%),
    radial-gradient(ellipse 60% 40% at 85% 15%, rgba(91, 76, 196, 0.18), transparent 70%),
    radial-gradient(ellipse 50% 35% at 10% 85%, rgba(249, 78, 16, 0.08), transparent 70%);
  background-size: 420px 420px, 380px 380px, 520px 520px, 460px 460px, 300px 300px, 600px 600px, 100% 100%, 100% 100%;
  background-repeat: repeat, repeat, repeat, repeat, repeat, repeat, no-repeat, no-repeat;
  background-attachment: fixed;
}

.area-page--space {
  --area-ink: #f4f1ff;
  --area-muted: #b9b4d0;
  --area-surface: rgba(255, 255, 255, 0.05);
  --area-line: rgba(196, 188, 255, 0.18);
  --area-link: #ffb38a;
  --area-chip: rgba(255, 255, 255, 0.04);
}

.area-page--space .area-hero {
  min-height: clamp(560px, 88vh, 860px);
  background: radial-gradient(ellipse 120% 90% at 70% 10%, #1b1946 0%, #0a0b22 45%, #04050d 100%);
}

.area-page--space .area-hero__shade {
  background:
    linear-gradient(180deg, rgba(4, 5, 13, 0.35) 0%, rgba(4, 5, 13, 0) 40%, rgba(4, 5, 13, 0.85) 92%, #04050d 100%),
    linear-gradient(90deg, rgba(4, 5, 13, 0.7) 0%, rgba(4, 5, 13, 0) 60%);
}

/* Without a photo, the theme draws a planet rising from the bottom right, with a thin bright atmosphere. */
.area-hero--drawn .area-hero__planet {
  z-index: -2;
  inset: auto;
  right: -22vw;
  bottom: -62vw;
  width: 110vw;
  height: 110vw;
  max-width: none;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.22), transparent 38%),
    radial-gradient(circle at 50% 45%, #2b5fae 0%, #18346e 38%, #0b1638 62%, #050818 78%);
  box-shadow:
    0 0 0 2px rgba(140, 200, 255, 0.55),
    0 0 40px 8px rgba(110, 170, 255, 0.45),
    0 0 140px 40px rgba(80, 120, 255, 0.25),
    inset 30px 40px 80px rgba(140, 200, 255, 0.25);
}

/* Stars sit above the planet's dark side but under the text. */
.area-hero--drawn .area-hero__stars {
  z-index: -3;
}

.area-page--space .area-hero__eyebrow {
  border-color: rgba(255, 179, 138, 0.5);
  background: rgba(249, 78, 16, 0.12);
  color: #ffd3bc;
}

.area-page--space .area-hero__title {
  text-shadow: 0 0 40px rgba(120, 140, 255, 0.35);
}

.area-page--space .area-button--primary {
  box-shadow: 0 0 0 1px rgba(255, 179, 138, 0.4), 0 10px 30px rgba(249, 78, 16, 0.45), 0 0 50px rgba(249, 78, 16, 0.25);
}

/* The teacher cards stay white (Explore styles), so their text keeps the dark ink instead of the theme's light text. */
.area-page--space .user-match-card {
  color: #130f19;
}

.area-page--space .area-card,
.area-page--space .area-pitch__points li,
.area-page--space .area-steps li {
  backdrop-filter: blur(6px);
}

.area-page--space .area-card:hover,
.area-page--space .area-card:focus-visible {
  border-color: rgba(255, 179, 138, 0.7);
  box-shadow: 0 0 0 1px rgba(255, 179, 138, 0.3), 0 14px 40px rgba(91, 76, 196, 0.35);
}

.area-page--space .area-first__chip {
  border-color: rgba(255, 179, 138, 0.45);
}

.area-page--space .area-cta {
  border: 1px solid var(--area-line);
  background:
    radial-gradient(ellipse 70% 120% at 100% 0%, rgba(91, 76, 196, 0.45), transparent 60%),
    radial-gradient(ellipse 60% 100% at 0% 100%, rgba(249, 78, 16, 0.22), transparent 60%),
    #0b0b20;
}

.area-page--space .area-empty {
  background: rgba(255, 255, 255, 0.03);
}

.area-page--space .subject-photo-credits a {
  color: var(--area-link);
}

@media (max-width: 767px) {
  .area-page--space .area-hero {
    min-height: 0;
  }

  .area-hero--drawn .area-hero__planet {
    right: -60vw;
    bottom: -150vw;
    width: 200vw;
    height: 200vw;
  }

  .area-hero--drawn .area-hero__content {
    padding-bottom: 9rem;
  }
}
