/* ============================================
   코스맥스바이오 웍스AI 교육 — 카탈로그형 + 검색
   브랜드: Red #E60012 + White + Black + Gray #F5F5F5
   ============================================ */

:root {
  --red: #E60012;
  --red-dark: #B3000E;
  --red-soft: #FFE9EB;
  --black: #111111;
  --ink: #1a1a1a;
  --gray-900: #2a2a2a;
  --gray-700: #4a4a4a;
  --gray-500: #8a8a8a;
  --gray-300: #d8d8d8;
  --gray-200: #ececec;
  --gray-100: #f5f5f5;
  --gray-50:  #fafafa;
  --white: #ffffff;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow-card: 0 1px 2px rgba(0,0,0,.04), 0 10px 28px rgba(0,0,0,.06);
  --shadow-card-hover: 0 2px 6px rgba(230,0,18,.08), 0 18px 40px rgba(0,0,0,.10);
  --font: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont,
          'Apple SD Gothic Neo', 'Malgun Gothic', 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  word-break: keep-all;
  scroll-behavior: smooth;
}

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

mark { background: #FFE066; color: inherit; padding: 0 2px; border-radius: 2px; }

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===========================
   HERO
   =========================== */
.hero {
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(230,0,18,.06) 0%, rgba(230,0,18,0) 60%),
    linear-gradient(180deg, #fff 0%, #fff 60%, var(--gray-50) 100%);
  padding: 96px 0 80px;
  border-bottom: 1px solid var(--gray-200);
}

.brand-mark { display: inline-flex; gap: 8px; align-items: center; margin-bottom: 28px; }
.brand-mark .dot {
  width: 14px; height: 14px;
  background: var(--red);
  border-radius: 50%;
}
.brand-mark .dot:nth-child(2) { opacity: .75; }
.brand-mark .dot:nth-child(3) { opacity: .5; }

.kicker {
  display: inline-block;
  font-size: 13px;
  letter-spacing: .14em;
  font-weight: 600;
  color: var(--red);
  text-transform: uppercase;
  margin: 0 0 18px;
  padding: 6px 14px;
  background: var(--red-soft);
  border-radius: 999px;
}

.hero h1 {
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.18;
  margin: 0 0 22px;
  color: var(--black);
}

.lead {
  font-size: clamp(16px, 1.6vw, 19px);
  color: var(--gray-700);
  max-width: 780px;
  margin: 0 0 28px;
}

.slogan {
  font-size: 13px;
  letter-spacing: .25em;
  color: var(--gray-500);
  font-weight: 600;
  text-transform: uppercase;
  margin: 0;
}

/* ===========================
   SECTION shared
   =========================== */
section { padding: 88px 0; }
section + section { border-top: 1px solid var(--gray-200); }

.section-title {
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--black);
  margin: 0 0 8px;
  text-align: center;
}
.section-title.left { text-align: left; }
.section-title::after {
  content: "";
  display: block;
  width: 40px;
  height: 3px;
  background: var(--red);
  margin: 14px auto 0;
}
.section-title.left::after { margin-left: 0; }

.section-sub {
  text-align: center;
  color: var(--gray-700);
  max-width: 780px;
  margin: 0 auto 36px;
  font-size: 16px;
}
.section-sub strong { color: var(--black); }

/* ===========================
   MODULES (4 cards)
   =========================== */
.modules { background: var(--white); }

.module-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.module-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 28px 22px 22px;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  overflow: hidden;
  min-height: 240px;
}

.module-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 5px;
  background: var(--red);
  transform: scaleX(.4);
  transform-origin: left;
  transition: transform .35s ease;
}
.module-card.module-black::before { background: var(--black); }

.module-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--gray-300);
}
.module-card:hover::before { transform: scaleX(1); }

.module-icon { font-size: 28px; margin-bottom: 14px; }

.module-no {
  font-size: 11.5px;
  letter-spacing: .12em;
  font-weight: 700;
  color: var(--red);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.module-card.module-black .module-no { color: var(--black); }

.module-card h3 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
  color: var(--black);
}

.module-card p {
  font-size: 13.5px;
  color: var(--gray-700);
  line-height: 1.55;
  margin: 0 0 16px;
  flex: 1;
}

.module-cta { font-size: 13.5px; font-weight: 700; color: var(--red); }
.module-card.module-black .module-cta { color: var(--black); }
.module-card:hover .module-cta { text-decoration: underline; }

/* ===========================
   LIBRARY
   =========================== */
.library { background: var(--gray-50); }

/* 검색바 */
.search-wrap {
  position: relative;
  max-width: 760px;
  margin: 0 auto 12px;
}
.search-wrap::before {
  content: "🔍";
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
  opacity: .55;
}
#searchInput {
  width: 100%;
  padding: 16px 50px 16px 48px;
  font-size: 15px;
  font-family: var(--font);
  border: 1px solid var(--gray-300);
  border-radius: 999px;
  background: var(--white);
  transition: border-color .2s ease, box-shadow .2s ease;
}
#searchInput:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 4px rgba(230,0,18,.10);
}
.search-clear {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--gray-200);
  color: var(--gray-700);
  border: none;
  font-size: 12px;
  cursor: pointer;
}
.search-clear:hover { background: var(--gray-300); }

.search-meta {
  text-align: center;
  font-size: 13.5px;
  color: var(--gray-700);
  margin: 0 0 36px;
}
.search-meta strong { color: var(--red); }

/* 카탈로그 레이아웃 */
.catalog-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 40px;
  align-items: start;
}

/* 좌측 sticky 인덱스 */
.catalog-index {
  position: sticky;
  top: 24px;
  align-self: start;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 20px 14px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
}

.idx-title {
  font-size: 11px;
  letter-spacing: .16em;
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
  margin: 0 8px 12px;
}

.idx-list { list-style: none; padding: 0; margin: 0; }
.idx-list li { margin: 1px 0; }

.idx-list a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--gray-700);
  border-left: 2px solid transparent;
  transition: all .15s ease;
}
.idx-list a:hover {
  background: var(--gray-50);
  color: var(--black);
}
.idx-list a.active {
  background: var(--red-soft);
  color: var(--red);
  border-left-color: var(--red);
  font-weight: 700;
}
.idx-icon { font-size: 14px; }
.idx-label { flex: 1; line-height: 1.3; }
.idx-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-500);
  background: var(--gray-100);
  padding: 2px 7px;
  border-radius: 999px;
}
.idx-list a.active .idx-count {
  background: var(--red);
  color: #fff;
}

/* 메인 카탈로그 */
.catalog-main { min-width: 0; }

.cat-group {
  margin-bottom: 56px;
  scroll-margin-top: 24px;
}
.cat-group:last-child { margin-bottom: 0; }

.cat-head {
  margin-bottom: 20px;
  padding: 18px 22px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-left: 5px solid var(--red);
  border-radius: var(--radius);
}
.cat-head-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.cat-icon { font-size: 22px; }
.cat-head h3 {
  flex: 1;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--black);
}
.cat-count {
  font-size: 12.5px;
  font-weight: 700;
  background: var(--red);
  color: #fff;
  padding: 3px 10px;
  border-radius: 999px;
}
.cat-head p {
  font-size: 13.5px;
  color: var(--gray-700);
  margin: 0;
  line-height: 1.55;
}

/* 프롬프트 카드 */
.prompt-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.prompt-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 20px 22px 16px;
  display: flex;
  flex-direction: column;
  transition: box-shadow .2s ease, border-color .2s ease;
}
.prompt-card:hover {
  box-shadow: var(--shadow-card);
  border-color: var(--gray-300);
}

.prompt-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.prompt-mod {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 4px;
  letter-spacing: .02em;
}
.prompt-mod.mod-report  { background: var(--red); color: #fff; }
.prompt-mod.mod-leader  { background: var(--black); color: #fff; }
.prompt-mod.mod-data    { background: var(--red-dark); color: #fff; }
.prompt-mod.mod-image   { background: #333; color: #fff; }

.prompt-id {
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-500);
  letter-spacing: .06em;
}

.prompt-card h4 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--black);
  margin: 4px 0 10px;
  line-height: 1.4;
}

.prompt-tags {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.prompt-tags li {
  font-size: 11.5px;
  color: var(--gray-500);
}
.prompt-tags li::before { content: "#"; }

.prompt-body {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-family: 'SF Mono', 'JetBrains Mono', Menlo, Consolas, ui-monospace, monospace;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--gray-900);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 200px;
  overflow: hidden;
  position: relative;
  margin: 0;
  transition: max-height .3s ease;
}
.prompt-body.expanded { max-height: 3000px; }
.prompt-body:not(.expanded)::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 56px;
  background: linear-gradient(180deg, rgba(250,250,250,0) 0%, var(--gray-50) 100%);
  pointer-events: none;
}

.prompt-foot {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  align-items: center;
}

.btn {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-300);
  background: var(--white);
  color: var(--gray-900);
  cursor: pointer;
  transition: all .15s ease;
}
.btn:hover { border-color: var(--gray-500); }

.btn-primary {
  background: var(--red);
  color: var(--white);
  border-color: var(--red);
}
.btn-primary:hover {
  background: var(--red-dark);
  border-color: var(--red-dark);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--gray-500);
}
.btn-ghost:hover { color: var(--black); }

.empty-state {
  text-align: center;
  padding: 64px 16px;
  color: var(--gray-500);
  background: var(--white);
  border: 1px dashed var(--gray-300);
  border-radius: var(--radius);
}

/* ===========================
   INSTRUCTOR
   =========================== */
.instructor { background: var(--white); }
.instructor-inner {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 60px;
  align-items: start;
}
.instructor-name {
  font-size: 28px;
  font-weight: 800;
  margin: 14px 0 6px;
  color: var(--black);
}
.instructor-role {
  font-size: 15px;
  color: var(--gray-700);
  margin: 0 0 14px;
  line-height: 1.7;
}
.instructor-mail a {
  color: var(--red);
  font-weight: 600;
  border-bottom: 1px solid var(--red-soft);
  padding-bottom: 2px;
}
.instructor-note {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 32px;
}
.instructor-note h3 {
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 800;
  color: var(--black);
}
.instructor-note ul { margin: 0; padding-left: 18px; }
.instructor-note li {
  font-size: 14.5px;
  color: var(--gray-700);
  margin-bottom: 8px;
  line-height: 1.6;
}
.instructor-note li::marker { color: var(--red); }

/* ===========================
   FOOTER
   =========================== */
.site-foot {
  background: var(--black);
  color: var(--gray-300);
  padding: 48px 0 36px;
}
.foot-grid {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 28px;
  margin-bottom: 28px;
}
.foot-brand {
  font-size: 17px;
  font-weight: 800;
  color: var(--white);
  margin: 0 0 4px;
}
.foot-sub {
  font-size: 12px;
  letter-spacing: .18em;
  color: var(--gray-500);
  margin: 0;
}
.foot-links {
  display: flex; gap: 22px;
  flex-wrap: wrap; align-items: center;
}
.foot-links a {
  font-size: 13.5px;
  color: var(--gray-300);
  transition: color .15s ease;
}
.foot-links a:hover { color: var(--red); }

.foot-mini {
  font-size: 12px;
  color: var(--gray-500);
  margin: 0;
  padding-top: 22px;
  border-top: 1px solid #222;
}

/* ===========================
   TOAST
   =========================== */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translate(-50%, 80px);
  background: var(--black);
  color: var(--white);
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  opacity: 0;
  pointer-events: none;
  transition: transform .3s ease, opacity .3s ease;
  z-index: 1000;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 1100px) {
  .catalog-layout { grid-template-columns: 220px 1fr; gap: 28px; }
}

@media (max-width: 980px) {
  .module-grid { grid-template-columns: repeat(2, 1fr); }
  .catalog-layout { grid-template-columns: 1fr; gap: 20px; }
  .catalog-index {
    position: static;
    max-height: none;
  }
  .idx-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .idx-list li { flex: 1 1 calc(50% - 6px); }
  .prompt-grid { grid-template-columns: 1fr; }
  .instructor-inner { grid-template-columns: 1fr; gap: 32px; }
}

@media (max-width: 640px) {
  .hero { padding: 64px 0 56px; }
  section { padding: 64px 0; }
  .module-grid { grid-template-columns: 1fr; }
  .module-card { min-height: 0; }
  .idx-list li { flex: 1 1 100%; }
  .cat-head { padding: 16px 18px; }
  .cat-head h3 { font-size: 18px; }
  .prompt-card { padding: 18px 18px 14px; }
  .prompt-body { font-size: 12px; max-height: 180px; }
  .container { padding: 0 18px; }
  #searchInput { padding: 14px 44px 14px 44px; font-size: 14px; }
}
