/* ── 기본값 ─────────────────────────────────────────────── */

:root {
  --bg: #08090c;
  --bg-elevated: #10131a;
  --bg-sunken: #0b0d12;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #e9ecf3;
  --text-muted: #98a0b0;
  /* 본문 배경(#08090c)과 카드 배경(#10131a) 양쪽에서 WCAG AA 4.5:1 을 넘는 값 */
  --text-faint: #7f8698;
  --accent: #38bdf8;

  --radius: 16px;
  --radius-sm: 8px;
  --wrap: 1120px;

  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
    "Apple SD Gothic Neo", "Noto Sans KR", system-ui, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3 {
  margin: 0;
  line-height: 1.25;
  letter-spacing: -0.02em;
  font-weight: 700;
}

p {
  margin: 0;
}

a {
  color: inherit;
}

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  padding: 0.12em 0.4em;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.07);
  color: #cfd6e4;
  white-space: nowrap;
}

em {
  font-style: normal;
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 55%, transparent);
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
}

strong {
  font-weight: 600;
  color: #ffffff;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 24px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 12px;
  padding: 10px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  text-decoration: none;
  z-index: 10;
}

.skip-link:focus {
  left: 24px;
}

/* ── 히어로 ─────────────────────────────────────────────── */

.hero {
  position: relative;
  padding-block: clamp(60px, 11vw, 116px) clamp(44px, 7vw, 76px);
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero::before {
  content: "";
  position: absolute;
  inset: -40% 20% auto -10%;
  height: 640px;
  background:
    radial-gradient(48% 52% at 22% 38%, rgba(56, 189, 248, 0.15), transparent 70%),
    radial-gradient(42% 46% at 68% 24%, rgba(167, 139, 250, 0.13), transparent 72%),
    radial-gradient(38% 44% at 46% 66%, rgba(240, 118, 106, 0.09), transparent 72%);
  filter: blur(12px);
  pointer-events: none;
}

.hero__inner {
  position: relative;
}

.hero__eyebrow {
  font-size: 0.8125rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 20px;
}

.hero__title {
  font-size: clamp(2.5rem, 7.2vw, 4.5rem);
  letter-spacing: -0.035em;
  margin-bottom: 28px;
  background: linear-gradient(180deg, #ffffff 20%, #b9c1d2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__lead {
  max-width: 62ch;
  font-size: clamp(1rem, 1.9vw, 1.1875rem);
  color: var(--text-muted);
  line-height: 1.75;
}

.hero__lead strong {
  color: var(--text);
}

/* 요약 통계 */

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 44px 0 0;
}

.stat {
  flex: 0 0 auto;
  min-width: 132px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012));
}

.stat dt {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  margin-bottom: 4px;
}

.stat dd {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ── 섹션 ───────────────────────────────────────────────── */

main {
  padding-block: clamp(44px, 6vw, 64px) 0;
}

.section-title {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 28px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

/* ── 카드 그리드 ────────────────────────────────────────── */

.grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 28px;
}

.card > article {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover > article,
.card:focus-within > article {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  transform: translateY(-3px);
  box-shadow: 0 18px 44px -28px rgba(0, 0, 0, 0.9),
    0 0 0 1px color-mix(in srgb, var(--accent) 12%, transparent);
}

/* 미디어 */

.card__media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--bg-sunken);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.card:hover .card__media img {
  transform: scale(1.025);
}

/* 이미지가 없는 카드는 타이포그래피 타일로 대체한다 */
.card__media--placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background:
    radial-gradient(60% 70% at 50% 30%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.022) 0 2px, transparent 2px 12px),
    var(--bg-sunken);
}

.placeholder__glyph {
  font-size: 3rem;
  line-height: 1;
  color: color-mix(in srgb, var(--accent) 70%, transparent);
}

.placeholder__label {
  font-size: 0.8125rem;
  color: var(--text-faint);
  letter-spacing: 0.02em;
}

/* 본문 */

.card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 26px 26px 24px;
}

.card__head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.card__title {
  font-size: 1.5rem;
  letter-spacing: -0.01em;
}

.card__summary {
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* 상태 배지 */

.badge {
  flex: 0 0 auto;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid;
  white-space: nowrap;
}

.badge--live {
  color: #6ee7b7;
  border-color: rgba(110, 231, 183, 0.34);
  background: rgba(110, 231, 183, 0.1);
}

.badge--local {
  color: #cbd3e1;
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.05);
}

.badge--wip {
  color: #9aa1b1;
  border-color: var(--line);
  background: transparent;
}

/* 설계 포인트 */

.points {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.65;
}

.points li {
  position: relative;
  padding-left: 18px;
}

.points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.68em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.75;
}

/* 기술 태그 */

.tags {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tags li {
  font-size: 0.75rem;
  color: var(--text-faint);
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
  white-space: nowrap;
}

/* 액션 */

.card__actions {
  margin-top: auto;
  padding-top: 4px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.9375rem;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  text-decoration: none;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn--primary {
  color: #06121a;
  background: var(--accent);
}

.btn--primary:hover {
  background: color-mix(in srgb, var(--accent) 82%, #ffffff);
}

.btn__ext {
  font-size: 0.875em;
  opacity: 0.75;
}

.btn--ghost {
  color: var(--text-faint);
  border-color: var(--line);
  background: transparent;
  cursor: default;
}

.card__note {
  font-size: 0.8125rem;
  color: var(--text-faint);
}

/* ── 원칙 ───────────────────────────────────────────────── */

.principles {
  padding-block: clamp(64px, 10vw, 104px) 0;
}

.principles__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.principle {
  padding: 26px 24px 28px;
  background: var(--bg-elevated);
}

.principle h3 {
  font-size: 1.0625rem;
  margin-bottom: 10px;
}

.principle p {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.principle em {
  --accent: #7dd3fc;
}

/* ── 푸터 ───────────────────────────────────────────────── */

.footer {
  margin-top: clamp(72px, 11vw, 120px);
  border-top: 1px solid var(--line);
  padding-block: 40px 56px;
}

.footer__inner {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.footer__note {
  max-width: 68ch;
  font-size: 0.9375rem;
  color: var(--text-faint);
}

.footer__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8125rem;
  color: var(--text-faint);
}

/* ── 스크롤 진입 연출 ───────────────────────────────────── */

/* 숨김은 JS가 켜져 있을 때만 건다. 스크립트가 없거나 실패하면 내용은 그대로 보인다. */
.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ── 반응형 ─────────────────────────────────────────────── */

@media (max-width: 640px) {
  .wrap {
    padding-inline: 18px;
  }

  .card__body {
    padding: 22px 20px 20px;
  }

  .stat {
    flex: 1 1 calc(50% - 6px);
    min-width: 0;
  }

  .card__actions {
    gap: 10px;
  }

  .card__note {
    flex-basis: 100%;
  }
}

@media (min-width: 1024px) {
  /* 배포된 프로젝트는 두 칸을 차지한다. 스크린샷은 자르지 않고 전체 폭으로 두고,
     본문만 2열로 나눠 줄이 지나치게 길어지지 않게 한다. */
  .grid > .card:first-child {
    grid-column: 1 / -1;
  }

  .grid > .card:first-child .card__body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    column-gap: 48px;
    align-content: start;
    padding: 30px 32px 32px;
  }

  .grid > .card:first-child .card__head,
  .grid > .card:first-child .card__summary,
  .grid > .card:first-child .tags,
  .grid > .card:first-child .card__actions {
    grid-column: 1;
  }

  .grid > .card:first-child .points {
    grid-column: 2;
    grid-row: 1 / span 4;
    margin-bottom: 0;
    align-self: start;
  }

  .grid > .card:first-child .card__title {
    font-size: 1.75rem;
  }

  .grid > .card:first-child .card__actions {
    margin-top: 6px;
  }

  /* 화면이 없는 카드는 홀로 남아 한 칸을 비우는 대신 가로로 눕는다 */
  .grid > .card--noimage {
    grid-column: 1 / -1;
  }

  .grid > .card--noimage > article {
    flex-direction: row;
  }

  .grid > .card--noimage .card__media {
    flex: 0 0 34%;
    aspect-ratio: auto;
    border-bottom: none;
    border-right: 1px solid var(--line);
  }

  .grid > .card--noimage .card__body {
    flex: 1 1 auto;
    padding: 30px 32px 32px;
  }
}

@media print {
  .js .reveal {
    opacity: 1;
    transform: none;
  }

  body {
    background: #fff;
    color: #000;
  }
}
