/* MSECM 가로 페이지 레이아웃 (2026-10 리디자인)
   구조: 고정 상단 메뉴 + 가로 트랙(페이지 6장, scroll-snap) + 페이지별 세로 스크롤 */

:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --ink: #0c1830;
  --ink-2: #4a556b;
  --line: #dbe1ea;
  --accent: #1d4ed8;
  --accent-ink: #ffffff;
  --accent-soft: #e7edfb;
  --mute: #b4bdcc;
  --nav-h: 68px;
  --gutter: clamp(16px, 4vw, 56px);
  --ease: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: 'Pretendard Variable', 'Pretendard', -apple-system, BlinkMacSystemFont,
               'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  font-weight: 480;
  color: var(--ink);
  background: var(--bg);
  overflow: hidden;
  word-break: keep-all;
  overflow-wrap: break-word;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── 상단 메뉴 ───────────────────────────── */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  height: var(--nav-h);
  display: flex; align-items: center; gap: 32px;
  padding: 0 var(--gutter);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.nav .logo { height: 34px; width: auto; }
.tabs { display: flex; gap: 4px; margin-left: auto; height: 100%; }
.tabs a {
  display: flex; align-items: center; height: 100%;
  padding: 0 14px;
  font-size: 15px; font-weight: 560; text-decoration: none;
  color: var(--ink-2);
  border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
}
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

/* ── 가로 트랙 ───────────────────────────── */
.track {
  position: fixed; top: var(--nav-h); left: 0; right: 0; bottom: 0;
  display: flex;
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
}
.track::-webkit-scrollbar { display: none; }
.page {
  flex: 0 0 100%;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  padding: clamp(32px, 6vh, 72px) var(--gutter) 112px;
}
.page-inner { max-width: 1320px; margin: 0 auto; }

/* 페이지에 들어올 때 내용이 순서대로 올라옴 */
@media (prefers-reduced-motion: no-preference) {
  .page .rv { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
  .page.is-active .rv { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .track { scroll-behavior: auto; }
}

/* ── 공통 글꼴·버튼 ─────────────────────── */
.eyebrow { font-size: 14px; font-weight: 640; color: var(--accent); letter-spacing: .02em; }
.h1 { font-size: clamp(34px, 4vw, 56px); font-weight: 720; line-height: 1.16; letter-spacing: -.035em; }
.h2 { font-size: clamp(28px, 3vw, 42px); font-weight: 700; line-height: 1.22; letter-spacing: -.03em; }
.h3 { font-size: 21px; font-weight: 680; line-height: 1.35; letter-spacing: -.02em; }
.lead { font-size: clamp(17px, 1.3vw, 19px); line-height: 1.7; color: var(--ink-2); max-width: 46ch; }
.body { font-size: 15.5px; line-height: 1.7; color: var(--ink-2); }
.num { font-variant-numeric: tabular-nums; }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  height: 50px; padding: 0 22px;
  font-size: 15.5px; font-weight: 620; white-space: nowrap; text-decoration: none;
  border: 1px solid var(--ink); background: transparent; cursor: pointer;
  transition: background .2s, color .2s, transform .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost:hover { background: var(--ink); color: var(--bg); }
.btn i { font-size: 18px; }

.photo { width: 100%; height: 100%; object-fit: cover; background: var(--line); }
.caption { margin-top: 10px; font-size: 13.5px; color: var(--ink-2); }

/* ── 1. 홈 ──────────────────────────────── */
.home { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(32px, 5vw, 80px); align-items: center; min-height: calc(100% - 150px); }
.home-copy { display: grid; gap: 26px; }
.home-ctas { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.home-media { aspect-ratio: 4 / 3; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: clamp(32px, 6vh, 64px); border-top: 1px solid var(--ink); }
.stat { padding: 22px 24px 4px 0; }
.stat + .stat { padding-left: 24px; border-left: 1px solid var(--line); }
.stat b { display: block; font-size: clamp(30px, 3vw, 44px); font-weight: 720; letter-spacing: -.03em; }
.stat span { display: block; margin-top: 6px; font-size: 14.5px; color: var(--ink-2); }

/* ── 2. 사업분야 (목록 + 상세) ───────────── */
.biz { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: clamp(28px, 4vw, 64px); margin-top: 40px; }
.biz-list { display: grid; align-content: start; border-top: 1px solid var(--line); }
.biz-item {
  display: grid; grid-template-columns: 52px 1fr; gap: 4px 14px; align-items: center;
  padding: 22px 0; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.biz-item .letter { grid-row: span 2; font-size: 40px; font-weight: 760; line-height: 1; color: var(--mute); transition: color .25s; }
.biz-item .name { font-size: 19px; font-weight: 680; }
.biz-item .short { font-size: 14.5px; color: var(--ink-2); }
.biz-item[aria-selected="true"] .letter, .biz-item:hover .letter { color: var(--accent); }
.biz-detail { display: grid; grid-template-columns: 1.15fr 1fr; gap: 32px; align-items: start; }
.biz-detail .media { aspect-ratio: 4 / 3; overflow: hidden; }
.biz-detail .photo { animation: fadeIn .5s var(--ease); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.facts { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 14px; }
.facts li { display: grid; grid-template-columns: 18px 1fr; gap: 10px; font-size: 15.5px; line-height: 1.6; }
.facts li i { color: var(--accent); margin-top: 4px; }

/* ── 3. 서비스 ───────────────────────────── */
.services { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 4vw, 64px); margin-top: 32px; }
.service { display: grid; gap: 12px; align-content: start; justify-items: start; }
.shot { display: block; width: 100%; aspect-ratio: 2 / 1; overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.shots { width: 100%; }
.shot { position: relative; }
.shot img { position: absolute; inset: 0; object-position: top; opacity: 0; transition: opacity .6s var(--ease), transform .6s var(--ease); }
.shot img.on { opacity: 1; }
.slide-tabs { display: flex; gap: 2px; margin-top: 10px; }
.slide-tabs button { padding: 6px 12px; background: none; border: 0; border-bottom: 2px solid transparent; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.slide-tabs button:hover { color: var(--ink); }
.slide-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.shot:hover img.on { transform: scale(1.02); }
.service-head { display: flex; align-items: center; gap: 16px; width: 100%; height: 66px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.service-head .who { font-size: 14px; font-weight: 620; color: var(--accent); padding-left: 16px; border-left: 1px solid var(--line); }
/* 각 서비스 사이트 상단 로고 원본을 절반 크기로 표시(레티나에서 선명) */
.logo-head { margin: 0; line-height: 0; }
.logo-head img { display: block; }
/* 로고가 아이콘뿐인 서비스는 이름을 글자로 옆에 둠 */
.logo-head { display: flex; align-items: center; gap: 10px; }
.logo-head span { font-size: 24px; font-weight: 800; line-height: 1; letter-spacing: -.02em; color: var(--ink); }
/* 교사 제작 콘텐츠: 소제목 + 한 줄 전체를 쓰는 카드(글 왼쪽, 화면 오른쪽) */
.services-group { grid-column: 1 / -1; margin: 8px 0 -8px; padding-top: 28px; border-top: 1px solid var(--line); }
.service.wide { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; grid-template-rows: auto auto auto auto 1fr; column-gap: clamp(28px, 4vw, 64px); }
.service.wide > * { grid-column: 1; }
.service.wide > .shots { grid-column: 2; grid-row: 1 / -1; }
.service .more { height: 44px; padding: 0 18px; font-size: 15px; }
.service .facts { margin: 0 0 10px; }
.visit { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 14.5px; font-weight: 620; color: var(--accent); text-decoration: none; white-space: nowrap; }
.visit:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ── 4. 운영 실적 ────────────────────────── */
.record { display: grid; grid-template-columns: 1fr 1fr 0.8fr; gap: clamp(20px, 2.5vw, 36px); margin-top: 40px; }
.facility .media { aspect-ratio: 16 / 10; overflow: hidden; }
.facility .meta { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 18px; }
.facility .since { font-size: 13.5px; font-weight: 620; color: var(--accent); white-space: nowrap; }
.facility .big { margin-top: 14px; font-size: 34px; font-weight: 720; letter-spacing: -.03em; }
.facility .big small { font-size: 15px; font-weight: 560; color: var(--ink-2); margin-left: 6px; letter-spacing: 0; }
.facility .body { margin-top: 8px; }
.clients { background: var(--surface); border: 1px solid var(--line); padding: 26px 24px; align-self: start; }
.clients h3 { font-size: 16px; font-weight: 680; }
.client-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; margin-top: 14px; }
.client-grid span { padding: 9px 0; font-size: 14.5px; border-top: 1px solid var(--line); }
.client-note { margin-top: 14px; font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.also { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--ink); }
.also b { display: block; font-size: 15.5px; font-weight: 680; }
.also span { display: block; margin-top: 4px; font-size: 14px; color: var(--ink-2); }

/* ── 4. 연혁 (시기별 3단) ─────────────────── */
.eras { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 3vw, 44px); margin-top: 40px; }
.era-head { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 12px; border-bottom: 2px solid var(--ink); }
.era-head b { font-size: 17px; font-weight: 700; }
.era-head span { font-size: 14px; color: var(--ink-2); }
.year { display: grid; grid-template-columns: 64px 1fr; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.year > b { font-size: 22px; font-weight: 720; color: var(--accent); line-height: 1.2; }
.year .theme { font-size: 15.5px; font-weight: 680; line-height: 1.45; }
.year ul { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 5px; }
.year li { font-size: 14px; line-height: 1.55; color: var(--ink-2); padding-left: 12px; position: relative; }
.year li::before { content: ''; position: absolute; left: 0; top: .72em; width: 5px; height: 1px; background: var(--ink-2); }

/* ── 5. 소식 ─────────────────────────────── */
.news { display: grid; grid-template-columns: 1.35fr 1fr; gap: clamp(28px, 4vw, 64px); margin-top: 40px; }
.col-head { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 12px; border-bottom: 2px solid var(--ink); }
.col-head b { font-size: 17px; font-weight: 700; }
.col-head a { font-size: 14px; font-weight: 600; color: var(--accent); text-decoration: none; display: inline-flex; gap: 4px; align-items: center; }
.posts { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 22px; }
.post { text-decoration: none; display: grid; gap: 12px; align-content: start; }
.post:first-child { grid-column: span 2; grid-template-columns: 1.2fr 1fr; gap: 24px; align-items: center; }
.post .media { aspect-ratio: 16 / 10; overflow: hidden; background: var(--line); }
.post .media img { transition: transform .6s var(--ease); }
.post:hover .media img { transform: scale(1.03); }
.post .date { font-size: 13.5px; color: var(--ink-2); }
.post .title { font-size: 17px; font-weight: 680; line-height: 1.45; }
.post:first-child .title { font-size: 22px; }
.post .sum { font-size: 14.5px; line-height: 1.65; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.headlines { list-style: none; margin: 0; padding: 0; }
.headlines a { display: grid; gap: 6px; padding: 16px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.headlines a:hover .t { color: var(--accent); }
.headlines .src { font-size: 13px; color: var(--ink-2); }
.headlines .t { font-size: 16px; font-weight: 620; line-height: 1.45; transition: color .2s; }
.skel { background: var(--line); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .5; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }
.state { padding: 28px 0; font-size: 15px; color: var(--ink-2); display: grid; gap: 12px; justify-items: start; }

/* ── 6. 회사·문의 ────────────────────────── */
.contact-band { position: relative; height: clamp(220px, 34vh, 340px); overflow: hidden; }
.contact-band::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(8, 18, 38, .82), rgba(8, 18, 38, .35)); }
.contact-band .copy { position: absolute; inset: auto var(--gutter) 32px clamp(20px, 3vw, 40px); z-index: 1; color: #f2f5fa; display: grid; gap: 12px; }
.contact-band .copy p { color: rgba(242, 245, 250, .86); font-size: 16.5px; }
.ways { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); }
.way { display: grid; gap: 8px; padding: 28px 28px 28px 0; text-decoration: none; }
.way + .way { padding-left: 28px; border-left: 1px solid var(--line); }
.way i { font-size: 24px; color: var(--accent); }
.way span { font-size: 14px; color: var(--ink-2); }
.way b { font-size: 21px; font-weight: 700; letter-spacing: -.01em; }
a.way:hover b { color: var(--accent); }
.company { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; padding: 26px 0; }
.company dt { font-size: 13.5px; color: var(--ink-2); }
.company dd { margin: 4px 0 0; font-size: 15.5px; font-weight: 560; }
.copyright { font-size: 13px; color: var(--ink-2); }

/* ── 하단 페이지 넘김 ────────────────────── */
.pager {
  position: fixed; left: var(--gutter); bottom: 22px; z-index: 20;
  display: flex; align-items: center; gap: 2px;
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(12, 24, 48, .08);
}
.pager button { display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 16px; background: none; border: 0; cursor: pointer; font-size: 14.5px; font-weight: 600; }
.pager button:disabled { opacity: .35; cursor: default; }
.pager button:not(:disabled):hover { color: var(--accent); }
.pager .pos { padding: 0 6px; font-size: 13.5px; color: var(--ink-2); }
.pager i { font-size: 18px; }

/* ── 태블릿 ──────────────────────────────── */
@media (max-width: 1100px) {
  .record { grid-template-columns: 1fr 1fr; }
  .clients { grid-column: span 2; }
  .client-grid { grid-template-columns: repeat(4, 1fr); }
  .biz-detail { grid-template-columns: 1fr; }
  .company { grid-template-columns: 1fr 1fr; }
}

/* ── 모바일 (< 768px): 모든 다단 배치를 한 줄로 ── */
@media (max-width: 767px) {
  :root { --nav-h: 104px; }
  .nav { flex-wrap: wrap; gap: 0; height: var(--nav-h); padding: 0; align-content: flex-start; }
  .nav .brand { height: 56px; display: flex; align-items: center; padding: 0 16px; }
  .nav .logo { height: 28px; }
  .tabs { width: 100%; height: 48px; margin: 0; overflow-x: auto; scrollbar-width: none; border-top: 1px solid var(--line); padding: 0 6px; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a { padding: 0 11px; font-size: 14.5px; white-space: nowrap; }
  .page { padding: 28px 16px 100px; }
  .home, .biz, .biz-detail, .services, .record, .eras, .news, .posts, .post:first-child, .ways, .company { grid-template-columns: 1fr; }
  .clients, .post:first-child { grid-column: auto; }
  .home { min-height: 0; gap: 28px; }
  .home-media { order: -1; aspect-ratio: 16 / 10; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat, .stat + .stat { padding: 18px 12px 16px 0; border-left: 0; }
  .stat:nth-child(even) { padding-left: 16px; border-left: 1px solid var(--line); }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .client-grid { grid-template-columns: 1fr 1fr; }
  .way, .way + .way { padding: 22px 0; border-left: 0; border-top: 1px solid var(--line); }
  .pager { left: 16px; bottom: 16px; }
  .service-head { flex-wrap: wrap; height: auto; row-gap: 8px; }
  .service-head .who { flex: 1; font-size: 13.5px; }
  .visit { flex-basis: 100%; margin-left: 0; }
  .service.wide { grid-template-columns: 1fr; grid-template-rows: none; }
  .service.wide > .shots { grid-column: 1; grid-row: auto; }
  .pager .label { display: none; }
}
