@import url("https://fonts.googleapis.com/css2?family=Jua&display=swap");

:root {
  --bg: #fffaf0;
  --paper: #ffffff;
  --ink: #2f2a24;
  --muted: #756b61;
  --sun: #f7b84b;
  --sun-deep: #ed9d21;
  --peach: #ffd9a8;
  --cream: #fff0ce;
  --green: #7ca982;
  --line: #eadfce;
  --shadow: 0 20px 60px rgba(89, 65, 35, .12);
  --radius: 28px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 10%, rgba(247,184,75,.14), transparent 22%),
    radial-gradient(circle at 88% 18%, rgba(124,169,130,.10), transparent 18%),
    var(--bg);
  line-height: 1.65;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(20px, 4vw, 64px);
  background: rgba(255,250,240,.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(234,223,206,.85);
}
.brand { display:flex; align-items:center; gap:10px; font-weight:900; letter-spacing:-.03em; }
.brand-mark { display:grid; place-items:center; width:34px; height:34px; border-radius:50%; background:var(--sun); color:#fff; box-shadow:0 8px 20px rgba(237,157,33,.25); }
.nav { display:flex; gap:22px; font-size:14px; font-weight:700; color:#5e554c; }
.nav a:hover { color:var(--sun-deep); }
.menu-btn { display:none; border:0; background:transparent; font-size:24px; cursor:pointer; }

.hero {
  position: relative;
  overflow: hidden;
  min-height: 760px;
  display:grid;
  grid-template-columns: 1fr 1fr;
  align-items:center;
  gap:56px;
  padding: 72px clamp(24px, 7vw, 120px) 88px;
}
.hero-inner, .hero-card { position:relative; z-index:2; }
.eyebrow, .section-kicker { margin:0 0 10px; color:var(--sun-deep); font-size:13px; font-weight:900; letter-spacing:.16em; }
.hero h1 { margin:0; font-family:"Jua", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif; font-weight:400; font-size:clamp(35px, 4.7vw, 68px); line-height:1.18; letter-spacing:-.035em; filter:drop-shadow(0 5px 0 rgba(255,255,255,.85)); }
.hero h1 .title-line { display:block; white-space:nowrap; color:#403329; }
.hero h1 .title-line.accent { color:#ed921b; text-shadow:2px 3px 0 rgba(255,255,255,.95), 4px 6px 0 rgba(250,191,88,.18); }
.hero-copy { margin:28px 0 20px; font-size:clamp(17px, 1.7vw, 22px); color:#5d554d; }
.tags { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:30px; }
.tags span { padding:8px 12px; border-radius:999px; background:#fff; border:1px solid var(--line); font-weight:700; font-size:13px; }
.hero-actions { display:flex; flex-wrap:wrap; gap:12px; }
.btn { display:inline-flex; justify-content:center; align-items:center; min-height:48px; padding:0 20px; border-radius:999px; font-weight:900; transition:.2s ease; }
.btn.primary { background:linear-gradient(135deg,var(--sun),var(--sun-deep)); color:white; box-shadow:0 12px 28px rgba(237,157,33,.28); }
.btn.primary:hover { transform:translateY(-2px); }
.btn.secondary { background:#fff; border:1px solid var(--line); }
.btn.disabled { opacity:.55; pointer-events:none; }

.hero-card { background:#fff; border:1px solid rgba(234,223,206,.9); border-radius:34px; box-shadow:var(--shadow); padding:16px; transform:rotate(2deg); }
.placeholder-photo {
  min-height:560px;
  border-radius:24px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.10) 40%, rgba(255,255,255,.88)),
    url('images/cover.webp') center/cover no-repeat;
  display:flex;
  flex-direction:column;
  justify-content:flex-end;
  gap:10px;
  padding:24px;
  font-weight:900;
}
.photo-chip {
  display:inline-flex;
  width:fit-content;
  padding:7px 12px;
  border-radius:999px;
  background:rgba(255,255,255,.86);
  border:1px solid rgba(255,255,255,.9);
  backdrop-filter:blur(10px);
}
.photo-caption {
  padding:16px 18px;
  border-radius:18px;
  background:rgba(255,250,240,.86);
  backdrop-filter:blur(12px);
}
.photo-caption span { display:block; }
.photo-caption small { display:block; font-weight:600; color:#6c6258; }
.sun { position:absolute; border-radius:50%; filter:blur(.2px); opacity:.45; }
.sun-1 { width:260px; height:260px; background:var(--sun); right:-80px; top:120px; }
.sun-2 { width:120px; height:120px; background:#9bc0a0; left:42%; bottom:40px; opacity:.25; }

.section { max-width:1180px; margin:0 auto; padding:90px 28px; }
.section.narrow { max-width:980px; }
.section-head { margin-bottom:34px; }
.section-head h2 { margin:0 0 8px; font-size:clamp(32px, 4vw, 52px); letter-spacing:-.045em; }
.section-head p:last-child { color:var(--muted); margin:0; }
.story-card, .guide-box { background:#fff; border:1px solid var(--line); border-radius:var(--radius); padding:32px; box-shadow:0 14px 40px rgba(89,65,35,.08); }
.lead { font-size:20px; }
.story-description { font-size:18px; line-height:1.9; }
.story-description h3 { margin:0 0 12px; font-size:clamp(26px,3vw,35px); color:#a96613; }
.story-description p { margin:0 0 19px; }
.story-description .story-quote { font-size:clamp(19px,2.5vw,25px); font-weight:800; color:#3a3126; margin-bottom:30px; }
.story-description .story-closing { font-weight:800; color:#a96613; margin:30px 0 0; }
.info-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:18px; }
.info-card { background:#fff; border:1px solid var(--line); border-radius:24px; padding:26px; min-height:210px; }
.info-card .icon { font-size:34px; }
.info-card h3 { font-size:20px; margin:14px 0 8px; }
.info-card p { color:var(--muted); margin:0; }

.characters-section { padding-top:72px; }
.split-head { display:flex; align-items:end; justify-content:space-between; gap:24px; }
.spoiler-switch { display:flex; align-items:center; gap:10px; cursor:pointer; user-select:none; font-weight:800; white-space:nowrap; }
.spoiler-switch input { position:absolute; opacity:0; pointer-events:none; }
.switch-ui { width:46px; height:26px; border-radius:999px; background:#d8cec0; position:relative; transition:.2s; }
.switch-ui::after { content:""; position:absolute; width:20px; height:20px; left:3px; top:3px; border-radius:50%; background:#fff; transition:.2s; box-shadow:0 2px 7px rgba(0,0,0,.14); }
.spoiler-switch input:checked + .switch-ui { background:var(--green); }
.spoiler-switch input:checked + .switch-ui::after { transform:translateX(20px); }

.character-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:24px; }
.character-card { overflow:hidden; border:1px solid var(--line); border-radius:30px; background:#fff; box-shadow:0 16px 44px rgba(89,65,35,.08); }
.character-image { min-height:460px; display:flex; flex-direction:column; justify-content:flex-end; padding:22px; background-position:center; background-size:cover; }


.character-body { padding:24px; }
.character-label { margin:0 0 4px; color:var(--sun-deep); font-size:11px; font-weight:900; letter-spacing:.14em; }
.character-body h3 { margin:0 0 8px; font-size:28px; }
.character-summary { color:var(--muted); }
.detail-btn { width:100%; border:1px solid var(--line); background:#fffaf2; border-radius:14px; padding:12px 14px; font-weight:900; cursor:pointer; }
.character-detail { padding-top:18px; }
dl { margin:0; }
dl div { display:grid; grid-template-columns:76px 1fr; gap:10px; padding:8px 0; border-bottom:1px dashed #eee2d2; }
dt { font-weight:900; }
dd { margin:0; color:var(--muted); }
.spoiler-box { display:none; margin-top:16px; padding:16px; background:#f6efe7; border-radius:14px; color:#61564c; }
body.show-spoiler .spoiler-box { display:block; }

.timeline-section { max-width:980px; }
.timeline { position:relative; padding-left:34px; }
.timeline::before { content:""; position:absolute; left:9px; top:8px; bottom:8px; width:2px; background:linear-gradient(var(--sun),#eadfce); }
.timeline article { position:relative; background:#fff; border:1px solid var(--line); border-radius:22px; padding:24px; margin:0 0 18px; }
.dot { position:absolute; width:18px; height:18px; left:-34px; top:30px; border-radius:50%; background:var(--sun); border:4px solid var(--bg); box-shadow:0 0 0 2px var(--sun); }
.step { margin:0; font-size:12px; font-weight:900; color:var(--sun-deep); letter-spacing:.16em; }
.timeline h3 { margin:5px 0 6px; }
.timeline p:last-child { margin:0; color:var(--muted); }
.guide-box ol { margin:0; padding-left:22px; }
.guide-box li { padding:7px 0; }

.cta-section { max-width:1180px; margin:20px auto 90px; padding:38px 42px; border-radius:32px; background:linear-gradient(135deg,#2f2a24,#4f453a); color:#fff; display:flex; align-items:center; justify-content:space-between; gap:28px; }
.cta-section h2 { margin:0 0 8px; font-size:clamp(28px,4vw,44px); }
.cta-section p { margin:0; color:#e9dfd4; }
footer { padding:32px 24px 46px; text-align:center; color:#776d63; font-size:13px; border-top:1px solid var(--line); }
footer p { margin:4px 0; }
.footer-note { font-size:12px; }

@media (max-width: 960px) {
  .hero {
    grid-template-columns:1fr;
    min-height:auto;
    padding:56px 22px 64px;
    gap:34px;
  }
  .hero-card { max-width:720px; width:100%; justify-self:center; transform:none; }
}

@media (max-width: 860px) {
  .topbar { padding:14px 18px; }
  .menu-btn { display:block; }
  .nav { display:none; position:absolute; left:16px; right:16px; top:66px; padding:16px; border:1px solid var(--line); border-radius:18px; background:#fff; box-shadow:var(--shadow); flex-direction:column; }
  .nav.open { display:flex; }
  .placeholder-photo { min-height:420px; }
  .info-grid, .character-grid { grid-template-columns:1fr; }
  .split-head { align-items:flex-start; flex-direction:column; }
  .character-image { min-height:360px; }
  .cta-section { margin:10px 18px 70px; padding:30px 24px; flex-direction:column; align-items:flex-start; }
}

@media (max-width: 520px) {
  .hero h1 { font-size:clamp(31px, 9vw, 42px); }
  .story-description { font-size:16px; }
  .section { padding:68px 18px; }
  .story-card, .guide-box { padding:22px; border-radius:22px; }
  .info-card { min-height:auto; }
  .character-body { padding:20px; }
}

/* Character introduction v6 */
.character-group { margin-top: 44px; }
.character-group + .character-group { margin-top: 76px; }
.group-title { display:flex; align-items:center; gap:14px; margin-bottom:22px; }
.group-icon { display:grid; place-items:center; width:52px; height:52px; border-radius:18px; background:#fff3d4; font-size:24px; box-shadow:0 8px 24px rgba(89,65,35,.08); }
.group-title p { margin:0 0 2px; font-size:11px; font-weight:900; letter-spacing:.18em; color:var(--sun-deep); }
.group-title h3 { margin:0; font-size:27px; }
.character-main-image { display:block; width:100%; aspect-ratio:1 / 1; object-fit:cover; background:#f7f0e7; }
.mini-gallery { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin-top:4px; }
.mini-gallery img { width:100%; aspect-ratio:1 / 1; object-fit:cover; border-radius:12px; border:1px solid var(--line); cursor:zoom-in; transition:transform .18s ease, box-shadow .18s ease; }
.mini-gallery img:hover { transform:translateY(-2px); box-shadow:0 8px 20px rgba(89,65,35,.14); }
.teachers-grid { grid-template-columns:repeat(3,1fr); }
@media (max-width: 980px) { .teachers-grid { grid-template-columns:repeat(2,1fr); } }
@media (max-width: 860px) { .teachers-grid { grid-template-columns:1fr; } }


/* v8: Keep every image fully visible without zooming or cropping. */
.hero-cover-image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: contain;
  object-position: center center;
  border-radius: 24px;
  background: #fff7e9;
}
.character-main-image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  object-position: center center;
  background: #fff7eb;
}
.mini-gallery img {
  display: block;
  height: auto;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  object-position: center center;
  background: #fff7eb;
}


/* v9: Fade slideshow for character images */
.character-main-image { transition: opacity .45s ease-in-out; }
.character-main-image.is-fading { opacity: 0; }

/* v10: Character birth-year and age metadata */
.character-meta { margin: 0 0 12px; font-size: 14px; font-weight: 750; color: #a26618; line-height: 1.5; }

/* v11: Main cover cross-fade, full image with no crop */
.hero-card { position: relative; aspect-ratio: 2 / 3; overflow: hidden; background: #fff7e9; }
.hero-cover-slide { position: absolute; inset: 16px; width: calc(100% - 32px); height: calc(100% - 32px); display: block; object-fit: contain; object-position: center; border-radius: 24px; opacity: 0; transition: opacity 800ms ease-in-out; }
.hero-cover-slide.is-visible { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .hero-cover-slide { transition: none; } }
