/* ========================================
   MediCare - Style (Medical Blue-Cyan Theme)
   세로형 교차 레이아웃 (Zigzag)
   ======================================== */

/* --- CSS Variables --- */
:root {
  --primary: #00B4D8;
  --primary-dark: #0096B7;
  --primary-glow: rgba(0, 180, 216, 0.3);
  --accent: #FF6B6B;
  --accent-dark: #E05252;
  --bg-dark: #0A1520;
  --bg-darker: #050D14;
  --bg-charcoal: #0E1A26;
  --bg-light: #F0F8FC;
  --bg-white: #FFFFFF;
  --text-white: #FFFFFF;
  --text-black: #1A1A1A;
  --text-gray: #888888;
  --text-light-gray: #AAAAAA;
  --radius: 16px;
  --radius-sm: 8px;
  --transition: 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --transition-slow: 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-black);
  background: var(--bg-white);
  line-height: 1.6;
  word-break: keep-all;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--transition);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 36px;
  border-radius: 50px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.1);
  opacity: 0;
  transition: opacity var(--transition);
}

.btn:hover::after {
  opacity: 1;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--primary-glow);
}

.btn-outline {
  background: transparent;
  color: var(--text-white);
  border: 1.5px solid rgba(255,255,255,0.3);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
}

.btn-lg {
  padding: 18px 48px;
  font-size: 16px;
}

.btn-full {
  width: 100%;
}

/* --- Header --- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 0 24px;
  transition: all var(--transition);
}

.header.scrolled {
  background: rgba(10, 21, 32, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0,180,216,0.1);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  height: 36px;
  width: auto;
}

.logo-text {
  font-size: 22px;
  font-weight: 900;
  color: var(--text-white);
  letter-spacing: -0.02em;
}

.nav {
  display: flex;
  gap: 36px;
}

.nav-link {
  color: rgba(255,255,255,0.7);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  position: relative;
  padding: 4px 0;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width var(--transition);
}

.nav-link:hover {
  color: var(--text-white);
}

.nav-link:hover::after {
  width: 100%;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-white);
  transition: all 0.3s ease;
  transform-origin: center;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 6px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -6px);
}

/* Mobile Nav */
.mobile-nav {
  position: fixed;
  inset: 0;
  background: rgba(5, 13, 20, 0.97);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.5s ease;
}

.mobile-nav.active {
  opacity: 1;
  visibility: visible;
}

.mobile-nav-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

.mobile-nav-link {
  color: var(--text-white);
  font-size: 28px;
  font-weight: 700;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.4s ease;
}

.mobile-nav.active .mobile-nav-link {
  opacity: 1;
  transform: translateY(0);
}

.mobile-nav.active .mobile-nav-link:nth-child(1) { transition-delay: 0.1s; }
.mobile-nav.active .mobile-nav-link:nth-child(2) { transition-delay: 0.15s; }
.mobile-nav.active .mobile-nav-link:nth-child(3) { transition-delay: 0.2s; }
.mobile-nav.active .mobile-nav-link:nth-child(4) { transition-delay: 0.25s; }
.mobile-nav.active .mobile-nav-link:nth-child(5) { transition-delay: 0.3s; }

.mobile-nav-link:hover {
  color: var(--primary);
}

/* --- Hero --- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: var(--bg-dark);
}

.hero-gradient {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(5,13,20,0.3) 0%, rgba(5,13,20,0.5) 50%, rgba(5,13,20,0.85) 100%),
    radial-gradient(ellipse 80% 60% at 50% 40%, rgba(0, 180, 216, 0.12) 0%, transparent 70%);
}

.hero-particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.hero-particle {
  position: absolute;
  width: 3px;
  height: 3px;
  background: var(--primary);
  border-radius: 50%;
  opacity: 0;
  animation: particleFloat 8s infinite;
}

@keyframes particleFloat {
  0% { opacity: 0; transform: translateY(100vh) scale(0); }
  10% { opacity: 0.6; }
  90% { opacity: 0.1; }
  100% { opacity: 0; transform: translateY(-20vh) scale(1); }
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 24px;
}

.hero-sub {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 24px;
  opacity: 0;
  animation: fadeUp 1s 0.3s forwards;
}

.hero-title {
  font-size: clamp(36px, 7vw, 72px);
  font-weight: 900;
  color: var(--text-white);
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
}

.blur-word {
  display: inline-block;
  opacity: 0;
  filter: blur(20px);
  transform: translateY(20px);
  animation: blurReveal 0.8s forwards;
}

.blur-word:nth-child(1) { animation-delay: 0.5s; }
.blur-word:nth-child(2) { animation-delay: 0.65s; }
.blur-word:nth-child(3) { animation-delay: 0.9s; }
.blur-word:nth-child(4) { animation-delay: 1.0s; }
.blur-word:nth-child(5) { animation-delay: 1.1s; }

@keyframes blurReveal {
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}

.hero-desc {
  font-size: clamp(16px, 2.5vw, 20px);
  color: var(--text-light-gray);
  margin-bottom: 40px;
  line-height: 1.7;
}

.fade-up {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeUp 0.8s 1.5s forwards;
}

.hero-desc.fade-up { animation-delay: 1.4s; }
.btn.fade-up { animation-delay: 1.6s; }

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Scroll Indicator */
.hero-scroll {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

.scroll-indicator {
  width: 28px;
  height: 44px;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 14px;
  display: flex;
  justify-content: center;
  padding-top: 8px;
}

.scroll-indicator span {
  display: block;
  width: 4px;
  height: 8px;
  background: var(--primary);
  border-radius: 2px;
  animation: scrollBounce 2s infinite;
}

@keyframes scrollBounce {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(12px); opacity: 0.3; }
}

/* Wave Divider */
.wave-divider {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 3;
  line-height: 0;
}

.wave-divider svg {
  width: 100%;
  height: 80px;
  display: block;
}

/* --- Section Commons --- */
.section-header {
  text-align: center;
  margin-bottom: 64px;
}

.section-tag {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.section-title {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--text-black);
}

.section-title-light {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.3;
  color: var(--text-white);
}

.section-desc {
  font-size: 17px;
  color: var(--text-gray);
  margin-top: 12px;
}

/* --- Services - Zigzag --- */
.services {
  padding: 120px 0;
  background: var(--bg-white);
}

.zigzag-item {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
  margin-bottom: 80px;
}

.zigzag-item:last-child {
  margin-bottom: 0;
}

.zigzag-reverse {
  direction: rtl;
}

.zigzag-reverse > * {
  direction: ltr;
}

.zigzag-visual {
  position: relative;
}

.zigzag-img {
  width: 100%;
  height: 360px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.zigzag-img::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%);
}

.zigzag-img svg {
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.2));
}

.zigzag-content {
  padding: 20px 0;
}

.service-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.1em;
}

.service-name {
  font-size: 32px;
  font-weight: 800;
  margin: 12px 0 16px;
  letter-spacing: -0.02em;
  color: var(--text-black);
}

.service-desc {
  font-size: 16px;
  color: #555;
  line-height: 1.8;
  margin-bottom: 24px;
}

.service-link {
  display: inline-flex;
  align-items: center;
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
  transition: all var(--transition);
}

.service-link:hover {
  color: var(--primary-dark);
  transform: translateX(4px);
}

/* --- Doctors --- */
.doctors {
  position: relative;
  padding: 140px 0;
  overflow: hidden;
}

.doctors-bg {
  position: absolute;
  inset: 0;
  background: var(--bg-dark);
}

.doctors-gradient {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 50% at 50% 30%, rgba(0, 180, 216, 0.08) 0%, transparent 70%);
}

.doctors-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.doctor-card {
  text-align: center;
  padding: 40px 20px;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.06);
  transition: all var(--transition);
  position: relative;
}

.doctor-card:hover {
  background: rgba(255,255,255,0.03);
  border-color: rgba(0, 180, 216, 0.2);
  transform: translateY(-4px);
}

.doctor-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.doctor-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-white);
  margin-bottom: 6px;
}

.doctor-dept {
  font-size: 13px;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 8px;
}

.doctor-desc {
  font-size: 14px;
  color: var(--text-gray);
  line-height: 1.5;
}

/* --- Stats --- */
.stats {
  padding: 120px 0;
  background: var(--bg-light);
}

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

.stat-item {
  text-align: center;
  padding: 40px 20px;
  border-radius: var(--radius);
  transition: all var(--transition);
  background: var(--bg-white);
  border: 1px solid rgba(0,180,216,0.08);
}

.stat-item:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 30px rgba(0,180,216,0.1);
}

.stat-number {
  font-size: clamp(40px, 5vw, 56px);
  font-weight: 900;
  color: var(--primary-dark);
  letter-spacing: -0.03em;
  line-height: 1;
}

.stat-suffix {
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 700;
  color: var(--primary-dark);
}

.stat-label {
  font-size: 15px;
  color: var(--text-gray);
  margin-top: 12px;
  font-weight: 500;
}

/* --- Reviews --- */
.reviews {
  padding: 120px 0;
  background: var(--bg-white);
}

.reviews-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.review-card {
  padding: 36px;
  border-radius: var(--radius);
  background: var(--bg-white);
  border: 1px solid #eee;
  transition: all var(--transition);
}

.review-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.06);
  border-color: transparent;
}

.review-stars {
  color: #F59E0B;
  font-size: 18px;
  margin-bottom: 16px;
  letter-spacing: 2px;
}

.review-text {
  font-size: 15px;
  color: #444;
  line-height: 1.8;
  margin-bottom: 24px;
  font-style: italic;
}

.review-author {
  display: flex;
  align-items: center;
  gap: 12px;
}

.review-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 16px;
}

.review-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-black);
}

.review-info {
  font-size: 13px;
  color: var(--text-gray);
}

/* --- CTA --- */
.cta {
  position: relative;
  padding: 140px 0;
  overflow: hidden;
}

.cta-bg {
  position: absolute;
  inset: 0;
  background: var(--bg-darker);
}

.cta-gradient {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(5,13,20,0.85) 0%, rgba(5,13,20,0.7) 50%, rgba(5,13,20,0.9) 100%),
    radial-gradient(ellipse 60% 60% at 50% 50%, rgba(0, 180, 216, 0.12) 0%, transparent 70%);
}

.cta-inner {
  position: relative;
  text-align: center;
}

.cta-title {
  font-size: clamp(30px, 5vw, 48px);
  font-weight: 900;
  color: var(--text-white);
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.cta-desc {
  font-size: 18px;
  color: var(--text-gray);
  margin: 24px 0 40px;
}

.cta-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* --- Contact --- */
.contact {
  padding: 120px 0;
  background: var(--bg-white);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 64px;
  align-items: start;
}

.contact-item {
  margin-bottom: 32px;
}

.contact-item h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-gray);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

.contact-item a,
.contact-item p {
  font-size: 16px;
  color: var(--text-black);
  font-weight: 500;
}

.contact-item a:hover {
  color: var(--primary-dark);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  padding: 16px 20px;
  border: 1.5px solid #ddd;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: inherit;
  background: var(--bg-white);
  transition: all var(--transition);
  color: var(--text-black);
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

.contact-form textarea {
  resize: vertical;
  min-height: 120px;
}

/* --- Footer --- */
.footer {
  background: var(--bg-dark);
  padding: 80px 0 40px;
  color: var(--text-gray);
}

.footer-top {
  display: flex;
  justify-content: space-between;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 32px;
}

.footer-logo {
  display: flex;
  align-items: center;
}

.footer-tagline {
  font-size: 14px;
  color: var(--text-gray);
  margin-top: 8px;
}

.footer-links {
  display: flex;
  gap: 64px;
}

.footer-col h5 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-white);
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

.footer-col a {
  display: block;
  font-size: 14px;
  color: var(--text-gray);
  margin-bottom: 10px;
}

.footer-col a:hover {
  color: var(--primary);
}

.portfolio-disclaimer {
  text-align: center;
  color: #e53e3e;
  font-weight: 700;
  font-size: 13px;
  padding: 12px 16px;
  margin-bottom: 16px;
  border: 1px solid rgba(229, 62, 62, 0.3);
  border-radius: 6px;
  background: rgba(229, 62, 62, 0.05);
}

.footer-bottom {
  text-align: center;
}

.footer-bottom p {
  font-size: 13px;
  color: #555;
  line-height: 1.8;
}

.footer-copy {
  margin-top: 16px;
  color: #444;
}

/* --- Scroll Animations --- */
.anim-on-scroll {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.anim-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .zigzag-item {
    gap: 40px;
  }

  .doctors-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .reviews-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-links {
    gap: 40px;
  }
}

@media (max-width: 768px) {
  .nav { display: none; }
  .hamburger { display: flex; }

  .header-inner { height: 64px; }

  .hero-title {
    font-size: clamp(28px, 8vw, 48px);
  }

  .zigzag-item {
    grid-template-columns: 1fr;
    gap: 24px;
    margin-bottom: 60px;
  }

  .zigzag-reverse {
    direction: ltr;
  }

  .zigzag-img {
    height: 260px;
  }

  .service-name {
    font-size: 26px;
  }

  .doctors-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .reviews-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .services { padding: 80px 0; }
  .doctors { padding: 80px 0; }
  .stats { padding: 80px 0; }
  .reviews { padding: 80px 0; }
  .cta { padding: 80px 0; }
  .contact { padding: 80px 0; }

  .section-header { margin-bottom: 40px; }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .stat-item { padding: 24px 12px; }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .footer-top {
    flex-direction: column;
    gap: 40px;
  }

  .footer-links {
    gap: 32px;
    flex-wrap: wrap;
  }

  .cta-buttons {
    flex-direction: column;
    align-items: center;
  }

  .btn-lg {
    padding: 16px 40px;
    width: 100%;
    max-width: 300px;
  }
}

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

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .hero-content {
    padding: 0 16px;
  }

  .footer-links {
    flex-direction: column;
    gap: 24px;
  }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .blur-word {
    opacity: 1;
    filter: none;
    transform: none;
  }

  .anim-on-scroll {
    opacity: 1;
    transform: none;
  }

  html { scroll-behavior: auto; }
}
