/*
 * tylhub.com — Tyl Consulting LLC
 * 단일 스타일시트. 외부 폰트·스크립트·이미지 없음 (CSP: default-src 'none'; style-src 'self').
 *
 * USCIS Torch API Program 심사 기준 대응 (감사 규칙):
 *   · 명암비 4.5:1 이상 — 라이트/다크 두 스킴 모두에서 계산 검증 (아래 토큰 주석의 실측값)
 *   · 본문 16px 이상 — 이 파일의 최소 글자 크기는 1rem. 1rem 미만 규칙 없음
 *   · 좁은 칼럼 금지 — 장문은 .prose (약 70ch), column-count 미사용
 *   · ALL-CAPS 문단·라벨 금지 — 대문자 변환 규칙을 두지 않는다. 강조는 굵기·색으로만
 *   · Section 508 — skip link · 시맨틱 랜드마크 · 헤딩 순서 · :focus-visible · lang="en"
 *   · WCAG 1.4.10 Reflow — 넓은 표는 .table-scroll 안에서만 가로 스크롤
 *   · prefers-reduced-motion — 모든 transition/hover 변형은 no-preference 안에서만 적용
 *
 * 구성: 1 토큰 · 2 베이스 · 3 레이아웃 · 4 헤더 · 5 컴포넌트 · 6 홈 섹션 ·
 *       7 푸터 · 8 문서(정책) 페이지 · 9 모션
 */

/* ============================================================
   1. 토큰
   ============================================================ */

:root {
  --font-serif: Georgia, 'Times New Roman', serif;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
    sans-serif;

  --bg: #ffffff;
  --fg: #16202b;            /* 16.5:1 on #ffffff · 15.3:1 on #f5f7fa · 15.2:1 on #f2f6fb */
  --fg-muted: #46525f;      /*  8.0:1 on #ffffff ·  7.4:1 on #f5f7fa ·  7.4:1 on #f2f6fb */
  --link: #0b4a8f;          /*  8.8:1 on #ffffff ·  8.2:1 on #f5f7fa ·  8.1:1 on #f2f6fb */
  --link-hover: #083a72;    /* 11.3:1 on #ffffff · 10.4:1 on #f2f6fb */
  --brand: #0b4a8f;
  --brand-deep: #083a72;

  --band: #f2f6fb;          /* 히어로·How we work 밴드 */
  --surface: #f5f7fa;       /* 카드·표 머리행·푸터 — 본문 15.3:1 · 보조 7.4:1 · 링크 8.2:1 */
  --surface-hover: #e6eef8; /* 아웃라인 버튼 hover — 링크 7.5:1, 본문 14.1:1 */
  --border: #d6dce3;
  --border-strong: #c3ccd6;

  --btn-fg: #ffffff;        /* 8.8:1 on #0b4a8f · 11.3:1 on #083a72 */
  --btn-bg: #0b4a8f;
  --btn-bg-hover: #083a72;

  --focus: #0b4a8f;

  --radius: 10px;
  --radius-sm: 6px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212;
    --fg: #e8e8e8;          /* 15.3:1 on #121212 · 14.0:1 on #171c22 · 13.2:1 on #1b2129 */
    --fg-muted: #b8b8b8;    /*  9.4:1 on #121212 ·  8.6:1 on #171c22 ·  8.2:1 on #1b2129 */
    --link: #7db8ff;        /*  9.1:1 on #121212 ·  8.3:1 on #171c22 ·  7.9:1 on #1b2129 */
    --link-hover: #a9d1ff;  /* 11.8:1 on #121212 · 10.8:1 on #171c22 */
    --brand: #7db8ff;
    --brand-deep: #a9d1ff;

    --band: #1b2129;
    --surface: #171c22;
    --surface-hover: #1b2129;
    --border: #333c46;
    --border-strong: #414c58;

    --btn-fg: #0d2440;      /* 7.6:1 on #7db8ff · 9.9:1 on #a9d1ff */
    --btn-bg: #7db8ff;
    --btn-bg-hover: #a9d1ff;

    --focus: #7db8ff;
  }
}

/* ============================================================
   2. 베이스
   ============================================================ */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 2rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 1rem; /* 16px — 감사 요건 충족. 이 파일에 1rem 미만 없음 */
  line-height: 1.65;
}

/* 키보드 사용자용 본문 바로가기 (Section 508) */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 0.75rem 1rem;
  background: var(--fg);
  color: var(--bg); /* 16.5:1 라이트 · 15.3:1 다크 */
  z-index: 10;
}

.skip-link:focus {
  left: 0;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 2px;
}

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

a:focus-visible,
.skip-link:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

h1,
h2,
h3 {
  font-family: var(--font-serif);
  font-weight: 700;
  color: var(--fg);
}

h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.14;
  letter-spacing: -0.01em;
  margin-block: 0 1rem;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 1.875rem);
  line-height: 1.25;
  margin-block: 0 0.75rem;
}

h3 {
  font-size: 1.1875rem;
  line-height: 1.35;
  margin-block: 0 0.5rem;
}

p,
ul,
ol {
  margin-block: 0 1rem;
}

ul,
ol {
  padding-left: 1.5rem;
}

li {
  margin-block: 0.35rem;
}

strong {
  font-weight: 700;
}

/* ============================================================
   3. 레이아웃
   ============================================================ */

.container {
  max-width: 72rem;
  margin-inline: auto;
  padding-inline: 1.5rem;
}

/* 장문 — 행 길이 제한 (좁은 칼럼도, 과도한 행 길이도 금지) */
.prose {
  max-width: 70ch;
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.section {
  padding-block: clamp(2.75rem, 6vw, 4.25rem);
}

.band {
  background: var(--band);
  border-block: 1px solid var(--border);
}

.section__intro {
  color: var(--fg-muted);
  max-width: 62ch;
  margin-bottom: 2rem;
}

/* 2단 — 모바일에서 1단으로 접힘 */
.split {
  display: grid;
  gap: 2rem;
}

@media (min-width: 52rem) {
  .split {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 3rem;
    align-items: start;
  }

  .split--even {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

/* ============================================================
   4. 헤더
   ============================================================ */

.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding-block: 1.5rem;
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--fg);
  text-decoration: none;
}

.brand__mark {
  flex: none;
  width: auto;
  height: 2rem;
}

/*
 * 로고는 단색 남색(#183265) PNG다. 다크 스킴 배경(#121212)에서는 대비 1.5:1 로
 * 묻히므로 흰색 실루엣으로 반전한다. invert()는 알파를 건드리지 않아 모양은 그대로다.
 * 흰색 #ffffff 기준 — 헤더 15.3:1 · 푸터(#171c22) 14.0:1
 */
@media (prefers-color-scheme: dark) {
  .brand__mark {
    filter: brightness(0) invert(1);
  }
}

.brand__name {
  font-family: var(--font-serif);
  font-size: 1.3125rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.01em;
}

.brand:hover .brand__name {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* JS 없음 — 햄버거 메뉴 대신 순수 CSS 줄바꿈 */
.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav li {
  margin: 0;
}

.site-nav a {
  color: var(--fg);
  text-decoration: none;
  padding-block: 0.25rem;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover {
  color: var(--link-hover);
  border-bottom-color: var(--border-strong);
}

.site-nav a[aria-current='page'] {
  color: var(--link);
  font-weight: 700;
  border-bottom-color: var(--brand);
}

/* ============================================================
   5. 컴포넌트
   ============================================================ */

/* --- 아이콘 --- */

.icon {
  color: var(--brand);
  flex: none;
}

/* --- 눈썹 문구 (대문자 변형 금지 — 굵기와 색으로만 구분) --- */

.eyebrow {
  color: var(--link);
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-block: 0 0.75rem;
}

/* --- 버튼 --- */

.btn {
  display: inline-block;
  padding: 0.8125rem 1.5rem;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
}

.btn--primary {
  background: var(--btn-bg);
  border-color: var(--btn-bg);
  color: var(--btn-fg);
}

.btn--primary:hover {
  background: var(--btn-bg-hover);
  border-color: var(--btn-bg-hover);
  color: var(--btn-fg);
}

.btn--outline {
  background: transparent;
  border-color: var(--brand);
  color: var(--link);
}

.btn--outline:hover {
  background: var(--surface-hover);
  border-color: var(--brand-deep);
  color: var(--link-hover);
}

.btn:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

/* --- 카드 --- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1.25rem;
  margin: 0 0 2rem;
  padding: 0;
  list-style: none;
}

/* 카드 6장 — 넓은 화면에서는 4+2 가 아니라 3+3 으로 떨어지게 고정한다 */
@media (min-width: 62rem) {
  .cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
  }
}

/* 카드 뒤에 안내 상자가 없으면 아래 여백은 섹션 패딩만 남긴다 */
.cards:last-child {
  margin-bottom: 0;
}

.card {
  margin: 0;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.card__icon {
  display: block;
  margin-bottom: 0.875rem;
}

.card h3 {
  margin-block: 0 0.5rem;
}

.card p {
  color: var(--fg-muted);
  margin-block: 0;
}

/* --- 알림 상자 (좌측 강조선) --- */

.note {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 5px solid var(--brand);
  border-radius: var(--radius-sm);
  padding: 1.125rem 1.5rem;
  margin-block: 0;
  max-width: 62ch;
}

/* --- 패널 (At a glance) --- */

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.panel h3 {
  margin-block: 0 1rem;
}

.glance {
  margin: 0;
}

.glance > div {
  padding-block: 0.75rem;
  border-top: 1px solid var(--border);
}

.glance > div:first-child {
  padding-top: 0;
  border-top: 0;
}

.glance > div:last-child {
  padding-bottom: 0;
}

.glance dt {
  color: var(--fg-muted);
  font-weight: 700;
}

.glance dd {
  margin: 0.125rem 0 0;
}

/* 밴드 위에 올라간 표면 요소는 페이지 배경색으로 되돌려 경계를 유지한다 */
.band .card,
.band .note,
.band .panel,
.band .contact-card {
  background: var(--bg);
}

/* ============================================================
   6. 홈 섹션
   ============================================================ */

/* --- 히어로 --- */

.hero {
  padding-block: clamp(3rem, 8vw, 5.5rem);
  border-top: 0; /* 헤더의 아래 테두리와 겹치지 않게 */
}

.hero h1 {
  max-width: 24ch;
}

.hero__lead {
  color: var(--fg-muted);
  font-size: 1.125rem;
  max-width: 54ch;
  margin-block: 0 2rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2.75rem;
}

.factstrip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
  margin: 0;
  padding: 1.5rem 0 0;
  border-top: 1px solid var(--border-strong);
  list-style: none;
  color: var(--fg-muted);
}

.factstrip li {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin: 0;
}

.factstrip li::before {
  content: '';
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--brand);
}

/* --- 진행 단계 --- */

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.step {
  margin: 0;
  padding-top: 1.25rem;
  border-top: 3px solid var(--border-strong);
}

.step__num {
  display: block;
  font-family: var(--font-serif);
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--brand);
}

.step h3 {
  margin-block: 0.25rem 0.5rem;
}

.step p {
  color: var(--fg-muted);
  margin-block: 0;
}

/* --- 연혁 --- */

/* 연도와 내용을 두 칼럼으로. 좁은 화면에서는 위아래로 쌓는다 (좁은 칼럼 금지) */
.timeline {
  margin: 0 0 2rem;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--border);
}

.timeline > li {
  display: grid;
  gap: 0.25rem 2rem;
  margin: 0;
  padding-block: 1.125rem;
  border-bottom: 1px solid var(--border);
}

@media (min-width: 46rem) {
  .timeline > li {
    grid-template-columns: 8rem minmax(0, 1fr);
  }
}

.timeline__year {
  font-family: var(--font-serif);
  font-weight: 700;
  color: var(--link);
  margin-block: 0;
}

.timeline__body {
  color: var(--fg-muted);
  max-width: 62ch;
  margin-block: 0;
}

/* --- 소개 본문 --- */

.about__body > p:last-child {
  margin-bottom: 0;
}

/* ============================================================
   7. 푸터
   ============================================================ */

.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-block: 3rem 2rem;
  color: var(--fg-muted);
}

.footer__grid {
  display: grid;
  gap: 2.5rem;
}

@media (min-width: 48rem) {
  .footer__grid {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 3rem;
  }
}

.footer__brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  color: var(--fg);
  text-decoration: none;
}

.footer__brand .brand__mark {
  height: 1.75rem;
}

.footer__brand .brand__name {
  font-size: 1.1875rem;
}

.footer__brand:hover .brand__name {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer__about {
  max-width: 34ch;
  margin-block: 0 1rem;
}

.footer__contact {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer__contact li {
  margin-block: 0 0.25rem;
}

.footer__title {
  font-family: var(--font-serif);
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--fg);
  margin-block: 0 0.75rem;
}

.footer__links {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer__links li {
  margin-block: 0 0.4375rem;
}

.footer__bottom {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.footer__bottom p {
  margin: 0;
}

/* ============================================================
   8. 문서(정책) 페이지 — privacy.html / terms.html 이 의존하는 규칙
   ============================================================ */

.page-head {
  background: var(--band);
  border-bottom: 1px solid var(--border);
  padding-block: clamp(2.5rem, 6vw, 3.5rem);
}

.page-head h1 {
  margin-block: 0 0.5rem;
}

.updated {
  color: var(--fg-muted);
  margin-block: 0;
}

.legal {
  padding-block: clamp(2.5rem, 5vw, 3.5rem);
}

.legal h2 {
  margin-block: 2.5rem 0.75rem;
}

.legal h3 {
  margin-block: 1.875rem 0.5rem;
}

.legal > h2:first-child {
  margin-top: 0;
}

/* 스크린리더 전용 — 표 caption 등. display:none 은 낭독도 막으므로 쓰지 않는다 */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* 넓은 표는 페이지가 아니라 표가 스크롤되어야 한다 (WCAG 1.4.10 Reflow) */
.table-scroll {
  overflow-x: auto;
  margin-block: 0 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 30rem;
  font-size: 1rem; /* 모바일에서도 축소 금지 */
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--surface);
  font-weight: 700;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-block: 0 1.5rem;
}

.contact-card p {
  margin-block: 0 0.25rem;
}

.contact-card p:last-child {
  margin-bottom: 0;
}

/* ============================================================
   9. 모션 — 모션 민감 사용자에게는 적용하지 않는다
   ============================================================ */

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  a,
  .btn,
  .site-nav a {
    transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
  }

  .card {
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  }

  .card:hover {
    transform: translateY(-2px);
    border-color: var(--border-strong);
  }
}
