/* Education page only. Shared thread, step, and fact-sheet styles are in
   assets/flow.css. */
.institutions-body {
  --edu-positive: #3F7A57;
}
:root[data-theme="dark"] .institutions-body {
  --edu-positive: #8CC5A4;
}

.institutions-body .site-navigation {
  position: relative;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 35%, transparent);
}

.institution-header-action {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-primary);
  font-size: 14px;
  text-decoration: none;
  transition: border-color 160ms ease, color 160ms ease;
}
.institution-header-action:hover { border-color: var(--accent); color: var(--accent); }

/* Hero */
.edu-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(500px, 1.05fr);
  align-items: center;
  gap: clamp(40px, 6vw, 96px);
  width: min(100% - 56px, 1280px);
  margin: 0 auto;
  padding: 72px 0 104px;
}
.edu-label {
  margin: 0 0 16px;
  color: var(--accent);
  font-family: "Avenir-Heavy", "Avenir Next", Avenir, sans-serif;
  font-size: 16px;
  font-weight: 800;
}
.edu-hero h1 {
  font-size: clamp(44px, 4.7vw, 68px);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -.05em;
}
.edu-hero .flow-highlight { white-space: nowrap; }
.edu-intro {
  max-width: 560px;
  margin: 28px 0 0;
  color: var(--text-secondary);
  font-size: clamp(17px, 1.5vw, 20px);
  line-height: 1.6;
}
.edu-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 32px; }
.edu-actions .primary-link { margin-top: 0; }
.edu-secondary-link {
  display: inline-flex;
  align-items: center;
  min-height: 50px;
  padding: 0 24px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-primary);
  font-family: "Avenir-Medium", "Avenir Next", Avenir, sans-serif;
  font-size: 15px;
  text-decoration: none;
  transition: border-color 160ms ease, color 160ms ease;
}
.edu-secondary-link:hover { border-color: var(--accent); color: var(--accent); }
.edu-note { margin: 20px 0 0; color: var(--text-tertiary); font-size: 13px; }

/* A small copy of the school portal: sand sidebar, cream canvas, white cards. */
.edu-portal {
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--border) 55%, transparent);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 30px 70px var(--screenshot-shadow);
  animation: edu-rise 900ms 150ms var(--flow-ease) both;
}
@keyframes edu-rise { from { opacity: 0; transform: translateY(22px); } }
.preview-window-bar { display: flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; background: var(--story-background); }
.preview-window-bar > span { width: 10px; height: 10px; border-radius: 50%; }
.preview-window-bar > span:first-child { background: #FF5F57; }
.preview-window-bar > span:nth-child(2) { background: #FEBC2E; }
.preview-window-bar > span:nth-child(3) { background: #28C840; }
.preview-window-bar p { margin: 0 auto; padding-right: 44px; color: var(--text-secondary); font-size: 11px; }
.preview-shell { display: grid; grid-template-columns: 150px minmax(0, 1fr); min-height: 440px; }
.preview-sidebar { display: flex; flex-direction: column; gap: 3px; padding: 14px 10px; background: var(--story-background); }
.preview-brand { display: flex; align-items: center; gap: 6px; margin: 0 4px 12px; }
.preview-brand img { width: 22px; height: 22px; }
.preview-brand b { color: var(--accent); font-family: "Avenir-Heavy", "Avenir Next", Avenir, sans-serif; font-size: 12px; }
.preview-sidebar > span { padding: 6px 8px; border-radius: 7px; color: var(--text-primary); font-size: 10.5px; }
.preview-sidebar > span.is-active { background: var(--flow-tan-deep); font-family: "Avenir-Medium", "Avenir Next", Avenir, sans-serif; }
.preview-content { min-width: 0; padding: 24px 22px; background: var(--background); }
.preview-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.preview-heading div { display: grid; gap: 2px; }
.preview-heading strong { font-family: "Avenir-Heavy", "Avenir Next", Avenir, sans-serif; font-size: 17px; }
.preview-heading small { color: var(--text-secondary); font-size: 10.5px; }
.preview-heading > span { padding: 6px 12px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 10px; white-space: nowrap; }
.preview-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 18px; }
.preview-metrics article { display: grid; gap: 2px; padding: 11px 12px; border-radius: 10px; background: var(--surface); }
.preview-metrics small { color: var(--text-secondary); font-size: 9.5px; }
.preview-metrics strong { font-family: "Avenir-Heavy", "Avenir Next", Avenir, sans-serif; font-size: 15px; white-space: nowrap; }
.preview-metrics em { color: var(--text-tertiary); font-size: 8.5px; font-style: normal; }
.preview-grid { display: grid; margin-top: 8px; }
.preview-grid article { padding: 14px; border-radius: 10px; background: var(--surface); }
.preview-usage-card > div:first-child { display: grid; gap: 1px; }
.preview-usage-card > div:first-child strong { font-family: "Avenir-Heavy", "Avenir Next", Avenir, sans-serif; font-size: 12px; }
.preview-usage-card small { color: var(--text-secondary); font-size: 9.5px; }
.preview-bars { height: 150px; padding: 14px 10px 0; }

/* Bar chart, used in the portal preview and the usage step. */
.edu-bars { display: flex; align-items: end; gap: 14px; border-bottom: 1px solid var(--flow-rule); }
.edu-bars span { flex: 1; min-height: 18px; border-radius: 6px 6px 0 0; background: var(--flow-blush); transform-origin: bottom; }
.edu-bars span:last-child { background: var(--accent); }
.bar-35 { height: 35%; }
.bar-48 { height: 48%; }
.bar-45 { height: 45%; }
.bar-67 { height: 67%; }
.bar-76 { height: 76%; }
.bar-89 { height: 89%; }
.preview-bars span { animation: edu-grow 650ms var(--flow-ease) both; }
.preview-bars span:nth-child(1) { animation-delay: 620ms; }
.preview-bars span:nth-child(2) { animation-delay: 680ms; }
.preview-bars span:nth-child(3) { animation-delay: 740ms; }
.preview-bars span:nth-child(4) { animation-delay: 800ms; }
.preview-bars span:nth-child(5) { animation-delay: 860ms; }
.preview-bars span:nth-child(6) { animation-delay: 920ms; }
@keyframes edu-grow { from { transform: scaleY(0); } }

/* Step illustrations: small pieces of the portal, drawn in CSS. */
.edu-card {
  display: grid;
  align-content: center;
  aspect-ratio: 16 / 10;
  padding: clamp(24px, 4.4vw, 60px);
  background: var(--surface);
}
.edu-card > * { min-width: 0; }
.edu-card p { margin: 0; }
.edu-card ul { margin: 0; padding: 0; list-style: none; }
.edu-card-title { color: var(--text-secondary); font-size: 15px; }
.edu-card-foot { display: flex; justify-content: space-between; gap: 16px; color: var(--text-secondary); font-size: 14px; }

.edu-seats-count { margin-top: 6px !important; font-family: "Avenir-Medium", "Avenir Next", Avenir, sans-serif; font-size: clamp(44px, 5vw, 72px); line-height: 1.05; letter-spacing: -.04em; }
.edu-meter { height: 12px; margin: 26px 0 14px; overflow: hidden; border-radius: 99px; background: var(--story-background); }
.edu-meter span { display: block; width: 84.2%; height: 100%; border-radius: inherit; background: var(--accent); transform-origin: left; }
.motion-ok .edu-meter span { transform: scaleX(0); transition: transform 1100ms 350ms var(--flow-ease); }
.motion-ok .is-visible .edu-meter span { transform: scaleX(1); }

.edu-domains ul { display: grid; gap: 10px; margin-top: 18px; }
.edu-domains li { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 18px; border-radius: 10px; background: var(--background); font-size: 16px; }
.edu-domains li span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.edu-domains strong { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; color: var(--edu-positive); font-size: 14px; font-weight: 600; }
.edu-domains strong::after { width: 8px; height: 8px; border-radius: 50%; background: currentColor; content: ""; }
.motion-ok .edu-domains strong { opacity: 0; transform: translateX(-8px); transition: opacity 400ms ease, transform 500ms var(--flow-ease); }
.motion-ok .edu-domains li:nth-child(1) strong { transition-delay: 500ms; }
.motion-ok .edu-domains li:nth-child(2) strong { transition-delay: 800ms; }
.motion-ok .edu-domains.is-visible strong { opacity: 1; transform: none; }

/* One roster fans out into a seat for each person. */
.edu-invite { grid-template-columns: auto minmax(40px, 1fr) minmax(0, 1.3fr); align-items: stretch; align-content: stretch; }
.edu-invite-file {
  display: inline-flex;
  align-items: center;
  align-self: center;
  gap: 8px;
  padding: 10px 16px 10px 12px;
  border-radius: 999px;
  background: var(--story-background);
  font-family: "Avenir-Medium", "Avenir Next", Avenir, sans-serif;
  font-size: 15px;
  white-space: nowrap;
}
.edu-invite-file svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.edu-invite-lines { width: 100%; height: 100%; overflow: visible; fill: none; stroke: var(--flow-tan-deep); stroke-width: 2; stroke-linecap: round; }
.edu-invite-lines path { vector-effect: non-scaling-stroke; }
.edu-invite-pulse { stroke: var(--accent); stroke-dasharray: 14 600; stroke-dashoffset: 14; animation: edu-pulse 2.6s linear infinite; }
.edu-invite-pulse:nth-of-type(6) { animation-delay: .35s; }
.edu-invite-pulse:nth-of-type(7) { animation-delay: .7s; }
.edu-invite-pulse:nth-of-type(8) { animation-delay: 1.05s; }
@keyframes edu-pulse { to { stroke-dashoffset: -460; } }
.edu-invite ul { display: grid; grid-template-rows: repeat(4, 1fr); gap: 8px; }
.edu-invite li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 14px; border-radius: 10px; background: var(--background); font-size: 15px; }
.edu-invite li span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.edu-invite strong { color: var(--edu-positive); font-size: 13px; font-weight: 600; }
.edu-invite em { color: var(--text-tertiary); font-size: 13px; font-style: normal; }

.edu-usage .edu-bars { height: 58%; min-height: 130px; margin: 20px 0 14px; padding: 0 6px; gap: clamp(10px, 2vw, 22px); }
.edu-usage { grid-template-rows: auto 1fr auto; align-content: stretch; }
.motion-ok .edu-usage .edu-bars span { transform: scaleY(0); transition: transform 700ms var(--flow-ease); }
.motion-ok .edu-usage .edu-bars span:nth-child(1) { transition-delay: 300ms; }
.motion-ok .edu-usage .edu-bars span:nth-child(2) { transition-delay: 380ms; }
.motion-ok .edu-usage .edu-bars span:nth-child(3) { transition-delay: 460ms; }
.motion-ok .edu-usage .edu-bars span:nth-child(4) { transition-delay: 540ms; }
.motion-ok .edu-usage .edu-bars span:nth-child(5) { transition-delay: 620ms; }
.motion-ok .edu-usage .edu-bars span:nth-child(6) { transition-delay: 700ms; }
.motion-ok .edu-usage.is-visible .edu-bars span { transform: scaleY(1); }

/* Privacy */
.edu-privacy {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  align-items: center;
  gap: 80px;
  width: min(calc(100% - 56px), var(--flow-width));
  margin: 130px auto;
}
.edu-privacy-copy p { max-width: 420px; margin: 24px 0 0; color: var(--text-secondary); font-size: 18px; line-height: 1.65; }
.edu-boundary { grid-template-columns: 1fr 1fr; }
.edu-boundary ul { margin: 18px 0 0; padding: 0; list-style: none; }
.edu-boundary li {
  padding: 15px 0;
  border-top: 1px solid var(--flow-rule);
  font-family: "Avenir-Medium", "Avenir Next", Avenir, sans-serif;
  font-size: clamp(19px, 1.9vw, 24px);
  letter-spacing: -.02em;
}

.edu-portal-link { color: var(--text-primary); font-size: 15px; }
.edu-portal-link span { display: inline-block; color: var(--accent); transition: transform 180ms ease; }
.edu-portal-link:hover span { transform: translateX(4px); }

@media (max-width: 1080px) {
  .edu-hero { grid-template-columns: 1fr; gap: 52px; padding: 64px 0 88px; }
  .edu-portal { width: min(100%, 820px); }
  .edu-privacy { gap: 48px; }
}
@media (max-width: 900px) {
  .edu-privacy { grid-template-columns: 1fr; gap: 36px; width: calc(100% - 48px); margin: 84px auto; }
  .edu-card { aspect-ratio: auto; min-height: 240px; }
}
@media (max-width: 680px) {
  .institutions-body .site-navigation { grid-template-columns: auto 1fr auto; }
  .institutions-body .site-navigation-brand span { display: none; }
  .institutions-body .site-navigation-tabs a { padding-inline: 9px; }
  .institution-header-action { min-height: 38px; padding-inline: 10px; font-size: 12px; }
  .edu-hero { width: calc(100% - 32px); padding: 48px 0 64px; }
  .edu-hero h1 { font-size: clamp(40px, 12.4vw, 60px); }
  .edu-actions { align-items: stretch; flex-direction: column; }
  .edu-actions > * { justify-content: center; }
  .preview-shell { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .preview-sidebar { display: none; }
  .preview-content { padding: 18px 14px; }
  .preview-metrics { grid-template-columns: 1fr 1fr; }
  .preview-metrics article:last-child { display: none; }
  .preview-bars { height: 120px; }
  .edu-card-foot { font-size: 13px; }
  .edu-domains li { padding: 14px; font-size: 14px; }
  .edu-invite { grid-template-columns: auto 24px minmax(0, 1fr); padding-inline: 16px; }
  .edu-invite-file { gap: 6px; padding: 7px 10px 7px 8px; font-size: 12px; }
  .edu-invite li { gap: 6px; padding: 0 8px; font-size: 12px; }
  .edu-invite strong, .edu-invite em { font-size: 11px; }
}
@media (max-width: 600px) {
  .edu-boundary { grid-template-columns: 1fr; }
}
@media (max-width: 440px) {
  .institutions-body .site-navigation-tabs a:first-child { display: none; }
  .institution-header-action { padding-inline: 7px; }
}
@media (prefers-reduced-motion: reduce) {
  .edu-invite-pulse { display: none; }
  .institutions-body .edu-meter span,
  .institutions-body .edu-usage .edu-bars span { transform: none; }
  .institutions-body .edu-domains strong { opacity: 1; transform: none; }
}
