:root {
  --ink: #071111;
  --muted: #516162;
  --paper: #f7fbf8;
  --white: #ffffff;
  --teal: #006d8b;
  --teal-dark: #064d62;
  --cyan: #08b9ca;
  --green: #008c62;
  --green-dark: #056341;
  --red: #ef233c;
  --gold: #f6b53d;
  --line: rgba(7, 17, 17, 0.12);
  --shadow: 0 20px 60px rgba(5, 37, 44, 0.16);
  --font-body: "Atkinson Hyperlegible", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Fraunces", Georgia, serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-body);
  line-height: 1.55;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

.site-header {
  position: fixed;
  inset: 16px 16px auto;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(18px);
  transition: background 180ms ease, box-shadow 180ms ease;
}

.site-header.is-scrolled {
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 46px rgba(0, 0, 0, 0.18);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
}

.brand img {
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  object-fit: contain;
}

.brand span {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.brand strong {
  overflow: hidden;
  color: var(--teal-dark);
  font-size: clamp(0.86rem, 1.8vw, 1rem);
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand small {
  color: var(--green-dark);
  font-size: 0.78rem;
  font-weight: 700;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.site-nav a {
  min-height: 40px;
  padding: 10px 12px;
  border-radius: 8px;
  color: #203031;
  font-size: 0.92rem;
  font-weight: 700;
  transition: background 180ms ease, color 180ms ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  background: rgba(0, 109, 139, 0.1);
  color: var(--teal-dark);
  outline: none;
}

.site-nav .nav-pill {
  background: var(--teal-dark);
  color: var(--white);
}

.site-nav .nav-pill:hover,
.site-nav .nav-pill:focus-visible {
  background: var(--green-dark);
  color: var(--white);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 5px auto;
  background: currentColor;
}

.hero {
  position: relative;
  min-height: 92svh;
  display: grid;
  align-items: end;
  overflow: hidden;
  padding: 132px 24px 30px;
  color: var(--white);
}

.hero-bg,
.hero-overlay {
  position: absolute;
  inset: 0;
}

.hero-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  background:
    linear-gradient(90deg, rgba(0, 37, 45, 0.84) 0%, rgba(0, 70, 82, 0.58) 42%, rgba(0, 0, 0, 0.16) 100%),
    linear-gradient(0deg, rgba(7, 17, 17, 0.7), rgba(7, 17, 17, 0.02) 42%);
}

.hero-content {
  position: relative;
  z-index: 2;
  width: min(1120px, 100%);
  margin: 0 auto;
  padding-bottom: 34px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero h1,
.section h2,
.community h2,
.contact h2 {
  margin: 0;
  font-family: var(--font-display);
  line-height: 0.98;
}

.hero h1 {
  max-width: 790px;
  font-size: clamp(3rem, 8vw, 6.8rem);
}

.hero-copy {
  max-width: 650px;
  margin: 24px 0 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: clamp(1rem, 2vw, 1.25rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 700;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-1px);
  outline: none;
}

.btn-primary {
  background: var(--red);
  color: var(--white);
  box-shadow: 0 14px 32px rgba(239, 35, 60, 0.28);
}

.btn-secondary {
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.14);
  color: var(--white);
}

.quick-panel {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: min(1120px, 100%);
  margin: 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  color: var(--ink);
  overflow: hidden;
}

.quick-panel article {
  padding: 22px;
  border-right: 1px solid var(--line);
}

.quick-panel article:last-child {
  border-right: 0;
}

.quick-panel strong {
  display: block;
  color: var(--teal-dark);
  font-size: 1.08rem;
}

.quick-panel span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.94rem;
}

.section {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 96px 0;
}

.intro-grid,
.section-heading,
.community-inner,
.contact-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 1fr);
  gap: clamp(28px, 6vw, 72px);
  align-items: start;
}

.section h2,
.community h2,
.contact h2 {
  font-size: clamp(2.2rem, 5vw, 4.2rem);
}

.intro-text {
  display: grid;
  gap: 18px;
  color: var(--muted);
  font-size: 1.08rem;
}

.intro-text p {
  margin: 0;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  padding-top: 0;
}

.metric-card,
.team-card,
.program-grid article,
.news-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 14px 36px rgba(8, 56, 64, 0.08);
}

.metric-card {
  padding: 24px;
}

.metric-card span,
.community-list span,
.news-card span {
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 700;
}

.metric-card h3,
.team-card h3,
.program-grid h3,
.news-card h3 {
  margin: 10px 0 8px;
  color: var(--teal-dark);
  font-size: 1.25rem;
  line-height: 1.18;
}

.metric-card p,
.team-card p,
.program-grid p,
.news-card p,
.section-heading p,
.community-copy p,
.contact p {
  margin: 0;
  color: var(--muted);
}

.team {
  padding-top: 18px;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.team-card {
  overflow: hidden;
}

.team-card img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: rgba(8, 185, 202, 0.08);
}

.team-card div {
  padding: 20px;
}

.team-card span {
  color: var(--green);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
}

.team-card h3 {
  margin-top: 8px;
}

.formation {
  padding-top: 24px;
}

.section-heading {
  margin-bottom: 34px;
}

.section-heading p {
  align-self: end;
  font-size: 1.04rem;
}

.program-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.program-grid article {
  min-height: 260px;
  padding: 24px;
}

.program-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: rgba(8, 185, 202, 0.12);
  color: var(--teal);
}

.program-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.community {
  padding: 94px 20px;
  background: var(--teal-dark);
  color: var(--white);
}

.community-inner {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.community-copy p {
  max-width: 620px;
  margin-top: 20px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 1.05rem;
}

.community-list {
  display: grid;
  gap: 12px;
}

.community-list a {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 76px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 700;
  transition: background 180ms ease, transform 180ms ease;
}

.community-list a:hover,
.community-list a:focus-visible {
  background: rgba(255, 255, 255, 0.14);
  transform: translateX(3px);
  outline: none;
}

.community-list span {
  color: var(--gold);
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.news-card {
  min-height: 220px;
  padding: 24px;
}

.text-link {
  align-self: end;
  color: var(--teal-dark);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 3px;
  text-underline-offset: 5px;
}

.contact {
  padding: 96px 20px;
  background:
    linear-gradient(180deg, rgba(0, 140, 98, 0.09), rgba(8, 185, 202, 0.12)),
    var(--paper);
}

.contact-panel {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: clamp(24px, 5vw, 48px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.contact p {
  margin-top: 18px;
  max-width: 560px;
}

.contact-form {
  display: grid;
  gap: 14px;
}

.contact-form label {
  display: grid;
  gap: 6px;
  color: var(--teal-dark);
  font-weight: 700;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  border: 1px solid rgba(6, 77, 98, 0.18);
  border-radius: 8px;
  background: #fbfefd;
  color: var(--ink);
  padding: 13px 14px;
  resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--cyan);
  outline: 3px solid rgba(8, 185, 202, 0.18);
}

.contact-form .btn {
  width: fit-content;
  border: 0;
  cursor: pointer;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 28px 20px;
  background: #061314;
  color: rgba(255, 255, 255, 0.76);
  text-align: center;
}

.site-footer img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: var(--gold);
  font-weight: 700;
}

.intranet-page {
  min-height: 100svh;
  background:
    linear-gradient(135deg, rgba(6, 77, 98, 0.9), rgba(0, 140, 98, 0.72)),
    url("assets/hero-cerro-castillo.png") center / cover fixed;
}

.login-shell {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(420px, 0.9fr);
}

.login-hero {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100svh;
  padding: clamp(24px, 5vw, 64px);
  color: var(--white);
}

.login-brand {
  width: fit-content;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.login-copy {
  max-width: 760px;
}

.login-copy h1,
.private-intro h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(3rem, 7vw, 6.4rem);
  line-height: 0.98;
}

.login-copy p:not(.eyebrow),
.private-intro p {
  max-width: 680px;
  margin: 22px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.08rem;
}

.login-panel {
  display: grid;
  align-items: center;
  padding: clamp(20px, 4vw, 48px);
  background: rgba(247, 251, 248, 0.96);
}

.login-form {
  display: grid;
  gap: 18px;
  width: min(100%, 460px);
  margin: 0 auto;
  padding: clamp(24px, 4vw, 38px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.login-form h2 {
  margin: 0 0 8px;
  color: var(--teal-dark);
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.1rem);
  line-height: 1;
}

.login-form p {
  margin: 0;
  color: var(--muted);
}

.login-form label {
  display: grid;
  gap: 7px;
  color: var(--teal-dark);
  font-weight: 700;
}

.login-form input {
  width: 100%;
  min-height: 50px;
  border: 1px solid rgba(6, 77, 98, 0.18);
  border-radius: 8px;
  background: #fbfefd;
  color: var(--ink);
  padding: 13px 14px;
}

.login-form input:focus {
  border-color: var(--cyan);
  outline: 3px solid rgba(8, 185, 202, 0.18);
}

.login-form .btn {
  width: 100%;
  border: 0;
  cursor: pointer;
}

.login-error {
  min-height: 24px;
  color: var(--red) !important;
  font-weight: 700;
}

.private-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(16px, 4vw, 48px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.14);
  backdrop-filter: blur(18px);
}

.private-logout {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--teal-dark);
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
}

.private-logout:hover,
.private-logout:focus-visible {
  border-color: rgba(239, 35, 60, 0.35);
  color: var(--red);
  outline: none;
}

.private-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.private-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 185, 202, 0.1);
  color: var(--teal-dark);
  padding: 10px 14px;
  font-weight: 700;
}

.private-link:hover,
.private-link:focus-visible {
  background: rgba(0, 140, 98, 0.12);
  outline: none;
}

.private-main {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 74px 0 90px;
}

.private-intro {
  color: var(--white);
}

.apps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-top: 40px;
}

.app-card {
  display: grid;
  min-height: 340px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.app-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: rgba(8, 185, 202, 0.12);
  color: var(--teal);
}

.app-icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.app-card span {
  align-self: end;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.app-card h2 {
  margin: 8px 0 10px;
  color: var(--teal-dark);
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 2.6vw, 2.2rem);
  line-height: 1;
}

.app-card p {
  margin: 0;
  color: var(--muted);
}

.app-card a {
  align-self: end;
  width: fit-content;
  margin-top: 24px;
  color: var(--teal-dark);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 3px;
  text-underline-offset: 5px;
}

.subjects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 40px;
}

.subject-card {
  position: relative;
  display: grid;
  min-height: 300px;
  overflow: hidden;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.subject-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.94) 58%);
}

.subject-bg {
  position: absolute;
  inset: 0 0 auto;
  z-index: 0;
  width: 100%;
  height: 142px;
  object-fit: cover;
}

.subject-icon {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: rgba(8, 185, 202, 0.12);
  color: var(--teal);
}

.subject-icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.subject-card h2 {
  position: relative;
  z-index: 1;
  align-self: end;
  margin: 28px 0 10px;
  color: var(--teal-dark);
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.45rem);
  line-height: 1;
}

.subject-card p {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--muted);
}

.subject-card a {
  position: relative;
  z-index: 1;
  align-self: end;
  width: fit-content;
  margin-top: 24px;
  color: var(--teal-dark);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 3px;
  text-underline-offset: 5px;
}

.subject-card.is-active,
.subject-card:has(.subject-open.is-active) {
  border-color: rgba(246, 181, 61, 0.9);
  box-shadow: 0 18px 44px rgba(246, 181, 61, 0.18);
}

.subject-content-area {
  margin-top: 28px;
}

.subject-content-panel {
  display: none;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow);
  padding: clamp(20px, 4vw, 30px);
}

.subject-content-panel:target,
.subject-content-panel.is-active {
  display: block;
}

.content-panel-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.content-panel-heading h2 {
  margin: 0;
  color: var(--teal-dark);
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1;
}

.content-panel-heading span {
  color: var(--green);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
}

.content-list {
  display: grid;
  gap: 16px;
}

.content-card {
  display: grid;
  grid-template-columns: minmax(260px, 0.92fr) minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.content-image {
  width: 100%;
  height: 100%;
  min-height: 240px;
  object-fit: cover;
}

.content-body {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding: clamp(22px, 4vw, 34px);
}

.content-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: rgba(8, 185, 202, 0.12);
  color: var(--teal);
}

.content-icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.content-body span {
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.content-body h3 {
  margin: 8px 0 10px;
  color: var(--teal-dark);
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4vw, 3rem);
  line-height: 1;
}

.content-body p,
.empty-content {
  margin: 0;
  color: var(--muted);
}

.empty-content {
  padding: 20px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(8, 185, 202, 0.06);
}

.content-action {
  display: inline-flex;
  width: fit-content;
  margin-top: 18px;
  color: var(--teal-dark);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 3px;
  text-underline-offset: 5px;
}

.lesson-page {
  min-height: 100svh;
  background:
    linear-gradient(180deg, rgba(247, 251, 248, 0.96), rgba(237, 249, 251, 0.96)),
    url("assets/hero-cerro-castillo.png") center / cover fixed;
}

.lesson-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(16px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(18px);
}

.lesson-main {
  width: min(1080px, calc(100% - 40px));
  margin: 0 auto;
  padding: 54px 0 90px;
}

.lesson-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.72fr);
  gap: clamp(28px, 6vw, 72px);
  align-items: center;
  padding: clamp(24px, 5vw, 44px);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.lesson-hero h1 {
  margin: 0;
  color: var(--teal-dark);
  font-family: var(--font-display);
  font-size: clamp(3.4rem, 9vw, 7rem);
  line-height: 0.95;
}

.lesson-hero p:not(.eyebrow) {
  max-width: 680px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: clamp(1.04rem, 2vw, 1.25rem);
}

.lesson-hero img {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.lesson-section {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(22px, 4vw, 38px);
  margin-top: 34px;
  padding: clamp(24px, 5vw, 44px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
}

.lesson-heading h2 {
  margin: 0;
  color: var(--teal-dark);
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.3vw, 3rem);
  line-height: 1;
  max-width: 900px;
  overflow-wrap: normal;
  text-wrap: balance;
  word-break: normal;
}

.lesson-text {
  display: grid;
  gap: 18px;
}

.lesson-text p {
  margin: 0;
  color: #344648;
  font-size: 1.08rem;
}

.daily-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.daily-grid article {
  min-height: 190px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.daily-grid span {
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 700;
}

.daily-grid h3 {
  margin: 10px 0 8px;
  color: var(--teal-dark);
  font-size: 1.25rem;
}

.daily-grid p {
  margin: 0;
  color: var(--muted);
}

.fraction-structure {
  display: grid;
  grid-template-columns: minmax(220px, 0.42fr) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 54px);
  align-items: center;
}

.fraction-diagram {
  position: relative;
  display: grid;
  justify-items: center;
  padding: 38px 28px;
  border: 1px solid rgba(8, 185, 202, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(8, 185, 202, 0.1), rgba(246, 181, 61, 0.12)),
    var(--white);
}

.fraction-diagram strong {
  color: var(--teal-dark);
  font-family: var(--font-display);
  font-size: clamp(4rem, 11vw, 7rem);
  line-height: 0.9;
}

.fraction-line {
  width: min(170px, 70%);
  height: 10px;
  margin: 18px 0;
  border-radius: 999px;
  background: var(--red);
}

.fraction-label {
  display: inline-flex;
  border-radius: 8px;
  background: var(--teal-dark);
  color: var(--white);
  padding: 7px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.fraction-label.top {
  margin-bottom: 14px;
}

.fraction-label.bottom {
  margin-top: 14px;
}

.fraction-types {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 24px;
}

.fraction-types article {
  display: grid;
  align-content: start;
  min-height: 260px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(8, 185, 202, 0.08), rgba(255, 255, 255, 0.88)),
    var(--white);
}

.mini-fraction {
  display: inline-grid;
  justify-items: center;
  width: fit-content;
}

.mini-fraction strong {
  color: var(--teal-dark);
  font-family: var(--font-display);
  font-size: 2.6rem;
  line-height: 0.92;
}

.mini-fraction span {
  width: 58px;
  height: 6px;
  margin: 8px 0;
  border-radius: 999px;
  background: var(--red);
}

.mixed-number {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mixed-number > strong {
  color: var(--teal-dark);
  font-family: var(--font-display);
  font-size: 4.4rem;
  line-height: 1;
}

.fraction-types h3 {
  margin: 18px 0 8px;
  color: var(--teal-dark);
  font-size: 1.25rem;
}

.fraction-types p {
  margin: 0;
  color: var(--muted);
}

.equivalent-fractions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 24px;
}

.equivalent-fractions article {
  display: grid;
  justify-items: center;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.fraction-bar {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 54px;
  border: 2px solid rgba(6, 77, 98, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(90deg, transparent 49%, rgba(6, 77, 98, 0.26) 49% 51%, transparent 51%),
    #f7fbf8;
}

.fraction-bar span {
  display: block;
  height: 100%;
  background: rgba(239, 35, 60, 0.72);
}

.divided-four {
  background:
    linear-gradient(90deg, transparent 24%, rgba(6, 77, 98, 0.22) 24% 26%, transparent 26% 49%, rgba(6, 77, 98, 0.22) 49% 51%, transparent 51% 74%, rgba(6, 77, 98, 0.22) 74% 76%, transparent 76%),
    #f7fbf8;
}

.divided-eight {
  background:
    repeating-linear-gradient(90deg, transparent 0 11.8%, rgba(6, 77, 98, 0.18) 11.8% 12.8%),
    #f7fbf8;
}

.equivalence-rule {
  margin-top: 18px;
  padding: 22px;
  border: 1px solid rgba(8, 185, 202, 0.26);
  border-radius: 8px;
  background: rgba(8, 185, 202, 0.08);
}

.equivalence-rule h3 {
  margin: 0 0 8px;
  color: var(--teal-dark);
  font-size: 1.25rem;
}

.equivalence-rule p {
  margin: 0;
  color: var(--muted);
}

.rule-example {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}

.rule-example span,
.rule-example strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 8px;
  padding: 8px 14px;
  font-weight: 700;
}

.rule-example span {
  background: var(--white);
  color: var(--teal-dark);
}

.rule-example strong {
  background: var(--gold);
  color: var(--ink);
}

.comparison-grid {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.comparison-grid article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.comparison-grid article > span {
  grid-column: 1;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.comparison-grid h3 {
  grid-column: 1;
  margin: 0 0 8px;
  color: var(--teal-dark);
  font-size: 1.25rem;
}

.comparison-grid p {
  grid-column: 1;
  margin: 0;
  color: var(--muted);
}

.comparison-example {
  grid-column: 2;
  grid-row: 1 / span 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-width: 230px;
  border-radius: 8px;
  background: rgba(8, 185, 202, 0.08);
  padding: 16px;
}

.comparison-example > strong {
  color: var(--red);
  font-family: var(--font-display);
  font-size: 2.8rem;
  line-height: 1;
}

.comparison-example.wide {
  min-width: 330px;
}

.assessment-intro {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 1.06rem;
}

.assessment-form {
  display: grid;
  gap: 16px;
}

.question-card {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.question-card legend {
  margin-bottom: 10px;
  color: var(--teal-dark);
  font-size: 1.15rem;
  font-weight: 700;
}

.question-card label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid rgba(6, 77, 98, 0.12);
  border-radius: 8px;
  background: #fbfefd;
  color: #344648;
  padding: 12px 14px;
  cursor: pointer;
}

.question-card label:has(input:checked) {
  border-color: rgba(8, 185, 202, 0.55);
  background: rgba(8, 185, 202, 0.1);
}

.question-card input {
  flex: 0 0 auto;
  margin-top: 5px;
  accent-color: var(--teal);
}

.assessment-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 6px;
}

.assessment-actions .btn {
  border: 0;
  cursor: pointer;
}

.assessment-warning {
  margin: 0;
  color: var(--red);
  font-weight: 700;
}

.assessment-results {
  margin-top: 28px;
}

.score-panel {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
  padding: 24px;
  border: 1px solid rgba(8, 185, 202, 0.32);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(8, 185, 202, 0.12), rgba(246, 181, 61, 0.16)),
    var(--white);
}

.score-panel span {
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.score-panel strong {
  color: var(--teal-dark);
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 5.5rem);
  line-height: 0.95;
}

.score-panel p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.feedback-list {
  display: grid;
  gap: 14px;
}

.feedback-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-left-width: 7px;
  border-radius: 8px;
  background: var(--white);
}

.feedback-card.is-correct {
  border-left-color: var(--green);
}

.feedback-card.is-incorrect {
  border-left-color: var(--red);
}

.feedback-card span {
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.feedback-card.is-incorrect span {
  color: var(--red);
}

.feedback-card h3 {
  margin: 8px 0 10px;
  color: var(--teal-dark);
  font-size: 1.24rem;
}

.feedback-card p {
  margin: 8px 0 0;
  color: var(--muted);
}

.feedback-card strong {
  color: var(--ink);
}

.next-lesson {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 34px;
  padding: clamp(24px, 5vw, 44px);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(6, 77, 98, 0.95), rgba(0, 140, 98, 0.82)),
    var(--teal-dark);
  color: var(--white);
  box-shadow: var(--shadow);
}

.next-lesson h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 1;
}

.next-lesson p:not(.eyebrow) {
  max-width: 620px;
  margin: 14px 0 0;
  color: rgba(255, 255, 255, 0.78);
}

.next-lesson .btn {
  flex: 0 0 auto;
}

.sum-example {
  display: grid;
  gap: 22px;
  margin-top: 24px;
}

.sum-visual {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  border: 1px solid rgba(8, 185, 202, 0.26);
  border-radius: 8px;
  background: rgba(8, 185, 202, 0.08);
}

.sum-block {
  display: grid;
  grid-template-columns: repeat(4, 42px);
  gap: 5px;
  justify-content: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.sum-block strong {
  grid-column: 1 / -1;
  margin-top: 10px;
  color: var(--teal-dark);
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1;
  text-align: center;
}

.piece {
  height: 78px;
  border: 2px solid rgba(6, 77, 98, 0.24);
  border-radius: 6px;
  background: #f7fbf8;
}

.piece.filled {
  background: rgba(239, 35, 60, 0.72);
}

.piece.result {
  background: rgba(0, 140, 98, 0.72);
}

.sum-symbol {
  color: var(--red);
  font-family: var(--font-display);
  font-size: 3.2rem;
  font-weight: 800;
  line-height: 1;
}

.sum-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.sum-steps article {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.sum-steps span {
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.sum-steps h3 {
  margin: 10px 0 8px;
  color: var(--teal-dark);
  font-size: 1.25rem;
}

.sum-steps p {
  margin: 0;
  color: var(--muted);
}

.practice-list {
  display: grid;
  gap: 22px;
}

.practice-card {
  display: grid;
  gap: 20px;
  overflow: hidden;
  padding: clamp(20px, 4vw, 28px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.practice-image {
  width: calc(100% + clamp(40px, 8vw, 56px));
  max-width: none;
  height: clamp(220px, 32vw, 360px);
  margin: calc(clamp(20px, 4vw, 28px) * -1) calc(clamp(20px, 4vw, 28px) * -1) 4px;
  object-fit: cover;
}

.practice-copy span {
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.practice-copy h3 {
  margin: 8px 0 10px;
  color: var(--teal-dark);
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 1;
}

.practice-copy p {
  margin: 0;
  color: var(--muted);
}

.token-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px;
  border: 1px dashed rgba(6, 77, 98, 0.28);
  border-radius: 8px;
  background: rgba(8, 185, 202, 0.06);
}

.token-bank button {
  display: inline-grid;
  place-items: center;
  min-width: 50px;
  min-height: 48px;
  border: 1px solid rgba(6, 77, 98, 0.18);
  border-radius: 8px;
  background: var(--white);
  color: var(--teal-dark);
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  cursor: grab;
}

.token-bank button:active {
  cursor: grabbing;
}

.token-bank button.is-selected {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(246, 181, 61, 0.22);
}

.interactive-equation {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: clamp(18px, 4vw, 26px);
  border: 1px solid rgba(8, 185, 202, 0.26);
  border-radius: 8px;
  background: rgba(8, 185, 202, 0.08);
}

.empty-fraction {
  display: inline-grid;
  justify-items: center;
  min-width: 94px;
}

.empty-fraction > span {
  width: 70px;
  height: 7px;
  margin: 8px 0;
  border-radius: 999px;
  background: var(--red);
}

.drop-slot {
  display: inline-grid;
  place-items: center;
  min-width: 62px;
  min-height: 58px;
  border: 2px dashed rgba(6, 77, 98, 0.35);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--teal-dark);
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  cursor: pointer;
}

.operator-slot {
  min-width: 58px;
  min-height: 58px;
  color: var(--red);
}

.drop-slot.is-filled {
  border-style: solid;
  border-color: rgba(8, 185, 202, 0.48);
  background: var(--white);
}

.drop-slot.is-over {
  border-color: var(--gold);
  background: rgba(246, 181, 61, 0.16);
}

.drop-slot.is-wrong {
  border-color: rgba(239, 35, 60, 0.72);
  background: rgba(239, 35, 60, 0.08);
}

.result-fraction .drop-slot.is-filled {
  border-color: rgba(0, 140, 98, 0.5);
}

.context-answer {
  display: grid;
  gap: 8px;
  color: var(--teal-dark);
  font-weight: 700;
}

.context-answer textarea {
  width: 100%;
  border: 1px solid rgba(6, 77, 98, 0.18);
  border-radius: 8px;
  background: #fbfefd;
  color: var(--ink);
  padding: 13px 14px;
  resize: vertical;
}

.context-answer textarea:focus {
  border-color: var(--cyan);
  outline: 3px solid rgba(8, 185, 202, 0.18);
}

.practice-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.practice-actions .btn {
  border: 0;
  cursor: pointer;
}

.practice-actions p {
  margin: 0;
  font-weight: 700;
}

.practice-actions p.is-correct {
  color: var(--green);
}

.practice-actions p.is-incorrect,
.practice-actions p.is-pending {
  color: var(--red);
}

@media (max-width: 920px) {
  .site-header {
    inset: 10px 10px auto;
  }

  .nav-toggle {
    display: block;
  }

  .site-nav {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: 0;
    display: none;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    box-shadow: var(--shadow);
  }

  .site-nav.is-open {
    display: grid;
  }

  .site-nav a {
    width: 100%;
  }

  .hero {
    min-height: auto;
    padding-top: 118px;
  }

  .quick-panel,
  .metrics,
  .team-grid,
  .program-grid,
  .news-grid {
    grid-template-columns: 1fr;
  }

  .quick-panel article {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .quick-panel article:last-child {
    border-bottom: 0;
  }

  .intro-grid,
  .section-heading,
  .community-inner,
  .contact-panel {
    grid-template-columns: 1fr;
  }

  .program-grid article {
    min-height: auto;
  }

  .team-card img {
    aspect-ratio: 4 / 5;
    max-height: none;
    object-fit: contain;
  }

  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-hero {
    min-height: auto;
    gap: 72px;
  }

  .login-panel {
    min-height: auto;
  }

  .apps-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .subjects-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .content-card {
    grid-template-columns: 1fr;
  }

  .lesson-hero,
  .lesson-section,
  .fraction-structure {
    grid-template-columns: 1fr;
  }

  .sum-steps {
    grid-template-columns: 1fr;
  }

  .practice-actions {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 620px) {
  .brand strong {
    max-width: 210px;
  }

  .brand small {
    display: none;
  }

  .hero {
    padding-right: 16px;
    padding-left: 16px;
  }

  .hero h1 {
    font-size: clamp(2.6rem, 15vw, 4.4rem);
  }

  .section {
    width: min(100% - 28px, 1120px);
    padding: 72px 0;
  }

  .hero-actions,
  .site-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .private-header {
    align-items: center;
    flex-direction: row;
  }

  .private-logout {
    width: auto;
    flex: 0 0 auto;
  }

  .private-actions {
    width: 100%;
    align-items: stretch;
  }

  .private-actions > * {
    flex: 1;
  }

  .private-main {
    width: min(100% - 28px, 1180px);
    padding-top: 54px;
  }

  .apps-grid,
  .subjects-grid {
    grid-template-columns: 1fr;
  }

  .content-panel-heading {
    align-items: start;
    flex-direction: column;
  }

  .content-body {
    grid-template-columns: 1fr;
  }

  .lesson-header {
    align-items: stretch;
    flex-direction: column;
  }

  .lesson-main {
    width: min(100% - 28px, 1080px);
    padding-top: 34px;
  }

  .daily-grid {
    grid-template-columns: 1fr;
  }

  .fraction-types {
    grid-template-columns: 1fr;
  }

  .equivalent-fractions {
    grid-template-columns: 1fr;
  }

  .comparison-grid article {
    grid-template-columns: 1fr;
  }

  .comparison-grid article > span,
  .comparison-grid h3,
  .comparison-grid p,
  .comparison-example {
    grid-column: auto;
    grid-row: auto;
  }

  .comparison-example,
  .comparison-example.wide {
    min-width: 0;
    width: 100%;
  }

  .assessment-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .next-lesson {
    align-items: stretch;
    flex-direction: column;
  }

  .sum-visual {
    align-items: stretch;
    flex-direction: column;
  }

  .sum-block {
    grid-template-columns: repeat(4, minmax(34px, 1fr));
  }

  .sum-symbol {
    text-align: center;
  }

  .interactive-equation {
    align-items: center;
    flex-direction: column;
  }
}
