/* ==========================================================================
   Deploy Test - style.css
   ========================================================================== */

/* ---------- 디자인 토큰 ---------- */
:root {
  --color-bg: #ffffff;
  --color-bg-alt: #f4f6fb;
  --color-text: #1c2333;
  --color-muted: #5b6475;
  --color-border: #e1e5ee;
  --color-primary: #3b5bdb;
  --color-primary-dark: #2f49b0;
  --color-ok: #2b8a3e;
  --color-fail: #c92a2a;
  --radius: 12px;
  --shadow: 0 6px 24px rgba(28, 35, 51, 0.08);
  --header-h: 64px;
  --font: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
}

[data-theme="dark"] {
  --color-bg: #12151c;
  --color-bg-alt: #1a1f29;
  --color-text: #e8ebf2;
  --color-muted: #9aa3b5;
  --color-border: #2a3140;
  --color-primary: #7090ff;
  --color-primary-dark: #5a7af0;
  --color-ok: #51cf66;
  --color-fail: #ff6b6b;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

/* ---------- 기본 ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }

body {
  margin: 0;
  font-family: var(--font);
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  transition: background 0.2s, color 0.2s;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { width: min(1120px, 100% - 32px); margin-inline: auto; }
.container.narrow { width: min(720px, 100% - 32px); }

/* ---------- 버튼 ---------- */
.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  border: 2px solid transparent;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  transition: transform 0.15s, background 0.15s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-dark); }
.btn-ghost { border-color: var(--color-primary); color: var(--color-primary); background: transparent; }

/* ---------- 헤더 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: color-mix(in srgb, var(--color-bg) 85%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
}
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; color: var(--color-text); }
.logo:hover { text-decoration: none; }

.site-nav { display: flex; gap: 28px; }
.site-nav a { color: var(--color-muted); font-weight: 500; }
.site-nav a.active, .site-nav a:hover { color: var(--color-primary); text-decoration: none; }

.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 22px; height: 2px; margin: 5px 0; background: var(--color-text); transition: 0.2s; }

/* ---------- 히어로 ---------- */
.hero { padding: 80px 0; background: linear-gradient(160deg, var(--color-bg-alt), var(--color-bg)); }
.hero-inner { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; }
.eyebrow { color: var(--color-primary); font-weight: 700; letter-spacing: 0.04em; margin: 0 0 8px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.2; margin: 0 0 16px; }
.lead { font-size: 1.1rem; color: var(--color-muted); }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.hero-image { animation: float 4s ease-in-out infinite; }

@keyframes float {
  50% { transform: translateY(-10px); }
}

/* ---------- 섹션 ---------- */
.section { padding: 72px 0; }
.section-alt { background: var(--color-bg-alt); }
.section-title { font-size: 1.8rem; margin: 0 0 8px; }
.section-desc { color: var(--color-muted); margin: 0 0 24px; }

/* ---------- 상태 체크 ---------- */
.status-list { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 10px; }
.status-list li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px; border: 1px solid var(--color-border); border-radius: var(--radius);
}
.badge { font-size: 0.85rem; font-weight: 700; padding: 4px 12px; border-radius: 999px; background: var(--color-bg-alt); color: var(--color-muted); }
.badge.ok { background: color-mix(in srgb, var(--color-ok) 15%, transparent); color: var(--color-ok); }
.badge.fail { background: color-mix(in srgb, var(--color-fail) 15%, transparent); color: var(--color-fail); }

.env-info { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.env-info div { padding: 12px 16px; background: var(--color-bg-alt); border-radius: var(--radius); }
.env-info span { display: block; font-size: 0.8rem; color: var(--color-muted); }
.env-info code { font-size: 0.95rem; word-break: break-all; }

/* ---------- 카드 ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin-top: 24px; }
.card {
  background: var(--color-bg); padding: 28px; border-radius: var(--radius);
  box-shadow: var(--shadow); transition: transform 0.2s;
}
.card:hover { transform: translateY(-4px); }
.card img { width: 48px; height: 48px; margin-bottom: 16px; }
.card h3 { margin: 0 0 8px; }
.card p { margin: 0; color: var(--color-muted); }
.loading { color: var(--color-muted); }

/* ---------- 갤러리 ---------- */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 24px; }
.gallery-item { padding: 0; border: 0; border-radius: var(--radius); overflow: hidden; cursor: zoom-in; background: none; }
.gallery-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform 0.3s; }
.gallery-item:hover img { transform: scale(1.05); }

.lightbox {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  background: rgba(0, 0, 0, 0.8); padding: 16px;
}
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; max-width: 900px; width: 100%; }
.lightbox figcaption { color: #fff; text-align: center; margin-top: 12px; }
.lightbox-close { position: absolute; top: 16px; right: 20px; font-size: 2.5rem; color: #fff; background: none; border: 0; cursor: pointer; }

/* ---------- 폼 ---------- */
.contact-form { display: grid; gap: 16px; margin-top: 24px; }
.contact-form label { display: grid; gap: 6px; font-weight: 600; }
.contact-form input, .contact-form textarea {
  font: inherit; padding: 12px 14px; border-radius: 8px;
  border: 1px solid var(--color-border); background: var(--color-bg); color: var(--color-text);
}
.contact-form input:focus, .contact-form textarea:focus { outline: 2px solid var(--color-primary); border-color: transparent; }
.contact-form .invalid { border-color: var(--color-fail); }
.form-result { min-height: 1.5em; margin: 0; font-weight: 600; }

/* ---------- 서브 페이지 ---------- */
.page-header { padding: 64px 0 32px; background: var(--color-bg-alt); }
.page-header h1 { margin: 0 0 8px; }
.prose h2 { margin-top: 40px; }
.prose pre { background: var(--color-bg-alt); padding: 20px; border-radius: var(--radius); overflow-x: auto; line-height: 1.5; }
.checklist li { margin-bottom: 8px; }

/* ---------- 404 ---------- */
.not-found { min-height: 100vh; display: grid; place-items: center; text-align: center; }
.error-code { font-size: 6rem; font-weight: 900; color: var(--color-primary); margin: 0; line-height: 1; }

/* ---------- 푸터 ---------- */
.site-footer { padding: 28px 0; border-top: 1px solid var(--color-border); color: var(--color-muted); font-size: 0.9rem; }
.site-footer .container { display: flex; justify-content: space-between; align-items: center; }
.site-footer p { margin: 0; }
.theme-toggle { font-size: 1.2rem; background: var(--color-bg-alt); border: 1px solid var(--color-border); border-radius: 50%; width: 40px; height: 40px; cursor: pointer; }

/* ---------- 반응형 ---------- */
@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .site-nav {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; gap: 0; background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    max-height: 0; overflow: hidden; transition: max-height 0.25s;
  }
  .site-nav.open { max-height: 300px; }
  .site-nav a { padding: 14px 16px; border-top: 1px solid var(--color-border); }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .hero { padding: 48px 0; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-image { order: -1; max-width: 360px; margin-inline: auto; }
  .gallery { grid-template-columns: 1fr; }
}
