:root {
  --page: #eaf8f4;
  --surface: #fbfffd;
  --panel: #f3fbff;
  --ink: #102528;
  --muted: #5f7172;
  --line: #b8d9d4;
  --teal: #147a75;
  --cyan: #37b7d6;
  --coral: #ee6f57;
  --yellow: #f6c953;
  --shadow: 0 18px 44px rgba(16, 37, 40, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family:
    Pretendard,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background:
    linear-gradient(rgba(20, 122, 117, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(55, 183, 214, 0.08) 1px, transparent 1px),
    var(--page);
  background-size: 26px 26px;
}

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: inherit;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.sheet-value {
  white-space: pre-line;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 82px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 14px clamp(18px, 4vw, 54px);
  border-bottom: 1px solid rgba(16, 37, 40, 0.14);
  background: rgba(234, 248, 244, 0.94);
  backdrop-filter: blur(10px);
}

.brand {
  grid-column: 2;
  justify-self: center;
}

.brand img {
  width: 120px;
  display: block;
}

.site-header nav {
  grid-column: 3;
  justify-self: end;
  display: flex;
  gap: 8px;
  align-items: center;
}

.site-header nav a,
.complete-dialog a {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 18px;
  background: var(--surface);
  text-decoration: none;
  font-weight: 900;
  white-space: nowrap;
}

.oneday-main,
.students-main {
  width: min(1120px, calc(100% - 36px));
  margin: 0 auto;
}

.oneday-main {
  padding: clamp(28px, 5vw, 62px) 0 80px;
}

.class-showcase,
.signup-shell {
  --media-column: minmax(320px, 1fr);
  --content-column: minmax(0, 1.05fr);
  display: grid;
  gap: clamp(20px, 4vw, 38px);
  align-items: start;
  margin-bottom: 34px;
}

.hero-section {
  min-height: min(600px, calc(100svh - 82px));
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  gap: clamp(24px, 5vw, 58px);
  align-items: center;
  padding: clamp(18px, 3vw, 36px) 0 clamp(28px, 5vw, 58px);
}

.hero-copy {
  min-width: 0;
}

.hero-visual,
.poster-card,
.video-card {
  margin: 0;
}

.hero-visual[hidden],
.poster-card[hidden] {
  display: none;
}

.hero-visual {
  position: relative;
  isolation: isolate;
}

.hero-visual::before,
.hero-visual::after {
  content: "";
  position: absolute;
  z-index: 2;
  width: clamp(86px, 11vw, 136px);
  height: clamp(26px, 3vw, 38px);
  background:
    linear-gradient(90deg, rgba(246, 201, 83, 0.5), rgba(55, 183, 214, 0.42)),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.2) 0 2px,
      rgba(255, 255, 255, 0.05) 2px 9px
    );
  box-shadow: 0 7px 16px rgba(16, 37, 40, 0.12);
  clip-path: polygon(4% 7%, 96% 0, 100% 80%, 91% 100%, 3% 91%, 0 22%);
  pointer-events: none;
}

.hero-visual::before {
  top: -12px;
  left: -14px;
  transform: rotate(-15deg);
}

.hero-visual::after {
  right: -14px;
  bottom: -12px;
  transform: rotate(-13deg);
}

.hero-visual img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 10px solid var(--surface);
  box-shadow: var(--shadow);
  object-fit: cover;
  transform: rotate(1deg);
}

.class-showcase {
  grid-template-columns: var(--media-column) var(--content-column);
  align-items: stretch;
}

#posterCard[hidden] + .story-panel {
  grid-column: 1 / -1;
}

.signup-shell {
  grid-template-columns: var(--content-column) var(--media-column);
  scroll-margin-top: 96px;
}

.signup-shell:not(.has-video) {
  display: block;
  max-width: 880px;
  margin-right: auto;
  margin-left: auto;
}

.poster-card,
.video-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(251, 255, 253, 0.92);
  box-shadow: var(--shadow);
}

.poster-card {
  display: block;
  cursor: zoom-in;
}

.poster-card:not([hidden]) + .story-panel {
  min-height: 100%;
}

.poster-frame {
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: zoom-in;
}

.poster-frame[hidden] {
  display: none;
}

.poster-frame img {
  display: block;
  width: 100%;
  height: auto;
}

.video-card {
  position: relative;
  isolation: isolate;
  aspect-ratio: 9 / 16;
  align-self: start;
  background: #000;
  contain: layout paint;
}

@media (min-width: 901px) {
  .signup-shell {
    align-items: stretch;
  }

  .signup-shell .video-card {
    align-self: stretch;
    height: 100%;
    min-height: 100%;
    aspect-ratio: auto;
  }
}

.video-play-card {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  background: #000;
  color: #fff;
  cursor: pointer;
}

.video-play-card[hidden] {
  display: none;
}

.video-play-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.72;
}

.video-play-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(16, 37, 40, 0.05), rgba(16, 37, 40, 0.42));
}

.video-play-icon,
.video-status {
  z-index: 1;
}

.video-play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  width: 74px;
  height: 74px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  background: rgba(16, 37, 40, 0.64);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
  font-size: 1.9rem;
  line-height: 1;
  transform: translate(-50%, -50%);
}

.video-status {
  position: absolute;
  top: calc(50% + 52px);
  left: 50%;
  transform: translateX(-50%);
  border-radius: 999px;
  padding: 8px 14px;
  background: rgba(16, 37, 40, 0.68);
  font-size: 0.9rem;
  font-weight: 900;
  white-space: nowrap;
}

.video-card.is-loading .video-play-icon {
  border: 4px solid rgba(255, 255, 255, 0.28);
  border-top-color: #fff;
  background: rgba(16, 37, 40, 0.48);
  color: transparent;
  animation: spin 0.9s linear infinite;
}

.video-card.is-playing .video-play-card {
  display: none;
}

.poster-video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  background: #000;
  object-fit: cover;
}

.poster-video[hidden] {
  display: none;
}

.poster-open-button:focus-visible {
  outline: 4px solid rgba(55, 183, 214, 0.25);
  outline-offset: 4px;
}

.story-panel,
.form-panel,
.roster-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(251, 255, 253, 0.92);
  box-shadow: var(--shadow);
}

.story-panel {
  position: relative;
  display: grid;
  align-content: center;
  gap: 10px;
  padding: clamp(28px, 4vw, 42px);
  overflow: hidden;
}

.story-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(55, 183, 214, 0.14), transparent 42%),
    linear-gradient(315deg, rgba(246, 201, 83, 0.18), transparent 44%);
  pointer-events: none;
}

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

.story-panel .eyebrow,
.story-panel h2 {
  margin-bottom: 0;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--teal);
  font-size: 0.88rem;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 10px;
  font-size: clamp(2.2rem, 4.8vw, 4.1rem);
  line-height: 1.06;
  letter-spacing: 0;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.story-panel h2,
.section-heading h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.08;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.lead {
  max-width: 620px;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.22rem);
  line-height: 1.65;
  font-weight: 720;
  word-break: keep-all;
}

.lesson-list {
  display: grid;
  gap: 0;
  margin: 8px 0 0;
  font-size: 1.125rem;
}

.lesson-list div {
  position: relative;
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  border-top: 0;
  padding: 15px 0;
}

.lesson-list div + div::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 1px;
  background: rgba(16, 37, 40, 0.1);
}

dt {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  color: var(--teal);
  font-weight: 950;
}

dd {
  margin: 0;
  font-weight: 900;
  line-height: 1.45;
}

#lessonPlaceText,
.space-fee {
  word-break: keep-all;
  overflow-wrap: anywhere;
}

#lessonPlaceText {
  white-space: pre-line;
}

.map-place {
  display: grid;
  gap: 9px;
  justify-items: start;
}

.map-app-links {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.map-app-links[hidden],
.map-app-link[hidden] {
  display: none;
}

.map-app-link {
  display: inline-grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 0;
  border-radius: 16px;
  background: transparent;
  box-shadow: none;
  text-decoration: none;
  transition: transform 0.16s ease;
}

.map-app-link:hover {
  transform: translateY(-1px);
}

.map-app-link img {
  display: block;
  width: 56px;
  height: 56px;
  border-radius: 15px;
  box-shadow: 0 8px 18px rgba(16, 37, 40, 0.12);
  object-fit: contain;
}

.space-fee {
  display: block;
  margin: 4px 0 0;
  color: rgba(16, 37, 40, 0.52);
  font-size: 0.92rem;
  font-weight: 650;
  line-height: 1.45;
}

.form-panel {
  display: grid;
  gap: 22px;
  padding: clamp(26px, 4vw, 38px);
}

.form-heading h2,
.students-title-row h1,
.roster-head h2 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.08;
  word-break: keep-all;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 18px;
}

.field-grid label,
.radio-field {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.field-grid .wide {
  grid-column: 1 / -1;
  margin-top: 14px;
}

.field-grid .is-hidden {
  display: none;
}

#referrerField {
  grid-column: 2;
  margin-top: -2px;
}

label > span,
.radio-field legend {
  font-size: 1rem;
  font-weight: 950;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 15px;
  background: var(--surface);
  color: var(--ink);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 4px rgba(55, 183, 214, 0.2);
}

.radio-field {
  border: 0;
  margin: 0;
  padding: 0;
  grid-template-columns: 1fr 1fr;
  column-gap: 10px;
  row-gap: 14px;
}

.radio-field legend,
.radio-field .field-error {
  grid-column: 1 / -1;
}

.radio-field label {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 14px;
  background: var(--surface);
  font-weight: 850;
}

.radio-field input {
  width: 18px;
  height: 18px;
}

.submit-button,
.students-title-row button {
  min-height: 56px;
  border: 0;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 950;
  cursor: pointer;
}

.submit-button:disabled {
  cursor: not-allowed;
  opacity: 0.66;
}

.students-title-row button {
  min-height: 42px;
  border: 1px solid #be9a2b;
  padding: 0 16px;
  background: var(--yellow);
  color: var(--ink);
}

.field-error,
.form-status {
  min-height: 18px;
  color: #b84d3d;
  font-size: 0.9rem;
  font-weight: 850;
}

.form-status {
  margin: -8px 0 0;
}

.submitting-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(16, 37, 40, 0.5);
}

.submitting-overlay[hidden] {
  display: none;
}

.submitting-overlay > div,
.complete-dialog {
  width: min(420px, calc(100% - 34px));
  border: 0;
  border-radius: 8px;
  padding: 28px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}

.submitting-overlay > div {
  display: grid;
  justify-items: center;
  gap: 10px;
}

.submitting-overlay strong,
.submitting-overlay p {
  margin: 0;
}

.spinner {
  width: 32px;
  height: 32px;
  display: inline-block;
  border: 4px solid rgba(55, 183, 214, 0.22);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.complete-dialog::backdrop {
  background: rgba(16, 37, 40, 0.6);
}

.poster-dialog {
  border: 0;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.poster-dialog::backdrop {
  background: rgba(16, 37, 40, 0.62);
}

.poster-dialog {
  width: min(860px, calc(100% - 28px));
  padding: 0;
}

.poster-dialog img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 88vh;
  margin: 0 auto;
  object-fit: contain;
  background: var(--panel);
}

.complete-dialog h2 {
  margin-top: 18px;
}

.complete-dialog p {
  color: var(--muted);
  font-weight: 750;
  line-height: 1.55;
}

.complete-dialog a {
  width: 100%;
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
}

.students-main {
  padding: clamp(42px, 8vw, 82px) 0 80px;
}

.students-hero {
  margin-bottom: 28px;
}

.students-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
}

.summary-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.summary-cards article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background: var(--surface);
}

.summary-cards span {
  color: var(--teal);
  font-weight: 950;
}

.summary-cards strong {
  display: block;
  margin-top: 8px;
  font-size: 2rem;
}

.roster-panel {
  padding: clamp(26px, 4vw, 42px);
}

.roster-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
}

.loading-state,
.empty-state {
  display: grid;
  gap: 12px;
  justify-items: center;
  padding: 44px 20px;
  color: var(--muted);
  font-weight: 850;
}

.page-loading {
  grid-template-columns: auto 1fr;
  justify-items: start;
  align-items: center;
  margin: -6px 0 18px;
  border: 1px solid rgba(16, 37, 40, 0.12);
  border-radius: 8px;
  padding: 16px 18px;
  background: rgba(251, 255, 253, 0.9);
  box-shadow: 0 8px 22px rgba(16, 37, 40, 0.08);
}

.page-loading .spinner {
  width: 28px;
  height: 28px;
  border-width: 3px;
}

.loading-state[hidden],
.empty-state[hidden],
.gender-roster[hidden] {
  display: none;
}

.gender-roster {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid rgba(16, 37, 40, 0.12);
  border-radius: 8px;
  background: var(--surface);
}

.roster-column {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  padding: clamp(16px, 3vw, 22px);
}

.roster-column + .roster-column {
  border-left: 1px solid rgba(16, 37, 40, 0.1);
}

.gender-roster-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--teal);
}

.gender-roster-head h2 {
  margin: 0;
  font-size: clamp(1.1rem, 2.3vw, 1.35rem);
  line-height: 1.2;
}

.gender-roster-head span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 950;
  white-space: nowrap;
}

.roster-list {
  display: grid;
  gap: 8px;
}

.roster-person {
  display: flex;
  min-width: 0;
  min-height: 34px;
  align-items: center;
}

.roster-person strong {
  min-width: 0;
  overflow: hidden;
  font-size: 1rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.roster-empty {
  margin: 0;
  padding: 8px 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 60;
  transform: translateX(-50%);
  border-radius: 999px;
  padding: 12px 18px;
  background: var(--ink);
  color: #fff;
  font-weight: 850;
}

body.is-submitting {
  cursor: progress;
}

@media (max-width: 900px) {
  .site-header {
    min-height: 78px;
    grid-template-columns: 1fr auto;
    gap: 12px;
  }

  .brand {
    grid-column: 1;
    justify-self: start;
  }

  .brand img {
    width: 104px;
  }

  .site-header nav {
    grid-column: 2;
  }

  .oneday-main,
  .students-main {
    width: min(100% - 28px, 680px);
  }

  .hero-section,
  .class-showcase,
  .signup-shell {
    grid-template-columns: 1fr;
  }

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

  .hero-visual img {
    transform: none;
  }

  .hero-visual::before {
    left: 0;
  }

  .hero-visual::after {
    right: 0;
  }

  #posterCard[hidden] + .story-panel {
    grid-column: auto;
  }

  .field-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  #referrerField {
    grid-column: 1 / -1;
  }

  input,
  select,
  textarea {
    padding: 12px 13px;
  }
}

@media (max-width: 560px) {
  .site-header {
    padding: 12px 14px;
  }

  .brand img {
    width: 94px;
  }

  .site-header nav {
    gap: 6px;
  }

  .site-header nav a {
    min-height: 38px;
    padding: 0 11px;
    font-size: 0.88rem;
  }

  h1 {
    font-size: clamp(2rem, 10vw, 2.7rem);
  }

  .story-panel,
  .form-panel,
  .roster-panel {
    padding: 22px 18px;
  }

  .lesson-list div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .radio-field {
    column-gap: 8px;
    row-gap: 12px;
  }

  .radio-field label {
    padding: 11px 12px;
  }

  .summary-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .summary-cards article {
    padding: 14px 10px;
  }

  .summary-cards span {
    font-size: 0.82rem;
  }

  .summary-cards strong {
    margin-top: 5px;
    font-size: 1.5rem;
  }

  .students-title-row {
    grid-template-columns: 1fr;
  }

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

  .roster-column + .roster-column {
    border-left: 1px solid rgba(16, 37, 40, 0.1);
    border-top: 0;
  }

  .roster-column {
    gap: 10px;
    padding: 14px 10px;
  }

  .gender-roster-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .gender-roster-head h2 {
    font-size: 1rem;
  }

  .roster-list {
    gap: 6px;
  }

  .roster-person {
    min-height: 30px;
  }

  .roster-person strong {
    font-size: 0.92rem;
  }
}
