:root {
  --bg: #fffdf8;
  --surface: #ffffff;
  --text: #252520;
  --muted: #77746b;
  --line: #e9e3d8;
  --soft: #eef5ff;
  --red: #2c7be5;
  --red-dark: #1b5fc0;
  --shadow: 0 18px 50px rgba(37, 37, 32, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(44, 123, 229, 0.08), transparent 30rem),
    linear-gradient(180deg, #fffefa 0%, var(--bg) 100%);
  color: var(--text);
  font-family:
    Pretendard,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  letter-spacing: 0;
}

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

.shell {
  width: min(100%, 780px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 48px 22px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 30px;
}

.profile {
  display: grid;
  grid-template-columns: 132px 1fr;
  align-items: center;
  gap: 24px;
}

.logo {
  width: 132px;
  aspect-ratio: 1;
  display: block;
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow);
  object-fit: cover;
}

.intro {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--red-dark);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(40px, 8vw, 64px);
  line-height: 1;
  letter-spacing: 0;
}

.subtitle {
  max-width: 28rem;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
  word-break: keep-all;
}

.link-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.link-item {
  min-height: 108px;
  display: grid;
  grid-template-columns: 46px 1fr;
  grid-template-rows: auto 1fr;
  align-items: center;
  gap: 12px 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 26px rgba(37, 37, 32, 0.06);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease,
    background 160ms ease;
}

.link-item:hover,
.link-item:focus-visible {
  border-color: rgba(44, 123, 229, 0.36);
  background: var(--soft);
  box-shadow: 0 16px 34px rgba(37, 37, 32, 0.11);
  transform: translateY(-2px);
}

.link-item:focus-visible {
  outline: 3px solid rgba(44, 123, 229, 0.22);
  outline-offset: 3px;
}

.link-item.accent .icon {
  background: #ffffff;
  color: var(--red);
  border-color: rgba(44, 123, 229, 0.3);
}

.icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
}

.icon {
  width: 46px;
  height: 46px;
  border: 1px solid #2d2d27;
  border-radius: 50%;
  background: #ffffff;
  color: #2d2d27;
  font-size: 16px;
  font-weight: 900;
}

.icon svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.slot-icon {
  background: #fff3ee;
  color: #f05a28;
  border-color: rgba(240, 90, 40, 0.28);
}

.slot-icon svg {
  fill: rgba(240, 90, 40, 0.14);
}

.hands-icon {
  background: #eef7ff;
  color: #2c7be5;
  border-color: rgba(44, 123, 229, 0.28);
}

.hands-icon svg {
  fill: rgba(44, 123, 229, 0.12);
}

.trophy-icon {
  background: #fff8db;
  color: #d99a00;
  border-color: rgba(217, 154, 0, 0.32);
}

.trophy-icon svg {
  fill: rgba(217, 154, 0, 0.18);
}

.youtube-icon svg {
  width: 28px;
  height: 28px;
  color: var(--red);
  fill: var(--red);
  stroke: none;
}

.youtube-icon .play {
  fill: #ffffff;
}

.kakao-icon {
  background: #fee500;
  color: #3a1d1d;
  border-color: rgba(58, 29, 29, 0.25);
}

.kakao-icon svg {
  fill: #3a1d1d;
  stroke: none;
}

.money-icon {
  background: #e7f8ee;
  color: #1f9d57;
  border-color: rgba(31, 157, 87, 0.3);
}

.money-icon svg {
  fill: rgba(31, 157, 87, 0.12);
}

.school-icon {
  background: #eaf2ff;
  color: #2c7be5;
  border-color: rgba(44, 123, 229, 0.28);
}

.school-icon svg {
  fill: rgba(44, 123, 229, 0.12);
}

.ai-icon {
  background: #e6faf4;
  color: #0ea597;
  border-color: rgba(14, 165, 151, 0.28);
}

.ai-icon svg {
  fill: rgba(14, 165, 151, 0.12);
}

.scholar-icon {
  background: #ecebff;
  color: #6366f1;
  border-color: rgba(99, 102, 241, 0.28);
}

.scholar-icon svg {
  fill: rgba(99, 102, 241, 0.12);
}

.news-icon {
  background: #fff2e2;
  color: #d97706;
  border-color: rgba(217, 119, 6, 0.3);
}

.news-icon svg {
  fill: rgba(217, 119, 6, 0.12);
}

.copy {
  grid-column: 1 / -1;
  min-width: 0;
  display: grid;
  gap: 5px;
  align-self: end;
}

.copy strong {
  font-size: 18px;
  line-height: 1.25;
}

.copy span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  word-break: keep-all;
}

/* 학년별 페이지 아코디언 */
.grades {
  display: block;
}

.grade-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 26px rgba(37, 37, 32, 0.06);
  overflow: hidden;
}

.grade-group > summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  grid-template-columns: 46px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 18px;
  transition: background 160ms ease;
}

.grade-group > summary::-webkit-details-marker {
  display: none;
}

.grade-group > summary:hover,
.grade-group > summary:focus-visible {
  background: var(--soft);
}

.grade-group > summary:focus-visible {
  outline: 3px solid rgba(44, 123, 229, 0.22);
  outline-offset: -3px;
}

.grade-icon {
  background: #f3ecff;
  color: #8b5cf6;
  border-color: rgba(139, 92, 246, 0.28);
}

.grade-icon svg {
  fill: rgba(139, 92, 246, 0.12);
}

.grade-group-copy {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.grade-group-copy strong {
  font-size: 18px;
  line-height: 1.25;
}

.grade-group-copy span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  word-break: keep-all;
}

.chevron {
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 180ms ease;
  justify-self: end;
  margin-right: 4px;
}

details[open] > summary .chevron {
  transform: rotate(-135deg);
}

.grade-items {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0 18px 18px;
}

.grade {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.grade > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 700;
  transition: background 160ms ease;
}

.grade > summary::-webkit-details-marker {
  display: none;
}

.grade > summary:hover,
.grade > summary:focus-visible {
  background: var(--soft);
}

.grade > summary:focus-visible {
  outline: 3px solid rgba(44, 123, 229, 0.22);
  outline-offset: -3px;
}

.grade-links {
  display: grid;
  gap: 6px;
  padding: 0 16px 14px;
}

.grade-links a {
  display: block;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  color: var(--text);
  font-size: 15px;
  line-height: 1.4;
  word-break: keep-all;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.grade-links a:hover,
.grade-links a:focus-visible {
  border-color: rgba(44, 123, 229, 0.36);
  box-shadow: 0 8px 20px rgba(37, 37, 32, 0.08);
  transform: translateY(-1px);
}

.grade-links a:focus-visible {
  outline: 3px solid rgba(44, 123, 229, 0.22);
  outline-offset: 2px;
}

.grade-empty {
  margin: 0;
  padding: 8px 2px 2px;
  color: var(--muted);
  font-size: 14px;
}

/* 페이지 등록 문의 — 하단 알약 버튼 */
.footer {
  display: flex;
  justify-content: center;
  padding-top: 4px;
}

.contact-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--muted);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(37, 37, 32, 0.05);
  transition:
    border-color 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.contact-pill:hover,
.contact-pill:focus-visible {
  border-color: rgba(44, 123, 229, 0.4);
  color: #2c7be5;
  box-shadow: 0 10px 22px rgba(37, 37, 32, 0.09);
  transform: translateY(-1px);
}

.contact-pill:focus-visible {
  outline: 3px solid rgba(44, 123, 229, 0.22);
  outline-offset: 3px;
}

.contact-pill .pill-icon {
  font-size: 15px;
}

/* 문의 팝업 */
.contact-dialog {
  width: min(92vw, 360px);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 30px 70px rgba(37, 37, 32, 0.28);
}

.contact-dialog::backdrop {
  background: rgba(20, 22, 28, 0.42);
}

.contact-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.contact-head .mail-icon {
  width: 34px;
  height: 34px;
  background: #eaf2ff;
  color: #2c7be5;
  border: 1px solid rgba(44, 123, 229, 0.28);
  border-radius: 10px;
}

.contact-head .mail-icon svg {
  width: 19px;
  height: 19px;
  fill: rgba(44, 123, 229, 0.12);
}

.contact-head strong {
  font-size: 18px;
}

.contact-desc {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  word-break: keep-all;
}

.email-field {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 6px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft);
}

.email-text {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  background: #2c7be5;
  color: #ffffff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition:
    background 160ms ease,
    transform 160ms ease;
}

.copy-btn:hover,
.copy-btn:focus-visible {
  background: #1b5fc0;
  transform: translateY(-1px);
}

.copy-btn:focus-visible {
  outline: 3px solid rgba(44, 123, 229, 0.3);
  outline-offset: 2px;
}

.copy-btn.copied {
  background: #1b9d57;
}

.copy-icon {
  display: inline-grid;
  place-items: center;
  width: 15px;
  height: 15px;
}

.copy-icon svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.contact-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  margin-top: 18px;
}

.mail-open {
  color: #2c7be5;
  font-size: 14px;
  font-weight: 700;
}

.mail-open:hover,
.mail-open:focus-visible {
  text-decoration: underline;
}

.close-btn {
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition:
    background 160ms ease,
    border-color 160ms ease;
}

.close-btn:hover,
.close-btn:focus-visible {
  background: #f1f3f7;
  border-color: #cfd6e0;
}

@media (max-width: 560px) {
  .shell {
    justify-content: flex-start;
    padding: 28px 16px;
    gap: 24px;
  }

  .profile {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 18px;
  }

  .logo {
    width: min(44vw, 156px);
    border-radius: 24px;
  }

  .subtitle {
    margin-inline: auto;
    font-size: 15px;
  }

  .link-item {
    grid-template-columns: 44px 1fr;
    grid-template-rows: auto;
    align-items: center;
    gap: 12px;
    min-height: 78px;
    padding: 14px;
  }

  .link-list {
    grid-template-columns: 1fr;
  }

  .grade-items {
    grid-template-columns: 1fr;
  }

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

  .copy strong {
    font-size: 16px;
  }

  .copy span {
    font-size: 13px;
  }

  .copy {
    grid-column: auto;
    align-self: center;
  }
}
