/* ============================================================
   제일좋은내과 — Design System v2
   ============================================================ */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css');

:root {
  --primary: #1d6ceb;
  --primary-dark: #114fc0;
  --primary-deep: #0b3a8f;
  --primary-light: #eaf2ff;
  --ink: #0b1f3a;
  --text: #24344d;
  --muted: #5c6b82;
  --border: #e4e9f1;
  --bg-soft: #f5f8fc;
  --white: #fff;
  --max-w: 1180px;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(11, 31, 58, 0.08);
  --shadow-sm: 0 3px 12px rgba(11, 31, 58, 0.06);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont,
    'Apple SD Gothic Neo', 'Malgun Gothic', '맑은 고딕', sans-serif;
  color: var(--text);
  background: var(--white);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Scroll reveal ===== */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.in {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ===== Top Bar ===== */
.topbar {
  background: var(--ink);
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
}
.topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 38px;
}
.topbar .tel {
  color: #8fb8ff;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* ===== Header ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.header.scrolled {
  border-bottom-color: var(--border);
  box-shadow: 0 4px 20px rgba(11, 31, 58, 0.06);
}
.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 21px;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.brand img { height: 42px; width: auto; }
.brand .sub {
  display: block;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.08em;
}
.nav { display: flex; gap: 2px; }
.nav a {
  position: relative;
  padding: 10px 15px;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--text);
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
}
.nav a:hover { background: var(--primary-light); color: var(--primary); }
.nav a.active { color: var(--primary); }
.nav a.active::after {
  content: '';
  position: absolute;
  left: 15px;
  right: 15px;
  bottom: 4px;
  height: 3px;
  border-radius: 3px;
  background: var(--primary);
}
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 13px;
  font-size: 18px;
  color: var(--ink);
  cursor: pointer;
}

/* ===== Hero (full-bleed) ===== */
.hero {
  position: relative;
  color: var(--white);
  overflow: hidden;
  background: var(--ink);
}
.hero-bg {
  position: absolute;
  inset: 0;
}
.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.5;
  transform: scale(1.05);
  animation: heroZoom 14s var(--ease) forwards;
}
@keyframes heroZoom {
  to { transform: scale(1); }
}
.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg,
    rgba(7, 22, 46, 0.92) 0%,
    rgba(9, 30, 66, 0.72) 45%,
    rgba(11, 31, 58, 0.35) 100%);
}
.hero-inner {
  position: relative;
  z-index: 1;
  padding: 120px 24px 140px;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(6px);
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 26px;
}
.hero-badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #6ee7b7;
  box-shadow: 0 0 0 4px rgba(110, 231, 183, 0.25);
}
.hero h1 {
  font-size: clamp(36px, 5.4vw, 60px);
  line-height: 1.18;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 22px;
  max-width: 640px;
}
.hero h1 .accent {
  background: linear-gradient(90deg, #8fb8ff, #5e97f7);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.lead {
  font-size: clamp(16px, 1.6vw, 19px);
  color: rgba(255, 255, 255, 0.82);
  margin-bottom: 36px;
  max-width: 560px;
}
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; }

/* ===== Hero stats strip ===== */
.hero-stats {
  position: relative;
  z-index: 2;
  margin-top: -72px;
  padding-bottom: 10px;
}
.hero-stats .grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.stat {
  padding: 28px 24px;
  text-align: center;
  border-right: 1px solid var(--border);
}
.stat:last-child { border-right: none; }
.stat .num {
  font-size: 32px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.stat .label {
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
  margin-top: 4px;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 15.5px;
  border: none;
  cursor: pointer;
  transition: transform 0.15s var(--ease), background 0.15s, color 0.15s, box-shadow 0.15s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: var(--primary);
  color: var(--white);
  box-shadow: 0 8px 20px rgba(29, 108, 235, 0.35);
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline {
  background: rgba(255, 255, 255, 0.06);
  color: var(--white);
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(4px);
}
.btn-outline:hover { background: rgba(255, 255, 255, 0.16); }
.section .btn-outline,
.content-block .btn-outline {
  color: var(--primary);
  border-color: var(--primary);
  background: transparent;
}
.section .btn-outline:hover,
.content-block .btn-outline:hover { background: var(--primary-light); }

/* ===== Quick Info Cards (sub pages / index) ===== */
.quick-info { padding: 48px 0 8px; }
.quick-info .grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.qi-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow-sm);
  display: flex;
  gap: 18px;
  align-items: flex-start;
  transition: transform 0.2s var(--ease), box-shadow 0.2s;
}
.qi-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.qi-card .icon {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--primary-light), #dbeafe);
  color: var(--primary);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}
.qi-card h3 {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.qi-card .value {
  font-size: 17.5px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.4;
  letter-spacing: -0.01em;
}
.qi-card .value small {
  display: block;
  font-size: 13.5px;
  color: var(--muted);
  font-weight: 500;
  margin-top: 4px;
}

/* ===== Section ===== */
.section { padding: 96px 0; }
.section.alt { background: var(--bg-soft); }
.section-head { text-align: center; margin-bottom: 56px; }
.section-head .eyebrow {
  display: inline-block;
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.18em;
  margin-bottom: 14px;
}
.section-head h2 {
  font-size: clamp(28px, 3.4vw, 40px);
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.025em;
  margin-bottom: 16px;
}
.section-head p {
  color: var(--muted);
  font-size: 16.5px;
  max-width: 660px;
  margin: 0 auto;
}

/* ===== Departments Grid ===== */
.dept-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
}
.dept-card {
  position: relative;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 34px 24px 30px;
  text-align: center;
  overflow: hidden;
  transition: transform 0.22s var(--ease), box-shadow 0.22s, border-color 0.22s;
}
.dept-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), #6ea6ff);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}
.dept-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
  border-color: transparent;
}
.dept-card:hover::before { transform: scaleX(1); }
.dept-card .icon {
  width: 62px;
  height: 62px;
  background: linear-gradient(135deg, var(--primary-light), #dbeafe);
  color: var(--primary);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin: 0 auto 18px;
  transition: transform 0.25s var(--ease);
}
.dept-card:hover .icon { transform: scale(1.1) rotate(-4deg); }
.dept-card h3 { font-size: 17.5px; font-weight: 800; color: var(--ink); margin-bottom: 6px; }
.dept-card p { font-size: 14px; color: var(--muted); }

/* ===== Feature split (image + text) ===== */
.feature-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}
.feature-split h3 {
  font-size: 26px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
  margin-bottom: 18px;
}
.hero-img,
.feature-img {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  aspect-ratio: 4/3;
}
.hero-img img,
.feature-img img { width: 100%; height: 100%; object-fit: cover; }

/* ===== Check list ===== */
.bullets { margin: 0 0 18px; }
.bullets li {
  position: relative;
  padding-left: 32px;
  margin-bottom: 12px;
  color: var(--text);
  font-size: 15.5px;
}
.bullets li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 1px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== CTA banner ===== */
.cta-banner {
  background: linear-gradient(115deg, var(--primary-deep), var(--primary));
  border-radius: 24px;
  padding: 64px 48px;
  text-align: center;
  color: var(--white);
  position: relative;
  overflow: hidden;
}
.cta-banner::before,
.cta-banner::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
}
.cta-banner::before { width: 340px; height: 340px; top: -160px; right: -80px; }
.cta-banner::after { width: 240px; height: 240px; bottom: -130px; left: -60px; }
.cta-banner h2 {
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  position: relative;
}
.cta-banner p {
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 28px;
  position: relative;
}
.cta-banner .btn-primary {
  background: var(--white);
  color: var(--primary-dark);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  position: relative;
}
.cta-banner .btn-primary:hover { background: #f0f5ff; }

/* ===== Schedule Table ===== */
.schedule-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}
.schedule-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 34px;
  box-shadow: var(--shadow-sm);
}
.schedule-card h3 {
  font-size: 21px;
  font-weight: 800;
  margin-bottom: 6px;
  color: var(--ink);
}
.schedule-card h3::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--primary);
  margin-right: 10px;
}
.schedule-card .note {
  font-size: 13.5px;
  color: var(--muted);
  margin-bottom: 20px;
}
.schedule-table { width: 100%; border-collapse: collapse; }
.schedule-table th,
.schedule-table td {
  padding: 13px 8px;
  border-bottom: 1px solid var(--border);
  text-align: center;
  font-size: 14.5px;
}
.schedule-table th {
  background: var(--bg-soft);
  font-weight: 700;
  color: var(--ink);
  font-size: 13.5px;
}
.schedule-table tr:last-child td { border-bottom: none; }
.schedule-table .closed { color: #e11d48; font-weight: 700; }

/* ===== Doctors ===== */
.doctor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 24px;
}
.doctor-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 32px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s var(--ease), box-shadow 0.2s;
}
.doctor-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.doctor-card .role {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
  border-radius: 999px;
  padding: 6px 14px;
  margin-bottom: 16px;
}
.doctor-card h3 {
  font-size: 23px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}
.doctor-card ul li {
  position: relative;
  padding-left: 16px;
  font-size: 14.5px;
  color: var(--muted);
  margin-bottom: 8px;
}
.doctor-card ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 5px;
  height: 5px;
  background: var(--primary);
  border-radius: 50%;
}

/* ===== Gallery ===== */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}
.gallery figure {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-soft);
  aspect-ratio: 4/3;
  box-shadow: var(--shadow-sm);
}
.gallery figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}
.gallery figure:hover img { transform: scale(1.06); }

/* ===== Page Header (sub pages) ===== */
.page-head {
  position: relative;
  background:
    radial-gradient(900px 400px at 85% -10%, rgba(94, 151, 247, 0.35), transparent 60%),
    radial-gradient(700px 380px at 8% 110%, rgba(29, 108, 235, 0.28), transparent 55%),
    linear-gradient(115deg, #0a1c38 0%, #123a7c 100%);
  color: var(--white);
  padding: 84px 0 72px;
  text-align: center;
  overflow: hidden;
}
.page-head h1 {
  font-size: clamp(30px, 4vw, 42px);
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 10px;
}
.page-head p { color: rgba(255, 255, 255, 0.78); font-size: 16.5px; }
.breadcrumb { margin-top: 18px; font-size: 13.5px; color: rgba(255, 255, 255, 0.6); }
.breadcrumb a:hover { color: var(--white); text-decoration: underline; }

/* ===== Content blocks ===== */
.content-block { max-width: 900px; margin: 0 auto; }
.content-block h2 {
  font-size: 25px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
  margin: 48px 0 16px;
  padding-left: 16px;
  border-left: 4px solid var(--primary);
}
.content-block h2:first-child { margin-top: 0; }
.content-block h3 { font-size: 18.5px; font-weight: 700; color: var(--ink); margin: 26px 0 8px; }
.content-block p { color: var(--muted); margin-bottom: 14px; font-size: 15.5px; }
.content-block ul.bullets { margin: 0 0 20px; }

/* ===== Directions / Map ===== */
.map-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  margin-bottom: 28px;
}
.map-wrap iframe { width: 100%; height: 440px; border: 0; display: block; }

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-top: 28px;
}
.info-grid .item {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow-sm);
}
.info-grid .item h4 {
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}
.info-grid .item p { color: var(--ink); font-weight: 700; font-size: 15.5px; }
.section.alt .info-grid .item { background: var(--white); }
.section .info-grid .item { background: var(--bg-soft); border-color: transparent; box-shadow: none; }

/* ===== Notice list ===== */
.notice-list { border-top: 2px solid var(--ink); }
.notice-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 10px;
  border-bottom: 1px solid var(--border);
  gap: 14px;
  transition: background 0.15s;
}
.notice-list li:hover { background: var(--bg-soft); }
.notice-list .title { font-weight: 600; flex: 1; font-size: 15.5px; }
.notice-list a.title:hover { text-decoration: underline; }
.notice-list .date { color: var(--muted); font-size: 13.5px; flex-shrink: 0; }
.notice-list .badge {
  background: var(--primary);
  color: var(--white);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 700;
  flex-shrink: 0;
}

/* ===== Footer ===== */
.footer {
  background: var(--ink);
  color: #b6c2d4;
  padding: 64px 0 36px;
  font-size: 14.5px;
}
.footer .container {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 40px;
}
.footer h4 {
  color: var(--white);
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}
.footer p, .footer li { line-height: 1.9; color: #8b9bb2; }
.footer a { transition: color 0.15s; }
.footer a:hover { color: var(--white); }
.footer-bottom {
  text-align: center;
  margin-top: 44px;
  padding-top: 26px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  color: #5f7086;
  font-size: 13px;
}

/* ===== Floating call button ===== */
.floating-call {
  position: fixed;
  right: 22px;
  bottom: 22px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--white);
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 26px rgba(29, 108, 235, 0.45);
  font-size: 24px;
  z-index: 40;
  transition: transform 0.2s var(--ease);
}
.floating-call:hover { transform: scale(1.1) rotate(-6deg); }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .hero-inner { padding: 84px 24px 120px; }
  .hero-stats .grid { grid-template-columns: repeat(2, 1fr); }
  .stat { border-right: none; border-bottom: 1px solid var(--border); }
  .stat:nth-child(odd) { border-right: 1px solid var(--border); }
  .stat:nth-child(3), .stat:nth-child(4) { border-bottom: none; }
  .quick-info .grid { grid-template-columns: 1fr; }
  .feature-split { grid-template-columns: 1fr; gap: 32px; }
  .schedule-wrap { grid-template-columns: 1fr; }
  .footer .container { grid-template-columns: 1fr; gap: 28px; }
  .nav {
    display: none;
    position: absolute;
    top: 76px;
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    padding: 10px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
  }
  .nav.open { display: flex; }
  .nav a { padding: 15px 18px; }
  .nav a.active::after { display: none; }
  .nav-toggle { display: block; }
  .section { padding: 64px 0; }
  .section-head { margin-bottom: 40px; }
  .page-head { padding: 60px 0 52px; }
  .cta-banner { padding: 48px 28px; border-radius: var(--radius); }
  .topbar { display: none; }
}
