/* =========================================================
   Metropy — Layout Styles
   Navigation, Pages, Hero, Sections, About, Footer
   ========================================================= */

/* ───── 네비게이션 ───── */
.navbar {
  position: fixed; top:0; left:0; right:0;
  z-index: 100;
  background: rgba(10,12,20,.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: var(--nav-h);
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  transition: all var(--transition);
}

.nav-logo:hover {
  transform: translateX(-2px);
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent), var(--green));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1rem;
  color: var(--bg);
  box-shadow: 0 4px 12px rgba(91, 140, 255, 0.3);
  transition: all var(--transition);
}

.nav-logo:hover .logo-icon {
  transform: rotate(-5deg) scale(1.05);
  box-shadow: 0 6px 16px rgba(91, 140, 255, 0.4);
}

.logo-text { font-weight: 800; font-size: 1.1rem; letter-spacing: -.02em; }

/* ───── 테마 토글 버튼 ───── */
.theme-toggle {
  background: var(--surface2);
  border: 2px solid var(--border);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  font-size: 1.2rem;
  margin-right: 8px;
}

.theme-toggle:hover {
  background: var(--surface3);
  border-color: var(--accent);
  transform: rotate(15deg) scale(1.1);
}

.theme-toggle .theme-icon-dark,
.theme-toggle .theme-icon-light {
  transition: opacity 0.3s, transform 0.3s;
}

[data-theme="light"] .theme-toggle .theme-icon-dark {
  display: none;
}

[data-theme="dark"] .theme-toggle .theme-icon-light,
:root:not([data-theme]) .theme-toggle .theme-icon-light {
  display: none;
}

.nav-links { display: flex; gap: 4px; }
.nav-link {
  padding: 8px 16px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: .88rem; font-weight: 500;
  border-radius: 8px;
  transition: var(--transition);
}
.nav-link:hover, .nav-link.active { color: var(--text); background: var(--surface2); }
.nav-hamburger {
  display: none;
  background: none; border: none; cursor: pointer;
  flex-direction: column; gap: 5px; padding: 8px;
}
.nav-hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--text-dim); border-radius: 2px;
  transition: var(--transition);
}
.nav-mobile {
  display: none;
  flex-direction: column;
  padding: 8px 24px 16px;
  border-top: 1px solid var(--border);
}
.nav-mobile.open { display: flex; }
.nav-mobile a {
  padding: 12px 0;
  color: var(--text-dim);
  text-decoration: none;
  font-size: .95rem;
  border-bottom: 1px solid var(--border);
}
.nav-mobile a:last-child { border-bottom: none; }

/* ───── 페이지 시스템 ───── */
.page { display: none; padding-top: var(--nav-h); min-height: 100vh; }
.page.active { display: block; }

.app-container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 40px 28px 60px;
}

/* ───── 히어로 ───── */
.hero {
  min-height: calc(100vh - var(--nav-h));
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  padding: 60px 24px;
  background: radial-gradient(ellipse at 50% 20%, rgba(91,140,255,.08) 0%, transparent 60%);
}
.hero-inner { max-width: 720px; }
.hero-badge {
  display: inline-block;
  padding: 6px 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: .78rem; font-weight: 600;
  color: var(--accent);
  letter-spacing: .04em;
  margin-bottom: 24px;
}
.hero-title {
  font-size: clamp(2rem, 6vw, 3.4rem);
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -.03em;
  margin-bottom: 20px;
}
.gradient-text {
  background: linear-gradient(135deg, var(--accent), var(--green));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-desc {
  font-size: 1.05rem;
  color: var(--text-dim);
  line-height: 1.8;
  margin-bottom: 32px;
}
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 48px; }
.btn-hero {
  padding: 16px 36px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: var(--bg);
  border: none;
  border-radius: var(--radius);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  box-shadow: 0 4px 16px rgba(91, 140, 255, 0.3);
  position: relative;
  overflow: hidden;
}

.btn-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s;
}

.btn-hero:hover::before {
  left: 100%;
}

.btn-hero:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 28px rgba(91, 140, 255, 0.45);
}

.btn-hero:active {
  transform: translateY(-1px) scale(0.98);
}

.btn-hero-secondary {
  padding: 16px 36px;
  background: var(--surface2);
  color: var(--text);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-hero-secondary:hover {
  background: var(--surface3);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn-hero-secondary:active {
  transform: translateY(0);
}

.btn-hero-github {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 16px 28px;
  background: var(--surface2);
  color: var(--text);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-hero-github:hover {
  background: var(--surface3);
  border-color: var(--text-dim);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn-hero-github:active {
  transform: translateY(0);
}

.btn-hero-github svg {
  flex-shrink: 0;
}
.hero-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
.stat {
  padding: 16px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.stat-number { display: block; font-size: 1.5rem; font-weight: 800; color: var(--accent); }
.stat-label { display: block; font-size: .75rem; color: var(--text-dim); margin-top: 2px; }

/* ───── 섹션 공통 ───── */
.section { padding: 80px 24px; }
.section-dark { background: var(--bg2); }
.section-inner { max-width: var(--max-w); margin: 0 auto; }
.section-title {
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 800; text-align: center;
  margin-bottom: 48px; letter-spacing: -.02em;
}

/* ───── 비교 그리드 ───── */
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 40px; }
.compare-card {
  padding: 32px; border-radius: var(--radius);
  border: 1px solid var(--border);
}
.compare-card.old { background: var(--red-dim); border-color: rgba(248,113,113,.2); }
.compare-card.new { background: var(--green-dim); border-color: rgba(52,211,153,.2); }
.compare-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 1rem; margin-bottom: 16px;
}
.compare-card.old .compare-icon { background: var(--red); color: var(--bg); }
.compare-card.new .compare-icon { background: var(--green); color: var(--bg); }
.compare-card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.compare-card p { color: var(--text-dim); font-size: .9rem; margin-bottom: 12px; }
.compare-card ul { list-style: none; }
.compare-card li {
  padding: 6px 0; font-size: .88rem; color: var(--text-dim);
  padding-left: 20px; position: relative;
}
.compare-card li::before { content: ''; position: absolute; left: 0; top: 13px; width: 6px; height: 6px; border-radius: 50%; }
.compare-card.old li::before { background: var(--red); }
.compare-card.new li::before { background: var(--green); }

.premise-box {
  background: var(--surface);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 28px 32px;
  position: relative;
}
.premise-quote {
  position: absolute; top: 8px; left: 16px;
  font-size: 3rem; color: var(--accent); opacity: .3; font-family: serif;
}
.premise-box p { font-size: 1rem; color: var(--text-dim); padding-left: 16px; }

/* ───── 스텝 ───── */
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
}
.step-num {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--accent), var(--green));
  border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.1rem; color: var(--bg);
  margin-bottom: 16px;
}
.step-card h3 { font-size: 1rem; margin-bottom: 8px; }
.step-card p { font-size: .85rem; color: var(--text-dim); }

/* ───── 공식 ───── */
.formula-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 32px;
}
.formula-main {
  text-align: center;
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  font-weight: 600;
  padding: 20px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  margin-bottom: 28px;
  overflow-x: auto;
  white-space: nowrap;
  color: var(--green);
}
.formula-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.formula-item {
  display: flex; flex-direction: column; gap: 6px;
  padding: 16px; background: var(--surface2);
  border-radius: var(--radius-sm);
}
.formula-symbol { font-size: 1.1rem; font-weight: 700; color: var(--accent); }
.formula-desc { font-size: .82rem; color: var(--text-dim); line-height: 1.5; }
.formula-desc small { color: var(--text-muted); }

.insight-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}
.insight-box h3 { font-size: 1rem; margin-bottom: 12px; color: var(--accent); }
.insight-box p { font-size: .9rem; color: var(--text-dim); }
.green { color: var(--green) !important; -webkit-text-fill-color: var(--green); }

/* ───── 연구 배경 ───── */
.about-container { max-width: 780px; }
.about-article h1 { font-size: 2rem; font-weight: 900; margin-bottom: 8px; letter-spacing: -.02em; }
.about-subtitle { font-size: 1rem; color: var(--text-dim); margin-bottom: 40px; }
.about-article section { margin-bottom: 40px; }
.about-article h2 {
  font-size: 1.2rem; font-weight: 700; margin-bottom: 16px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.about-article p { font-size: .92rem; color: var(--text-dim); margin-bottom: 12px; }
.about-article blockquote {
  border-left: 4px solid var(--accent); padding: 16px 24px; margin: 20px 0;
  background: var(--surface); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 1rem; font-weight: 500; color: var(--text); line-height: 1.8;
}

.data-table { border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); }
.data-row { display: grid; grid-template-columns: 2fr 1.5fr 1fr; padding: 12px 16px; font-size: .85rem; border-bottom: 1px solid var(--border); }
.data-row:last-child { border-bottom: none; }
.data-row.header { background: var(--surface2); font-weight: 700; font-size: .78rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: .05em; }
.data-row:not(.header) { color: var(--text-dim); }
.data-row:not(.header) span:first-child { color: var(--text); font-weight: 500; }

.findings-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 20px 0; }
.finding { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 20px; text-align: center; }
.finding-car { display: block; font-size: 1.4rem; font-weight: 900; color: var(--green); margin-bottom: 6px; }
.finding-car.bad { color: var(--red); }
.finding-desc { font-size: .82rem; color: var(--text-dim); }

/* ───── 개발 과정 타임라인 ───── */
.timeline {
  position: relative;
  padding-left: 28px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--accent), var(--green));
  border-radius: 1px;
}
.timeline-item {
  position: relative;
  margin-bottom: 28px;
}
.timeline-item:last-child { margin-bottom: 0; }
.timeline-marker {
  position: absolute;
  left: -24px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 2px var(--accent);
}
.timeline-item:last-child .timeline-marker { background: var(--green); box-shadow: 0 0 0 2px var(--green); }
.timeline-content h3 {
  font-size: .95rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.timeline-content p {
  font-size: .88rem;
  color: var(--text-dim);
  line-height: 1.6;
  margin-bottom: 0;
}

/* ───── Contact 섹션 ───── */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.contact-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  transition: all var(--transition);
}
.contact-card:hover {
  border-color: var(--accent);
  background: var(--surface2);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.contact-card svg { flex-shrink: 0; color: var(--accent); }
.contact-card strong { display: block; font-size: .9rem; margin-bottom: 2px; }
.contact-card span { font-size: .82rem; color: var(--text-dim); }

.limit-list { list-style: none; }
.limit-list li { padding: 10px 0 10px 24px; font-size: .88rem; color: var(--text-dim); border-bottom: 1px solid var(--border); position: relative; }
.limit-list li::before {
  content: '!'; position: absolute; left: 0; top: 10px;
  width: 16px; height: 16px; background: var(--yellow); border-radius: 4px;
  font-size: .65rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center; color: #000;
}


/* ───── 푸터 ───── */
.footer { padding: 40px 24px; text-align: center; border-top: 1px solid var(--border); color: var(--text-muted); font-size: .82rem; }
.footer-sub { margin-top: 4px; font-size: .72rem; }
.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 16px;
}
.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: .82rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.footer-link:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(91, 140, 255, .08);
}
.footer-link svg { flex-shrink: 0; }

