/* ============================================================
   한국학교상담연구소 KISC — styles
   디자인 토큰 출처: typeui.sh glassmorphism 스킬
   (.claude/skills/design-system/SKILL.md) — 다크모드로 적용
   ============================================================ */

:root {
  /* --- 스킬 토큰 --- */
  --primary: #1856ff;
  --primary-soft: #5b86ff;
  --primary-deep: #0f3fd1;
  --secondary: #3a344e;
  --success: #07ca6b;
  --warning: #e89558;
  --danger: #ea2143;

  /* --- 다크 표면 (surface #FFFFFF / text #141414 를 반전 적용) --- */
  --bg: #060912;
  --bg-2: #0a1020;
  --fg: #eef1f8;
  --fg-muted: #9aa6c0;
  --fg-faint: #6b7795;

  /* --- 글래스 (스킬: 1px rgba(255,255,255,0.18) 테두리, 반투명 표면) --- */
  --glass: rgba(255, 255, 255, 0.055);
  --glass-strong: rgba(255, 255, 255, 0.085);
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-border-soft: rgba(255, 255, 255, 0.1);
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.14);
  --blur-light: 10px;
  --blur-med: 18px;
  --blur-heavy: 28px;

  --shadow-sm: 0 4px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.5);
  --shadow-primary: 0 12px 36px rgba(24, 86, 255, 0.35);

  /* --- 타이포 (스킬 페어링 + 한글 보완) --- */
  --font-sans: "Plus Jakarta Sans", "Pretendard Variable", Pretendard, system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;

  /* --- 레이아웃 --- */
  --container: 1160px;
  --radius: 20px;
  --radius-sm: 14px;
  --radius-pill: 999px;
  --ring: 0 0 0 3px rgba(91, 134, 255, 0.55);
}

/* ---------------- Reset / Base ---------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 88px; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 400;
  color: var(--fg);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.01em;
  overflow-x: hidden;
}

h1, h2, h3 { line-height: 1.18; letter-spacing: -0.025em; margin: 0; font-weight: 700; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; display: block; }

:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: 6px;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 12px;
  z-index: 200;
  background: var(--primary);
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
}
.skip-link:focus { left: 16px; }

/* ---------------- 오로라 배경 ---------------- */
.aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% -10%, #0c1730 0%, var(--bg) 55%),
    var(--bg);
}
/* 정밀 그리드(블루프린트) — 연구소다운 절제·정확함. 상단에 집중되도록 마스크 */
.aurora::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 72px 72px;
  -webkit-mask-image: radial-gradient(125% 75% at 50% 0%, #000 28%, transparent 72%);
  mask-image: radial-gradient(125% 75% at 50% 0%, #000 28%, transparent 72%);
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(95px);
  opacity: 0.36;
  will-change: transform;
}
/* 오로라: 모두 #1856FF 블루 계열(명도만 변주) — 오프-팔레트 색 제거 */
.blob--1 {
  width: 52vw; height: 52vw;
  left: -10vw; top: -12vw;
  background: radial-gradient(circle, rgba(24, 86, 255, 0.8), transparent 70%);
  animation: drift1 22s ease-in-out infinite alternate;
}
.blob--2 {
  width: 46vw; height: 46vw;
  right: -12vw; top: 6vw;
  background: radial-gradient(circle, rgba(91, 134, 255, 0.42), transparent 70%);
  animation: drift2 26s ease-in-out infinite alternate;
}
.blob--3 {
  width: 40vw; height: 40vw;
  left: 28vw; bottom: -18vw;
  background: radial-gradient(circle, rgba(15, 63, 209, 0.5), transparent 70%);
  animation: drift3 30s ease-in-out infinite alternate;
}
.grain {
  position: absolute;
  inset: -50%;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@keyframes drift1 { to { transform: translate(8vw, 6vw) scale(1.1); } }
@keyframes drift2 { to { transform: translate(-7vw, 8vw) scale(1.08); } }
@keyframes drift3 { to { transform: translate(5vw, -7vw) scale(1.12); } }

/* ---------------- 글래스 유틸 ---------------- */
.glass {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(var(--blur-med)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--blur-med)) saturate(140%);
  box-shadow: var(--shadow-sm), var(--glass-highlight);
}

/* ---------------- Navbar ---------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(8, 12, 24, 0.6);
  backdrop-filter: blur(var(--blur-heavy)) saturate(150%);
  -webkit-backdrop-filter: blur(var(--blur-heavy)) saturate(150%);
  border-bottom-color: var(--glass-border-soft);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand__mark { color: var(--primary-soft); display: inline-flex; }
.brand__text { display: flex; flex-direction: column; line-height: 1.05; }
.brand__text strong { font-size: 1.05rem; font-weight: 800; letter-spacing: 0.02em; }
.brand__text small { font-size: 0.72rem; color: var(--fg-muted); }

.nav__links { display: flex; align-items: center; gap: 6px; }
.nav__links a {
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--fg-muted);
  transition: color 0.2s, background 0.2s;
}
.nav__links a:hover { color: var(--fg); background: var(--glass); }
.nav__cta {
  color: #fff !important;
  background: var(--primary);
  font-weight: 600 !important;
}
.nav__cta:hover { background: var(--primary-deep) !important; }

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 44px; height: 44px;
  align-items: center;
  justify-content: center;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  cursor: pointer;
}
.nav__toggle span {
  width: 18px; height: 2px;
  background: var(--fg);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}
.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0 16px 12px;
  padding: 12px;
  border-radius: var(--radius);
}
.mobile-menu[hidden] { display: none; }
.mobile-menu a {
  padding: 13px 16px;
  border-radius: 12px;
  font-weight: 500;
  color: var(--fg);
}
.mobile-menu a:hover { background: var(--glass-strong); }

/* ---------------- Hero ---------------- */
.hero { padding: clamp(64px, 13vh, 150px) 0 clamp(48px, 9vh, 110px); }
.hero__inner { max-width: 860px; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--primary-soft);
  margin-bottom: 22px;
}
.eyebrow::before,
.kicker::before {
  content: "";
  flex: none;
  width: 26px;
  height: 1.5px;
  background: var(--primary);
}
.hero__title {
  font-size: clamp(1.95rem, 6.2vw, 4.4rem);
  font-weight: 800;
  word-break: keep-all;
  overflow-wrap: break-word;
}
.grad {
  /* 강조 단어: 밝고 선명한 블루로 가시성↑(기존 #5b86ff는 탁하게 보임) */
  color: #7db4ff;
}
.hero__sub {
  margin-top: 26px;
  font-size: clamp(1.02rem, 1.6vw, 1.2rem);
  color: var(--fg-muted);
  max-width: 640px;
}
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 38px; }
.hero__trust {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 40px;
  font-size: 0.9rem;
  color: var(--fg-faint);
}
.hero__trust .dot {
  flex: none;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 12px var(--success);
}

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-size: 0.96rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.2s, background 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.btn--primary {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-primary);
}
.btn--primary:hover { background: var(--primary-deep); transform: translateY(-2px); }
.btn--primary:active { transform: translateY(0); }
.btn--ghost {
  background: var(--glass);
  border-color: var(--glass-border);
  color: var(--fg);
  backdrop-filter: blur(var(--blur-light));
  -webkit-backdrop-filter: blur(var(--blur-light));
}
.btn--ghost:hover { background: var(--glass-strong); transform: translateY(-2px); }

/* ---------------- Section ---------------- */
.section { padding: clamp(56px, 9vh, 110px) 0; }
.section__head { max-width: 620px; margin-bottom: 48px; }
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.2em;
  color: var(--primary-soft);
  margin-bottom: 14px;
}
.section__title { font-size: clamp(1.7rem, 3.6vw, 2.6rem); font-weight: 800; }
.section__desc { margin-top: 16px; color: var(--fg-muted); font-size: 1.04rem; }

/* ---------------- Bento (핵심 사업) ---------------- */
.bento {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 28px;
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
}
.card::after {
  /* 호버 글로우 (목적있는 모션) */
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(91, 134, 255, 0.16), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
a.card:hover, .card--feature:hover {
  transform: translateY(-4px);
  border-color: rgba(91, 134, 255, 0.5);
  box-shadow: var(--shadow-lg), var(--glass-highlight);
}
a.card:hover::after { opacity: 1; }
.card::before {
  content: "";
  position: absolute;
  top: 0; left: 22px; right: 22px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  opacity: 0.7;
}
.card--feature {
  grid-column: span 2;
  background: linear-gradient(120deg, rgba(24, 86, 255, 0.1), var(--glass) 68%);
}
.card__icon {
  width: 52px; height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  color: var(--primary-soft);
  background: rgba(24, 86, 255, 0.16);
  border: 1px solid rgba(91, 134, 255, 0.3);
}
.card__body { flex: 1; }
.card__title {
  font-size: 1.18rem;
  font-weight: 700;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
}
.card--feature .card__title { font-size: 1.4rem; }
.card__en {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--primary-soft);
  letter-spacing: 0.02em;
}
.card__text { color: var(--fg-muted); font-size: 0.97rem; }
.card__link {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--fg);
  display: inline-flex;
  gap: 6px;
}
.card__link--muted { color: var(--fg-faint); }

.badge {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.06em;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  white-space: nowrap;
}
.badge--soon { background: rgba(232, 149, 88, 0.18); color: var(--warning); border: 1px solid rgba(232, 149, 88, 0.4); }
.badge--research { background: rgba(7, 202, 107, 0.16); color: var(--success); border: 1px solid rgba(7, 202, 107, 0.4); }
.card--soon, .card--research { cursor: default; }

/* AI Agent 연구 — 하단 풀폭 배너 ('제품 → 연구 방향'으로 읽히게) */
.card--research {
  grid-column: 1 / -1;
  background: linear-gradient(100deg, rgba(24, 86, 255, 0.12), var(--glass) 60%);
}
@media (min-width: 721px) {
  .card--research {
    flex-direction: row;
    align-items: center;
    gap: 28px;
  }
  .card--research .card__body { flex: 1; }
  .card--research .card__link { margin-left: auto; }
}

/* ---------------- 연구·비전 / 지표 ---------------- */
.research {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  padding: clamp(32px, 5vw, 56px);
  border-radius: 28px;
}
.research .btn { margin-top: 28px; }
.stats-wrap { align-self: center; }
.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.stats__note {
  margin-top: 14px;
  font-size: 0.78rem;
  color: var(--fg-faint);
}
.stat {
  padding: 24px;
  border-radius: var(--radius-sm);
  background: var(--glass);
  border: 1px solid var(--glass-border-soft);
}
.stat__num {
  display: block;
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(120deg, #fff, var(--primary-soft));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-variant-numeric: tabular-nums;
}
.stat__label { font-size: 0.86rem; color: var(--fg-muted); }

/* ---------------- 도입기관 ---------------- */
/* 도입기관 로고 월 — 작은 칩으로 전체를 한눈에 (신뢰 목적) */
.partners {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(94px, 1fr));
  gap: 8px;
}
.partner {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7px 9px;
  border-radius: 8px;
  /* 흰색 카드 — 로고 이미지 다수가 자체 흰 배경이라 순백에서 깔끔히 블렌딩 */
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.18s, box-shadow 0.18s;
}
.partner:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4); }
.partner img {
  max-height: 26px;
  max-width: 80px;
  width: auto;
  object-fit: contain;
  display: block;
}
.partners__note {
  margin-top: 18px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--fg-faint);
}

/* ---------------- 연락처 ---------------- */
.contact {
  text-align: center;
  padding: clamp(40px, 7vw, 72px);
  border-radius: 28px;
}
.contact .section__desc { margin-inline: auto; max-width: 520px; }
.contact__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  margin-top: 32px;
}

/* ---------------- Footer ---------------- */
.footer {
  border-top: 1px solid var(--glass-border-soft);
  padding: 56px 0 36px;
  margin-top: 40px;
}
.footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  justify-content: space-between;
}
.footer__brand { display: flex; gap: 14px; }
.footer__brand .brand__mark { color: var(--primary-soft); }
.footer__brand strong { font-size: 1rem; }
.footer__meta { margin-top: 8px; font-size: 0.82rem; color: var(--fg-faint); line-height: 1.7; }
.footer__links { display: flex; flex-wrap: wrap; gap: 8px 20px; align-content: flex-start; }
.footer__links a { font-size: 0.9rem; color: var(--fg-muted); }
.footer__links a:hover { color: var(--fg); }
.footer__copy { margin-top: 40px; font-size: 0.8rem; color: var(--fg-faint); }

/* ---------------- Reveal 애니메이션 ---------------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s ease;
  transition-delay: calc(var(--reveal-delay, 0) * 90ms);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------------- 반응형 ---------------- */
@media (max-width: 900px) {
  .bento { grid-template-columns: repeat(2, 1fr); }
  .card--feature { grid-column: span 2; }
  .research { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .nav__links { display: none; }
  .nav__toggle { display: flex; }
}
@media (max-width: 560px) {
  .bento { grid-template-columns: 1fr; }
  .card--feature { grid-column: span 1; }
  .stats { grid-template-columns: 1fr 1fr; }
  .hero__cta .btn, .contact__actions .btn { flex: 1 1 auto; }
}

/* ---------------- 모션 줄이기 ---------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .blob { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
