/* ============================================================
   엠테크(발전기아저씨) 랜딩페이지 커스텀 스타일
   - Tailwind(CDN)가 커버하지 못하는 것만 이 파일에 둡니다.
   - ★ 브랜드 색상은 아래 :root 한 곳에서만 관리합니다.
     (Tailwind 유틸리티도 이 변수를 참조하므로, 여기만 바꾸면
      사이트 전체 색이 함께 바뀝니다)
   ============================================================ */

:root {
  /* ---- 브랜드 팔레트 (R G B 값 / 오른쪽 주석이 실제 색상 HEX) ---- */
  --c-navy-950: 10 19 34;    /* #0A1322  최심 배경 */
  --c-navy-900: 15 27 45;    /* #0F1B2D  메인 다크 배경 */
  --c-navy-800: 30 42 58;    /* #1E2A3A  카드 배경 */
  --c-navy-700: 44 59 80;    /* #2C3B50  경계선/보더 */

  --c-orange-600: 193 68 21; /* #C14415  밝은 배경 위 오렌지 텍스트(AA 확보용) */
  --c-orange-500: 232 93 37; /* #E85D25  세이프티 오렌지 (CTA) */
  --c-orange-400: 255 107 44;/* #FF6B2C  호버/하이라이트 */

  --c-steel-50: 244 246 248; /* #F4F6F8  밝은 섹션 배경 */
  --c-steel-100: 231 233 236;/* #E7E9EC  밝은 배경/구분선 */
  --c-steel-300: 195 202 211;/* #C3CAD3  다크 위 본문 보조 */
  --c-steel-400: 154 166 180;/* #9AA6B4  다크 위 흐린 텍스트 */
  --c-steel-500: 107 114 128;/* #6B7280  밝은 배경 위 흐린 텍스트(큰 글씨용) */
  --c-steel-600: 71 82 97;   /* #475261  밝은 배경 위 본문 보조(AA 확보용) */

  --header-h: 4.5rem;
}

/* ---- 베이스 ---- */
html {
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  font-family: 'Pretendard Variable', Pretendard, 'Noto Sans KR', 'Malgun Gothic', system-ui, -apple-system, sans-serif;
  /* 한글 단어 단위 줄바꿈 — 헤드라인이 어색하게 끊기는 것 방지 */
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

/* 앵커 이동 시 고정 헤더에 가려지지 않도록 */
section[id], footer[id] {
  scroll-margin-top: calc(var(--header-h) + 0.75rem);
}

::selection {
  background: rgb(var(--c-orange-500));
  color: #fff;
}

/* ---- 접근성: 스킵 링크 / 포커스 링 ---- */
.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -100px;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  border-radius: 0.5rem;
  background: rgb(var(--c-orange-500));
  color: rgb(var(--c-navy-950));
  font-weight: 700;
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 0.75rem;
}

:focus-visible {
  outline: 3px solid rgb(var(--c-orange-400));
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---- 타이포: 반응형 헤드라인 ---- */
.display-1 {
  font-size: clamp(2.25rem, 5.2vw + 0.9rem, 4.25rem);
  line-height: 1.18;
  font-weight: 800;
  letter-spacing: -0.025em;
}
.display-2 {
  font-size: clamp(1.6rem, 2.6vw + 0.7rem, 2.6rem);
  line-height: 1.28;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.display-3 {
  font-size: clamp(1.25rem, 1.4vw + 0.7rem, 1.75rem);
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* ---- 버튼 ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3rem;              /* 터치 타겟 44px 이상 확보 */
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  font-weight: 700;
  font-size: 1.0625rem;
  line-height: 1.2;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  text-align: center;
}
.btn:active { transform: translateY(1px); }

/* 주 CTA: 세이프티 오렌지 배경 + 다크 네이비 텍스트 (WCAG AA 대비 확보 조합) */
.btn-primary {
  background: rgb(var(--c-orange-500));
  color: rgb(var(--c-navy-950));
  box-shadow: 0 10px 24px -10px rgb(var(--c-orange-500) / 0.65);
}
.btn-primary:hover { background: rgb(var(--c-orange-400)); }

/* 보조 CTA: 다크 배경 위 아웃라인 */
.btn-ghost {
  border: 1.5px solid rgb(var(--c-navy-700));
  color: #fff;
  background: rgb(var(--c-navy-800) / 0.45);
}
.btn-ghost:hover {
  border-color: rgb(var(--c-orange-500));
  color: rgb(var(--c-orange-400));
}

/* 밝은 배경 위 보조 CTA */
.btn-outline-dark {
  border: 1.5px solid rgb(var(--c-steel-300));
  color: rgb(var(--c-navy-900));
  background: #fff;
}
.btn-outline-dark:hover { border-color: rgb(var(--c-orange-500)); color: rgb(var(--c-orange-600)); }

/* ---- 고정 헤더 ---- */
#site-header {
  transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  background: rgb(var(--c-navy-950) / 0.55);
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
#site-header.is-scrolled {
  background: rgb(var(--c-navy-950) / 0.92);
  border-bottom-color: rgb(var(--c-navy-700) / 0.6);
  box-shadow: 0 8px 24px -16px rgba(0, 0, 0, 0.7);
}

/* 모바일 메뉴 패널 */
#mobile-nav {
  display: none;
}
#mobile-nav.is-open {
  display: block;
}

/* ---- 히어로 배경: 산업풍 그리드 + 오렌지 글로우 ---- */
.hero-bg {
  background-color: rgb(var(--c-navy-950));
  background-image:
    radial-gradient(58rem 30rem at 82% -12%, rgb(var(--c-orange-500) / 0.16), transparent 62%),
    radial-gradient(46rem 26rem at -10% 108%, rgb(var(--c-navy-700) / 0.5), transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48'%3E%3Cpath d='M48 0H0v48' fill='none' stroke='%232C3B50' stroke-opacity='0.35' stroke-width='1'/%3E%3C/svg%3E");
}

/* 섹션 공용 다크 그리드 배경 */
.dark-grid-bg {
  background-color: rgb(var(--c-navy-950));
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48'%3E%3Cpath d='M48 0H0v48' fill='none' stroke='%232C3B50' stroke-opacity='0.28' stroke-width='1'/%3E%3C/svg%3E");
}

/* ---- 스크롤 리빌 (JS 활성 시에만 숨김 → JS 꺼져도 콘텐츠 노출) ---- */
html.js [data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.65s ease, transform 0.65s ease;
  transition-delay: var(--reveal-delay, 0ms);
}
html.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  html.js [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---- 폼 ---- */
.field-label {
  display: block;
  font-weight: 600;
  font-size: 0.9375rem;
  color: rgb(var(--c-steel-300));
  margin-bottom: 0.375rem;
}
.field-input {
  width: 100%;
  min-height: 3rem;
  padding: 0.7rem 0.9rem;
  border-radius: 0.625rem;
  border: 1.5px solid rgb(var(--c-navy-700));
  background: rgb(var(--c-navy-800));
  color: #fff;
  font-size: 1rem;               /* 16px — iOS 포커스 자동 확대 방지 */
  transition: border-color 0.2s ease;
}
.field-input::placeholder { color: rgb(var(--c-steel-400) / 0.75); }
.field-input:focus {
  outline: none;
  border-color: rgb(var(--c-orange-500));
}
.field-input[aria-invalid="true"] {
  border-color: #F87171;
}
select.field-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' fill='none'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%239AA6B4' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  padding-right: 2.5rem;
}
.field-error {
  display: none;
  margin-top: 0.375rem;
  font-size: 0.875rem;
  color: #FCA5A5;
}
.field-error.is-visible { display: block; }

/* 폼 결과 안내 (성공/실패 인라인 메시지) */
.form-status {
  display: none;
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 0.625rem;
  font-size: 0.9375rem;
  line-height: 1.55;
}
.form-status.is-success {
  display: block;
  background: rgb(var(--c-orange-500) / 0.12);
  border: 1px solid rgb(var(--c-orange-500) / 0.5);
  color: #FFD9C4;
}
.form-status.is-error {
  display: block;
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.45);
  color: #FCA5A5;
}

/* ---- 작업 프로세스 스텝퍼 ---- */
.process-grid {
  display: grid;
  gap: 2rem 1rem;
}
@media (min-width: 768px) { .process-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .process-grid { grid-template-columns: repeat(6, 1fr); } }

.process-step { position: relative; }
/* 모바일: 좌측 세로 연결선 */
.process-step::before {
  content: "";
  position: absolute;
  left: 1.75rem;
  top: 3.75rem;
  bottom: -2rem;
  width: 2px;
  background: rgb(var(--c-navy-700));
}
.process-step:last-child::before { display: none; }
/* 데스크톱: 아이콘 옆 가로 연결선 */
@media (min-width: 768px) {
  .process-step::before {
    left: 4rem;
    right: -0.75rem;
    top: 1.75rem;
    bottom: auto;
    width: auto;
    height: 2px;
  }
  .process-step:nth-child(3n)::before { display: none; } /* 3열 줄 끝 */
}
@media (min-width: 1024px) {
  .process-step:nth-child(3n)::before { display: block; }
  .process-step:last-child::before { display: none; }
}

.process-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgb(var(--c-navy-800));
  border: 1.5px solid rgb(var(--c-navy-700));
  color: rgb(var(--c-orange-400));
  position: relative;
  z-index: 1;
}

/* ---- 플로팅 전화 버튼 ---- */
.floating-call {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 70;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 3.25rem;
  padding: 0.8rem 1.15rem;
  border-radius: 999px;
  background: rgb(var(--c-orange-500));
  color: rgb(var(--c-navy-950));
  font-weight: 800;
  font-size: 1rem;
  box-shadow: 0 14px 32px -10px rgb(var(--c-orange-500) / 0.75), 0 4px 12px rgba(0, 0, 0, 0.35);
  transition: transform 0.3s ease, opacity 0.3s ease, background-color 0.2s ease;
}
.floating-call:hover { background: rgb(var(--c-orange-400)); }
.floating-call.is-hidden {
  opacity: 0;
  transform: translateY(18px);
  pointer-events: none;
}
@media (min-width: 768px) {
  .floating-call { right: 1.5rem; bottom: 1.5rem; }
}

/* 통화 아이콘 살짝 흔들림 (모션 최소화 설정 시 정지) */
@keyframes ring-shake {
  0%, 100% { transform: rotate(0deg); }
  20% { transform: rotate(-12deg); }
  40% { transform: rotate(10deg); }
  60% { transform: rotate(-6deg); }
  80% { transform: rotate(4deg); }
}
.floating-call svg { animation: ring-shake 2.6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  .floating-call svg { animation: none; }
}

/* ---- 비교표 X/O 아이콘 배지 ---- */
.mark-x, .mark-o {
  flex: none;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
}
.mark-x {
  background: rgb(var(--c-navy-700) / 0.55);
  color: rgb(var(--c-steel-400));
}
.mark-o {
  background: rgb(var(--c-orange-500));
  color: rgb(var(--c-navy-950));
}

/* ---- 카드 호버 (데스크톱에서만 살짝) ---- */
@media (hover: hover) {
  .lift-card { transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease; }
  .lift-card:hover {
    transform: translateY(-4px);
    border-color: rgb(var(--c-orange-500) / 0.55) !important;
    box-shadow: 0 18px 36px -18px rgba(0, 0, 0, 0.5);
  }
}

/* ---- 유틸 ---- */
.text-balance { text-wrap: balance; } /* 미지원 브라우저는 무시됨(점진적 향상) */
