/**
 * AILO Base Styles & Reset
 * Source of Truth: docs/02_개발_명세서.md, docs/03_디자인_명세서.md
 */

/* ==========================================================================
   Web Fonts: Gmarket Sans (지마켓산스 - 강조 폰트)
   ========================================================================== */

@font-face {
  font-family: 'GmarketSans';
  src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2001@1.1/GmarketSansLight.woff') format('woff');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'GmarketSans';
  src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2001@1.1/GmarketSansMedium.woff') format('woff');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'GmarketSans';
  src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2001@1.1/GmarketSansBold.woff') format('woff');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Gmarket Sans';
  src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2001@1.1/GmarketSansLight.woff') format('woff');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Gmarket Sans';
  src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2001@1.1/GmarketSansMedium.woff') format('woff');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Gmarket Sans';
  src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2001@1.1/GmarketSansBold.woff') format('woff');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1 0 auto;
}

/* Skip Link */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  background: var(--color-midnight);
  color: var(--color-white);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  z-index: 10000;
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow-lift);
  transition: top var(--duration-fast) var(--ease-out);
}

.skip-link:focus {
  top: var(--space-3);
  outline: 2px solid var(--color-indigo);
  outline-offset: 3px;
}

/* Screen Reader Only (Visually 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;
}

/* Typography Hierarchy: Headings & Emphasis use Gmarket Sans */
h1, h2, h3, h4, h5, h6,
.font-display,
.font-emphasis,
.emphasis-text {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.025em;
  word-break: keep-all;
  overflow-wrap: break-word;
  color: var(--color-midnight);
}

h1 {
  font-size: clamp(2.25rem, 5.5vw, 4.5rem);
  line-height: 1.15;
}

h2 {
  font-size: clamp(1.75rem, 3.5vw, 2.75rem);
  line-height: 1.25;
}

h3 {
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  line-height: 1.35;
}

h4 {
  font-size: 1.125rem;
  line-height: 1.4;
}

p {
  word-break: keep-all;
  overflow-wrap: break-word;
}

.lead-text {
  font-size: clamp(1.125rem, 1.5vw, 1.35rem);
  line-height: 1.6;
  color: var(--color-text-secondary);
  font-weight: 400;
}

/* Links & Interactive */
a {
  color: inherit;
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
}

button {
  cursor: pointer;
}

/* Focus Visible */
:focus-visible {
  outline: 2px solid var(--color-indigo);
  outline-offset: 3px;
}

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

/* Container & Layout */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--section-gap);
  position: relative;
}

.section--subtle {
  background-color: var(--color-surface-subtle);
}

/* Grid Children Constraint */
.grid-item,
[class*="grid"] > * {
  min-width: 0;
}

/* Text Selection */
::selection {
  background-color: var(--color-indigo-mist);
  color: var(--color-indigo);
}
