/* ============================================================
   세온코더 (SEONCODER) — Base Styles
   리셋 · 기본 타이포그래피 · 레이아웃 유틸리티
   ============================================================ */

@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/variable/pretendardvariable.css');

/* ─── 리셋 ─────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  color: var(--color-text-dark);
  background-color: var(--color-bg-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

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

input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
}

/* ─── 타이포그래피 기본 ─────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: var(--leading-tight);
  font-weight: var(--weight-bold);
  color: inherit;
}

h1 { font-size: var(--text-h1); }
h2 { font-size: var(--text-h2); }
h3 { font-size: var(--text-h3); font-weight: var(--weight-semibold); }
h4 { font-size: var(--text-h4); font-weight: var(--weight-semibold); }

p {
  line-height: var(--leading-normal);
  color: inherit;
}

code,
pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

pre {
  overflow-x: auto;
  padding: var(--space-md);
  background-color: var(--color-bg-dark-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-dark);
  color: var(--color-text-light);
}

/* ─── 컨테이너 ──────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-padding);
}

.container--narrow {
  max-width: var(--container-narrow);
}

/* ─── 섹션 ──────────────────────────────────────────────────── */
.section {
  padding: var(--section-padding);
}

.section--dark {
  background-color: var(--color-bg-dark);
  color: var(--color-text-light);
}

.section--light {
  background-color: var(--color-bg-light);
  color: var(--color-text-dark);
}

.section--white {
  background-color: var(--color-bg-white);
  color: var(--color-text-dark);
}

.section__header {
  text-align: center;
  margin-bottom: var(--space-3xl);
}

.section__tag {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary);
  background-color: var(--color-primary-light);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-md);
}

.section--dark .section__tag {
  color: var(--color-accent);
  background-color: rgba(0, 229, 160, 0.12);
}

.section__title {
  font-size: var(--text-h2);
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-md);
}

.section__desc {
  font-size: var(--text-body-lg);
  color: var(--color-text-dark-secondary);
  max-width: 600px;
  margin-inline: auto;
  line-height: var(--leading-relaxed);
}

.section--dark .section__desc {
  color: var(--color-text-light-secondary);
}

/* ─── 그리드 ────────────────────────────────────────────────── */
.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

/* ─── 플렉스 유틸리티 ───────────────────────────────────────── */
.flex        { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between{ display: flex; align-items: center; justify-content: space-between; }
.flex-col    { display: flex; flex-direction: column; }
.gap-sm      { gap: var(--space-sm); }
.gap-md      { gap: var(--space-md); }
.gap-lg      { gap: var(--space-lg); }
.gap-xl      { gap: var(--space-xl); }

/* ─── 텍스트 유틸리티 ───────────────────────────────────────── */
.text-center  { text-align: center; }
.text-left    { text-align: left; }
.text-right   { text-align: right; }
.text-primary { color: var(--color-primary); }
.text-accent  { color: var(--color-accent); }
.text-highlight { color: var(--color-highlight); }
.text-muted   { color: var(--color-text-dark-secondary); }
.text-muted-light { color: var(--color-text-light-secondary); }

.text-hero {
  font-size: var(--text-hero);
  font-weight: var(--weight-black);
  line-height: var(--leading-tight);
}

.text-h1 { font-size: var(--text-h1); font-weight: var(--weight-bold); }
.text-h2 { font-size: var(--text-h2); font-weight: var(--weight-bold); }
.text-h3 { font-size: var(--text-h3); font-weight: var(--weight-semibold); }
.text-body-lg { font-size: var(--text-body-lg); }
.text-small   { font-size: var(--text-small); }
.text-xs      { font-size: var(--text-xs); }

.font-black    { font-weight: var(--weight-black); }
.font-bold     { font-weight: var(--weight-bold); }
.font-semibold { font-weight: var(--weight-semibold); }
.font-medium   { font-weight: var(--weight-medium); }
.font-regular  { font-weight: var(--weight-regular); }

/* ─── 스크롤 진입 애니메이션 초기 상태 ──────────────────────── */
.animate-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-in.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.animate-in[data-delay="1"] { transition-delay: 0.1s; }
.animate-in[data-delay="2"] { transition-delay: 0.2s; }
.animate-in[data-delay="3"] { transition-delay: 0.3s; }
.animate-in[data-delay="4"] { transition-delay: 0.4s; }
.animate-in[data-delay="5"] { transition-delay: 0.5s; }

/* ─── 스크린 리더 전용 ─────────────────────────────────────── */
.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;
}

/* ─── 반응형 ────────────────────────────────────────────────── */
@media (max-width: 1023px) {
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 767px) {
  .section { padding: var(--section-padding-mobile); }

  .container { padding-inline: var(--container-padding-mobile); }

  .section__header { margin-bottom: var(--space-2xl); }

  .text-hero  { font-size: var(--text-hero-mobile); }
  .text-h1    { font-size: var(--text-h1-mobile); }
  .text-h2    { font-size: var(--text-h2-mobile); }
  .text-h3    { font-size: var(--text-h3-mobile); }

  h1 { font-size: var(--text-h1-mobile); }
  h2 { font-size: var(--text-h2-mobile); }
  h3 { font-size: var(--text-h3-mobile); }

  .section__title { font-size: var(--text-h2-mobile); }
  .section__desc  { font-size: var(--text-body); }

  .grid--3,
  .grid--2,
  .grid--4 { grid-template-columns: 1fr; }
}
