/* =========================================================================
   Science Lab — portal styles
   Design tokens mirror the course apps: 8px spacing scale, 12-col thinking,
   44px tap targets, 16–18px body, one display face + one text face.
   ========================================================================= */
:root {
  /* palette — cool paper and graphite, so subject accents carry the colour */
  --bg: #F1F4F4;
  --surface: #FFFFFF;
  --surface-1: #E9EEEE;
  --surface-2: #DDE5E5;
  --ink: #141C1D;
  --ink-soft: #4B585A;
  --line: #C7D2D2;
  --line-soft: #E2E9E9;
  --accent: #124F4A;
  --warn: #8A4B12;
  --danger: #8C2F2F;
  --ok: #1F6B4E;

  /* spacing scale */
  --s1: 4px;
  --s2: 8px;
  --s3: 16px;
  --s4: 24px;
  --s5: 32px;
  --s6: 48px;
  --s7: 64px;
  --s8: 80px;

  /* radii and shadow */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-full: 999px;
  --shadow-1: 0 1px 2px rgba(12, 28, 30, .08), 0 2px 8px rgba(12, 28, 30, .06);
  --shadow-2: 0 4px 12px rgba(12, 28, 30, .10), 0 12px 28px rgba(12, 28, 30, .08);

  /* type */
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.2, 0, 0, 1);
}

@media (prefers-color-scheme:dark) {
  :root {
    --bg: #0D1415;
    --surface: #131C1D;
    --surface-1: #182324;
    --surface-2: #1F2C2D;
    --ink: #E2E9E9;
    --ink-soft: #A3B1B2;
    --line: #33403F;
    --line-soft: #243030;
    --shadow-1: none;
    --shadow-2: 0 8px 24px rgba(0, 0, 0, .4);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 var(--s3)
}

p {
  margin: 0 0 var(--s3)
}

.small {
  font-size: .86rem;
  color: var(--ink-soft)
}

.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 {
  position: absolute;
  left: -999px
}

.skip:focus {
  left: var(--s3);
  top: var(--s3);
  z-index: 60;
  background: var(--surface);
  padding: var(--s2) var(--s3);
  border-radius: var(--r-sm)
}

.wrap {
  width: min(1140px, calc(100% - var(--s4)));
  margin-inline: auto
}

.wrap.narrow {
  width: min(560px, calc(100% - var(--s4)))
}

.section {
  padding-block: var(--s6)
}

.section-title {
  font-size: 1.32rem;
  margin-top: var(--s5)
}

.page-title {
  font-size: clamp(1.7rem, 1.2rem + 2.2vw, 2.5rem)
}

.lede {
  font-size: 1.06rem;
  color: var(--ink-soft);
  max-width: 62ch
}

.crumb {
  font-size: .86rem;
  color: var(--ink-soft);
  margin-bottom: var(--s2)
}

.crumb a {
  text-decoration: none;
  border-bottom: 1px solid var(--line)
}

.empty {
  color: var(--ink-soft);
  background: var(--surface-1);
  border-radius: var(--r-md);
  padding: var(--s4);
  text-align: center
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line-soft)
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  min-height: 60px
}

.mark {
  display: flex;
  align-items: center;
  gap: var(--s2);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.06rem;
  text-decoration: none;
  letter-spacing: -.01em
}

.mark-glyph {
  width: 24px;
  height: 24px;
  color: var(--accent)
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--s2)
}

.nav a {
  text-decoration: none;
  padding: var(--s2) var(--s3);
  border-radius: var(--r-full);
  font-size: .94rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center
}

.nav a:hover {
  background: var(--surface-1)
}

.topbar-admin {
  background: var(--surface);
  border-bottom: 2px solid var(--accent)
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  min-height: 44px;
  padding: var(--s2) var(--s4);
  border-radius: var(--r-full);
  font: inherit;
  font-size: .94rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  background: var(--surface-1);
  color: var(--ink);
  transition: transform .12s var(--ease), background .18s var(--ease)
}

.btn:active {
  transform: translateY(1px)
}

.btn-solid {
  background: var(--accent);
  color: #fff
}

.btn-ghost {
  background: transparent;
  border-color: var(--line)
}

.btn-lg {
  min-height: 52px;
  padding-inline: var(--s5);
  font-size: 1rem
}

.btn-sm {
  min-height: 40px;
  padding: var(--s1) var(--s3);
  font-size: .85rem
}

.btn-block {
  width: 100%
}

.btn-danger {
  color: var(--danger);
  border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent);
  background: transparent
}

/* ---------- hero ---------- */
.hero {
  background: linear-gradient(160deg, var(--accent), color-mix(in srgb, var(--accent) 62%, #05171a));
  color: #fff;
  padding-block: clamp(48px, 10vw, 80px) clamp(40px, 8vw, 64px);
  position: relative;
  overflow: hidden
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .14;
  background-image: linear-gradient(rgba(255, 255, 255, .22) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .22) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(135deg, black, transparent 72%)
}

.hero-grid {
  display: grid;
  gap: var(--s5);
  align-items: center
}

@media (min-width:860px) {
  .hero-grid {
    grid-template-columns: 1.25fr .9fr
  }
}

.hero h1 {
  font-size: clamp(2rem, 1.2rem + 3.4vw, 3.2rem);
  letter-spacing: -.02em;
  margin-bottom: var(--s3);
  max-width: 18ch
}

.hero .lede {
  color: rgba(255, 255, 255, .88);
  max-width: 52ch
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  margin-top: var(--s4)
}

.hero .btn-solid {
  background: #fff;
  color: var(--accent)
}

.hero .btn-ghost {
  border-color: rgba(255, 255, 255, .5);
  color: #fff
}

.hero-copy,
.hero-art {
  position: relative;
  z-index: 1
}

.student-collage {
  position: relative;
  width: min(100%, 440px);
  height: clamp(250px, 68vw, 390px);
  margin: 0 auto -42px;
  isolation: isolate
}

.student-glow {
  position: absolute;
  width: 70%;
  aspect-ratio: 1;
  left: 15%;
  top: 9%;
  border-radius: 50%;
  background: rgba(255, 210, 123, .2);
  filter: blur(24px);
  z-index: -1
}

.student {
  position: absolute;
  bottom: 0;
  width: auto;
  object-fit: contain;
  transform-origin: bottom center;
  filter: drop-shadow(0 18px 16px rgba(0, 0, 0, .22));
  animation: studentRise .8s var(--ease) both
}

.student-pair {
  left: 17%;
  height: 94%;
  z-index: 2
}

.student-green {
  left: 0;
  height: 75%;
  z-index: 1;
  animation-delay: .12s
}

.student-books {
  right: 0;
  height: 82%;
  z-index: 3;
  animation-delay: .22s
}

@keyframes studentRise {
  from {
    opacity: 0;
    transform: translateY(22px) scale(.94)
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1)
  }
}

.hero-art svg {
  width: 100%;
  max-width: 340px;
  margin: -16px auto 0;
  filter: drop-shadow(0 18px 20px rgba(0, 0, 0, .16))
}

.hero-art {
  animation: heroFloat 6s ease-in-out infinite
}

.bub {
  fill: rgba(255, 255, 255, .62)
}

@media (prefers-reduced-motion:no-preference) {
  .bub {
    animation: rise 4.5s var(--ease) infinite
  }

  .bub:nth-child(3) {
    animation-delay: .8s
  }

  .bub:nth-child(4) {
    animation-delay: 1.7s
  }

  .bub:nth-child(5) {
    animation-delay: 2.6s
  }
}

@keyframes rise {
  0% {
    transform: translateY(0);
    opacity: .7
  }

  100% {
    transform: translateY(-42px);
    opacity: 0
  }
}

@keyframes heroFloat {

  0%,
  100% {
    transform: translateY(0) rotate(-1deg)
  }

  50% {
    transform: translateY(-8px) rotate(1deg)
  }
}

@media (max-width: 859px) {
  .hero-art {
    max-width: 440px;
    margin-inline: auto
  }

  .student-collage {
    height: clamp(230px, 70vw, 330px)
  }
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s5);
  margin: var(--s5) 0 0;
  padding: 0
}

.stats div {
  margin: 0
}

.stats dt {
  font-size: .78rem;
  text-transform: none;
  letter-spacing: .01em;
  opacity: .8;
  margin: 0
}

.stats dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 600;
  line-height: 1.1
}

.stats-inline {
  gap: var(--s4);
  margin-top: var(--s3)
}

.stats-inline dd {
  font-size: 1.4rem
}

/* ---------- subject cards ---------- */
.subject-grid,
.course-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--s3)
}

.subject-grid {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr))
}

.course-grid {
  grid-template-columns: repeat(auto-fill, minmax(272px, 1fr))
}

.subject-card,
.course-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-1);
  transition: box-shadow .2s var(--ease), transform .2s var(--ease), border-color .2s var(--ease);
  animation: cardIn .55s var(--ease) both
}

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

.subject-card:focus-within,
.course-card:focus-within {
  border-color: var(--card);
  box-shadow: var(--shadow-2)
}

.subject-card:nth-child(2),
.course-card:nth-child(2) {
  animation-delay: .06s
}

.subject-card:nth-child(3),
.course-card:nth-child(3) {
  animation-delay: .12s
}

.subject-card:nth-child(4),
.course-card:nth-child(4) {
  animation-delay: .18s
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(14px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

.subject-card.is-soon {
  opacity: .62
}

.stretch {
  position: absolute;
  inset: 0;
  z-index: 2
}

.stretch:focus-visible {
  outline: 3px solid var(--card, var(--accent));
  outline-offset: -3px;
  border-radius: var(--r-lg)
}

.subject-top {
  height: 84px;
  background: linear-gradient(135deg, var(--card), color-mix(in srgb, var(--card) 68%, #0b1c1e));
  display: grid;
  place-items: center;
  color: #fff
}

.subject-glyph {
  width: 34px;
  height: 34px;
  filter: drop-shadow(0 5px 7px rgba(0, 0, 0, .2));
  animation: iconPop .7s var(--ease) both
}

@keyframes iconPop {
  0% {
    opacity: 0;
    transform: scale(.65) rotate(-12deg)
  }

  70% {
    transform: scale(1.1) rotate(3deg)
  }

  100% {
    opacity: 1;
    transform: scale(1) rotate(0)
  }
}

.subject-body {
  padding: var(--s3) var(--s4) var(--s4)
}

.subject-body h3 {
  font-size: 1.14rem;
  margin-bottom: var(--s1)
}

.subject-body p {
  margin: 0;
  color: var(--ink-soft);
  font-size: .94rem
}

.subject-body .meta {
  margin-top: var(--s2);
  font-size: .82rem;
  color: var(--card)
}

.thumb {
  aspect-ratio: 16/9;
  background: var(--surface-2);
  overflow: hidden;
  position: relative;
  z-index: 3;
}

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

.thumb img,
.course-hero-art img {
  cursor: zoom-in;
  transition: transform .55s var(--ease), filter .3s var(--ease)
}

.course-card:hover .thumb img,
.course-card:focus-within .thumb img {
  transform: scale(1.06);
  filter: saturate(1.08)
}

.course-hero-art:hover img {
  transform: scale(1.03);
  filter: saturate(1.08)
}

.course-body {
  padding: var(--s3) var(--s4) var(--s4)
}

.kicker {
  font-size: .78rem;
  color: var(--card);
  margin: 0 0 var(--s1);
  font-weight: 600
}

.course-body h3 {
  font-size: 1.1rem;
  margin-bottom: var(--s2)
}

.summary {
  font-size: .94rem;
  color: var(--ink-soft);
  margin-bottom: var(--s2)
}

.course-body .meta {
  font-size: .8rem;
  color: var(--ink-soft);
  margin: 0
}

.course-hero {
  display: grid;
  gap: var(--s4);
  align-items: start
}

@media (min-width:760px) {
  .course-hero {
    grid-template-columns: 320px 1fr
  }
}

.course-hero-art {
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--shadow-1)
}

.course-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  margin-top: var(--s4)
}

/* ---------- forms ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  padding: var(--s4);
  box-shadow: var(--shadow-1)
}

.card h2 {
  font-size: 1.06rem
}

.form .field {
  margin-bottom: var(--s4)
}

.form label {
  display: block;
  font-size: .88rem;
  font-weight: 600;
  margin-bottom: var(--s1)
}

.form input,
.form select,
.form textarea {
  width: 100%;
  min-height: 48px;
  padding: var(--s2) var(--s3);
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--r-sm)
}

.form textarea {
  min-height: 96px;
  resize: vertical
}

.form input[type=color] {
  padding: var(--s1);
  height: 48px
}

.form input[type=file] {
  padding: var(--s2);
  background: transparent
}

.form input:focus,
.form select:focus,
.form textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent)
}

.field-row {
  display: grid;
  gap: var(--s3);
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr))
}

.hint {
  font-size: .82rem;
  color: var(--ink-soft);
  margin: var(--s1) 0 0
}

.err {
  color: var(--danger);
  font-size: .86rem;
  margin: var(--s1) 0 0
}

.err-block {
  background: color-mix(in srgb, var(--danger) 10%, transparent);
  padding: var(--s2) var(--s3);
  border-radius: var(--r-sm)
}

.alt {
  margin: var(--s3) 0 0;
  text-align: center;
  font-size: .92rem;
  color: var(--ink-soft)
}

.flash {
  margin: var(--s3) 0 0;
  padding: var(--s2) var(--s3);
  border-radius: var(--r-sm);
  font-size: .94rem;
  background: color-mix(in srgb, var(--ok) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--ok) 30%, transparent)
}

.flash-warn {
  background: color-mix(in srgb, var(--warn) 14%, transparent);
  border-color: color-mix(in srgb, var(--warn) 34%, transparent)
}

/* ---------- admin ---------- */
.head-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  align-items: center;
  justify-content: space-between
}

.tiles {
  list-style: none;
  margin: 0 0 var(--s5);
  padding: 0;
  display: grid;
  gap: var(--s3);
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr))
}

.tile {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  padding: var(--s4);
  display: flex;
  flex-direction: column;
  gap: var(--s1)
}

.tile-n {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  line-height: 1
}

.tile span:last-child {
  font-size: .86rem;
  color: var(--ink-soft)
}

.two-col {
  display: grid;
  gap: var(--s3);
  grid-template-columns: 1fr
}

@media (min-width:760px) {
  .two-col {
    grid-template-columns: 1fr 1fr
  }
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: .92rem
}

.table th,
.table td {
  text-align: left;
  padding: var(--s2) var(--s3);
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top
}

.table th {
  font-size: .78rem;
  color: var(--ink-soft);
  font-weight: 600
}

.table .num {
  text-align: right;
  font-variant-numeric: tabular-nums
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1)
}

.inline {
  display: inline
}

.pill {
  display: inline-block;
  padding: 2px var(--s2);
  border-radius: var(--r-full);
  font-size: .78rem;
  background: color-mix(in srgb, var(--card) 16%, transparent);
  color: var(--card)
}

.status {
  display: inline-block;
  padding: 2px var(--s2);
  border-radius: var(--r-full);
  font-size: .78rem;
  font-weight: 600
}

.status-published {
  background: color-mix(in srgb, var(--ok) 16%, transparent);
  color: var(--ok)
}

.status-draft {
  background: var(--surface-2);
  color: var(--ink-soft)
}

.searchbox {
  display: flex;
  gap: var(--s2)
}

.searchbox input {
  min-height: 44px;
  padding: var(--s2) var(--s3);
  font-size: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  background: var(--surface-1);
  color: var(--ink)
}

.form-row {
  display: grid;
  gap: var(--s3);
  align-items: end;
  margin-bottom: var(--s3);
  grid-template-columns: auto repeat(auto-fit, minmax(110px, 1fr)) auto
}

.form-row .field {
  margin: 0
}

.form-row .field.short {
  max-width: 120px
}

.swatch {
  width: 48px;
  height: 48px;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--card)
}

/* ---------- footer ---------- */
.foot {
  border-top: 1px solid var(--line-soft);
  padding-block: var(--s5);
  margin-top: var(--s7);
  color: var(--ink-soft);
  font-size: .9rem
}

.foot p {
  margin: 0 0 var(--s1)
}

.brand-signature {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  margin-top: var(--s3);
  padding-top: var(--s3);
  border-top: 1px solid var(--line-soft)
}

.brand-mark {
  width: 30px;
  height: 30px;
  flex: none;
  object-fit: contain;
  border-radius: 50%;
  transform: rotate(-8deg)
}

.brand-signature strong,
.brand-signature small {
  display: block
}

.brand-signature strong {
  color: var(--ink);
  font-size: .78rem;
  letter-spacing: .04em
}

.brand-signature small {
  font-size: .76rem
}

.brand-signature small a {
  white-space: nowrap
}

.brand-signature a {
  color: var(--accent);
  text-decoration: none
}

.brand-signature a:hover {
  text-decoration: underline
}

/* =========================================================================
   PWA install — floating action button + iOS "Add to Home Screen" sheet
   ========================================================================= */
.pwa-install {
  position: fixed;
  right: var(--s4);
  bottom: var(--s4);
  z-index: 80;
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s2) var(--s4) var(--s2) var(--s2);
  border: 0;
  border-radius: var(--r-full);
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 65%, #0A2E2B));
  color: #fff;
  box-shadow: var(--shadow-2);
  animation: pwaRise .45s var(--ease) both, pwaGlow 2.6s ease-in-out .6s infinite;
  max-width: calc(100vw - var(--s4) * 2);
}

.pwa-install:hover {
  transform: translateY(-2px)
}

.pwa-install:active {
  transform: translateY(0) scale(.98)
}

.pwa-install:disabled {
  opacity: .7;
  cursor: progress;
  animation: none
}

.pwa-install-glyph {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, .16);
}

.pwa-install-icon {
  width: 20px;
  height: 20px
}

.pwa-install-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  line-height: 1.25
}

.pwa-install-text strong {
  font-size: .92rem;
  font-weight: 700
}

.pwa-install-text em {
  font-style: normal;
  font-size: .74rem;
  color: rgba(255, 255, 255, .82)
}

@keyframes pwaRise {
  0% {
    opacity: 0;
    transform: translateY(16px) scale(.92)
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1)
  }
}

@keyframes pwaGlow {

  0%,
  100% {
    box-shadow: var(--shadow-2), 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent)
  }

  50% {
    box-shadow: var(--shadow-2), 0 0 0 10px color-mix(in srgb, var(--accent) 0%, transparent)
  }
}

@media (prefers-reduced-motion:reduce) {
  .pwa-install {
    animation: none
  }
}

@media (max-width:520px) {
  .pwa-install {
    left: var(--s3);
    right: var(--s3);
    bottom: var(--s3);
    justify-content: center
  }

  .pwa-install-text {
    align-items: flex-start
  }
}

.pwa-ios-sheet {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  align-items: end;
  background: rgba(10, 20, 20, .45);
  backdrop-filter: blur(2px);
}

.pwa-ios-card {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin-inline: auto;
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  padding: var(--s5) var(--s4) var(--s6);
  box-shadow: var(--shadow-2);
  animation: pwaSheetUp .3s var(--ease) both;
}

@media (min-width:521px) {
  .pwa-ios-sheet {
    align-items: center
  }

  .pwa-ios-card {
    border-radius: var(--r-lg);
    animation: pwaRise .3s var(--ease) both
  }
}

@keyframes pwaSheetUp {
  0% {
    transform: translateY(24px);
    opacity: .4
  }

  100% {
    transform: translateY(0);
    opacity: 1
  }
}

.pwa-ios-close {
  position: absolute;
  top: var(--s3);
  right: var(--s3);
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: var(--r-full);
  background: var(--surface-1);
  color: var(--ink);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.pwa-ios-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 var(--s3)
}

.pwa-ios-steps {
  margin: 0;
  padding-left: 1.2em;
  display: flex;
  flex-direction: column;
  gap: var(--s2)
}

.pwa-ios-steps li {
  padding-left: var(--s1)
}

.pwa-ios-glyph {
  display: inline-block;
  transform: rotate(90deg)
}

/* ---------- image viewer ---------- */
.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: var(--s3)
}

.image-lightbox[hidden] {
  display: none
}

.image-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 16, 17, .82);
  backdrop-filter: blur(8px);
  animation: fadeIn .2s ease both
}

.image-lightbox-panel {
  position: relative;
  z-index: 1;
  width: min(900px, 100%);
  max-height: calc(100dvh - 32px);
  display: grid;
  place-items: center;
  animation: lightboxPop .28s var(--ease) both
}

.image-lightbox-panel img {
  max-height: calc(100dvh - 104px);
  width: auto;
  max-width: 100%;
  object-fit: contain;
  border-radius: var(--r-md);
  box-shadow: 0 18px 60px rgba(0, 0, 0, .35)
}

.image-lightbox-close {
  position: absolute;
  z-index: 2;
  top: -12px;
  right: -4px;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, .32);
  border-radius: 50%;
  background: rgba(10, 25, 25, .75);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer
}

.image-lightbox-caption {
  margin: var(--s2) 0 0;
  color: rgba(255, 255, 255, .88);
  text-align: center;
  font-size: .9rem
}

@keyframes fadeIn {
  from {
    opacity: 0
  }

  to {
    opacity: 1
  }
}

@keyframes lightboxPop {
  from {
    opacity: 0;
    transform: scale(.92) translateY(12px)
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0)
  }
}

@media (prefers-reduced-motion:reduce) {

  .hero-art,
  .subject-card,
  .course-card,
  .subject-glyph {
    animation: none
  }

  .student {
    animation: none
  }

  .thumb img,
  .course-hero-art img {
    transition: none
  }
}