/*
Theme Name: PICODE
Theme URI: http://picode.co.kr/
Author: PICODE
Author URI: http://picode.co.kr/
Description: 주식회사 피아이코드 자체 워드프레스 테마. 자동차·모빌리티 시험·검증 솔루션 전문기업의 신뢰감을 전달하는 B2B 디자인. Sonnet/Elementor 의존성 없이 가볍고 빠르게 동작하도록 직접 제작되었습니다.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: Proprietary
License URI: http://picode.co.kr/
Text Domain: picode
Tags: business, b2b, automotive, custom
*/

/* ============================================================
   1. DESIGN TOKENS (CSS 변수)
   - 모든 색상/간격/폰트는 여기서 한 번에 관리
   ============================================================ */
:root {
  /* NAVY - 메인 다크 톤 */
  --pi-navy-950: #050B1F;
  --pi-navy-900: #1A2750;
  --pi-navy-800: #243561;
  --pi-navy-700: #2A3960;
  --pi-navy-600: #3D4D7A;

  /* GOLD - 메인 액센트 (브랜드 일관성, 소개서 톤) */
  --pi-gold-600: #B8901F;
  --pi-gold-500: #D4A437;
  --pi-gold-400: #DDB654;
  --pi-gold-300: #E8C374;
  --pi-gold-100: #F8EFD7;

  /* CYAN - 데이터·기술 표시 전용 */
  --pi-cyan-500: #1FBDD9;
  --pi-cyan-400: #38D6F0;
  --pi-cyan-300: #6FE3F2;

  /* GRAY - 본문/보조 */
  --pi-gray-50:  #F7F9FC;
  --pi-gray-100: #EEF2F8;
  --pi-gray-200: #DCE3ED;
  --pi-gray-300: #C3CDD9;
  --pi-gray-400: #8896AB;
  --pi-gray-500: #66748A;
  --pi-gray-600: #4A5668;
  --pi-gray-700: #343C4D;
  --pi-gray-800: #2A3344;
  --pi-gray-900: #1A1F2E;

  --pi-white: #FFFFFF;
  --pi-black: #0A0E18;

  /* SEMANTIC */
  --pi-success: #00B89A;
  --pi-warning: #E07A1E;
  --pi-error:   #E04848;

  /* TYPOGRAPHY */
  --pi-font-display: 'Manrope', 'Pretendard', 'IBM Plex Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  --pi-font-body:    'Pretendard', 'IBM Plex Sans KR', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', sans-serif;
  --pi-font-mono:    'JetBrains Mono', 'IBM Plex Mono', 'Courier New', monospace;

  /* SPACING SCALE */
  --pi-space-1: 4px;
  --pi-space-2: 8px;
  --pi-space-3: 12px;
  --pi-space-4: 16px;
  --pi-space-5: 24px;
  --pi-space-6: 32px;
  --pi-space-7: 48px;
  --pi-space-8: 64px;
  --pi-space-9: 96px;
  --pi-space-10: 128px;

  /* RADIUS */
  --pi-radius-sm: 4px;
  --pi-radius-md: 8px;
  --pi-radius-lg: 12px;
  --pi-radius-xl: 20px;
  --pi-radius-full: 999px;

  /* SHADOW */
  --pi-shadow-sm: 0 1px 2px rgba(10, 22, 51, 0.06);
  --pi-shadow-md: 0 4px 12px -2px rgba(10, 22, 51, 0.08);
  --pi-shadow-lg: 0 10px 30px -10px rgba(10, 22, 51, 0.15);
  --pi-shadow-xl: 0 20px 50px -20px rgba(10, 22, 51, 0.25);
  --pi-shadow-gold: 0 10px 30px -10px rgba(212, 164, 55, 0.4);

  /* CONTAINER */
  --pi-container: 1280px;
  --pi-container-narrow: 960px;
  --pi-container-wide: 1440px;
}

/* ============================================================
   2. RESET (가벼운 리셋)
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 80px; /* sticky header 보정 */
}

body {
  margin: 0;
  font-family: var(--pi-font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--pi-navy-950);
  background: var(--pi-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  word-break: keep-all; /* 한글 단어 단위 줄바꿈 */
  overflow-wrap: break-word;
}

img, svg, video {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

ul, ol { padding: 0; margin: 0; }
li { list-style: none; }

/* ============================================================
   3. TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--pi-font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--pi-navy-950);
  margin: 0;
  line-height: 1.2;
}

h1 { font-size: clamp(36px, 5vw, 56px); font-weight: 800; line-height: 1.1; letter-spacing: -0.03em; }
h2 { font-size: clamp(28px, 3.5vw, 42px); line-height: 1.15; }
h3 { font-size: clamp(22px, 2.5vw, 28px); }
h4 { font-size: 20px; }
h5 { font-size: 17px; }
h6 { font-size: 15px; }

p { margin: 0 0 1em 0; }
p:last-child { margin-bottom: 0; }

::selection {
  background: var(--pi-gold-500);
  color: var(--pi-navy-950);
}

/* ============================================================
   4. ACCESSIBILITY
   ============================================================ */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  -webkit-clip-path: inset(50%);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute !important;
  width: 1px;
  word-wrap: normal !important;
}

.skip-link {
  position: absolute;
  left: -9999px;
  z-index: 999;
  padding: 12px 20px;
  background: var(--pi-navy-950);
  color: var(--pi-gold-500);
  text-decoration: none;
  font-weight: 600;
}
.skip-link:focus {
  left: 16px;
  top: 16px;
}

:focus-visible {
  outline: 2px solid var(--pi-gold-500);
  outline-offset: 2px;
}

/* ============================================================
   5. LAYOUT - 컨테이너 (모든 페이지에서 공통)
   ============================================================ */
.pi-container {
  width: 100%;
  max-width: var(--pi-container);
  margin: 0 auto;
  padding: 0 24px;
}
.pi-container-narrow { max-width: var(--pi-container-narrow); }
.pi-container-wide   { max-width: var(--pi-container-wide); }

@media (max-width: 768px) {
  .pi-container { padding: 0 20px; }
}

/* ============================================================
   6. UTILITY CLASSES (공통 헬퍼)
   ============================================================ */
.pi-tag-mono {
  font-family: var(--pi-font-mono);
  font-size: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--pi-gold-600);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.pi-tag-mono::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--pi-gold-500);
}

.pi-tag-mono.is-cyan { color: var(--pi-cyan-500); }
.pi-tag-mono.is-cyan::before { background: var(--pi-cyan-500); }

.pi-tag-mono.on-dark { color: var(--pi-gold-400); }
.pi-tag-mono.on-dark::before { background: var(--pi-gold-400); }

.text-gold { color: var(--pi-gold-500); }
.text-cyan { color: var(--pi-cyan-400); }
.text-navy { color: var(--pi-navy-950); }
.text-muted { color: var(--pi-gray-500); }

/* ============================================================
   7. BUTTONS - 공통 버튼 시스템
   ============================================================ */
.pi-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  font-family: var(--pi-font-body);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
  border-radius: var(--pi-radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.4;
}

.pi-btn:hover { transform: translateY(-1px); }

/* Primary: 골드 - 가장 강조 */
.pi-btn-primary {
  background: var(--pi-gold-500);
  color: var(--pi-navy-950);
  font-weight: 700;
}
.pi-btn-primary:hover {
  background: var(--pi-gold-400);
  box-shadow: var(--pi-shadow-gold);
  color: var(--pi-navy-950);
}

/* Dark: 네이비 - 보조 */
.pi-btn-dark {
  background: var(--pi-navy-950);
  color: var(--pi-white);
}
.pi-btn-dark:hover {
  background: var(--pi-navy-800);
  color: var(--pi-white);
  box-shadow: var(--pi-shadow-lg);
}

/* Outline (light): 라이트 배경에서 사용 */
.pi-btn-outline {
  background: transparent;
  color: var(--pi-navy-950);
  border-color: var(--pi-gray-300);
}
.pi-btn-outline:hover {
  border-color: var(--pi-navy-950);
  background: var(--pi-navy-950);
  color: var(--pi-white);
}

/* Outline (dark): 다크 배경에서 사용 */
.pi-btn-outline-light {
  background: transparent;
  color: var(--pi-white);
  border-color: rgba(255, 255, 255, 0.3);
}
.pi-btn-outline-light:hover {
  border-color: var(--pi-white);
  background: rgba(255, 255, 255, 0.05);
  color: var(--pi-white);
}

.pi-btn-lg {
  padding: 18px 32px;
  font-size: 15px;
}

.pi-btn .pi-btn-icon {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}
.pi-btn:hover .pi-btn-icon {
  transform: translateX(3px);
}

/* ============================================================
   8. SECTION 공통 (모든 페이지에서 사용)
   ============================================================ */
.pi-section {
  padding: var(--pi-space-10) 0;
  position: relative;
}
.pi-section-tight { padding: var(--pi-space-9) 0; }

.pi-section-header {
  max-width: 720px;
  margin-bottom: var(--pi-space-8);
}
.pi-section-header.is-center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}
.pi-section-header.is-center .pi-tag-mono {
  justify-content: center;
}

.pi-section-tag {
  margin-bottom: var(--pi-space-4);
}

.pi-section-title {
  margin-bottom: var(--pi-space-4);
}

.pi-section-desc {
  font-size: 17px;
  line-height: 1.7;
  color: var(--pi-gray-600);
  max-width: 640px;
}
.pi-section-header.is-center .pi-section-desc {
  margin-left: auto;
  margin-right: auto;
}

/* SECTION VARIANTS */
.pi-section-light { background: var(--pi-gray-50); }
.pi-section-dark {
  background: var(--pi-navy-950);
  color: var(--pi-white);
  position: relative;
  overflow: hidden;
}
.pi-section-dark .pi-section-title,
.pi-section-dark h2,
.pi-section-dark h3,
.pi-section-dark h4 { color: var(--pi-white); }
.pi-section-dark .pi-section-desc { color: var(--pi-gray-200); }

.pi-section-dark::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(212, 164, 55, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(212, 164, 55, 0.06) 1px, transparent 1px);
  background-size: 64px 64px;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse at center, black 0%, transparent 80%);
  mask-image: radial-gradient(ellipse at center, black 0%, transparent 80%);
}
.pi-section-dark > .pi-container { position: relative; z-index: 1; }

/* ============================================================
   9. WORDPRESS REQUIRED CLASSES
   ============================================================ */
.alignleft  { float: left; margin-right: 24px; }
.alignright { float: right; margin-left: 24px; }
.aligncenter {
  display: block;
  margin-left: auto;
  margin-right: auto;
}
.alignwide { max-width: 100%; }
.alignfull { max-width: none; width: 100vw; margin-left: calc(50% - 50vw); }
.wp-caption {
  max-width: 100%;
  margin-bottom: 24px;
}
.wp-caption-text {
  font-size: 13px;
  color: var(--pi-gray-500);
  margin-top: 8px;
  text-align: center;
}

/* ============================================================
   10. SCROLL REVEAL ANIMATION
   ============================================================ */
.pi-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.pi-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .pi-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  html { scroll-behavior: auto; }
}

/* ============================================================
   11. RESPONSIVE BREAKPOINTS
   참고: <768px 모바일 / 768~1023 태블릿 / 1024+ 데스크톱
   ============================================================ */
@media (max-width: 1023px) {
  .pi-section { padding: var(--pi-space-9) 0; }
}
@media (max-width: 768px) {
  .pi-section { padding: var(--pi-space-8) 0; }
  .pi-section-header { margin-bottom: var(--pi-space-6); }
  .pi-btn-lg { padding: 14px 22px; font-size: 14px; }
}
