:root {
  --crimson: #c8102e;
  --crimson-dark: #9c0c22;
  --cream: #faf6f0;
  --cream-deep: #f1e9dc;
  --ink: #2b2420;
  --ink-soft: #6b5f54;
  --border: #e7ddcd;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(43, 36, 32, 0.08);
  --max: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Noto Sans KR", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.65;
}

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

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

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */
header.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 246, 240, 0.94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  max-width: var(--max);
  margin: 0 auto;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand img { width: 40px; height: 40px; }

.brand-text .name {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.2px;
}

.brand-text .tagline {
  font-size: 0.78rem;
  color: var(--ink-soft);
}

nav.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

nav.main-nav a {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink);
  transition: background 0.15s ease, color 0.15s ease;
}

nav.main-nav a:hover { background: var(--cream-deep); }

nav.main-nav a.active {
  background: var(--crimson);
  color: #fff;
}

.lang-toggle {
  display: flex;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  background: #fff;
}

.lang-toggle button {
  border: none;
  background: transparent;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--ink-soft);
}

.lang-toggle button.active {
  background: var(--crimson);
  color: #fff;
}

.nav-toggle {
  display: none;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 62vh;
  display: flex;
  align-items: center;
  color: #fff;
  background: linear-gradient(180deg, rgba(30, 18, 10, 0.55), rgba(20, 12, 8, 0.72)), url("../img/hero-autumn-road.jpg") center/cover no-repeat;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
  gap: 40px;
  padding: 70px 24px;
  max-width: var(--max);
  margin: 0 auto;
}

.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  margin: 0 0 14px;
  line-height: 1.3;
}

.hero p.lead {
  font-size: 1.05rem;
  color: #f0e9df;
  margin: 0 0 24px;
  max-width: 46ch;
}

.hero-figure img {
  border-radius: var(--radius);
  box-shadow: 0 20px 45px rgba(0,0,0,0.35);
  background: #fff2e0;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--crimson);
  color: #fff;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.btn:hover { background: var(--crimson-dark); }
.btn:active { transform: translateY(1px); }

.btn-outline {
  background: transparent;
  border: 1.5px solid rgba(255,255,255,0.8);
}
.btn-outline:hover { background: rgba(255,255,255,0.12); }

/* ---------- Sections ---------- */
section { padding: 64px 0; }

.section-title {
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  font-weight: 700;
  margin: 0 0 8px;
}

.section-sub {
  color: var(--ink-soft);
  margin: 0 0 36px;
  max-width: 70ch;
}

.section-head { margin-bottom: 36px; }

/* level cards */
.level-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.level-card {
  background: url("../img/chalkboard-bg.jpg") center/cover no-repeat;
  border-radius: var(--radius);
  padding: 28px 24px;
  color: #eafbea;
  box-shadow: var(--shadow);
  min-height: 210px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.level-card .tag {
  align-self: flex-start;
  background: rgba(255,255,255,0.15);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.level-card h3 { margin: 0; font-size: 1.3rem; }
.level-card .codes { font-size: 0.85rem; opacity: 0.85; margin-bottom: 4px; }
.level-card ul { margin: 0; padding-left: 18px; font-size: 0.9rem; }
.level-card li { margin-bottom: 4px; }

/* notice / semester box */
.notice-box {
  background: #fff;
  border: 1px solid var(--border);
  border-left: 6px solid var(--crimson);
  border-radius: var(--radius);
  padding: 30px 32px;
  box-shadow: var(--shadow);
}

.notice-box h3 {
  margin: 0 0 16px;
  font-size: 1.2rem;
}

.notice-box dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 20px;
  margin: 0;
}

.notice-box dt { font-weight: 700; color: var(--ink-soft); white-space: nowrap; }
.notice-box dd { margin: 0; }

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

/* teacher cards */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}

.team-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.team-card .avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--crimson);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  margin-bottom: 12px;
}

.team-card .name { font-weight: 700; margin-bottom: 2px; }
.team-card .role { font-size: 0.84rem; color: var(--crimson); margin-bottom: 8px; font-weight: 600; }
.team-card .meta { font-size: 0.84rem; color: var(--ink-soft); }
.team-card .meta a { color: var(--ink-soft); text-decoration: underline; }

/* about hero image band */
.image-band {
  height: 240px;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 40px;
}
.image-band img { width: 100%; height: 100%; object-fit: cover; }

.prose p { margin: 0 0 16px; color: var(--ink); }

/* class page */
.doc-list {
  display: grid;
  gap: 10px;
  margin: 0 0 48px;
}
.doc-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
  font-weight: 600;
  transition: border-color 0.15s ease;
}
.doc-list a:hover { border-color: var(--crimson); }
.doc-list a .arrow { color: var(--crimson); font-weight: 700; }

.level-list {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.level-row {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--border);
}
.level-row:last-child { border-bottom: none; }

.level-row .book-thumb {
  flex: 0 0 96px;
  width: 96px;
  aspect-ratio: 3 / 4;
  border-radius: 8px;
  overflow: hidden;
  background: var(--cream-deep);
  border: 1px solid var(--border);
}
.level-row .book-thumb img { width: 100%; height: 100%; object-fit: cover; }

.level-row .divider {
  align-self: stretch;
  width: 2px;
  background: var(--crimson);
  opacity: 0.25;
  border-radius: 2px;
  flex-shrink: 0;
}

.level-row .content { flex: 1; min-width: 0; }
.level-row h3 { margin: 0 0 2px; font-size: 1.1rem; }
.level-row .codes { font-size: 0.8rem; color: var(--ink-soft); margin-bottom: 8px; }
.level-row p { font-size: 0.9rem; margin: 0; }

.level-row .btn { flex-shrink: 0; padding: 9px 18px; font-size: 0.85rem; }

/* gallery */
.gallery-section { margin-bottom: 44px; }
.gallery-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--crimson);
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.gallery-item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  cursor: pointer;
  box-shadow: var(--shadow);
  background: var(--cream-deep);
}
.gallery-item img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.3s ease;
}
.gallery-item:hover img { transform: scale(1.06); }
.gallery-item .caption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 10px 12px 8px;
  font-size: 0.82rem;
  color: #fff;
  background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,0.65));
}

.lightbox {
  position: fixed; inset: 0; background: rgba(15,10,8,0.9);
  display: none; align-items: center; justify-content: center;
  z-index: 1000; padding: 32px;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: min(90vw, 900px); max-height: 82vh; border-radius: 10px; }
.lightbox .caption { color: #fff; text-align: center; margin-top: 14px; }
.lightbox .close {
  position: absolute; top: 24px; right: 28px;
  color: #fff; font-size: 1.8rem; cursor: pointer; line-height: 1;
  background: rgba(255,255,255,0.1); width: 42px; height: 42px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
}

/* contact */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
  align-items: start;
}

.map-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.map-wrap iframe { width: 100%; height: 420px; border: 0; display: block; }

.school-address {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-top: 20px;
  box-shadow: var(--shadow);
}
.school-address h4 { margin: 0 0 8px; }
.school-address p { margin: 2px 0; color: var(--ink-soft); font-size: 0.92rem; }

form.contact-form {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 16px;
}

.field { display: grid; gap: 6px; }
.field label { font-size: 0.86rem; font-weight: 700; color: var(--ink-soft); }
.field input, .field textarea {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  font: inherit;
  color: var(--ink);
  background: var(--cream);
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--crimson);
  background: #fff;
}
.field textarea { min-height: 130px; resize: vertical; }

.form-note {
  font-size: 0.82rem;
  color: var(--ink-soft);
  background: var(--cream-deep);
  border-radius: 8px;
  padding: 10px 12px;
}

.form-status {
  font-size: 0.9rem;
  font-weight: 600;
  display: none;
  padding: 10px 12px;
  border-radius: 8px;
}
.form-status.show { display: block; }
.form-status.ok { background: #e8f6ea; color: #1e7b34; }
.form-status.err { background: #fbe9e9; color: var(--crimson-dark); }

/* footer */
footer.site-footer {
  background: #221812;
  color: #e9ddcf;
  padding: 40px 0 28px;
  margin-top: 40px;
}
footer.site-footer .foot-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 20px;
}
footer.site-footer .name { font-weight: 700; color: #fff; margin-bottom: 6px; }
footer.site-footer p { margin: 2px 0; font-size: 0.88rem; color: #cfc0ae; }
footer.site-footer .foot-nav { display: flex; gap: 16px; flex-wrap: wrap; }
footer.site-footer .foot-nav a { font-size: 0.88rem; color: #e9ddcf; }
footer.site-footer .foot-nav a:hover { color: #fff; text-decoration: underline; }
footer.site-footer .copyright {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 0.8rem;
  color: #9a8b78;
}

/* lang visibility */
[data-ko] { display: none; }
html[lang="ko"] [data-ko] { display: revert; }
html[lang="ko"] [data-en] { display: none; }

/* responsive */
@media (max-width: 880px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-figure { max-width: 320px; margin: 0 auto; }
  .level-grid { grid-template-columns: 1fr 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  nav.main-nav { display: none; }
  nav.main-nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--cream);
    border-bottom: 1px solid var(--border);
    padding: 10px 24px 18px;
  }
  .nav-toggle { display: block; }
  .level-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .notice-box dl { grid-template-columns: 1fr; }
  .level-row { flex-wrap: wrap; }
  .level-row .divider { display: none; }
  .level-row .btn { width: 100%; text-align: center; }
}
