/* =========================================================
   base.css — reset + typography + element defaults
   Relies on tokens.css. Load order: tokens → base → …
   ========================================================= */

/* ---------- Modern reset (Meyer + Andy Bell hybrid, trimmed) ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
  /* mobile-menu(transform: translateX(100%) 화면 밖)가 일부 브라우저에서
     문서 가로 스크롤에 잡히는 케이스 방지 */
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  font-family: var(--ff-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-loose);
  color: var(--text-body);
  background: var(--bg-page);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

input, button, textarea, select { font: inherit; color: inherit; }

button {
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--dur-base) var(--ease-out);
}

a:hover { color: var(--brand); }

ul, ol { list-style: none; }

table { border-collapse: collapse; border-spacing: 0; }

hr {
  border: 0;
  border-top: 1px solid var(--border-soft);
  margin: var(--sp-5) 0;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--ff-sans);
  color: var(--text-strong);
  line-height: var(--lh-snug);
  font-weight: var(--fw-bold);
  letter-spacing: -0.01em;
  /* Korean-friendly line breaking — split by word/eojeol, not mid-syllable */
  word-break: keep-all;
  overflow-wrap: break-word;
}

/* Korean-friendly word-level line breaking — apply globally to all text content
   so words like "컴플라이언스" are never split mid-syllable, regardless of
   container width. */
body, p, li, dt, dd, span, a, button, label, th, td, blockquote, figcaption {
  word-break: keep-all;
  overflow-wrap: break-word;
}

h1 { font-size: var(--fs-h1); line-height: var(--lh-tight); letter-spacing: -0.02em; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); font-weight: var(--fw-semibold); }
h4 { font-size: var(--fs-h4); font-weight: var(--fw-semibold); line-height: var(--lh-normal); }
h5 { font-size: var(--fs-h5); font-weight: var(--fw-semibold); line-height: 1.5; }
h6 { font-size: var(--fs-h6); font-weight: var(--fw-semibold); line-height: 1.5; }

p { line-height: var(--lh-loose); }

small, .text-sm { font-size: var(--fs-body-sm); }
.text-caption { font-size: var(--fs-caption); color: var(--text-muted); }
.text-lg      { font-size: var(--fs-body-lg); }
.text-muted   { color: var(--text-muted); }
.text-strong  { color: var(--text-strong); font-weight: var(--fw-semibold); }
.text-brand   { color: var(--brand); }
.text-accent  { color: var(--color-accent-600); }

.mono { font-family: var(--ff-display); }

strong, b { font-weight: var(--fw-semibold); color: var(--text-strong); }

/* Dark / hero contexts — inherit parent color so emphasized text stays visible
   instead of falling back to dark --text-strong on a dark background. */
.hero b, .hero strong,
.sub-hero b, .sub-hero strong,
.cta-strip b, .cta-strip strong,
.duo-panel-banner b, .duo-panel-banner strong,
.vendor-spotlight--dark b, .vendor-spotlight--dark strong,
body.xerxes-page b, body.xerxes-page strong {
  color: inherit;
}

/* ---------- Utility: container ---------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-px-mobile);
}

@media (min-width: 641px) {
  .container { padding-inline: var(--container-px-desktop); }
}

/* Visually hidden but accessible to screen readers */
.sr-only,
.sound_only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* ---------- Focus ---------- */
:focus { outline: none; }
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-xs);
}

/* ---------- Selection ---------- */
::selection {
  background: var(--color-accent-100);
  color: var(--text-strong);
}

/* ---------- Eyebrow label (reusable) ---------- */
.eyebrow {
  display: inline-block;
  font-family: var(--ff-display);
  font-size: var(--fs-eyebrow);
  font-weight: var(--fw-semibold);
  line-height: 1.2;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent-600);
}

.eyebrow--brand { color: var(--color-primary-600); }
.eyebrow--muted { color: var(--text-muted); }
.eyebrow--invert { color: var(--color-accent-300); }

/* Short underline below section heading */
.underline-mark {
  display: inline-block;
  width: 40px;
  height: 3px;
  background: var(--accent);
  border-radius: var(--radius-pill);
  margin-top: var(--sp-3);
}

/* ---------- Section heading block (centered) ---------- */
.section-head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto var(--sp-8);
}
/* Wide variant — opt-out of 720px cap when a long Korean headline must
   stay on one line at desktop width (mobile still wraps naturally).
   .section-desc는 가독성 위해 720px 유지. */
.section-head.section-head--wide { max-width: none; }
.section-head.section-head--wide .section-desc {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}
.section-head .eyebrow { margin-bottom: var(--sp-3); }
.section-head h2 { margin-bottom: var(--sp-4); }
.section-head .section-desc {
  color: var(--text-muted);
  font-size: var(--fs-body-lg);
}

/* ---------- Reduced motion guard ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
