:root {
  --primary: #1976d2;
  --primary-dark: #0d47a1;
  --accent: #f44336;
  --bg-soft: #f5f7fa;
  --text: #1a1a1a;
  --text-soft: #555;
  --border: #e6e9ee;
  --tip: #fff7e6;
  --tip-border: #f9a825;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

/* Sticky Header */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.95); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
}
.site-header-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 56px;
}
.site-logo {
  display: flex; align-items: center; gap: 8px;
  text-decoration: none; color: var(--text); font-weight: 800; font-size: 16px;
}
.site-logo-emoji { font-size: 22px; }
.site-nav {
  display: flex; gap: 4px; align-items: center;
}
.nav-link {
  padding: 8px 12px; border-radius: 8px;
  color: var(--text-soft); text-decoration: none; font-size: 14px; font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-link:hover { background: var(--bg-soft); color: var(--text); }
.nav-link.active { color: var(--service-color, var(--primary)); background: var(--bg-soft); }
.menu-toggle {
  display: none; background: none; border: none; cursor: pointer;
  padding: 8px; border-radius: 8px;
}
.menu-toggle:hover { background: var(--bg-soft); }
.menu-toggle svg { width: 24px; height: 24px; }

@media (max-width: 768px) {
  .site-nav {
    display: none; position: absolute; top: 56px; left: 0; right: 0;
    background: white; flex-direction: column; padding: 12px; gap: 4px;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(0,30,80,0.08);
  }
  .site-nav.open { display: flex; }
  .nav-link { padding: 12px 16px; font-size: 15px; width: 100%; }
  .menu-toggle { display: flex; align-items: center; justify-content: center; }
}
body {
  font-family: 'Pretendard', 'Malgun Gothic', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #ecf3fb 0%, #f7fafd 30%, #ffffff 100%);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; }

/* Service-specific colors */
body[data-service="gabia"] { --service-color: #1976d2; --service-bg: linear-gradient(135deg, #1565c0, #42a5f5); }
body[data-service="cloudflare"] { --service-color: #f6821f; --service-bg: linear-gradient(135deg, #ff8c00, #f6821f); }
body[data-service="supabase"] { --service-color: #3ecf8e; --service-bg: linear-gradient(135deg, #2dba6a, #3ecf8e); }
body[data-service="netlify"] { --service-color: #00ad9f; --service-bg: linear-gradient(135deg, #008b80, #00ad9f); }
body[data-service="naver"] { --service-color: #03c75a; --service-bg: linear-gradient(135deg, #02a14a, #03c75a); }
body[data-service="google"] { --service-color: #4285f4; --service-bg: linear-gradient(135deg, #3b78e7, #4285f4); }

.hero {
  position: relative;
  padding: 80px 24px 100px;
  text-align: center;
  background: var(--service-bg, linear-gradient(135deg, #1565c0 0%, #42a5f5 100%));
  color: white;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%; width: 200%; height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.12) 0%, transparent 50%);
  animation: pulse 6s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { transform: scale(1); opacity: 0.6; } 50% { transform: scale(1.05); opacity: 1; } }
.hero-badge {
  display: inline-block; background: rgba(255,255,255,0.2); backdrop-filter: blur(10px);
  padding: 8px 18px; border-radius: 100px; font-size: 14px; font-weight: 500;
  margin-bottom: 20px; letter-spacing: 0.3px; position: relative;
}
.hero h1 {
  font-size: clamp(32px, 6vw, 56px); font-weight: 800; margin-bottom: 16px;
  letter-spacing: -1px; position: relative;
}
.hero p {
  font-size: clamp(15px, 2.5vw, 19px); opacity: 0.95; margin-bottom: 32px;
  position: relative;
}
.hero-cta {
  display: inline-flex; align-items: center; gap: 8px; background: white;
  color: var(--service-color, var(--primary)); padding: 14px 28px; border-radius: 100px;
  font-weight: 700; font-size: 16px; box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  transition: transform 0.2s ease, box-shadow 0.2s ease; position: relative;
}
.hero-cta:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(0,0,0,0.25); }

.back-link {
  display: inline-block; margin: 16px 0 0 16px; color: white;
  text-decoration: none; font-size: 14px; opacity: 0.9; position: relative; z-index: 5;
}
.back-link:hover { opacity: 1; }

.toc {
  max-width: 880px; margin: -40px auto 0; padding: 0 16px; position: relative; z-index: 5;
}
.toc-card {
  background: white; border-radius: 16px; padding: 24px;
  box-shadow: 0 12px 40px rgba(0,30,80,0.08); border: 1px solid var(--border);
}
.toc-title {
  font-size: 13px; font-weight: 600; color: var(--text-soft);
  letter-spacing: 0.5px; text-transform: uppercase; margin-bottom: 14px;
}
.toc-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px;
}
.toc-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 8px; color: var(--text); font-size: 14px; font-weight: 500;
  transition: background 0.15s ease;
}
.toc-item:hover { background: var(--bg-soft); }
.toc-num {
  width: 28px; height: 28px; background: var(--service-color, var(--primary));
  color: white; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex-shrink: 0;
}

.container {
  max-width: 880px; margin: 60px auto; padding: 0 16px;
}
.step {
  background: white; border-radius: 20px; padding: 36px; margin-bottom: 28px;
  box-shadow: 0 4px 20px rgba(0,30,80,0.06); border: 1px solid var(--border);
  scroll-margin-top: 20px; transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.step:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(0,30,80,0.1); }
.step-header {
  display: flex; align-items: center; gap: 16px; margin-bottom: 20px;
}
.step-badge {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--service-color, var(--primary)), var(--primary-dark));
  color: white; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15); flex-shrink: 0;
}
.step-title {
  font-size: clamp(20px, 3.5vw, 26px); font-weight: 700; color: var(--text);
}
.step-desc {
  color: var(--text-soft); font-size: 16px; line-height: 1.8; margin-bottom: 16px;
}
.step-desc b { color: var(--text); font-weight: 600; }
.step-desc b[style*="red"] { color: var(--accent) !important; font-weight: 700; }
.step-desc code {
  background: #f1f4f8; padding: 2px 8px; border-radius: 4px; font-size: 14px;
  color: var(--primary-dark); font-family: 'Consolas', 'Monaco', monospace;
}
.tip {
  display: flex; gap: 12px; background: var(--tip);
  border-left: 4px solid var(--tip-border); padding: 14px 18px; margin: 16px 0;
  border-radius: 8px; font-size: 15px; color: #5d4037;
}
.tip-icon { font-size: 22px; flex-shrink: 0; }
.shot-wrap {
  margin-top: 20px; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--border); background: #fafafa;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.shot { width: 100%; display: block; }

.illustration {
  margin-top: 20px; padding: 32px; background: #f8fafc;
  border-radius: 12px; border: 2px dashed var(--border); text-align: center;
}
.illustration-label {
  font-size: 13px; color: var(--text-soft); margin-bottom: 12px; font-weight: 600;
}
.illustration-box {
  background: white; padding: 24px; border-radius: 8px;
  border: 1px solid var(--border); margin: 12px auto; max-width: 600px;
}

.footer {
  background: #102a43; color: #c8d2dc; padding: 48px 24px;
  text-align: center; margin-top: 80px;
}
.footer h3 { color: white; margin-bottom: 12px; font-size: 22px; }
.footer p { font-size: 14px; line-height: 1.8; opacity: 0.85; }
.footer a { color: #90caf9; }

/* Hub (index) */
.hub-hero {
  padding: 100px 24px 60px;
  text-align: center;
  background: linear-gradient(135deg, #102a43 0%, #243b53 100%);
  color: white;
  position: relative; overflow: hidden;
}
.hub-hero::before {
  content: ''; position: absolute; top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle, rgba(66,165,245,0.15) 0%, transparent 50%);
  animation: pulse 8s ease-in-out infinite;
}
.hub-hero h1 {
  font-size: clamp(36px, 6vw, 64px); font-weight: 800;
  margin-bottom: 16px; letter-spacing: -1px; position: relative;
}
.hub-hero p {
  font-size: clamp(15px, 2.5vw, 18px); opacity: 0.85; position: relative; max-width: 600px; margin: 0 auto;
}
.cards {
  max-width: 1100px; margin: -40px auto 80px; padding: 0 16px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px;
  position: relative; z-index: 5;
}
.card {
  background: white; border-radius: 20px; padding: 32px;
  box-shadow: 0 12px 40px rgba(0,30,80,0.1);
  border: 1px solid var(--border);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex; flex-direction: column; gap: 14px;
  text-decoration: none; color: inherit;
}
.card:hover { transform: translateY(-6px); box-shadow: 0 24px 60px rgba(0,30,80,0.16); }
.card-icon {
  width: 64px; height: 64px; border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; color: white; font-weight: 800;
}
.card-icon.gabia { background: linear-gradient(135deg, #1565c0, #42a5f5); }
.card-icon.cloudflare { background: linear-gradient(135deg, #ff8c00, #f6821f); }
.card-icon.supabase { background: linear-gradient(135deg, #2dba6a, #3ecf8e); }
.card-icon.netlify { background: linear-gradient(135deg, #008b80, #00ad9f); }
.card-icon.naver { background: linear-gradient(135deg, #02a14a, #03c75a); }
.card-icon.google { background: linear-gradient(135deg, #3b78e7, #4285f4); }
.card-title { font-size: 22px; font-weight: 700; }
.card-subtitle { font-size: 14px; color: var(--text-soft); }
.card-meta {
  display: flex; gap: 12px; font-size: 13px; color: var(--text-soft);
  margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border);
}
.card-meta span { display: inline-flex; align-items: center; gap: 4px; }

@media (max-width: 600px) {
  .hero { padding: 56px 16px 80px; }
  .step { padding: 24px 20px; }
  .step-badge { width: 44px; height: 44px; font-size: 18px; border-radius: 12px; }
  .toc { margin-top: -30px; }
  .card { padding: 24px; }
}
