:root {
  --paper: #f4f0e7;
  --paper-light: #faf8f2;
  --ink: #292a25;
  --muted: #69685f;
  --clay: #b78374;
  --line: rgba(41, 42, 37, 0.18);
  --serif-jp: "Noto Serif JP", serif;
  --serif-en: "Cormorant Garamond", serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--serif-jp);
  font-weight: 300;
}

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

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

figure {
  margin: 0;
}

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

.lesson-header {
  display: grid;
  position: sticky;
  z-index: 20;
  top: 0;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 20px 4vw;
  border-bottom: 1px solid var(--line);
  background: rgba(250, 248, 242, 0.94);
  backdrop-filter: blur(10px);
}

.lesson-logo {
  display: flex;
  width: fit-content;
  min-height: 44px;
  justify-content: center;
  flex-direction: column;
}

.lesson-logo span {
  font-size: 23px;
  letter-spacing: 0.16em;
}

.lesson-logo small {
  color: var(--muted);
  font-size: 7px;
  letter-spacing: 0.26em;
}

.room-nav {
  display: flex;
  gap: 34px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.13em;
}

.room-nav a,
.back-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding-bottom: 5px;
  border-bottom: 1px solid transparent;
  transition: border-color 180ms ease, color 180ms ease;
}

.room-nav a:hover,
.back-link:hover {
  color: var(--ink);
  border-color: var(--clay);
}

.back-link,
.lesson-footer {
  color: var(--muted);
  font-family: var(--serif-en);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.back-link {
  justify-self: end;
  border-bottom-color: var(--clay);
}

.gallery-room {
  padding: 11vh 6vw 18vh;
}

.classroom-room {
  background: var(--paper-light);
}

.student-room {
  border-top: 1px solid var(--line);
  background: #dedad0;
}

.room-heading {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: end;
  margin-bottom: 7vh;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.room-heading p {
  margin: 0;
  color: var(--muted);
  font-family: var(--serif-en);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.room-heading h2 {
  justify-self: end;
  margin: 0;
  font-size: clamp(22px, 2.4vw, 34px);
  font-weight: 300;
  letter-spacing: 0.18em;
}

.classroom-hero {
  height: min(72vw, 920px);
  overflow: hidden;
  background: #e3ded3;
}

.classroom-hero img,
.classroom-photo img {
  height: 100%;
  object-fit: cover;
}

.classroom-hero img {
  object-position: center 48%;
}

.room-action {
  display: grid;
  grid-template-columns: minmax(0, 480px) auto;
  justify-content: space-between;
  align-items: end;
  gap: 48px;
  padding: 28px 0 14vh;
}

.room-action p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.08em;
  line-height: 2;
}

.room-action a,
.lesson-closing a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 52px;
  padding: 8px 0;
  border-bottom: 1px solid currentColor;
  font-size: 13px;
  letter-spacing: 0.12em;
}

.room-action a:active,
.lesson-closing a:active,
.room-nav a:active,
.back-link:active {
  opacity: 0.6;
}

.classroom-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 8vw 5vw;
  align-items: start;
}

.classroom-photo {
  overflow: hidden;
  background: #e3ded3;
}

.classroom-guidance {
  height: min(72vw, 860px);
}

.classroom-hands {
  height: min(54vw, 660px);
  margin-top: 11vh;
}

.classroom-table {
  width: min(50vw, 650px);
  height: min(62vw, 800px);
  grid-column: 1 / -1;
  justify-self: center;
}

.student-feature {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 2.2vw;
  margin-bottom: 10vh;
}

.student-feature figure {
  min-height: 0;
  overflow: hidden;
  background: #e9e4da;
}

.student-feature-main {
  grid-row: 1 / 3;
  height: min(74vw, 900px);
}

.student-feature-side {
  height: min(35.9vw, 438px);
}

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

.student-feature-side:last-child img {
  object-position: center 58%;
}

.student-invitation {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 8vw;
  margin: 0 0 12vh;
  padding: 0 0 42px;
  border-bottom: 1px solid var(--line);
}

.student-invitation p {
  margin: 0;
  font-size: clamp(24px, 3.4vw, 46px);
  letter-spacing: 0.1em;
  line-height: 1.75;
}

.student-invitation a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
  padding: 8px 0;
  border-bottom: 1px solid currentColor;
  font-size: 13px;
  letter-spacing: 0.12em;
}

.student-wall {
  columns: 3;
  column-gap: 2.2vw;
}

.student-piece {
  width: 100%;
  margin-bottom: 2.2vw;
  overflow: hidden;
  break-inside: avoid;
  background: #e9e4da;
}

.student-piece img {
  height: auto;
}

.student-piece:nth-child(5n + 2) {
  margin-top: 5vw;
}

.lesson-closing {
  display: grid;
  min-height: 68vh;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 10vw;
  padding: 13vh 9vw;
  border-top: 1px solid var(--line);
  background: var(--paper);
}

.lesson-closing-title {
  max-width: 720px;
  margin: 0;
  font-size: clamp(30px, 5vw, 67px);
  letter-spacing: 0.08em;
  line-height: 1.65;
}

.lesson-closing-title span {
  display: block;
  white-space: nowrap;
}

.lesson-closing-note {
  margin: 32px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.08em;
  line-height: 2;
}

.lesson-footer {
  display: flex;
  justify-content: space-between;
  padding: 24px 4vw;
  background: var(--paper-light);
}

.motion-ready .reveal-media,
.motion-ready .reveal-copy {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 340ms ease, transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

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

.motion-fallback .reveal-media,
.motion-fallback .reveal-copy {
  opacity: 1;
  transform: none;
  transition: none;
}

@media (max-width: 760px) {
  html {
    scroll-padding-top: 118px;
  }

  .lesson-header {
    grid-template-columns: 1fr auto;
    padding: 17px 6vw;
    background: rgba(250, 248, 242, 0.98);
    backdrop-filter: none;
  }

  .room-nav {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    justify-content: center;
    gap: 36px;
    padding: 12px 6vw;
    border-bottom: 1px solid var(--line);
    background: rgba(250, 248, 242, 0.98);
  }

  .gallery-room {
    padding: 96px 6vw 120px;
  }

  .room-heading {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 42px;
  }

  .room-heading h2 {
    justify-self: start;
    font-size: 24px;
  }

  .classroom-hero {
    height: 112vw;
  }

  .classroom-hero img {
    object-position: 52% center;
  }

  .room-action {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 24px;
    padding: 24px 0 90px;
  }

  .room-action a,
  .lesson-closing a {
    width: 100%;
    gap: 20px;
  }

  .classroom-grid {
    grid-template-columns: 1fr;
    gap: 72px;
  }

  .classroom-guidance,
  .classroom-hands,
  .classroom-table {
    width: 100%;
    height: 116vw;
    margin: 0;
  }

  .classroom-hands {
    width: 84%;
    justify-self: end;
  }

  .classroom-table {
    width: 76%;
    height: 104vw;
    grid-column: auto;
    justify-self: start;
  }

  .student-wall {
    columns: 2;
    column-gap: 12px;
  }

  .student-feature {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto auto;
    gap: 12px;
    margin-bottom: 72px;
  }

  .student-feature-main {
    grid-column: 1 / -1;
    grid-row: auto;
    height: auto;
    aspect-ratio: 4 / 5;
  }

  .student-feature-side {
    height: auto;
    aspect-ratio: 4 / 5;
  }

  .student-invitation {
    grid-template-columns: 1fr;
    gap: 32px;
    margin-bottom: 72px;
    padding-bottom: 32px;
  }

  .student-invitation p {
    font-size: clamp(22px, 6.8vw, 30px);
    letter-spacing: 0.06em;
  }

  .student-invitation a {
    width: 100%;
    gap: 20px;
  }

  .student-piece {
    margin-bottom: 12px;
  }

  .student-piece:nth-child(5n + 2) {
    margin-top: 28px;
  }

  .lesson-closing {
    min-height: 560px;
    grid-template-columns: 1fr;
    align-items: end;
    padding: 90px 7vw;
  }

  .lesson-closing-title {
    align-self: center;
    font-size: clamp(23px, 7.1vw, 31px);
    letter-spacing: 0.035em;
    line-height: 1.75;
  }

  .lesson-closing-note {
    margin-top: 28px;
  }

  .lesson-footer {
    gap: 18px;
    flex-direction: column;
    padding: 25px 6vw;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .motion-ready .reveal-media,
  .motion-ready .reveal-copy,
  .motion-ready .reveal-media img {
    opacity: 1;
    clip-path: none;
    transform: none;
    transition: none;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .lesson-header,
  .room-nav {
    background: var(--paper-light);
    backdrop-filter: none;
  }
}

@media (prefers-contrast: more) {
  :root {
    --muted: #4f504a;
    --line: rgba(41, 42, 37, 0.42);
  }
}
