/* =========================================================
   학습 기록 사이트 공통 스타일
   - 색은 :root 변수만 바꾸면 사이트 전체에 적용됩니다.
   - "다크 모드" 부분은 휴대폰·PC가 다크 모드일 때 쓰는 색입니다.
   ========================================================= */

:root {
  --bg: #f5f7fb;
  --bg-alt: #ecf0f6;
  --surface: #ffffff;
  --surface-2: #f1f4f9;
  --text: #0f172a;
  --muted: #586274;
  --line: #e1e7ef;
  --line-strong: #cbd5e1;
  --accent: #0e7490;
  --accent-soft: #e2f4f8;
  --on-accent: #ffffff;
  --crane-dark: #164e63;
  --diagram: #64748b;

  --header-bg: rgba(11, 20, 38, .9);
  --hero-bg: #0b1426;
  --hero-text: #e8eef8;
  --hero-muted: #a3b2c8;
  --hero-accent: #22d3ee;

  --ph-bg: #fff3c4;
  --ph-text: #7a5300;
  --ph-line: #e0a400;

  --radius: 16px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
    "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", system-ui, sans-serif;

  color-scheme: light dark;
}

/* 다크 모드 */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a1120;
    --bg-alt: #0d1628;
    --surface: #111b2e;
    --surface-2: #17233a;
    --text: #e6edf7;
    --muted: #9aa7bb;
    --line: #1f2c45;
    --line-strong: #2c3b57;
    --accent: #22d3ee;
    --accent-soft: rgba(34, 211, 238, .12);
    --on-accent: #04222b;
    --crane-dark: #0e7490;
    --diagram: #7b8aa5;

    --header-bg: rgba(6, 12, 24, .9);
    --hero-bg: #060c18;

    --ph-bg: rgba(250, 204, 21, .14);
    --ph-text: #fde68a;
    --ph-line: #facc15;

    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  }
}

/* ---------- 기본 ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

img, video, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible { outline: 3px solid var(--hero-accent); outline-offset: 3px; border-radius: 8px; }
h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3 { line-height: 1.3; letter-spacing: -0.02em; }
[id] { scroll-margin-top: 84px; }

.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }

.icon { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- 직접 채울 곳 표시 (노란색) ----------
   내용을 바꾼 뒤 class="ph" 를 지우면 노란 표시가 사라집니다. */
.ph {
  padding: 0 .2em;
  border-radius: 4px;
  border-bottom: 1.5px dashed var(--ph-line);
  background: var(--ph-bg);
  color: var(--ph-text);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.hero .ph, .page-hero .ph { background: rgba(250, 204, 21, .16); color: #fde68a; border-color: #facc15; }

/* ---------- 상단 메뉴 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }

.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; font-size: 17px; font-weight: 800; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, #22d3ee, #0e7490);
  color: #04222b;
}
.brand-mark svg { width: 18px; height: 18px; stroke-width: 2.4; }

.nav { display: flex; gap: 2px; }
.nav a {
  padding: 7px 14px;
  border-radius: 999px;
  color: #c3cfe2;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color .15s, color .15s;
}
.nav a:hover { color: #fff; background: rgba(255, 255, 255, .08); text-decoration: none; }
.nav a[aria-current="page"] { color: #04222b; background: var(--hero-accent); }

@media (max-width: 600px) {
  .brand { gap: 8px; font-size: 16px; }
  .nav a { padding: 6px 10px; font-size: 14px; }
}
@media (max-width: 340px) {
  .site-header { position: static; }
  .header-inner { flex-direction: column; align-items: stretch; gap: 6px; padding-top: 10px; padding-bottom: 10px; }
  .nav { justify-content: space-between; }
}

/* ---------- 어두운 머리 영역 (첫 화면·페이지 제목) ---------- */
.hero, .page-hero { position: relative; overflow: hidden; background: var(--hero-bg); color: var(--hero-text); }
.hero::before, .page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(148, 163, 184, .09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, .09) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask-image: radial-gradient(ellipse 80% 90% at 75% 20%, #000 25%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 90% at 75% 20%, #000 25%, transparent 75%);
}
.hero::after, .page-hero::after {
  content: "";
  position: absolute;
  top: -220px;
  right: -160px;
  width: 560px;
  height: 560px;
  pointer-events: none;
  background: radial-gradient(circle, rgba(34, 211, 238, .2), transparent 65%);
}
.hero > .container, .page-hero > .container { position: relative; z-index: 1; }

.hero { padding: 72px 0 84px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(32px, 5vw, 50px); font-weight: 800; }

.page-hero { padding: 64px 0 60px; }
.page-hero h1 { font-size: clamp(34px, 5.4vw, 52px); font-weight: 800; }
.page-hero h1 small {
  display: block;
  margin-top: 8px;
  color: var(--hero-muted);
  font-size: clamp(15px, 2vw, 18px);
  font-weight: 600;
  letter-spacing: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  color: var(--hero-accent);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .04em;
}
.eyebrow::before { content: ""; width: 20px; height: 2px; border-radius: 2px; background: currentColor; }
.lead { max-width: 36em; margin-top: 18px; color: var(--hero-muted); font-size: clamp(16px, 1.9vw, 18px); }

.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  transition: transform .15s, background-color .15s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--hero-accent); color: #04222b; }
.btn-ghost { border: 1px solid rgba(255, 255, 255, .24); color: var(--hero-text); }
.btn-ghost:hover { background: rgba(255, 255, 255, .08); }

@media (max-width: 880px) {
  .hero { padding: 52px 0 60px; }
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .page-hero { padding: 48px 0 44px; }
}

/* ---------- 영상 ---------- */
.video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #000;
  box-shadow: var(--shadow);
}
.hero .video-frame { border-color: rgba(255, 255, 255, .1); box-shadow: 0 24px 60px rgba(0, 0, 0, .45); }
.video-frame video { width: 100%; height: 100%; object-fit: contain; background: #000; }

/* 영상 파일이 아직 없을 때 보이는 안내 (js/main.js 가 켜 줌) */
.video-empty {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px;
  text-align: center;
  color: #a3b2c8;
  font-size: 14px;
  background: repeating-linear-gradient(135deg, #0f1a30 0 16px, #0c1528 16px 32px);
}
.video-empty svg { width: 40px; height: 40px; margin-bottom: 4px; color: #22d3ee; }
.video-empty strong { color: #e8eef8; font-size: 17px; }
.video-empty code { padding: 2px 10px; border-radius: 6px; background: rgba(255, 255, 255, .08); color: #c3cfe2; font-size: 13px; }
.video-frame.is-empty video { display: none; }
.video-frame.is-empty .video-empty { display: flex; }

.video figcaption { margin-top: 12px; color: var(--muted); font-size: 14px; }
.hero .video figcaption { color: var(--hero-muted); }
.video-solo { max-width: 880px; }

/* ---------- 본문 영역 ---------- */
.section { padding: 80px 0; }
.section-alt { background: var(--bg-alt); }
.section-next { padding: 0 0 80px; }

.section-head { max-width: 720px; margin-bottom: 32px; }
.kicker { margin-bottom: 8px; color: var(--accent); font-size: 14px; font-weight: 700; letter-spacing: .02em; }
.section-head h2 { font-size: clamp(24px, 3.4vw, 32px); font-weight: 800; }
.section-head p:not(.kicker) { margin-top: 12px; color: var(--muted); }

.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 980px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) { .grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .grid-4 { grid-template-columns: 1fr; } }

@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .section { padding: 56px 0; }
  .section-next { padding: 0 0 56px; }
  .section-head { margin-bottom: 24px; }
}

/* 학원·과정 정보 카드 */
.info-card {
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.info-card .label { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; color: var(--muted); font-size: 14px; font-weight: 600; }
.info-card .label svg { width: 18px; height: 18px; color: var(--accent); }
.info-card .value { display: block; font-size: 19px; font-weight: 700; line-height: 1.5; }
.info-card .sub { display: block; margin-top: 6px; color: var(--muted); font-size: 14px; }

.course-desc {
  margin-top: 20px;
  padding: 26px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.course-desc h3 { margin-bottom: 10px; font-size: 18px; font-weight: 800; }
.course-desc p { font-size: 16.5px; line-height: 1.85; }

/* 첫 페이지 주제 카드 (IoT · ASRS · 기타) */
.topic-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  transition: transform .2s, border-color .2s;
}
.topic-card:hover { text-decoration: none; transform: translateY(-3px); border-color: var(--accent); }
.topic-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 8px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
}
.topic-icon svg { width: 26px; height: 26px; }
.topic-num { position: absolute; top: 26px; right: 28px; color: var(--muted); font-size: 14px; font-weight: 700; }
.topic-card h3 { font-size: 22px; font-weight: 800; }
.topic-card h3 small { margin-left: 6px; color: var(--muted); font-size: 15px; font-weight: 600; letter-spacing: 0; }
.topic-card p { color: var(--muted); font-size: 15px; }
.topic-more { display: inline-flex; align-items: center; gap: 6px; margin-top: auto; padding-top: 12px; color: var(--accent); font-size: 15px; font-weight: 700; }
.topic-more svg { width: 18px; height: 18px; transition: transform .2s; }
.topic-card:hover .topic-more svg { transform: translateX(3px); }

/* 설명 + 한 줄 요약 */
.split { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 48px; align-items: center; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; gap: 28px; } }

.prose { font-size: 17px; line-height: 1.85; }
.prose p + p { margin-top: 14px; }
.prose strong { font-weight: 700; background: linear-gradient(transparent 62%, var(--accent-soft) 62%); }

.formula-card {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.formula-title { margin-bottom: 14px; color: var(--muted); font-size: 14px; font-weight: 700; }
.formula { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.chip { padding: 8px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); font-size: 15px; font-weight: 700; }
.chip-result { border-color: transparent; background: var(--accent); color: var(--on-accent); }
.op { color: var(--muted); font-weight: 700; }

/* 번호 카드 */
.card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.card-num {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-bottom: 14px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 15px;
  font-weight: 800;
}
.card h3 { font-size: 18px; font-weight: 800; }
.card h3 small { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; font-weight: 600; letter-spacing: 0; }
.card p { margin-top: 8px; color: var(--muted); font-size: 15px; line-height: 1.7; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.tag { padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 13px; }

.card-plain { position: relative; padding-top: 30px; }
.card-plain::before {
  content: "";
  position: absolute;
  top: 0;
  left: 24px;
  width: 32px;
  height: 4px;
  border-radius: 0 0 4px 4px;
  background: var(--accent);
}

/* 단계별 흐름 */
.flow { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 28px; margin: 0; padding: 0; list-style: none; }
.flow li {
  position: relative;
  padding: 18px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  text-align: center;
  box-shadow: var(--shadow);
}
.flow li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -21px;
  width: 12px;
  height: 12px;
  border-top: 2.5px solid var(--accent);
  border-right: 2.5px solid var(--accent);
  transform: translateY(-50%) rotate(45deg);
}
.flow .step { display: block; margin-bottom: 4px; color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.flow strong { display: block; font-size: 16px; }
.flow .desc { display: block; margin-top: 4px; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.flow-note { margin-top: 20px; color: var(--muted); font-size: 15px; }

@media (max-width: 860px) {
  .flow { grid-auto-flow: row; gap: 26px; }
  .flow li:not(:last-child)::after {
    top: auto;
    right: auto;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%) rotate(135deg);
  }
}

/* 수업 실습 */
.practice { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 32px; align-items: start; }
@media (max-width: 860px) { .practice { grid-template-columns: 1fr; } }

.checklist { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.checklist li {
  position: relative;
  padding: 14px 16px 14px 50px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  font-size: 15.5px;
}
.checklist li::before {
  content: "";
  position: absolute;
  top: 15px;
  left: 16px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-soft);
}
.checklist li::after {
  content: "";
  position: absolute;
  top: 20px;
  left: 23px;
  width: 6px;
  height: 10px;
  border: solid var(--accent);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.note { margin-top: 16px; padding: 20px 22px; border-left: 4px solid var(--accent); border-radius: 12px; background: var(--accent-soft); }
.note-title { margin-bottom: 6px; color: var(--accent); font-size: 15px; font-weight: 800; }

.closing {
  max-width: 880px;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 17px;
  line-height: 1.85;
}
.closing::before { content: "\201C"; display: block; margin-bottom: 4px; color: var(--accent); font-size: 56px; font-weight: 800; line-height: .8; }

/* 다음 페이지 링크 */
.next-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 28px;
  border-radius: 20px;
  background: var(--hero-bg);
  color: var(--hero-text);
}
.next-link:hover { text-decoration: none; }
.next-link small { display: block; color: var(--hero-muted); font-size: 14px; }
.next-link strong { font-size: 20px; }
.next-link .arrow {
  display: grid;
  flex: none;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--hero-accent);
  color: #04222b;
  transition: transform .2s;
}
.next-link .arrow svg { width: 20px; height: 20px; }
.next-link:hover .arrow { transform: translateX(4px); }

/* ---------- 바닥글 ---------- */
.site-footer { padding: 28px 0 36px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; }

/* ---------- ASRS 구조도 ---------- */
.diagram {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.diagram svg { width: 100%; height: auto; }
.diagram figcaption { margin-top: 10px; color: var(--muted); font-size: 14px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 18px 0 0; padding: 0; list-style: none; font-size: 15px; font-weight: 600; }
.legend li { display: inline-flex; align-items: center; gap: 8px; }
.legend b {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 13px;
}
.diagram + .grid-4 { margin-top: 20px; }
@media (max-width: 640px) { .diagram { padding: 16px; border-radius: 16px; } }

.asrs .floor { stroke: var(--line-strong); stroke-width: 2; }
.asrs .rail { fill: none; stroke: var(--diagram); stroke-width: 4; stroke-linecap: round; opacity: .55; }
.asrs .rack-frame, .asrs .rack-beam { fill: none; stroke: var(--diagram); stroke-width: 3; }
.asrs .box { fill: #e2b77a; stroke: #a8743a; stroke-width: 1.5; }
.asrs .tape { fill: none; stroke: #a8743a; stroke-width: 3; opacity: .55; }
.asrs .crane-head, .asrs .crane-mast, .asrs .crane-truck { fill: var(--accent); }
.asrs .crane-carriage, .asrs .crane-fork { fill: var(--crane-dark); }
.asrs .wheel, .asrs .roller { fill: var(--diagram); }
.asrs .conveyor-belt { fill: var(--surface-2); stroke: var(--diagram); stroke-width: 2; }
.asrs .conveyor-leg { fill: none; stroke: var(--diagram); stroke-width: 3; }
.asrs .panel-body { fill: var(--surface-2); stroke: var(--diagram); stroke-width: 2; }
.asrs .panel-screen { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.5; }
.asrs .panel-line { fill: none; stroke: var(--diagram); stroke-width: 2; stroke-linecap: round; opacity: .7; }
.asrs .lamp-green { fill: #22c55e; }
.asrs .lamp-amber { fill: #f59e0b; }
.asrs .lamp-red { fill: #ef4444; }
.asrs .callout circle { fill: var(--accent); }
.asrs .callout text { fill: var(--on-accent); font-size: 15px; font-weight: 800; text-anchor: middle; dominant-baseline: central; }
.asrs .stored-box { opacity: 0; }

/* 스태커 크레인이 화물을 랙에 넣는 움직임 (움직임 줄이기 설정이면 멈춤) */
@media (prefers-reduced-motion: no-preference) {
  .asrs .crane { animation: crane-travel 9s ease-in-out infinite; }
  .asrs .lift { animation: crane-lift 9s ease-in-out infinite; }
  .asrs .lift-box { animation: box-leave 9s linear infinite; }
  .asrs .stored-box { animation: box-arrive 9s linear infinite; }
}
@keyframes crane-travel {
  0%, 8% { transform: translateX(0); }
  38%, 58% { transform: translateX(-340px); }
  88%, 100% { transform: translateX(0); }
}
@keyframes crane-lift {
  0%, 8% { transform: translateY(0); }
  38%, 58% { transform: translateY(-92px); }
  88%, 100% { transform: translateY(0); }
}
@keyframes box-leave {
  0%, 44% { opacity: 1; }
  47%, 93% { opacity: 0; }
  96%, 100% { opacity: 1; }
}
@keyframes box-arrive {
  0%, 44% { opacity: 0; }
  47%, 93% { opacity: 1; }
  96%, 100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
