:root {
  --ink: #111111;
  --paper: #fffdf5;
  --paper-muted: #f4efdd;
  --red: #e5162f;
  --red-dark: #b90c22;
  --cyan: #45e9ed;
  --cyan-dark: #16aeb5;
  --yellow: #ffe052;
  --yellow-dark: #e7b500;
  --blue: #176fc1;
  --muted: #5f5b55;
  --shadow: 8px 8px 0 var(--ink);
  --shadow-small: 5px 5px 0 var(--ink);
  --radius: 18px;
  --max-width: 1180px;
  --header-height: 82px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background-color: var(--red-dark);
  background-image:
    linear-gradient(rgba(124, 0, 20, .2), rgba(80, 0, 12, .35)),
    url("../images/background/comic-background.jpg");
  background-size: cover;
  background-position: center top;
  background-attachment: fixed;
  font-family: "Trebuchet MS", Arial, sans-serif;
  line-height: 1.65;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 255, 255, .15), transparent 20rem),
    radial-gradient(circle at 85% 75%, rgba(69, 233, 237, .12), transparent 22rem);
}

body.modal-open {
  overflow: hidden;
}

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

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

p,
h1,
h2,
h3,
h4,
dl,
dd {
  margin-top: 0;
}

h1,
h2,
h3,
.eyebrow,
.section-kicker,
.comic-button,
.sound-word,
.page-hero__badge,
.portal-card__tag,
.sort-button,
.alphabet-nav button,
.memory-filters button {
  font-family: Impact, "Arial Black", "Trebuchet MS", sans-serif;
  letter-spacing: .035em;
}

h1,
h2,
h3 {
  line-height: 1.12;
}

h1 {
  font-size: clamp(2.7rem, 7vw, 6.2rem);
}

h2 {
  font-size: clamp(2rem, 4vw, 3.5rem);
}

h3 {
  font-size: clamp(1.35rem, 2vw, 1.75rem);
}

code {
  padding: .12rem .42rem;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: var(--yellow);
  font-family: Consolas, Monaco, monospace;
  font-size: .9em;
}

::selection {
  color: var(--ink);
  background: var(--cyan);
}

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

.skip-link {
  position: fixed;
  z-index: 10000;
  top: 10px;
  left: 10px;
  padding: .65rem 1rem;
  transform: translateY(-160%);
  border: 3px solid var(--ink);
  background: var(--yellow);
  font-weight: 900;
}

.skip-link:focus {
  transform: translateY(0);
}

.section-shell {
  width: min(calc(100% - 2rem), var(--max-width));
  margin-inline: auto;
  padding-block: clamp(2.5rem, 6vw, 5.5rem);
}

.comic-panel {
  position: relative;
  border: 4px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.comic-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: calc(var(--radius) - 4px);
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(17, 17, 17, .075) 1.2px, transparent 1.3px);
  background-size: 14px 14px;
  opacity: .55;
}

.comic-panel > * {
  position: relative;
  z-index: 1;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  min-height: var(--header-height);
  border-bottom: 4px solid var(--ink);
  background: rgba(17, 17, 17, .96);
  box-shadow: 0 6px 0 rgba(255, 224, 82, .95);
}

.site-header__inner {
  width: min(calc(100% - 2rem), var(--max-width));
  min-height: var(--header-height);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  color: #fff;
}

.brand__mark {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  transform: rotate(-3deg);
  border: 3px solid #fff;
  border-radius: 12px;
  background: var(--red);
  box-shadow: 3px 3px 0 var(--cyan);
}

.brand__mark svg {
  width: 30px;
  height: 30px;
  fill: var(--yellow);
  stroke: var(--ink);
  stroke-width: 1.7;
  stroke-linejoin: round;
}

.brand__text {
  display: grid;
  line-height: 1.05;
}

.brand__text strong {
  font-family: Impact, "Arial Black", sans-serif;
  font-size: 1.45rem;
  letter-spacing: .07em;
}

.brand__text small {
  margin-top: .25rem;
  color: var(--yellow);
  font-size: .67rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: .45rem;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .66rem .82rem;
  border: 2px solid transparent;
  border-radius: 9px;
  color: #fff;
  font-size: .88rem;
  font-weight: 900;
  text-transform: uppercase;
  transition: transform .18s ease, color .18s ease, background-color .18s ease;
}

.site-nav a svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  transform: translateY(-2px);
  color: var(--ink);
  background: var(--cyan);
  outline: none;
}

.site-nav a.is-active {
  border-color: var(--ink);
  color: var(--ink);
  background: var(--yellow);
  box-shadow: 3px 3px 0 var(--red);
}

.nav-toggle {
  width: 50px;
  height: 46px;
  display: none;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 9px;
  color: #fff;
  background: var(--red);
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--cyan);
}

.nav-toggle span,
.nav-toggle::before,
.nav-toggle::after {
  content: "";
  width: 24px;
  height: 3px;
  display: block;
  border-radius: 9px;
  background: currentColor;
  transition: transform .2s ease, opacity .2s ease;
}

.nav-toggle span {
  margin-block: 5px;
}

.nav-toggle[aria-expanded="true"] span {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"]::before {
  transform: translateY(8px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"]::after {
  transform: translateY(-8px) rotate(-45deg);
}

/* Shared headings and buttons */
.eyebrow,
.section-kicker {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: .32rem .65rem;
  border: 2px solid var(--ink);
  border-radius: 6px;
  color: var(--ink);
  background: var(--yellow);
  box-shadow: 3px 3px 0 var(--ink);
  font-size: .76rem;
  line-height: 1;
  text-transform: uppercase;
}

.section-heading {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 1.7rem;
  text-align: center;
}

.section-heading--left {
  align-items: flex-start;
  text-align: left;
}

.section-heading h2 {
  margin: .75rem 0 0;
  color: #fff;
  text-shadow: 4px 4px 0 var(--ink);
}

.comic-panel .section-heading h2,
.reading-panel .section-heading h2,
.teacher-card h2,
.coming-soon h2,
.replace-guide h2 {
  color: var(--ink);
  text-shadow: none;
}

.section-heading:has(.section-icon) {
  flex-direction: row;
  justify-content: center;
  gap: 1rem;
}

.section-icon {
  width: 70px;
  height: 70px;
  flex: 0 0 70px;
  display: grid;
  place-items: center;
  transform: rotate(-4deg);
  border: 4px solid var(--ink);
  border-radius: 16px;
  background: var(--cyan);
  box-shadow: 5px 5px 0 var(--ink);
}

.section-icon svg,
.subject-card__icon svg,
.portal-card svg,
.replace-guide__icon svg,
.empty-state svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.section-icon svg {
  width: 40px;
  height: 40px;
}

.section-intro {
  max-width: 880px;
  margin: 0 auto 2rem;
  padding: 1rem 1.2rem;
  border: 3px solid var(--ink);
  background: rgba(255, 253, 245, .95);
  box-shadow: var(--shadow-small);
  font-size: 1.04rem;
  font-weight: 700;
}

.comic-button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .76rem 1.05rem;
  border: 3px solid var(--ink);
  border-radius: 9px;
  color: var(--ink);
  background: #fff;
  box-shadow: 4px 4px 0 var(--ink);
  cursor: pointer;
  line-height: 1;
  text-transform: uppercase;
  transition: transform .16s ease, box-shadow .16s ease;
}

.comic-button:hover,
.comic-button:focus-visible {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 var(--ink);
  outline: none;
}

.comic-button--yellow {
  background: var(--yellow);
}

.comic-button--cyan {
  background: var(--cyan);
}

.comic-button--white {
  background: #fff;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  border-bottom: 3px solid var(--red);
  font-weight: 900;
}

.text-link:hover,
.text-link:focus-visible {
  color: var(--red);
  outline: none;
}

/* Home */
.hero {
  min-height: calc(100vh - var(--header-height));
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
}

.comic-panel--hero {
  padding: clamp(1.5rem, 4vw, 3.25rem);
  overflow: hidden;
}

.comic-panel--hero::before {
  content: "";
  position: absolute;
  right: -50px;
  bottom: -70px;
  width: 210px;
  height: 210px;
  z-index: 0;
  border: 4px solid var(--ink);
  border-radius: 50%;
  background: repeating-radial-gradient(circle, var(--cyan) 0 8px, var(--ink) 9px 11px);
  opacity: .35;
}

.hero h1 {
  margin: 1rem 0 .55rem;
  text-transform: uppercase;
}

.hero h1 span,
.page-hero h1 span {
  color: var(--red);
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
}

.hero__school {
  width: fit-content;
  margin-bottom: 1.2rem;
  padding: .38rem .7rem;
  transform: rotate(-1deg);
  border: 3px solid var(--ink);
  background: var(--cyan);
  box-shadow: 4px 4px 0 var(--ink);
  font-size: clamp(1rem, 2vw, 1.35rem);
  font-weight: 900;
}

.hero__lead {
  max-width: 650px;
  font-size: clamp(1rem, 2vw, 1.15rem);
  font-weight: 700;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .9rem;
  margin-top: 1.5rem;
}

.hero__visual {
  position: relative;
}

.logo-card {
  padding: 1.3rem;
  transform: rotate(2deg);
  background: var(--yellow);
}

.logo-card::before {
  content: "";
  position: absolute;
  inset: 14px;
  z-index: 0;
  border: 3px dashed var(--ink);
  border-radius: 12px;
}

.logo-card img {
  width: 100%;
  height: auto;
  margin-bottom: 1rem;
  filter: drop-shadow(4px 4px 0 rgba(17, 17, 17, .45));
}

.hero-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .65rem;
}

.hero-stat-grid div {
  padding: .75rem .35rem;
  border: 3px solid var(--ink);
  border-radius: 10px;
  background: var(--paper);
  text-align: center;
}

.hero-stat-grid strong,
.hero-stat-grid span {
  display: block;
}

.hero-stat-grid strong {
  color: var(--red);
  font-family: Impact, "Arial Black", sans-serif;
  font-size: 2rem;
  line-height: 1;
}

.hero-stat-grid span {
  margin-top: .3rem;
  font-size: .7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.sound-word {
  position: absolute;
  z-index: 4;
  padding: .25rem .55rem;
  color: #fff;
  background: var(--red);
  -webkit-text-stroke: 1px var(--ink);
  text-shadow: 3px 3px 0 var(--ink);
  transform: rotate(-8deg);
  font-size: clamp(1.1rem, 2.2vw, 1.9rem);
}

.sound-word--one {
  top: -1.5rem;
  right: -1rem;
}

.sound-word--two {
  bottom: -1.2rem;
  left: -1rem;
  color: var(--ink);
  background: var(--cyan);
  -webkit-text-stroke: 0;
}

.reading-panel {
  padding: clamp(1.5rem, 4vw, 3rem);
  font-size: 1.12rem;
}

.reading-panel p {
  margin-bottom: 0;
}

.subject-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.7rem;
}

.subject-card {
  min-height: 320px;
  padding: 1.5rem;
  overflow: hidden;
  transition: transform .2s ease;
}

.subject-card:nth-child(2) {
  background: #fff9d5;
}

.subject-card:nth-child(3) {
  background: #e9ffff;
}

.subject-card:nth-child(4) {
  background: #fff1f3;
}

.subject-card:hover {
  transform: translateY(-6px) rotate(-.5deg);
}

.subject-card__number {
  position: absolute;
  top: -.65rem;
  right: .4rem;
  color: rgba(17, 17, 17, .08);
  font-family: Impact, "Arial Black", sans-serif;
  font-size: 7rem;
  line-height: 1;
}

.subject-card__icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  margin-bottom: 1.1rem;
  border: 3px solid var(--ink);
  border-radius: 12px;
  background: var(--yellow);
  box-shadow: 4px 4px 0 var(--ink);
}

.subject-card:nth-child(2) .subject-card__icon,
.subject-card:nth-child(4) .subject-card__icon {
  background: var(--cyan);
}

.subject-card__icon svg {
  width: 36px;
  height: 36px;
}

.subject-card h3 {
  margin-bottom: .8rem;
}

.subject-card p {
  margin-bottom: 0;
  font-weight: 700;
}

.teacher-card {
  display: grid;
  grid-template-columns: minmax(250px, .75fr) minmax(0, 1.25fr);
  overflow: hidden;
}

.teacher-card__photo {
  position: relative;
  min-height: 420px;
  border-right: 4px solid var(--ink);
  background: var(--cyan);
}

.teacher-card__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.teacher-card__photo span {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  padding: .35rem .7rem;
  transform: rotate(-3deg);
  border: 3px solid var(--ink);
  background: var(--yellow);
  box-shadow: 4px 4px 0 var(--ink);
  font-family: Impact, "Arial Black", sans-serif;
  letter-spacing: .06em;
}

.teacher-card__body {
  padding: clamp(1.5rem, 4vw, 3rem);
}

.teacher-card__body h2 {
  margin: .8rem 0 1rem;
}

.teacher-card__quote {
  padding: 1rem 1.1rem;
  border-left: 8px solid var(--red);
  background: var(--paper-muted);
  font-size: 1.1rem;
  font-weight: 900;
}

.profile-mini {
  display: grid;
  gap: .7rem;
  margin-bottom: 1.2rem;
}

.profile-mini div {
  padding-bottom: .7rem;
  border-bottom: 2px dashed var(--ink);
}

.profile-mini dt {
  color: var(--muted);
  font-size: .75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.profile-mini dd {
  margin: .15rem 0 0;
  font-weight: 900;
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.6rem;
}

.portal-card {
  min-height: 310px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 1.4rem;
  transition: transform .2s ease, box-shadow .2s ease;
}

.portal-card:hover,
.portal-card:focus-visible {
  transform: translateY(-7px) rotate(-.5deg);
  box-shadow: 12px 12px 0 var(--ink);
  outline: none;
}

.portal-card--blog {
  background: #fff9d7;
}

.portal-card--bio {
  background: #e8ffff;
}

.portal-card--memory {
  background: #fff0f2;
}

.portal-card__tag {
  padding: .25rem .5rem;
  border: 2px solid var(--ink);
  background: #fff;
  box-shadow: 3px 3px 0 var(--ink);
  font-size: .72rem;
}

.portal-card svg {
  width: 64px;
  height: 64px;
  margin: 1.25rem 0 .8rem;
}

.portal-card p {
  margin: auto 0 0;
  font-weight: 700;
}

/* Inner page hero */
.page-hero {
  min-height: 490px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  align-items: center;
  gap: 2.5rem;
}

.page-hero__content {
  padding: clamp(1.5rem, 4vw, 3.2rem);
}

.page-hero h1 {
  margin: 1rem 0 .8rem;
  font-size: clamp(2.8rem, 6vw, 5.6rem);
  text-transform: uppercase;
}

.page-hero p {
  max-width: 760px;
  margin-bottom: 0;
  font-size: 1.08rem;
  font-weight: 700;
}

.page-hero__badge {
  width: 205px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  transform: rotate(8deg);
  clip-path: polygon(50% 0, 62% 25%, 84% 8%, 82% 36%, 100% 43%, 76% 57%, 96% 78%, 65% 73%, 57% 100%, 43% 76%, 17% 94%, 23% 63%, 0 54%, 27% 41%, 11% 17%, 39% 29%);
  color: #fff;
  background: var(--red);
  filter: drop-shadow(8px 8px 0 var(--ink));
  font-size: 2.6rem;
  text-shadow: 3px 3px 0 var(--ink);
}

.page-hero__badge--cyan {
  color: var(--ink);
  background: var(--cyan);
  text-shadow: none;
}

.page-hero__badge--yellow {
  color: var(--ink);
  background: var(--yellow);
  text-shadow: none;
}

/* Toolbars */
.toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
}

.search-field,
.select-field {
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: .65rem;
  border: 3px solid var(--ink);
  border-radius: 9px;
  background: #fff;
}

.search-field {
  flex: 1 1 420px;
  padding-inline: .9rem;
}

.search-field--wide {
  flex-basis: 560px;
}

.search-field svg,
.select-field svg {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.search-field input,
.select-field select {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: none;
  color: var(--ink);
  background: transparent;
  font-weight: 800;
}

.select-field {
  flex: 0 1 260px;
  padding-inline: .8rem;
}

.select-field select {
  cursor: pointer;
}

.result-count {
  min-width: 110px;
  padding: .45rem .7rem;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--cyan);
  font-size: .78rem;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

/* Blog */
.story-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.6rem;
}

.story-card {
  overflow: hidden;
  transition: transform .2s ease;
}

.story-card:hover {
  transform: translateY(-7px) rotate(-.4deg);
}

.story-card__image {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-bottom: 4px solid var(--ink);
  background: var(--yellow);
}

.story-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.story-card__episode {
  position: absolute;
  top: .8rem;
  left: .8rem;
  padding: .28rem .55rem;
  transform: rotate(-3deg);
  border: 3px solid var(--ink);
  background: var(--yellow);
  box-shadow: 3px 3px 0 var(--ink);
  font-family: Impact, "Arial Black", sans-serif;
  font-size: .76rem;
}

.story-card__body {
  padding: 1.2rem;
}

.story-card__region {
  display: inline-flex;
  margin-bottom: .65rem;
  padding: .2rem .5rem;
  border: 2px solid var(--ink);
  border-radius: 5px;
  color: var(--ink);
  background: var(--cyan);
  font-size: .72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.story-card h3 {
  margin-bottom: .65rem;
}

.story-card p {
  display: -webkit-box;
  margin-bottom: 1rem;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  font-size: .94rem;
  font-weight: 700;
}

.story-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .7rem;
  margin-bottom: .9rem;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.story-card .comic-button {
  width: 100%;
}

.empty-state {
  max-width: 600px;
  margin: 2rem auto 0;
  padding: 2rem;
  text-align: center;
}

.empty-state svg {
  width: 70px;
  height: 70px;
  margin: 0 auto 1rem;
}

.empty-state p {
  margin-bottom: 0;
}

.coming-soon {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: clamp(1.5rem, 4vw, 3rem);
}

.coming-soon h2 {
  margin: .75rem 0 .5rem;
}

.coming-soon p {
  max-width: 680px;
  margin-bottom: 0;
  font-weight: 700;
}

.coming-soon__burst {
  width: 145px;
  aspect-ratio: 1;
  flex: 0 0 145px;
  display: grid;
  place-items: center;
  clip-path: polygon(50% 0, 62% 26%, 86% 8%, 82% 37%, 100% 50%, 76% 61%, 91% 88%, 61% 77%, 48% 100%, 38% 75%, 10% 91%, 22% 61%, 0 48%, 27% 38%, 12% 10%, 40% 24%);
  color: #fff;
  background: var(--red);
  filter: drop-shadow(6px 6px 0 var(--ink));
  font-family: Impact, "Arial Black", sans-serif;
  font-size: 1.8rem;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 1rem;
  visibility: hidden;
  opacity: 0;
  transition: opacity .2s ease, visibility .2s ease;
}

.modal.is-open {
  visibility: visible;
  opacity: 1;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .82);
  backdrop-filter: blur(5px);
}

.modal__panel {
  position: relative;
  z-index: 1;
  width: min(100%, 980px);
  max-height: calc(100vh - 2rem);
  overflow: auto;
  transform: translateY(22px) scale(.98);
  transition: transform .2s ease;
}

.modal.is-open .modal__panel {
  transform: translateY(0) scale(1);
}

.modal__close {
  position: absolute;
  top: .8rem;
  right: .8rem;
  z-index: 10;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 3px solid var(--ink);
  border-radius: 50%;
  color: #fff;
  background: var(--red);
  box-shadow: 4px 4px 0 var(--ink);
  cursor: pointer;
}

.modal__close svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
}

.story-reader {
  padding: 0;
}

.reading-progress {
  position: sticky;
  top: 0;
  z-index: 8;
  height: 8px;
  border-bottom: 2px solid var(--ink);
  background: #fff;
}

.reading-progress span {
  width: 0;
  height: 100%;
  display: block;
  background: var(--cyan);
}

.story-reader__header {
  position: relative;
  min-height: 330px;
  overflow: hidden;
  border-bottom: 4px solid var(--ink);
}

.story-reader__header img {
  width: 100%;
  height: 330px;
  object-fit: cover;
}

.story-reader__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 25%, rgba(0, 0, 0, .78));
}

.story-reader__title {
  position: absolute;
  right: 2rem;
  bottom: 1.6rem;
  left: 2rem;
  color: #fff;
}

.story-reader__title span {
  display: inline-flex;
  padding: .25rem .55rem;
  border: 2px solid var(--ink);
  color: var(--ink);
  background: var(--yellow);
  font-size: .74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.story-reader__title h2 {
  margin: .55rem 0 0;
  font-size: clamp(2.2rem, 5vw, 4.2rem);
  text-shadow: 4px 4px 0 var(--ink);
}

.story-reader__body {
  padding: clamp(1.4rem, 4vw, 3rem);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1rem, 2vw, 1.13rem);
  line-height: 1.85;
}

.story-reader__body p {
  margin-bottom: 1.35rem;
}

.story-reader__body p:first-child::first-letter {
  float: left;
  margin: .15rem .5rem 0 0;
  color: var(--red);
  font-family: Impact, "Arial Black", sans-serif;
  font-size: 4.6rem;
  line-height: .8;
}

.story-reader__navigation {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 clamp(1.4rem, 4vw, 3rem) 2.5rem;
}

/* Biodata */
.teacher-profile {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  overflow: hidden;
}

.teacher-profile__photo {
  position: relative;
  min-height: 360px;
  border-right: 4px solid var(--ink);
  background: var(--yellow);
}

.teacher-profile__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.teacher-profile__initial {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  transform: rotate(4deg);
  border: 4px solid var(--ink);
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 4px 4px 0 var(--ink);
  font-family: Impact, "Arial Black", sans-serif;
  font-size: 1.7rem;
}

.teacher-profile__body {
  padding: clamp(1.4rem, 4vw, 2.6rem);
}

.teacher-profile__body h3 {
  margin: .8rem 0 1rem;
  font-size: clamp(2rem, 4vw, 3.4rem);
}

.teacher-profile__motto {
  padding: 1rem 1.2rem;
  border: 3px solid var(--ink);
  border-left: 10px solid var(--red);
  background: var(--paper-muted);
  font-weight: 900;
}

.teacher-profile dl,
.student-detail dl {
  display: grid;
  gap: .7rem;
  margin: 1rem 0 0;
}

.teacher-profile dl div,
.student-detail dl div {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: .8rem;
  padding-bottom: .65rem;
  border-bottom: 2px dashed rgba(17, 17, 17, .45);
}

.teacher-profile dt,
.student-detail dt {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.teacher-profile dd,
.student-detail dd {
  margin: 0;
  font-weight: 900;
}

.sort-buttons {
  display: flex;
  gap: .5rem;
}

.sort-button,
.alphabet-nav button,
.memory-filters button {
  min-width: 50px;
  min-height: 44px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: #fff;
  box-shadow: 3px 3px 0 var(--ink);
  cursor: pointer;
}

.sort-button:hover,
.sort-button:focus-visible,
.sort-button.is-active,
.alphabet-nav button:hover,
.alphabet-nav button:focus-visible,
.alphabet-nav button.is-active,
.memory-filters button:hover,
.memory-filters button:focus-visible,
.memory-filters button.is-active {
  transform: translate(2px, 2px);
  background: var(--yellow);
  box-shadow: 1px 1px 0 var(--ink);
  outline: none;
}

.alphabet-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .5rem;
  margin: 1.5rem 0 2rem;
  padding: .9rem;
}

.alphabet-nav button {
  min-width: 42px;
  min-height: 38px;
  padding: .3rem;
  font-size: .82rem;
}

.alphabet-nav button[disabled] {
  cursor: not-allowed;
  opacity: .35;
  box-shadow: none;
}

.student-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.45rem;
}

.student-card {
  overflow: hidden;
  transition: transform .2s ease;
}

.student-card:hover {
  transform: translateY(-6px) rotate(-.35deg);
}

.student-card__photo {
  position: relative;
  aspect-ratio: 4 / 4.7;
  overflow: hidden;
  border-bottom: 4px solid var(--ink);
  background: var(--yellow);
}

.student-card__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.student-card__initial {
  position: absolute;
  right: .65rem;
  bottom: .65rem;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  transform: rotate(5deg);
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 3px 3px 0 var(--ink);
  font-family: Impact, "Arial Black", sans-serif;
  font-size: 1.35rem;
}

.student-card__body {
  padding: 1rem;
}

.student-card__index {
  display: inline-flex;
  margin-bottom: .55rem;
  padding: .18rem .42rem;
  border: 2px solid var(--ink);
  border-radius: 5px;
  background: var(--yellow);
  font-size: .67rem;
  font-weight: 900;
}

.student-card h3 {
  min-height: 3.1rem;
  margin-bottom: .55rem;
  font-size: 1.25rem;
}

.student-card__dream {
  min-height: 2.75rem;
  margin-bottom: .85rem;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 900;
}

.student-card .comic-button {
  width: 100%;
  min-height: 42px;
  font-size: .8rem;
}

.student-detail {
  width: min(100%, 820px);
  display: grid;
  grid-template-columns: minmax(260px, .75fr) minmax(0, 1.25fr);
  overflow: hidden;
}

.student-detail__photo-wrap {
  position: relative;
  min-height: 540px;
  border-right: 4px solid var(--ink);
  background: var(--yellow);
}

.student-detail__photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.student-detail__photo-wrap span {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  transform: rotate(5deg);
  border: 4px solid var(--ink);
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 4px 4px 0 var(--ink);
  font-family: Impact, "Arial Black", sans-serif;
  font-size: 1.7rem;
}

.student-detail__body {
  padding: clamp(1.5rem, 4vw, 2.7rem);
}

.student-detail__body h2 {
  margin: .8rem 3rem 1.2rem 0;
}

.student-detail blockquote {
  margin: 1.4rem 0 0;
  padding: 1rem 1.1rem;
  border: 3px solid var(--ink);
  border-left: 9px solid var(--red);
  background: var(--paper-muted);
  font-weight: 900;
}

/* Memories */
.memory-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .65rem;
  margin-bottom: 2rem;
  padding: 1rem;
}

.memory-filters button {
  min-width: auto;
  padding: .55rem .85rem;
  font-size: .82rem;
}

.memory-grid {
  columns: 3 280px;
  column-gap: 1.4rem;
}

.memory-card {
  width: 100%;
  display: inline-block;
  margin: 0 0 1.4rem;
  overflow: hidden;
  break-inside: avoid;
  cursor: pointer;
  transition: transform .18s ease;
}

.memory-card:hover,
.memory-card:focus-visible {
  transform: translateY(-5px) rotate(-.3deg);
  outline: none;
}

.memory-card__image {
  position: relative;
  overflow: hidden;
  border-bottom: 4px solid var(--ink);
  background: var(--yellow);
}

.memory-card__image img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.memory-card__zoom {
  position: absolute;
  right: .7rem;
  bottom: .7rem;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 3px solid var(--ink);
  border-radius: 50%;
  color: var(--ink);
  background: var(--yellow);
  box-shadow: 3px 3px 0 var(--ink);
}

.memory-card__zoom svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.memory-card__body {
  padding: 1rem;
}

.memory-card__category {
  display: inline-flex;
  padding: .2rem .45rem;
  border: 2px solid var(--ink);
  border-radius: 5px;
  background: var(--cyan);
  font-size: .67rem;
  font-weight: 900;
  text-transform: uppercase;
}

.memory-card h3 {
  margin: .65rem 0 .4rem;
  font-size: 1.25rem;
}

.memory-card p {
  margin-bottom: .6rem;
  font-size: .87rem;
  font-weight: 700;
}

.memory-card time {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.replace-guide {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  padding: clamp(1.4rem, 4vw, 2.5rem);
}

.replace-guide__icon {
  width: 90px;
  height: 90px;
  flex: 0 0 90px;
  display: grid;
  place-items: center;
  transform: rotate(-4deg);
  border: 4px solid var(--ink);
  border-radius: 16px;
  background: var(--cyan);
  box-shadow: 5px 5px 0 var(--ink);
}

.replace-guide__icon svg {
  width: 50px;
  height: 50px;
}

.replace-guide h2 {
  margin: .75rem 0 .5rem;
}

.replace-guide p {
  margin-bottom: 0;
  font-weight: 700;
}

.lightbox {
  width: min(100%, 1050px);
  overflow: hidden;
}

.lightbox__image-wrap {
  display: grid;
  place-items: center;
  min-height: 300px;
  max-height: 68vh;
  border-bottom: 4px solid var(--ink);
  background: #111;
}

.lightbox__image-wrap img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 68vh;
  object-fit: contain;
}

.lightbox__caption {
  padding: 1.25rem 1.5rem .7rem;
}

.lightbox__caption span {
  display: inline-flex;
  padding: .2rem .5rem;
  border: 2px solid var(--ink);
  background: var(--cyan);
  font-size: .7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.lightbox__caption h2 {
  margin: .6rem 0 .35rem;
  font-size: clamp(1.8rem, 4vw, 3rem);
}

.lightbox__caption p {
  margin-bottom: .4rem;
  font-weight: 700;
}

.lightbox__caption time {
  color: var(--muted);
  font-size: .75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.lightbox__navigation {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: .8rem 1.5rem 1.4rem;
}

.lightbox__navigation button {
  width: 48px;
  height: 45px;
  display: grid;
  place-items: center;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: var(--yellow);
  box-shadow: 3px 3px 0 var(--ink);
  cursor: pointer;
}

.lightbox__navigation button:hover,
.lightbox__navigation button:focus-visible {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--ink);
  outline: none;
}

.lightbox__navigation svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lightbox__navigation span {
  min-width: 75px;
  font-weight: 900;
  text-align: center;
}

/* Footer */
.site-footer {
  margin-top: 3rem;
  border-top: 5px solid var(--ink);
  color: #fff;
  background: var(--ink);
}

.site-footer__inner {
  width: min(calc(100% - 2rem), var(--max-width));
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 2rem;
  padding: 2.2rem 0;
}

.footer-brand {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.footer-brand img {
  width: 160px;
  height: auto;
}

.footer-brand p {
  max-width: 520px;
  margin-bottom: 0;
  color: #ddd;
  font-size: .9rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  justify-content: flex-end;
  gap: .65rem;
}

.footer-links a {
  padding: .45rem .65rem;
  border: 2px solid #fff;
  border-radius: 7px;
  font-size: .78rem;
  font-weight: 900;
}

.footer-links a:hover,
.footer-links a:focus-visible {
  color: var(--ink);
  background: var(--yellow);
  outline: none;
}

.site-footer__bottom {
  border-top: 2px solid #3a3a3a;
}

.site-footer__bottom div {
  width: min(calc(100% - 2rem), var(--max-width));
  margin-inline: auto;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .9rem 0;
  color: #bbb;
  font-size: .76rem;
  font-weight: 700;
}

.back-to-top {
  position: fixed;
  right: 1.2rem;
  bottom: 1.2rem;
  z-index: 900;
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  transform: translateY(120px);
  border: 3px solid var(--ink);
  border-radius: 50%;
  color: var(--ink);
  background: var(--yellow);
  box-shadow: 4px 4px 0 var(--ink);
  cursor: pointer;
  opacity: 0;
  transition: transform .2s ease, opacity .2s ease;
}

.back-to-top.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.back-to-top svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .5s ease, transform .5s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 1020px) {
  .nav-toggle {
    display: grid;
  }

  .site-nav {
    position: absolute;
    top: calc(100% + 4px);
    right: 1rem;
    left: 1rem;
    display: grid;
    gap: .5rem;
    padding: .8rem;
    transform: translateY(-10px) scale(.98);
    visibility: hidden;
    border: 4px solid var(--ink);
    border-radius: 13px;
    background: #151515;
    box-shadow: 7px 7px 0 var(--yellow);
    opacity: 0;
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
  }

  .site-nav.is-open {
    transform: translateY(0) scale(1);
    visibility: visible;
    opacity: 1;
  }

  .site-nav a {
    justify-content: flex-start;
    padding: .8rem;
  }

  .hero {
    grid-template-columns: 1fr;
    padding-top: 4rem;
  }

  .hero__visual {
    max-width: 620px;
    margin-inline: auto;
  }

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

  .student-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .portal-card {
    min-height: 240px;
  }
}

@media (max-width: 760px) {
  :root {
    --shadow: 6px 6px 0 var(--ink);
    --header-height: 72px;
  }

  body {
    background-attachment: scroll;
    background-size: auto 1150px;
  }

  .section-shell {
    width: min(calc(100% - 1.2rem), var(--max-width));
    padding-block: 2.7rem;
  }

  .brand__text small {
    display: none;
  }

  .brand__text strong {
    font-size: 1.18rem;
  }

  .brand__mark {
    width: 44px;
    height: 44px;
  }

  .hero {
    min-height: auto;
    gap: 2.8rem;
    padding-top: 3rem;
  }

  .hero__visual {
    width: 94%;
  }

  .hero__actions {
    flex-direction: column;
  }

  .hero__actions .comic-button {
    width: 100%;
  }

  .hero-stat-grid strong {
    font-size: 1.55rem;
  }

  .subject-grid,
  .story-grid {
    grid-template-columns: 1fr;
  }

  .teacher-card,
  .teacher-profile,
  .student-detail {
    grid-template-columns: 1fr;
  }

  .teacher-card__photo,
  .teacher-profile__photo,
  .student-detail__photo-wrap {
    min-height: auto;
    aspect-ratio: 4 / 4;
    border-right: 0;
    border-bottom: 4px solid var(--ink);
  }

  .page-hero {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 1rem;
    padding-top: 3.2rem;
  }

  .page-hero__badge {
    width: 120px;
    margin: -1.2rem 1rem 0 auto;
    font-size: 1.6rem;
  }

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

  .search-field,
  .search-field--wide,
  .select-field {
    flex: none;
    width: 100%;
  }

  .result-count {
    width: 100%;
  }

  .sort-buttons {
    width: 100%;
  }

  .sort-button {
    flex: 1;
  }

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

  .student-card h3 {
    min-height: 0;
  }

  .student-card__dream {
    min-height: 0;
  }

  .story-reader__header,
  .story-reader__header img {
    height: 260px;
    min-height: 260px;
  }

  .story-reader__title {
    right: 1rem;
    bottom: 1rem;
    left: 1rem;
  }

  .story-reader__navigation {
    flex-direction: column;
  }

  .story-reader__navigation .comic-button {
    width: 100%;
  }

  .coming-soon {
    flex-direction: column;
    align-items: flex-start;
  }

  .coming-soon__burst {
    align-self: flex-end;
  }

  .replace-guide {
    align-items: flex-start;
  }

  .replace-guide__icon {
    width: 64px;
    height: 64px;
    flex-basis: 64px;
  }

  .replace-guide__icon svg {
    width: 36px;
    height: 36px;
  }

  .site-footer__inner {
    grid-template-columns: 1fr;
  }

  .footer-links {
    justify-content: flex-start;
  }

  .site-footer__bottom div {
    flex-direction: column;
    gap: .3rem;
  }
}

@media (max-width: 520px) {
  .comic-panel {
    border-width: 3px;
  }

  .section-heading:has(.section-icon) {
    flex-direction: column;
  }

  .section-heading:has(.section-icon) .section-icon {
    margin-inline: auto;
  }

  .hero-stat-grid {
    grid-template-columns: 1fr;
  }

  .sound-word {
    display: none;
  }

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

  .student-card {
    display: grid;
    grid-template-columns: 125px minmax(0, 1fr);
  }

  .student-card__photo {
    height: 100%;
    min-height: 220px;
    aspect-ratio: auto;
    border-right: 3px solid var(--ink);
    border-bottom: 0;
  }

  .student-card__body {
    display: flex;
    flex-direction: column;
  }

  .student-card .comic-button {
    margin-top: auto;
  }

  .teacher-profile dl div,
  .student-detail dl div {
    grid-template-columns: 1fr;
    gap: .15rem;
  }

  .replace-guide {
    flex-direction: column;
  }

  .footer-brand {
    flex-direction: column;
  }

  .modal {
    padding: .45rem;
  }

  .modal__panel {
    max-height: calc(100vh - .9rem);
  }
}
.student-detail blockquote {
  white-space: pre-line;
}
