  :root {
    --bg: #ffffff;
    --bg-soft: #f6f7fb;
    --text: #15171c;
    --text-sub: #5b6170;
    --line: #e6e8ef;
    --accent: #1f3a68;      /* Coding Story 네이비 */
    --accent-soft: #e9eef8;
    --card: #ffffff;
    --shadow: 0 10px 30px rgba(20, 30, 60, .06);
  }
  [data-theme="dark"] {
    --bg: #0f1218;
    --bg-soft: #161a22;
    --text: #eef0f4;
    --text-sub: #9aa1b0;
    --line: #262b36;
    --accent: #8fb0ff;
    --accent-soft: #1c2638;
    --card: #161a22;
    --shadow: 0 10px 30px rgba(0, 0, 0, .3);
  }

  * { margin: 0; padding: 0; box-sizing: border-box; }
  html { scroll-behavior: smooth; }
  body {
    font-family: "Pretendard", -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    transition: background .3s, color .3s;
    -webkit-font-smoothing: antialiased;
  }
  a { color: inherit; text-decoration: none; }
  .container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

  /* ===== Header ===== */
  header {
    position: fixed; inset: 0 0 auto 0; z-index: 100;
    background: color-mix(in srgb, var(--bg) 85%, transparent);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent;
    transition: border-color .3s;
  }
  header.scrolled { border-color: var(--line); }
  .nav { display: flex; align-items: center; justify-content: space-between; height: 68px; }
  .logo { font-weight: 800; font-size: 20px; letter-spacing: -0.5px; }
  .logo span { color: var(--accent); }
  .nav-links { display: flex; gap: 32px; list-style: none; align-items: center; }
  .nav-links a { font-size: 15px; color: var(--text-sub); font-weight: 500; transition: color .2s; }
  .nav-links a:hover, .nav-links a.active { color: var(--text); }
  .theme-btn {
    width: 38px; height: 38px; border-radius: 50%;
    border: 1px solid var(--line); background: var(--card); color: var(--text);
    cursor: pointer; font-size: 16px; display: grid; place-items: center;
  }
  .menu-btn { display: none; background: none; border: none; font-size: 24px; color: var(--text); cursor: pointer; }

  /* ===== Hero ===== */
  .hero { min-height: 100vh; display: flex; align-items: center; padding-top: 68px; }
  .hero-inner { display: grid; grid-template-columns: 1.4fr 1fr; gap: 60px; align-items: center; }
  .badge {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 14px; border-radius: 999px;
    background: var(--accent-soft); color: var(--accent);
    font-size: 13px; font-weight: 600; margin-bottom: 24px;
  }
  .badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #22c55e; }
  .hero h1 { font-size: clamp(36px, 5vw, 56px); line-height: 1.25; font-weight: 800; letter-spacing: -1.5px; margin-bottom: 20px; }
  .hero h1 em { font-style: normal; color: var(--accent); }
  .hero p { font-size: 18px; color: var(--text-sub); max-width: 520px; margin-bottom: 36px; }
  .btn-group { display: flex; gap: 12px; flex-wrap: wrap; }
  .btn {
    padding: 14px 26px; border-radius: 12px; font-weight: 600; font-size: 15px;
    transition: transform .2s, box-shadow .2s, background .2s;
  }
  .btn-primary { background: var(--accent); color: #fff; }
  [data-theme="dark"] .btn-primary { color: #0f1218; }
  .btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
  .btn-ghost { border: 1px solid var(--line); }
  .btn-ghost:hover { background: var(--bg-soft); }

  .profile-card {
    background: var(--card); border: 1px solid var(--line); border-radius: 24px;
    padding: 32px; box-shadow: var(--shadow); text-align: center;
  }
  .avatar {
    width: 120px; height: 120px; border-radius: 50%; margin: 0 auto 20px;
    background: linear-gradient(135deg, var(--accent), #5b7fc4);
    display: grid; place-items: center; color: #fff; font-size: 42px; font-weight: 700;
    overflow: hidden;
  }
  .avatar img { width: 100%; height: 100%; object-fit: cover; }
  .profile-card h3 { font-size: 22px; margin-bottom: 4px; }
  .profile-card .role { color: var(--text-sub); font-size: 14px; margin-bottom: 24px; }
  .stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); padding-top: 20px; }
  .stats strong { display: block; font-size: 24px; color: var(--accent); }
  .stats span { font-size: 12px; color: var(--text-sub); }

  /* ===== Section common ===== */
  section { padding: 110px 0; }
  section.soft { background: var(--bg-soft); }
  .section-head { margin-bottom: 56px; }
  .section-label { color: var(--accent); font-weight: 700; font-size: 14px; letter-spacing: 2px; text-transform: uppercase; }
  .section-head h2 { font-size: clamp(28px, 3.5vw, 38px); font-weight: 800; letter-spacing: -1px; margin-top: 8px; }

  /* ===== About ===== */
  .about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; }
  .about-text p { color: var(--text-sub); font-size: 17px; margin-bottom: 18px; }
  .about-text strong { color: var(--text); }
  .info-list { list-style: none; display: grid; gap: 14px; }
  .info-list li {
    display: flex; gap: 16px; padding: 18px 20px;
    background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  }
  .info-list b { min-width: 72px; color: var(--text-sub); font-weight: 500; font-size: 14px; }

  /* ===== Skills ===== */
  .skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
  .skill-card {
    background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 28px;
    transition: transform .25s, box-shadow .25s;
  }
  .skill-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
  .skill-card .icon { font-size: 28px; margin-bottom: 14px; }
  .skill-card h3 { font-size: 18px; margin-bottom: 14px; }
  .tags { display: flex; flex-wrap: wrap; gap: 8px; }
  .tag {
    font-size: 13px; padding: 5px 12px; border-radius: 8px;
    background: var(--accent-soft); color: var(--accent); font-weight: 500;
  }

  /* ===== Projects ===== */
  .filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 36px; }
  .filter {
    padding: 9px 18px; border-radius: 999px; border: 1px solid var(--line);
    background: var(--card); color: var(--text-sub); font-size: 14px; font-weight: 500;
    cursor: pointer; transition: all .2s; font-family: inherit;
  }
  .filter.active, .filter:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
  [data-theme="dark"] .filter.active { color: #0f1218; }
  .projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }
  .project {
    background: var(--card); border: 1px solid var(--line); border-radius: 20px; overflow: hidden;
    display: flex; flex-direction: column; transition: transform .25s, box-shadow .25s;
  }
  .project:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
  .project.hide { display: none; }
  .thumb {
    height: 180px; display: grid; place-items: center; font-size: 48px;
    background: linear-gradient(135deg, var(--accent-soft), var(--bg-soft));
    border-bottom: 1px solid var(--line);
  }
  .project-body { padding: 24px; display: flex; flex-direction: column; flex: 1; }
  .project-cat { font-size: 12px; font-weight: 700; color: var(--accent); letter-spacing: .5px; margin-bottom: 6px; }
  .project h3 { font-size: 19px; margin-bottom: 10px; letter-spacing: -.3px; }
  .project p { font-size: 14.5px; color: var(--text-sub); margin-bottom: 18px; flex: 1; }
  .project .tags { margin-bottom: 18px; }
  .project .tag { background: var(--bg-soft); color: var(--text-sub); }
  .project-links { display: flex; gap: 16px; font-size: 14px; font-weight: 600; }
  .project-links a { color: var(--accent); }
  .project-links a:hover { text-decoration: underline; }

  /* ===== Timeline ===== */
  .timeline { position: relative; padding-left: 28px; }
  .timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
  .tl-item { position: relative; padding-bottom: 36px; }
  .tl-item:last-child { padding-bottom: 0; }
  .tl-item::before {
    content: ""; position: absolute; left: -28px; top: 6px;
    width: 14px; height: 14px; border-radius: 50%;
    background: var(--bg); border: 3px solid var(--accent);
  }
  .tl-date { font-size: 13px; color: var(--accent); font-weight: 700; }
  .tl-item h3 { font-size: 18px; margin: 4px 0; }
  .tl-item p { color: var(--text-sub); font-size: 15px; }

  /* ===== Contact ===== */
  .contact-box {
    background: var(--accent); color: #fff; border-radius: 28px;
    padding: 64px 48px; text-align: center;
  }
  [data-theme="dark"] .contact-box { background: var(--accent-soft); color: var(--text); }
  .contact-box h2 { font-size: clamp(26px, 3.5vw, 36px); font-weight: 800; margin-bottom: 12px; letter-spacing: -1px; }
  .contact-box p { opacity: .8; margin-bottom: 32px; }
  .contact-links { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
  .contact-links a {
    padding: 13px 24px; border-radius: 12px; font-weight: 600; font-size: 15px;
    background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25);
    transition: background .2s;
  }
  .contact-links a:hover { background: rgba(255,255,255,.22); }
  [data-theme="dark"] .contact-links a { background: var(--card); border-color: var(--line); }

  footer { padding: 36px 0; text-align: center; color: var(--text-sub); font-size: 14px; border-top: 1px solid var(--line); }

  /* ===== Reveal animation ===== */
  .reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
  .reveal.show { opacity: 1; transform: none; }

  /* ===== Responsive ===== */
  @media (max-width: 860px) {
    .hero-inner, .about-grid { grid-template-columns: 1fr; gap: 40px; }
    .hero { padding: 120px 0 60px; min-height: auto; }
    .profile-card { max-width: 380px; }
    section { padding: 80px 0; }
    .menu-btn { display: block; }
    .nav-links {
      position: absolute; top: 68px; left: 0; right: 0;
      flex-direction: column; gap: 0; padding: 8px 24px 20px;
      background: var(--bg); border-bottom: 1px solid var(--line);
      display: none;
    }
    .nav-links.open { display: flex; }
    .nav-links li { width: 100%; }
    .nav-links a { display: block; padding: 12px 0; }
    .projects-grid { grid-template-columns: 1fr; }
    .contact-box { padding: 48px 24px; }
  }

   .press-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
  .press-desc { color: var(--text-sub); font-size: 16px; margin-top: 10px; }
  .press-desc b { color: var(--text); font-weight: 600; }
  .press-more {
    font-size: 14px; font-weight: 600; color: var(--accent);
    padding: 10px 18px; border-radius: 10px; border: 1px solid var(--line);
    background: var(--card); transition: background .2s, border-color .2s;
  }
  .press-more:hover { border-color: var(--accent); }

  .press-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
  }
  .press-card {
    display: flex; flex-direction: column;
    background: var(--card); border: 1px solid var(--line); border-radius: 18px;
    padding: 22px; transition: transform .25s, box-shadow .25s, border-color .25s;
  }
  .press-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--accent); }
  .press-top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
  .press-logo {
    width: 40px; height: 40px; border-radius: 11px; flex-shrink: 0;
    display: grid; place-items: center;
    background: var(--accent-soft); color: var(--accent);
    font-weight: 800; font-size: 16px;
  }
  .press-name { font-weight: 700; font-size: 14.5px; line-height: 1.3; }
  .press-date { font-size: 12.5px; color: var(--text-sub); }
  .press-card h3 {
    font-size: 15.5px; line-height: 1.5; letter-spacing: -.2px; flex: 1;
    word-break: keep-all; margin-bottom: 14px;
  }
  .press-link { font-size: 13.5px; font-weight: 600; color: var(--accent); }
  .press-card:hover .press-link { text-decoration: underline; }

  @media (max-width: 860px) {
    .press-grid { grid-template-columns: 1fr; }
  }

  
  .license-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
  }
  .license-card {
    position: relative;
    display: flex; gap: 16px; align-items: flex-start;
    background: var(--card); border: 1px solid var(--line); border-radius: 18px;
    padding: 22px; transition: transform .25s, box-shadow .25s, border-color .25s;
  }
  .license-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--accent); }
  .license-icon {
    width: 48px; height: 48px; border-radius: 13px; flex-shrink: 0;
    display: grid; place-items: center; font-size: 24px;
    background: var(--accent-soft);
  }
  .license-body { flex: 1; min-width: 0; }
  .license-type {
    display: inline-block; font-size: 11.5px; font-weight: 700; letter-spacing: .3px;
    padding: 3px 9px; border-radius: 6px; margin-bottom: 6px;
    background: var(--accent-soft); color: var(--accent);
  }
  .license-type.national { background: #e8f5ee; color: #1f7a4d; }
  .license-type.certified { background: #fdf3e1; color: #b7791f; }
  .license-type.intl { background: #ede9fe; color: #6d28d9; }
  .license-type.degree { background: #e0f2fe; color: #0369a1; }
  .license-type.patent { background: #fde8e8; color: #c53030; }
  .license-type.etc { background: var(--bg-soft); color: var(--text-sub); }
  [data-theme="dark"] .license-type.national { background: #17291f; color: #6fd3a0; }
  [data-theme="dark"] .license-type.certified { background: #2d2617; color: #f2c46d; }
  [data-theme="dark"] .license-type.intl { background: #241c38; color: #b9a3ff; }
  [data-theme="dark"] .license-type.degree { background: #132634; color: #7cc7f2; }
  [data-theme="dark"] .license-type.patent { background: #331b1b; color: #f59a9a; }
  .license-tags { font-size: 12.5px; color: var(--text-sub); opacity: .75; margin-top: 6px; word-break: keep-all; }
  .license-card h3 { font-size: 16.5px; letter-spacing: -.3px; line-height: 1.4; margin-bottom: 4px; word-break: keep-all; }
  .license-meta { font-size: 13.5px; color: var(--text-sub); }
  .license-meta span + span::before { content: "·"; margin: 0 6px; opacity: .6; }
  .license-summary {
    display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 28px;
  }
  .license-summary div {
    font-size: 14px; color: var(--text-sub);
    padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--card);
  }
  .license-summary b { color: var(--accent); margin-left: 4px; }

  
  .activity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
  }
  .activity-card { height: 100%; }
  .activity-period { font-size: 13px; color: var(--accent); font-weight: 600; margin-bottom: 8px; }
  .activity-desc { font-size: 14px; color: var(--text-sub); line-height: 1.65; word-break: keep-all; }

  .license-type.leader { background: #e9eef8; color: #1f3a68; }
  .license-type.create { background: #ede9fe; color: #6d28d9; }
  .license-type.support { background: #e8f5ee; color: #1f7a4d; }
  .license-type.military { background: #f1efe6; color: #5d5a3c; }
  [data-theme="dark"] .license-type.leader { background: #1c2638; color: #8fb0ff; }
  [data-theme="dark"] .license-type.create { background: #241c38; color: #b9a3ff; }
  [data-theme="dark"] .license-type.support { background: #17291f; color: #6fd3a0; }
  [data-theme="dark"] .license-type.military { background: #26251c; color: #cfc99a; }

  @media (max-width: 860px) {
    .activity-grid { grid-template-columns: 1fr; }
  }
  
  :root { --accent-2: #5b7fc4; }
  [data-theme="dark"] { --accent-2: #c7d6ff; }

  .hero h1 { word-break: keep-all; }

  /* 회전하는 단어 상자: 가장 긴 단어 폭에 맞춰 고정 → 단어가 바뀌어도 문장이 흔들리지 않음 */
  .hero h1 .rot {
    position: relative; display: inline-grid; vertical-align: top;
    overflow: hidden; padding: 0 .04em;
  }
  .hero h1 .rot > span {
    grid-area: 1 / 1; white-space: nowrap;
    transform: translateY(105%); opacity: 0; filter: blur(4px);
    transition: transform .6s cubic-bezier(.77, 0, .175, 1), opacity .6s ease, filter .6s ease;
  }
  .hero h1 .rot > span.cur { transform: none; opacity: 1; filter: none; }
  .hero h1 .rot > span.out { transform: translateY(-105%); opacity: 0; filter: blur(4px); }

  /* 회전 단어 강조: 그라데이션 글자 + 아래 형광펜 */
  .hero h1 .rot > span {
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text; background-clip: text; color: transparent;
  }
  .hero h1 .rot::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: .1em; height: .2em; border-radius: 99px;
    background: color-mix(in srgb, var(--accent-2) 30%, transparent);
    transform: scaleX(0); transform-origin: left;
    animation: rotMark .9s cubic-bezier(.65, 0, .35, 1) .8s forwards;
  }
  @keyframes rotMark { to { transform: scaleX(1); } }

  /* 배지 점이 은은하게 맥박 */
  .hero .badge::before { animation: badgePulse 2s ease-out infinite; }
  @keyframes badgePulse {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .55); }
    70%, 100% { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); }
  }

  @media (prefers-reduced-motion: reduce) {
    .hero h1 .rot > span { transition: none; filter: none; }
    .hero h1 .rot::after { animation: none; transform: scaleX(1); }
    .hero .badge::before { animation: none; }
  }

  
  a, a *,
  a:hover, a:hover *,
  a:focus, a:focus *,
  a:active, a:active *,
  a:visited, a:visited * { text-decoration: none !important; }

  /* 프로젝트 카드도 언론 보도와 동일: 카드에 마우스를 올리면 "자세히 →"가 버튼처럼 색이 채워짐 */
  .project .project-links { gap: 6px; flex-wrap: wrap; }
  .project .project-links a {
    padding: 6px 12px; border-radius: 8px;
    transition: background .2s ease, color .2s ease, margin .2s ease, transform .2s ease;
  }
  .project .project-links a:first-child { margin-left: -12px; }
  .project:hover .project-links a { background: var(--accent, #1f3a68); color: #fff; }
  .project:hover .project-links a:first-child { margin-left: 0; }
  .project .project-links a:hover { transform: translateY(-2px); }   /* 링크가 2개인 카드: 누를 버튼이 살짝 떠오름 */
  [data-theme="dark"] .project:hover .project-links a { color: #0f1218; }

  /* 링크가 2개인 카드(홍보대사 · 영상 제작): 항상 한 줄에 두 칸으로 나란히
     - 글자 크기를 카드 폭에 맞춰 자동 조절 (좁은 카드에서도 줄바꿈 없음) */
  .project .project-links:has(a + a) {
    display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
    container-type: inline-size;
  }
  .project .project-links:has(a + a) a {
    margin-left: 0 !important; min-width: 0;
    padding: 7px 4px; text-align: center; white-space: nowrap;
    border: 1px solid var(--line, #e6e8ef);
    font-size: clamp(11px, calc((50cqw - 14px) / 10.6), 14px);
  }
  .project:hover .project-links:has(a + a) a { border-color: var(--accent, #1f3a68); }

  /* 언론 보도 카드는 "기사 보기"가 버튼처럼 색이 채워짐 */
  .press-card .press-link {
    align-self: flex-start; padding: 6px 12px; margin-left: -12px; border-radius: 8px;
    transition: background .2s ease, color .2s ease, margin .2s ease;
  }
  .press-card:hover .press-link { background: var(--accent, #1f3a68); color: #fff; margin-left: 0; }
  [data-theme="dark"] .press-card:hover .press-link { color: #0f1218; }

  /* ---------- 오른쪽 스크롤바(드래그바) 숨기기 — 스크롤 기능은 그대로 ---------- */
  html, body { scrollbar-width: none; -ms-overflow-style: none; }   /* Firefox · 구형 Edge */
  html::-webkit-scrollbar, body::-webkit-scrollbar { display: none; width: 0; height: 0; }   /* Chrome · Edge · Safari */

  .to-top {
    position: fixed; right: 24px; bottom: 28px; z-index: 90;
    width: 52px; height: 52px; padding: 0; border: none; border-radius: 50%;
    display: grid; place-items: center; cursor: pointer;
    background: var(--card, #fff); color: var(--accent, #1f3a68);
    box-shadow: 0 8px 24px rgba(20, 30, 60, .14), 0 0 0 1px var(--line, #e6e8ef);
    opacity: 0; visibility: hidden; transform: translateY(16px) scale(.9);
    transition: opacity .3s ease, transform .3s ease, visibility .3s, box-shadow .2s;
  }
  .to-top.show { opacity: 1; visibility: visible; transform: none; }
  .to-top:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(20, 30, 60, .2), 0 0 0 1px var(--accent, #1f3a68); }
  .to-top:active { transform: translateY(0) scale(.95); }
  .to-top:focus-visible { outline: 3px solid var(--accent, #1f3a68); outline-offset: 3px; }

  /* 스크롤 진행률 링 */
  .to-top svg.ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
  .to-top .ring-bg { fill: none; stroke: var(--line, #e6e8ef); stroke-width: 3; }
  .to-top .ring-fg {
    fill: none; stroke: var(--accent, #1f3a68); stroke-width: 3; stroke-linecap: round;
    stroke-dasharray: 150.8; stroke-dashoffset: 150.8; transition: stroke-dashoffset .1s linear;
  }
  /* 화살표: 마우스를 올리면 위로 살짝 튀어오름 */
  .to-top .arrow { position: relative; width: 20px; height: 20px; transition: transform .25s ease; }
  .to-top:hover .arrow { transform: translateY(-3px); }

  @media (max-width: 860px) {
    .to-top { right: 16px; bottom: 18px; width: 46px; height: 46px; }
  }
  @media (prefers-reduced-motion: reduce) {
    .to-top, .to-top .arrow, .to-top .ring-fg { transition: none; }
  }

  /* ---------- 콘텐츠 보호: 텍스트 선택 · 이미지 드래그 방지 ---------- */
  body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
  input, textarea, [contenteditable="true"] { -webkit-user-select: text; user-select: text; }   /* 입력칸은 예외 */
  img, a { -webkit-user-drag: none; user-drag: none; }

  /* 보호 안내 토스트 */
  .guard-toast {
    position: fixed; left: 50%; bottom: 32px; z-index: 200;
    display: flex; align-items: center; gap: 10px;
    padding: 12px 18px; border-radius: 12px;
    background: rgba(21, 23, 28, .92); color: #fff; font-size: 14px; font-weight: 500;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .2); backdrop-filter: blur(6px);
    opacity: 0; pointer-events: none; transform: translate(-50%, 12px);
    transition: opacity .25s ease, transform .25s ease;
  }
  .guard-toast.show { opacity: 1; transform: translate(-50%, 0); }
  .guard-toast .ico { font-size: 16px; }
  @media (prefers-reduced-motion: reduce) { .guard-toast { transition: none; } }

    #header { --nav-h: 64px; }
  #header .nav { height: var(--nav-h); gap: 16px; }
  #header.scrolled { box-shadow: 0 6px 24px rgba(20, 30, 60, .06); }
  #header .logo { flex-shrink: 0; font-size: 19px; }

  /* ---------- 메뉴: 알약 모양 묶음 ---------- */
  #header .nav-links {
    display: flex; align-items: center; gap: 2px; list-style: none; margin: 0 0 0 auto;
    padding: 4px; border-radius: 999px;
    background: color-mix(in srgb, var(--bg-soft, #f6f7fb) 80%, transparent);
    border: 1px solid var(--line, #e6e8ef);
  }
  #header .nav-links > li > a,
  #header .more-btn {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 7px 14px; border-radius: 999px;
    font-family: inherit; font-size: 14px; font-weight: 600; letter-spacing: -.1px;
    color: var(--text-sub, #5b6170); background: none; border: none; cursor: pointer;
    transition: color .2s, background .2s, box-shadow .2s;
  }
  #header .nav-links > li > a:hover,
  #header .more-btn:hover { color: var(--text, #15171c); background: color-mix(in srgb, var(--card, #fff) 70%, transparent); }
  /* 현재 보고 있는 섹션 */
  #header .nav-links > li > a.active,
  #header .more-btn.has-active {
    color: var(--accent, #1f3a68); background: var(--card, #fff);
    box-shadow: 0 1px 2px rgba(20, 30, 60, .08), 0 0 0 1px var(--line, #e6e8ef);
  }

  /* Contact: 강조 버튼 */
  #header .nav-cta { margin-left: 4px; }
  #header .nav-cta > a { background: var(--accent, #1f3a68) !important; color: #fff !important; box-shadow: none !important; }
  #header .nav-cta > a:hover { filter: brightness(1.12); }
  [data-theme="dark"] #header .nav-cta > a { color: #0f1218 !important; }

  /* ---------- 더보기 드롭다운 ---------- */
  #header .nav-more { position: relative; }
  #header .more-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
  #header .nav-more.open .more-btn svg { transform: rotate(180deg); }
  #header .more-menu {
    position: absolute; top: calc(100% + 10px); right: -8px; min-width: 200px;
    list-style: none; margin: 0; padding: 6px; border-radius: 14px;
    background: var(--card, #fff); border: 1px solid var(--line, #e6e8ef);
    box-shadow: 0 16px 40px rgba(20, 30, 60, .14);
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s;
  }
  #header .nav-more.open .more-menu { opacity: 1; visibility: visible; transform: none; }
  #header .more-menu a {
    display: flex; justify-content: space-between; align-items: center; gap: 16px;
    padding: 10px 12px; border-radius: 10px;
    font-size: 14px; font-weight: 600; color: var(--text, #15171c); transition: background .15s, color .15s;
  }
  #header .more-menu a small { font-size: 12px; font-weight: 500; color: var(--text-sub, #5b6170); }
  #header .more-menu a:hover, #header .more-menu a.active { background: var(--accent-soft, #e9eef8); color: var(--accent, #1f3a68); }

  /* ---------- 오른쪽 도구 (테마 · 햄버거) ---------- */
  #header .nav-tools { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
  #header .theme-btn { width: 38px; height: 38px; }
  #header .menu-btn {
    display: none; position: relative; width: 40px; height: 40px; padding: 0;
    border-radius: 12px; border: 1px solid var(--line, #e6e8ef); background: var(--card, #fff); cursor: pointer;
  }
  #header .menu-btn span {
    position: absolute; left: 11px; width: 18px; height: 2px; border-radius: 2px; background: var(--text, #15171c);
    transition: transform .25s ease, opacity .2s ease, top .25s ease;
  }
  #header .menu-btn span:nth-child(1) { top: 13px; }
  #header .menu-btn span:nth-child(2) { top: 19px; }
  #header .menu-btn span:nth-child(3) { top: 25px; }
  #header .menu-btn.open span:nth-child(1) { top: 19px; transform: rotate(45deg); }
  #header .menu-btn.open span:nth-child(2) { opacity: 0; }
  #header .menu-btn.open span:nth-child(3) { top: 19px; transform: rotate(-45deg); }

  /* 스크롤 진행 막대 (헤더 아래 얇은 선) */
  #header .nav-progress {
    position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%;
    background: linear-gradient(90deg, var(--accent, #1f3a68), color-mix(in srgb, var(--accent, #1f3a68) 45%, #fff));
    transform: scaleX(0); transform-origin: left; transition: transform .1s linear;
  }

  /* ---------- 태블릿 · 모바일 (1100px 이하): 햄버거 메뉴 ---------- */
  @media (max-width: 1100px) {
    #header .menu-btn { display: block; }
    #header .nav-links {
      position: absolute; top: var(--nav-h); left: 12px; right: 12px; margin: 0;
      display: grid !important; grid-template-columns: 1fr 1fr; gap: 6px;
      padding: 14px; border-radius: 18px;
      background: var(--card, #fff); border: 1px solid var(--line, #e6e8ef);
      box-shadow: 0 20px 50px rgba(20, 30, 60, .16);
      opacity: 0; visibility: hidden; transform: translateY(-8px);
      transition: opacity .2s ease, transform .2s ease, visibility .2s;
    }
    #header .nav-links.open { opacity: 1; visibility: visible; transform: none; }
    #header .nav-links li { width: auto; }
    #header .nav-links > li > a { width: 100%; justify-content: flex-start; padding: 12px 14px; border-radius: 12px; font-size: 15px; }
    #header .nav-links > li > a:hover { background: var(--bg-soft, #f6f7fb); }
    /* 모바일에서는 '더보기' 묶음을 풀어서 모든 메뉴를 바로 표시 */
    #header .nav-more { display: contents; }
    #header .more-btn { display: none; }
    #header .more-menu { display: contents; visibility: visible; opacity: 1; transform: none; }   /* 데스크톱의 숨김 상태가 하위 항목에 상속되지 않게 */
    #header .more-menu li { width: auto; }
    #header .more-menu a { padding: 12px 14px; border-radius: 12px; font-size: 15px; }
    #header .nav-cta { grid-column: 1 / -1; margin: 6px 0 0; }
    #header .nav-cta > a { justify-content: center !important; padding: 13px !important; }
  }
  @media (max-width: 420px) {
    #header .nav-links { grid-template-columns: 1fr; }
  }
  @media (prefers-reduced-motion: reduce) {
    #header *, #header .nav-links { transition: none !important; }
  }