/* =========================================================
   AIFTER — Design Tokens & Skeleton Layout
   1단계: 토큰 + 모바일 우선 정적 레이아웃 뼈대
   (모션/인터랙션/기능 없음 — 후속 단계에서 추가)
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
  /* Core brand */
  --aifter-blue:    #2563DB;
  --apron-khaki:    #6B755C;
  --warm-cream:     #FFF4E0;
  --chicken-orange: #F59E0B;
  --deep-ink:       #111827;

  /* Surfaces */
  --bg-page: #F7F6F2;
  --bg-card: #FFFFFF;
  --bg-dark: #111827;

  /* Text */
  --text-primary:   #111827;
  --text-secondary: #5F5E5A;
  --text-on-dark:   #F7F6F2;

  /* Lines */
  --border: #E5E3DB;

  /* Spacing (8px base) */
  --space-1:  8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 48px;
  --space-6: 56px;
  --space-7: 88px;

  /* Layout */
  --container-max: 1080px;
  --reading-max:    680px;
  --pad-x: 20px;

  /* Radius */
  --radius-card: 16px;
  --radius-btn:  14px;

  /* Type weights */
  --w-regular: 400;
  --w-semi:    600;
  --w-bold:    700;
}

@media (min-width: 768px) {
  :root {
    --pad-x: 40px;
  }
}

/* ---------- Reset (가벼운) ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo',
               'Segoe UI', Roboto, sans-serif;
  font-weight: var(--w-regular);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-primary);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--aifter-blue); text-decoration: none; }
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--aifter-blue);
  outline-offset: 2px;
}

h1, h2, h3, p { margin: 0; }

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

/* ---------- Container ---------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
}

.reading {
  max-width: var(--reading-max);
}

/* ---------- Sections ---------- */
.section {
  padding-top: 56px;
  padding-bottom: 56px;
}

@media (min-width: 768px) {
  .section {
    padding-top: 88px;
    padding-bottom: 88px;
  }
}

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

.section__eyebrow {
  font-size: 13px;
  font-weight: var(--w-semi);
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: var(--space-1);
}

.section__title {
  font-size: clamp(24px, 5vw, 40px);
  font-weight: var(--w-bold);
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.section--dark .section__title { color: var(--text-on-dark); }

.section__lede {
  color: var(--text-secondary);
  max-width: var(--reading-max);
  margin-bottom: var(--space-4);
}

.section--dark .section__lede { color: var(--text-on-dark); opacity: 0.85; }

/* ---------- Hero ---------- */
.hero {
  padding-top: 48px;
  padding-bottom: 48px;
  background: var(--bg-page);
}

@media (min-width: 768px) {
  .hero {
    padding-top: 80px;
    padding-bottom: 80px;
  }
}

.hero__logo {
  font-size: 18px;
  font-weight: var(--w-bold);
  letter-spacing: 0.02em;
  margin-bottom: 24px;
}

.hero__inner {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.hero__title {
  max-width: 720px;
  font-size: clamp(34px, 9vw, 72px);
  font-weight: var(--w-bold);
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  word-break: keep-all;
}

.hero__sub {
  margin-top: 14px;
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 560px;
  word-break: keep-all;
}

.hero__cta {
  margin-top: 20px;
}

.hero__line { display: block; }

.hero__visual {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
}

.hero__speech {
  display: inline-block;
  background: var(--warm-cream);
  color: var(--deep-ink);
  font-size: 14px;
  font-weight: var(--w-semi);
  line-height: 1.4;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(17, 24, 39, 0.04);
  max-width: 100%;
}

.hero__mascot {
  width: 100%;
  max-width: 240px;
  aspect-ratio: 4 / 3;
  background: var(--warm-cream);
  border: 1px dashed var(--border);
  border-radius: var(--radius-card);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 13px;
}

.hero__mascot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 14px;
}

@media (min-width: 768px) {
  .hero__inner {
    flex-direction: row-reverse;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
  }
  .hero__text { flex: 1; min-width: 0; }
  .hero__visual { flex: 0 0 240px; max-width: 240px; }
  .hero__mascot { max-width: 240px; aspect-ratio: 1 / 1; }
}


@media (max-width: 420px) {
  .hero__title {
    font-size: clamp(33px, 9.5vw, 37px);
  }

  .hero__sub {
    font-size: 14px;
    line-height: 1.65;
  }

  .btn {
    width: 100%;
    padding-left: 18px;
    padding-right: 18px;
  }

  .link-card {
    align-items: flex-start;
    padding: 20px;
  }

  .link-card__icon {
    flex-basis: 40px;
    width: 40px;
    height: 40px;
  }
}

@media (min-width: 768px) and (max-width: 899px) {
  .hero__title {
    max-width: 420px;
    font-size: clamp(42px, 6vw, 48px);
  }
}

@media (min-width: 900px) {
  .hero__inner {
    gap: 56px;
  }

  .hero__visual {
    flex-basis: 340px;
    max-width: 340px;
  }

  .hero__mascot {
    max-width: 340px;
  }
}
/* ---------- Hero Motion Sequence (3단계) ---------- */
@keyframes heroFadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes heroPop {
  0%   { opacity: 0; transform: scale(0.9) translateY(8px); }
  60%  { opacity: 1; transform: scale(1.03) translateY(0); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes heroFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes heroPulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.04); }
  100% { transform: scale(1); }
}

.hero.is-animating .hero__line,
.hero.is-animating .hero__sub,
.hero.is-animating .hero__speech,
.hero.is-animating .hero__mascot,
.hero.is-animating .hero__cta {
  opacity: 0;
}

.hero.is-animating .hero__line {
  animation: heroFadeUp 320ms ease-out both;
}
.hero.is-animating .hero__line:nth-of-type(1) { animation-delay:   0ms; }
.hero.is-animating .hero__line:nth-of-type(2) { animation-delay:  80ms; }

.hero.is-animating .hero__sub {
  animation: heroFadeUp 320ms ease-out 200ms both;
}

.hero.is-animating .hero__mascot {
  transform-origin: center bottom;
  animation: heroPop 320ms ease-out 800ms both;
}

.hero.is-animating .hero__speech {
  animation: heroFadeIn 220ms ease-out 950ms both;
}

.hero.is-animating .hero__cta {
  animation: heroFadeUp 240ms ease-out 1000ms both;
}

.hero.is-animating .hero__cta .btn {
  animation: heroPulse 480ms ease-out 1280ms 1 both;
}

@media (prefers-reduced-motion: reduce) {
  .hero.is-animating .hero__line,
  .hero.is-animating .hero__sub,
  .hero.is-animating .hero__speech,
  .hero.is-animating .hero__mascot,
  .hero.is-animating .hero__cta,
  .hero.is-animating .hero__cta .btn {
    opacity: 1;
    transform: none;
    animation: none;
  }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 14px 24px;
  border-radius: var(--radius-btn);
  font-family: inherit;
  font-size: 16px;
  font-weight: var(--w-semi);
  line-height: 1;
  border: 1px solid transparent;
  cursor: pointer;
  text-align: center;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(17, 24, 39, 0.08);
}

.btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn--primary {
  background: var(--aifter-blue);
  color: var(--warm-cream);
}

.btn--emphasis {
  background: var(--chicken-orange);
  color: var(--deep-ink);
}

.btn--secondary {
  background: transparent;
  border-color: var(--border);
  color: var(--deep-ink);
}

.btn--secondary:hover,
.btn--secondary:focus-visible {
  background: var(--bg-card);
}

.section--dark .btn--secondary {
  color: var(--text-on-dark);
  border-color: rgba(247, 246, 242, 0.25);
}

/* ---------- Glossary (검색은 2단계에서) ---------- */
.glossary {
  background: var(--bg-page);
}

.glossary__search {
  width: 100%;
  min-height: 48px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  background: var(--bg-card);
  font-family: inherit;
  font-size: 16px;
  color: var(--text-primary);
  margin-bottom: var(--space-3);
}

.glossary__chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-bottom: var(--space-4);
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 14px;
  font-weight: var(--w-semi);
  color: var(--text-primary);
  cursor: pointer;
}

.chip--active {
  background: var(--deep-ink);
  color: var(--text-on-dark);
  border-color: var(--deep-ink);
}

.glossary__results {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2);
}

@media (min-width: 768px) {
  .glossary__results { grid-template-columns: 1fr 1fr; }
}

.term-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--space-3);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.term-card:hover,
.term-card:focus-within {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(17, 24, 39, 0.08);
}

.term-card__head {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin-bottom: var(--space-1);
}

.term-card__name {
  font-size: 18px;
  font-weight: var(--w-bold);
  color: var(--text-primary);
}

.term-card__badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--warm-cream);
  color: var(--deep-ink);
  font-size: 12px;
  font-weight: var(--w-semi);
}

.term-card__def {
  font-size: 15px;
  color: var(--text-primary);
  line-height: 1.6;
}

.term-card__ex {
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-secondary);
}

.glossary__empty {
  padding: var(--space-5) var(--space-3);
  text-align: center;
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius-card);
  color: var(--text-secondary);
  font-size: 14px;
}

.glossary__empty strong {
  display: block;
  color: var(--text-primary);
  font-size: 17px;
  font-weight: var(--w-semi);
  margin-bottom: 4px;
}

/* ---------- Link Cards (섹션 공통) ---------- */
.card-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2);
}

@media (min-width: 768px) {
  .card-list--2col { grid-template-columns: 1fr 1fr; }
}

.link-card {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  color: var(--text-primary);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.link-card:hover,
.link-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(17, 24, 39, 0.08);
}

.link-card__icon {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--bg-page);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.link-card__body { flex: 1; min-width: 0; }

.link-card__title {
  font-size: 17px;
  font-weight: var(--w-semi);
  margin-bottom: 2px;
}

.link-card__desc {
  font-size: 14px;
  color: var(--text-secondary);
}

.link-card__chevron {
  flex: 0 0 auto;
  color: var(--text-secondary);
  font-size: 20px;
}

/* ---------- Contact Section ---------- */
.contact-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2);
}

@media (min-width: 768px) {
  .contact-list { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Footer ---------- */
.footer {
  background: var(--bg-dark);
  color: var(--text-on-dark);
  padding-top: var(--space-5);
  padding-bottom: var(--space-5);
}

.footer__inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.footer__logo {
  font-size: 18px;
  font-weight: var(--w-bold);
  letter-spacing: 0.02em;
}

.footer__channels {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.footer__channels a {
  color: var(--text-on-dark);
  opacity: 0.8;
  font-size: 14px;
}

.footer__copy {
  font-size: 13px;
  color: var(--text-on-dark);
  opacity: 0.6;
}

@media (min-width: 768px) {
  .footer__inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

/* ---------- Utilities ---------- */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}
/* ---------- Scroll Reveal Motion ---------- */
.section[data-reveal] {
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 0.4s ease-out,
    transform 0.4s ease-out;
  will-change: opacity, transform;
}

.section[data-reveal].is-revealed {
  opacity: 1;
  transform: translateY(0);
}

.section[data-reveal] .card-list > li,
.section[data-reveal] .contact-list > li,
.section[data-reveal] .glossary__results > * {
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 0.4s ease-out var(--reveal-delay, 0ms),
    transform 0.4s ease-out var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}

.section[data-reveal].is-revealed .card-list > li,
.section[data-reveal].is-revealed .contact-list > li,
.section[data-reveal].is-revealed .glossary__results > * {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .section[data-reveal],
  .section[data-reveal] .card-list > li,
  .section[data-reveal] .contact-list > li,
  .section[data-reveal] .glossary__results > * {
    opacity: 1;
    transform: none;
    transition: none;
    will-change: auto;
  }

  .btn,
  .link-card,
  .term-card {
    transition: none;
  }

  .btn:hover,
  .btn:focus-visible,
  .link-card:hover,
  .link-card:focus-visible,
  .term-card:hover,
  .term-card:focus-within {
    transform: none;
  }
}
/* ---------- Global Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0ms !important;
  }
}
