/* 지맥스시스템 홈페이지 — 설계 기준: docs/02_DESIGN_SPEC.md §2~§4
   순서: 토큰 → 리셋 → 레이아웃 → 컴포넌트 → 섹션 → 반응형 */

/* ── 토큰 ── */
:root {
  --navy-900: #0B1B33;
  --navy-800: #102545;
  --navy-700: #15325C;
  --blue-600: #2563EB;
  --blue-700: #1D4ED8;
  --blue-50: #EFF6FF;
  --vin: #0369A1;          /* V-IN 브랜드(#0EA5E9) 계열 — 글자·버튼용은 흰색 대비 AA(5.9:1)를 위해 진하게, 브랜드색은 테두리 장식만 */
  --vin-soft: #0EA5E9;
  --vin-50: #F0F9FF;
  --zica: #0F766E;
  --zica-50: #F0FDFA;
  --gman: #4F46E5;         /* G-Manual 앱 인디고 — 흰색 대비 6.3:1(AA) */
  --gman-50: #EEF2FF;
  --slate-900: #0F172A;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-400: #94A3B8;
  --slate-200: #E2E8F0;
  --slate-100: #F1F5F9;
  --slate-50: #F8FAFC;
  --white: #FFFFFF;

  --radius-card: 12px;
  --radius-btn: 8px;
  --shadow-card: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .06);
  --header-h: 64px;
  --gutter: 16px;
  --section-y: 72px;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", sans-serif;
  color-scheme: light;
}

/* ── 리셋 ── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  color: var(--slate-600);
  background: var(--white);
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; color: var(--slate-900); line-height: 1.35; letter-spacing: -0.02em; }
p { margin: 0; }
ul, ol, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
section[id], main[id] { scroll-margin-top: var(--header-h); }
:focus-visible { outline: 3px solid var(--blue-600); outline-offset: 2px; border-radius: 4px; }
.hero :focus-visible, .contact :focus-visible, .site-footer :focus-visible { outline-color: var(--white); }

[hidden] { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 16px; top: 12px; z-index: 100; transform: translateY(-200%);
  padding: 10px 16px; background: var(--blue-600); color: var(--white);
  border-radius: var(--radius-btn); font-weight: 600;
}
.skip-link:focus { transform: none; }

.icon {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.icon-sm { width: 16px; height: 16px; }
.muted { color: var(--slate-600); font-weight: 500; }
.br-pc { display: none; }

/* ── 레이아웃 ── */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: var(--section-y) 0; }
.section--alt { background: var(--slate-50); }

.section-head { margin-bottom: 40px; }
.section-head--center { text-align: center; max-width: 720px; margin-left: auto; margin-right: auto; }
.section-head h2, .solution-copy h2 { font-size: 24px; font-weight: 700; }
.section-head p:last-child:not(.eyebrow) { margin-top: 12px; }

.eyebrow { font-size: 14px; font-weight: 600; color: var(--blue-600); margin-bottom: 8px; }
.eyebrow--light { color: #93C5FD; }

/* ── 버튼 ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px;
  border: 1px solid transparent; border-radius: var(--radius-btn);
  font-size: 16px; font-weight: 600; line-height: 1; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn--sm { min-height: 40px; padding: 0 16px; font-size: 15px; }
.btn--lg { min-height: 52px; padding: 0 24px; }
.btn--primary { background: var(--blue-600); color: var(--white); }
.btn--primary:hover { background: var(--blue-700); }
.btn--ghost-light { background: transparent; color: var(--white); border-color: rgba(255, 255, 255, .5); }
.btn--ghost-light:hover { background: rgba(255, 255, 255, .1); border-color: var(--white); }
.btn--white { background: var(--white); color: var(--navy-900); }
.btn--white:hover { background: var(--blue-50); }
.btn--vin { background: var(--vin); color: var(--white); }
.btn--vin:hover { background: #075985; }
.btn--zica { background: var(--zica); color: var(--white); }
.btn--zica:hover { background: #115E59; }
.btn--gman { background: var(--gman); color: var(--white); }
.btn--gman:hover { background: #4338CA; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.btn-row--center { justify-content: center; }

.text-link { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: var(--blue-600); }
.text-link:hover { text-decoration: underline; text-underline-offset: 3px; }

.badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0; }
.badge {
  padding: 4px 12px; border-radius: 999px; font-size: 14px; font-weight: 500;
  background: var(--white); border: 1px solid var(--slate-200); color: var(--slate-700);
}

/* ── 헤더 ── */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--header-h);
  color: var(--white);
  transition: background-color .2s, box-shadow .2s, color .2s;
}
.site-header.is-scrolled, .site-header.is-open {
  background: rgba(255, 255, 255, .97); color: var(--slate-900);
  box-shadow: 0 1px 0 var(--slate-200), 0 4px 16px rgba(15, 23, 42, .05);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 100%; }
.logo { display: inline-flex; align-items: center; gap: 10px; }
.logo-mark { width: 32px; height: 32px; flex: none; }
.logo-text { font-size: 18px; font-weight: 700; letter-spacing: 0.02em; }

.menu-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; margin-right: -10px;
  background: none; border: 0; color: inherit; border-radius: var(--radius-btn);
}
.menu-toggle .icon { width: 24px; height: 24px; }
.menu-toggle .icon-close, .menu-toggle[aria-expanded="true"] .icon-open { display: none; }
.menu-toggle[aria-expanded="true"] .icon-close { display: block; }

/* 모바일 메뉴: JS가 있을 때만 접는다(없으면 헤더 아래 항상 펼침 대신 가로 목록으로 노출) */
.site-nav ul { display: flex; align-items: center; gap: 4px; }
.site-nav a:not(.btn) { display: block; padding: 10px 12px; font-weight: 500; border-radius: var(--radius-btn); }
.site-nav a[aria-current="true"]:not(.btn) { color: var(--blue-600); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.site-header:not(.is-scrolled):not(.is-open) .site-nav a[aria-current="true"]:not(.btn) { color: #93C5FD; }

html:not(.js) .menu-toggle { display: none; }
html:not(.js) .site-nav a:not(.btn) { padding: 10px 6px; font-size: 14px; }
html:not(.js) .site-nav .btn { display: none; }
@media (max-width: 419px) { html:not(.js) .logo-text { display: none; } }

html.js .site-nav {
  position: fixed; inset: var(--header-h) 0 auto 0;
  background: var(--white); color: var(--slate-900);
  border-top: 1px solid var(--slate-200);
  box-shadow: 0 12px 24px rgba(15, 23, 42, .08);
  padding: 8px var(--gutter) 20px;
  display: none;
  max-height: calc(100vh - var(--header-h)); max-height: calc(100dvh - var(--header-h)); /* 가로 모드 휴대폰에서도 끝까지 스크롤 */
  overflow-y: auto;
}
html.js .site-header.is-open .site-nav { display: block; }
html.js .site-nav ul { flex-direction: column; align-items: stretch; gap: 0; }
html.js .site-nav a:not(.btn) { padding: 14px 4px; font-size: 17px; border-bottom: 1px solid var(--slate-100); border-radius: 0; }
html.js .site-nav li:last-child { margin-top: 16px; }
html.js .site-nav .btn { width: 100%; min-height: 48px; }
body.menu-open { overflow: hidden; }

/* ── 메인 배너 ── */
.hero {
  position: relative;
  min-height: 88vh; min-height: 88svh;
  display: flex; align-items: center;
  padding: calc(var(--header-h) + 48px) 0 96px;
  color: #CBD5E1;
  background:
    radial-gradient(circle at 80% 20%, rgba(37, 99, 235, .35), transparent 45%),
    radial-gradient(circle at 10% 90%, rgba(14, 165, 233, .18), transparent 40%),
    linear-gradient(135deg, var(--navy-900) 0%, var(--navy-800) 50%, var(--navy-700) 100%);
  overflow: hidden;
}
.hero::before { /* 옅은 격자 패턴 */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(to bottom, #000 30%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, #000 30%, transparent 100%);
}
.hero-inner { position: relative; display: grid; gap: 48px; align-items: center; }
.hero h1 { color: var(--white); font-size: 28px; font-weight: 700; }
.hero-sub { margin: 20px 0 32px; font-size: 16px; color: #CBD5E1; }
.hero-visual { display: none; }
.scroll-cue {
  position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%);
  display: inline-flex; width: 44px; height: 44px; align-items: center; justify-content: center;
  color: rgba(255, 255, 255, .7); border-radius: 999px;
  animation: cue 2s ease-in-out infinite;
}
.scroll-cue .icon { width: 28px; height: 28px; }
@keyframes cue { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 6px); } }

/* ── 기기 목업(CSS로 그린 틀) ── */
.mockup-screen { overflow: hidden; background: var(--white); }
.mockup--laptop .mockup-screen {
  border: 10px solid #1E293B; border-bottom-width: 14px;
  border-radius: 12px 12px 4px 4px;
  aspect-ratio: 16 / 10;
}
.mockup--laptop .mockup-screen img { width: 100%; height: 100%; object-fit: cover; object-position: top left; }
.mockup-base {
  height: 12px; margin: 0 -6%;
  background: linear-gradient(#CBD5E1, #94A3B8);
  border-radius: 0 0 12px 12px;
  position: relative;
}
.mockup-base::after {
  content: ""; position: absolute; left: 50%; top: 0; transform: translateX(-50%);
  width: 18%; height: 5px; background: #64748B; border-radius: 0 0 6px 6px; opacity: .5;
}
.mockup--phone .mockup-screen {
  border: 8px solid #0F172A; border-radius: 28px;
  aspect-ratio: 1 / 2;
  box-shadow: 0 20px 40px rgba(15, 23, 42, .25);
  position: relative;
  padding-top: 22px; /* 노치가 화면 내용을 가리지 않게 */
}
.mockup--phone .mockup-screen::before { /* 노치 */
  content: ""; position: absolute; top: 6px; left: 50%; transform: translateX(-50%);
  width: 30%; height: 14px; background: #0F172A; border-radius: 999px; z-index: 1;
}
.mockup--phone .mockup-screen img { width: 100%; height: 100%; object-fit: cover; object-position: top; }

/* ── 솔루션 개요 카드 ── */
.overview-grid { display: grid; gap: 20px; }
.overview-card {
  padding: 28px; border-radius: var(--radius-card);
  background: var(--white); border: 1px solid var(--slate-200); box-shadow: var(--shadow-card);
  border-top: 4px solid var(--blue-600);
}
.overview-card--vin { border-top-color: var(--vin-soft); }
.overview-card--zica { border-top-color: var(--zica); }
.overview-card--gman { border-top-color: var(--gman); }
.overview-card--gman .text-link { color: var(--gman); }
.overview-label { font-size: 14px; font-weight: 600; color: var(--slate-600); margin-bottom: 6px; }
.overview-card h3 { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.card-actions { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 20px; }
.overview-card--zica .text-link { color: var(--zica); }
.overview-card--vin .text-link { color: var(--vin); }

/* ── 솔루션 상세 ── */
.solution-top { display: grid; gap: 40px; align-items: center; margin-bottom: 48px; }
.solution-lead { font-size: 18px; font-weight: 600; color: var(--slate-700); margin-top: 4px; }
.solution--vin .eyebrow { color: var(--vin); }
.solution--zica .eyebrow { color: var(--zica); }
.solution--gman .eyebrow { color: var(--gman); }
.solution-note { margin-bottom: 20px; font-size: 15px; color: var(--slate-600); }
.solution-visual { display: flex; justify-content: center; }
.solution-visual .mockup--laptop { width: 88%; max-width: 560px; } /* 받침대가 좌우 6%씩 튀어나와도 화면 안에 들어오게 */
.mockup--phone-lg { width: 240px; }

.flow { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 28px; counter-reset: flow; }
.flow li {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 500; color: var(--slate-700);
}
.flow li:not(:last-child)::after { content: "→"; color: var(--slate-400); }
.flow li::before {
  counter-increment: flow; content: counter(flow);
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 999px;
  background: var(--vin-50); color: var(--vin); font-size: 12px; font-weight: 700;
}

.feature-grid { display: grid; gap: 16px; }
.feature {
  padding: 24px; border-radius: var(--radius-card);
  background: var(--white); border: 1px solid var(--slate-200); box-shadow: var(--shadow-card);
}
.feature--center { text-align: center; }
.feature--center .feature-icon { margin-left: auto; margin-right: auto; }
.feature h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.feature p { font-size: 15px; }
.feature-icon {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; margin-bottom: 16px;
  border-radius: 10px; background: var(--blue-50); color: var(--blue-600);
}
.feature-icon .icon { width: 22px; height: 22px; }
.solution--vin .feature-icon { background: var(--vin-50); color: var(--vin); }
.solution--zica .feature-icon { background: var(--zica-50); color: var(--zica); }
.solution--gman .feature-icon { background: var(--gman-50); color: var(--gman); }
.solution--gman .flow li::before { background: var(--gman-50); color: var(--gman); }

/* ── 문의 ── */
.contact {
  padding: var(--section-y) 0; text-align: center; color: #CBD5E1;
  background: linear-gradient(135deg, var(--navy-900), var(--navy-700));
}
.contact h2 { color: var(--white); font-size: 24px; font-weight: 700; }
.contact-email {
  display: inline-flex; align-items: center; gap: 10px;
  margin: 24px 0 28px; font-size: 20px; font-weight: 600; color: var(--white);
  user-select: all;
}

/* ── 푸터 ── */
.site-footer { background: #07142A; color: var(--slate-400); padding: 48px 0 40px; font-size: 14px; }
.footer-inner { display: grid; gap: 24px; }
.logo--light { color: var(--white); }
.footer-name { margin-top: 8px; color: #CBD5E1; }
.footer-info { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.footer-info div { display: flex; gap: 6px; }
.footer-info dt { color: var(--slate-400); }
.footer-info a:hover, .footer-links a:hover { color: var(--white); text-decoration: underline; }
.footer-links { display: flex; gap: 16px; }
.footer-links a { color: #CBD5E1; font-weight: 500; }
.copyright { padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .08); color: var(--slate-400); }

/* ── 등장 애니메이션(JS 있을 때만 숨김 상태로 시작) ── */
html.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
html.js .reveal.is-visible { opacity: 1; transform: none; }

/* ── 반응형 ── */
@media (min-width: 768px) {
  :root { --gutter: 24px; }
  .overview-grid { grid-template-columns: 1fr 1fr; }
  .overview-card--gman { grid-column: 1 / -1; } /* 768~1023px: 세 번째 카드는 아래 한 줄 전체 */
  .feature-grid { grid-template-columns: 1fr 1fr; }
  .feature-grid--3 { grid-template-columns: repeat(3, 1fr); }
  .hero h1 { font-size: 38px; }
  .hero-sub { font-size: 17px; }
  .section-head h2, .solution-copy h2, .contact h2 { font-size: 30px; }
  .footer-inner { grid-template-columns: 1fr auto; }
  .footer-info, .copyright { grid-column: 1 / -1; }
  .footer-links { align-self: start; }
}

@media (min-width: 1024px) {
  :root { --gutter: 32px; --section-y: 112px; --header-h: 72px; }
  body { font-size: 17px; }
  .br-pc { display: inline; }
  .overview-grid { grid-template-columns: repeat(3, 1fr); }
  .overview-card--gman { grid-column: auto; }

  .menu-toggle { display: none; }
  html.js .site-nav {
    position: static; display: block; padding: 0; max-height: none; overflow: visible;
    background: none; border: 0; box-shadow: none; color: inherit;
  }
  html.js .site-nav ul { flex-direction: row; align-items: center; gap: 4px; }
  html.js .site-nav a:not(.btn) { padding: 10px 14px; font-size: 16px; border: 0; border-radius: var(--radius-btn); }
  html.js .site-nav li:last-child { margin: 0 0 0 12px; }
  html.js .site-nav .btn { width: auto; min-height: 40px; }
  .site-nav a:not(.btn):hover { background: rgba(127, 127, 127, .12); }
  .site-header.is-open { background: transparent; box-shadow: none; color: var(--white); }
  .site-header.is-open.is-scrolled { background: rgba(255, 255, 255, .97); color: var(--slate-900); }

  .hero-inner { grid-template-columns: 1.1fr 1fr; }
  .hero h1 { font-size: 46px; line-height: 1.3; }
  .hero-sub { font-size: 18px; }
  .hero-visual { display: block; position: relative; padding: 0 40px 40px 0; }
  .hero-visual .mockup--laptop { box-shadow: 0 30px 60px rgba(0, 0, 0, .35); border-radius: 12px; }
  .hero-visual .mockup--phone { position: absolute; right: 0; bottom: 0; width: 34%; }

  .section-head h2, .solution-copy h2, .contact h2 { font-size: 36px; }
  .solution-top { grid-template-columns: 1fr 1fr; gap: 64px; margin-bottom: 56px; }
  .solution-top--reverse .solution-copy { order: 2; }
  .mockup--phone-lg { width: 280px; }
  .feature-grid { grid-template-columns: repeat(4, 1fr); gap: 20px; }
  .feature-grid--3 { grid-template-columns: repeat(3, 1fr); }
  .feature-grid--3 .feature { padding: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .scroll-cue { animation: none; }
  html.js .reveal { opacity: 1; transform: none; transition: none; }
  .site-header, .btn { transition: none; }
}

/* ── 404 ── */
.notfound { min-height: 100vh; min-height: 100svh; display: flex; align-items: center; }
.notfound h1 { color: var(--white); font-size: 26px; }
.notfound-sub { margin: 12px 0 28px; }
