/* ==========
   Design tokens
   ========== */
:root{
  --bg: #f6f8ff;
  --panel: rgba(255,255,255,0.78);
  --card: rgba(255,255,255,0.92);
  --text: rgba(12, 18, 32, 0.92);
  --muted: rgba(12, 18, 32, 0.68);
  --border: rgba(12, 18, 32, 0.10);
  --shadow: 0 12px 40px rgba(12, 18, 32, 0.08);
  --shadow-sm: 0 8px 22px rgba(12, 18, 32, 0.06);

  --primary: #4f46e5;     /* indigo */
  --primary-2: #6366f1;
  --primary-soft: rgba(79, 70, 229, 0.12);

  --radius: 18px;
  --radius-sm: 14px;

  --container: 1120px;
  --focus: 0 0 0 4px rgba(79, 70, 229, 0.22);
}

/* Dark theme (manual override via JS) */
:root[data-theme="dark"]{
  --bg: #0b1020;
  --panel: rgba(20, 26, 44, 0.72);
  --card: rgba(18, 24, 40, 0.90);
  --text: rgba(245, 246, 250, 0.92);
  --muted: rgba(245, 246, 250, 0.66);
  --border: rgba(245, 246, 250, 0.12);
  --shadow: 0 14px 50px rgba(0,0,0,0.45);
  --shadow-sm: 0 10px 26px rgba(0,0,0,0.35);

  --primary-soft: rgba(99, 102, 241, 0.18);
}

*{ box-sizing: border-box; }
html, body { min-height: 100%; }
body{
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
               "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  color: var(--text);
  background:
    /* Smooth page background: no horizontal seam */
    radial-gradient(farthest-corner at 10% 0%,
      rgba(79,70,229,0.12) 0%,
      rgba(79,70,229,0.08) 30%,
      rgba(79,70,229,0.04) 60%,
      rgba(79,70,229,0.015) 82%,
      rgba(79,70,229,0.00) 100%),
    radial-gradient(farthest-corner at 90% 10%,
      rgba(99,102,241,0.12) 0%,
      rgba(99,102,241,0.08) 30%,
      rgba(99,102,241,0.04) 60%,
      rgba(99,102,241,0.015) 82%,
      rgba(99,102,241,0.00) 100%),
    linear-gradient(180deg,
      rgba(79,70,229,0.018) 0%,
      rgba(79,70,229,0.00) 100%),
    var(--bg);
  line-height: 1.55;
}

a{ color: inherit; }
a:hover{ text-decoration: none; }
strong{ font-weight: 760; }

.container{
  width: min(var(--container), calc(100% - 40px));
  margin: 0 auto;
}

.skip-link{
  position: absolute;
  left: 12px; top: 12px;
  padding: 10px 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  transform: translateY(-140%);
  transition: transform .2s ease;
  z-index: 9999;
}
.skip-link:focus{ transform: translateY(0); outline: none; box-shadow: var(--shadow-sm), var(--focus); }

.muted{ color: var(--muted); }
.small{ font-size: 0.95rem; }
.fineprint{ font-size: 0.92rem; color: var(--muted); margin: 10px 0 0; }
.w-full{ width: 100%; }

/* ==========
   Header
   ========== */
.site-header{
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  background: rgba(255,255,255,0.52);
  border-bottom: 1px solid var(--border);
}
:root[data-theme="dark"] .site-header{
  background: rgba(11,16,32,0.52);
}

.header-inner{
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
}

.brand{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.brand-mark{
  width: 38px;
  height: 38px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 10px 22px rgba(79,70,229,0.20);
}
.brand-text{
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.badge{
  font-size: 0.82rem;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
}

.nav{
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}
.nav-link{
  font-size: 0.95rem;
  text-decoration: none;
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 12px;
}
.nav-link:hover{
  background: var(--panel);
  color: var(--text);
}
.nav-link.active{
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
}

.theme-toggle{
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  border-radius: 14px;
  padding: 8px 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: none;
}
.theme-toggle:focus{ outline: none; box-shadow: var(--focus); }
.theme-toggle-icon{
  display: grid;
  place-items: center;
}
.icon-moon{ display: none; }
:root[data-theme="dark"] .icon-sun{ display: none; }
:root[data-theme="dark"] .icon-moon{ display: inline; }
.theme-toggle-text{ font-size: 0.92rem; color: var(--muted); }

/* ==========
   Hero
   ========== */
.hero{
  padding: 54px 0 10px;
}
.hero-grid{
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 26px;
  align-items: start;
}
.hero h1{
  margin: 0 0 12px;
  font-size: clamp(2.0rem, 3vw, 2.9rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.accent{
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lead{
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 1.05rem;
}

.cta-row{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0 0;
}
.cta-row-center{
  justify-content: center;
  margin-top: 22px;
}

.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 14px;
  text-decoration: none;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: transform .08s ease, box-shadow .12s ease, background .12s ease;
  user-select: none;
}
.btn:hover{
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.btn:active{ transform: translateY(0); box-shadow: var(--shadow-sm); }

.btn-primary{
  border-color: rgba(79,70,229,0.28);
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: white;
}
.btn-soft{
  background: rgba(79,70,229,0.10);
  border-color: rgba(79,70,229,0.22);
}
.btn-outline{
  background: transparent;
}

.hero-notes{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}
.note{
  display: flex;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}
.note-icon{
  width: 34px;
  height: 34px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
}

.hero-card .card{
  border-radius: 22px;
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow);
  padding: 18px;
}
.card-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.card-title{ margin: 0; font-size: 1.15rem; }
.pill{
  font-size: 0.84rem;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(79,70,229,0.24);
  background: rgba(79,70,229,0.10);
  color: var(--text);
}

.spec-list{
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: grid;
  gap: 10px;
}
.spec-list li{
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--panel);
}
.spec-ico{
  width: 36px;
  height: 36px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
}

.stack{
  margin-top: 14px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--panel);
}
.stack-title{
  font-weight: 760;
  margin-bottom: 10px;
}
.stack-badges{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip{
  font-size: 0.86rem;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
}
.card-actions{ margin-top: 14px; }
.card-actions .btn{ box-shadow: var(--shadow-sm); }

/* ==========
   Sections
   ========== */
.section{ padding: 44px 0; }
.section-alt{
  background: transparent;
}
.section-cta{
  padding: 40px 0 54px;
}

.section-head h2{
  margin: 0 0 8px;
  font-size: clamp(1.35rem, 2.2vw, 1.7rem);
  letter-spacing: -0.01em;
}
.section-head p{ margin: 0; }

.grid-3{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
}
.mini-card{
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  padding: 16px;
}
.mini-card h3{ margin: 0 0 8px; font-size: 1.06rem; }
.mini-card p{ margin: 0; }

.steps{
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
  display: grid;
  gap: 10px;
}
.steps li{
  display: flex;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}
.step-num{
  width: 34px;
  height: 34px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  font-weight: 800;
}
.step-body strong{ display: block; margin-bottom: 2px; }

.faq{
  margin-top: 16px;
  display: grid;
  gap: 10px;
}
.faq-item{
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 6px 12px;
}
.faq-item summary{
  cursor: pointer;
  padding: 12px 6px;
  font-weight: 760;
}
.faq-item summary:focus{ outline: none; box-shadow: var(--focus); border-radius: 14px; }
.faq-body{
  padding: 0 6px 14px;
  color: var(--muted);
}

/* FAQ open/close animation helpers */
.faq-item .faq-body{
  overflow: hidden;
}

.faq-body ul{ margin: 10px 0 0; padding-left: 18px; }
.faq-body p{ margin: 10px 0 0; }

.cta-panel{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow);
}
.cta-panel h2{ margin: 0 0 8px; }
.cta-panel p{ margin: 0; }

/* ==========
   Doc pages
   ========== */
.doc .doc-container{ max-width: 920px; }
.doc-head{
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}
.doc-head h1{
  margin: 0;
  font-size: clamp(1.6rem, 2.6vw, 2.0rem);
  letter-spacing: -0.02em;
}
.doc-actions{ display: flex; flex-wrap: wrap; gap: 10px; }
.doc-card{
  border-radius: 22px;
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow);
  padding: 18px;
}
.doc-card h2{
  margin: 18px 0 8px;
  font-size: 1.12rem;
}
.doc-card h2:first-child{ margin-top: 0; }
.doc-card p{ margin: 8px 0 0; color: var(--muted); }
.doc-card ul, .doc-card ol{ margin: 10px 0 0; padding-left: 18px; color: var(--muted); }
.doc-card li{ margin: 6px 0; }
.doc-sep{
  border: none;
  border-top: 1px solid var(--border);
  margin: 18px 0;
}

/* ==========
   Footer
   ========== */
.site-footer{
  border-top: 1px solid var(--border);
  padding: 22px 0;
  background: rgba(255,255,255,0.35);
}
:root[data-theme="dark"] .site-footer{
  background: rgba(11,16,32,0.35);
}
.footer-inner{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.footer-right{
  display: flex;
  gap: 12px;
}
.footer-right a{
  color: var(--muted);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 12px;
}
.footer-right a:hover{
  background: var(--panel);
  color: var(--text);
}

/* ==========
   Responsive
   ========== */
@media (max-width: 980px){
  .hero-grid{ grid-template-columns: 1fr; }
  .nav{ display: none; } /* hide desktop nav on small screens */
  .theme-toggle{ margin-left: auto; }
  .hero-notes{ grid-template-columns: 1fr; }
  .cta-panel{ flex-direction: column; align-items: stretch; }
}

@media (max-width: 720px){
  .grid-3{ grid-template-columns: 1fr; }
  .header-inner{ gap: 10px; }
  .badge{ display: none; }
}


/* Reduce motion */
@media (prefers-reduced-motion: reduce){
  *{ scroll-behavior: auto !important; transition: none !important; }
}

/* Mobile menu (off-canvas) */
.menu-toggle{
  display: inline-flex; /* mobile: visible (desktop hidden below) */
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  border-radius: 14px;
  cursor: pointer;
  box-shadow: none;
  transition: transform .08s ease, box-shadow .12s ease, background .12s ease;
}
.menu-toggle:hover{
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.menu-toggle:active{ transform: translateY(0); box-shadow: none; }
.menu-toggle:focus{ outline: none; box-shadow: var(--focus); }

.hamburger{
  width: 18px;
  height: 14px;
  display: grid;
  gap: 3px;
}
.hamburger span{
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.85;
}
.menu-toggle:hover .hamburger span{ opacity: 1; }
.menu-toggle:focus{ outline: none; box-shadow: var(--focus); }
.menu-toggle-text{
  /* icon-only: hide visually but keep for screen readers */
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.mobile-menu{
  display: block; /* mobile: enabled (desktop disabled via media query below) */
}
.mobile-menu[hidden]{ display: none !important; }
.mobile-menu-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.28);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity .18s ease;
  z-index: 999;
}
.mobile-menu-panel{
  position: fixed;
  top: 0; right: 0;
  height: 100%;
  width: min(84vw, 340px);
  background: var(--card);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow);
  transform: translateX(102%);
  transition: transform .22s ease;
  z-index: 1000;
  padding: 14px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
}
.mobile-menu-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.mobile-menu-title{ font-weight: 800; }
.mobile-menu-close{
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  border-radius: 12px;
  padding: 8px;
  cursor: pointer;
}
.mobile-menu-close:focus{ outline: none; box-shadow: var(--focus); }

.mobile-nav{
  display: grid;
  gap: 6px;
  /* Portrait: avoid auto-stretched grid rows creating oversized menu boxes */
  align-content: start;
}
.mobile-nav a{
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
}
.mobile-nav a:hover{ background: var(--card); }

:root[data-menu-open="true"] .mobile-menu-overlay{ opacity: 1; }
:root[data-menu-open="true"] .mobile-menu-panel{ transform: translateX(0); }

@media (min-width: 981px){
  .menu-toggle{ display: none; }
  .mobile-menu{ display: none; }
}
