/* 첫 페이지(index.html) 스타일 — 카드 #550 에서 디자인 방향(문서함 design-direction)을 적용.
   토큰은 이 페이지가 스스로 선언한다. index.html 은 site.css 를 읽지 않는다 —
   로그인 전 공개 페이지라 멤버 페이지 스타일 전부를 받을 이유가 없다.

   캐시 버전은 손대지 않아도 된다 (카드 #549). npm run deploy 가 stamp-static.mjs 를
   먼저 돌려 index.html 의 ?v= 를 이 파일의 내용 해시로 맞춘다.

   마감은 design-direction 8절의 "환대" 쪽이다 — 여백을 넓게, 마스코트를 쓰고,
   그림자는 --shadow-1 까지만. 작업 도구(곰반·문서함)는 반대로 간다.

   다크는 카드 #534 에서 넣었다. 예고한 대로 토큰 블록을 두 벌로 늘리는 것으로
   끝났다 — 규칙 안에 리터럴 색이 없었기 때문이다.
   카드 #571 에서 시스템 설정만 따르던 것을 고쳤다. index.html 이 head 에 첫 페인트
   스크립트를 직접 갖고 있어 앱에서 고른 테마(data-theme)를 이 페이지도 받는다. */
:root {
  /* 면과 선 */
  --ground: #f4fafd;
  --surface: #ffffff;
  --surface-sunken: #eef6fc;
  --line: #dde8f2;
  --line-strong: #c5e4f5;

  /* 글자 */
  --fg: #24343f;
  --fg-soft: #5b7284;
  --fg-faint: #8298a8;

  /* 강조 — 이 페이지에서 강조는 파랑 하나뿐이다 */
  --accent: #2b7cb8;
  --accent-strong: #1f5e8e;
  --accent-soft: #eaf3fa;
  --fg-on-accent: #ffffff;

  /* 타이포 */
  --fs-xs: 0.75rem;
  --fs-sm: 0.8125rem;
  --fs-md: 0.9375rem;
  --fs-lg: 1.0625rem;
  --fs-xl: 1.3125rem;
  --lh: 1.6;
  --lh-loose: 1.75;
  --lh-tight: 1.3;

  /* 간격 */
  --sp-2: 0.25rem;
  --sp-3: 0.5rem;
  --sp-4: 0.75rem;
  --sp-5: 1rem;
  --sp-6: 1.5rem;
  --sp-7: 2rem;
  --sp-8: 3rem;
  --sp-9: 4rem;

  /* 반경 — 3단 */
  --r-sm: 6px;
  --r-md: 10px;
  --r-pill: 999px;

  /* 그림자 — 중립, 저채도 */
  --shadow-1: 0 1px 2px rgba(20, 64, 110, 0.06);
  --shadow-focus: 0 0 0 3px rgba(43, 124, 184, 0.35);
  --shadow-mascot: drop-shadow(0 10px 22px rgba(20, 64, 110, 0.1));

  --font-title:
    "Paperozi", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --font-body:
    "Presentation", "Apple SD Gothic Neo", "Malgun Gothic", system-ui,
    sans-serif;
}

/* 다크 (카드 #534 · 카드 #571 에서 3단으로). 값은 site.css 의 다크 표와 같다.

   site.css 와 같은 세 갈래다 (방향 9절):
     :root                                   라이트 정본 (위)
     prefers-color-scheme: dark + data-theme 없음/dark 아님   시스템 따라가기
     :root[data-theme="dark"]                사용자가 다크를 고른 경우
   가드가 없으면 앱에서 "라이트"를 고른 사용자가 OS 다크일 때 이 페이지만
   다크로 떴다 — 랜딩 하나만 선택을 안 따르던 이유다.
   두 다크 블록의 내용은 같아야 하므로 한 곳에서 고치고 다른 쪽에 옮긴다. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #0f1720;
    --surface: #17212b;
    --surface-sunken: #121b24;
    --line: #26333f;
    --line-strong: #33434f;
    --fg: #e3ecf3;
    --fg-soft: #9fb2c0;
    --fg-faint: #78899a;
    --accent: #6cb2e4;
    --accent-strong: #9bcdf1;
    --accent-soft: #16293a;
    --fg-on-accent: #0b1620;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-focus: 0 0 0 3px rgba(108, 178, 228, 0.4);
    --shadow-mascot: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.5));
  }
}
:root[data-theme="dark"] {
  --ground: #0f1720;
  --surface: #17212b;
  --surface-sunken: #121b24;
  --line: #26333f;
  --line-strong: #33434f;
  --fg: #e3ecf3;
  --fg-soft: #9fb2c0;
  --fg-faint: #78899a;
  --accent: #6cb2e4;
  --accent-strong: #9bcdf1;
  --accent-soft: #16293a;
  --fg-on-accent: #0b1620;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-focus: 0 0 0 3px rgba(108, 178, 228, 0.4);
  --shadow-mascot: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.5));
}

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

body {
  font-family: var(--font-body);
  font-size: var(--fs-md);
  line-height: var(--lh);
  background: var(--ground);
  color: var(--fg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 아이콘 심볼 정의는 그리지 않는다 — 참조용으로만 문서에 있다 */
.sprite {
  position: absolute;
  width: 0;
  height: 0;
}

/* 키보드 포커스 — 사이트 공통 규칙과 같은 모양이다 (카드 #555) */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

main {
  flex: 1;
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: var(--sp-9) var(--sp-6) var(--sp-8);
  display: flex;
  flex-direction: column;
  /* 세로 가운데로 모은다. 위에 붙이면 큰 화면에서 아래가 통째로 빈다 */
  justify-content: center;
  gap: var(--sp-9);
}

/* ── 소개 영역 ─────────────────────────────────────────────
   마스코트와 글을 가로로 놓는다. 예전에는 550px 폭 안에 세로로 쌓여
   1440px 화면에서 좌우가 통째로 비었다. */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  align-items: center;
  gap: var(--sp-8);
}

.hero-img {
  width: 100%;
  height: auto;
  filter: var(--shadow-mascot);
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-img {
    animation: none;
  }
}

.brand {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: clamp(2.125rem, 5vw, 3rem);
  line-height: var(--lh-tight);
  letter-spacing: -0.02em;
  color: var(--accent-strong);
}

/* 도메인은 이름이 아니라 라벨이다. 예전에는 브랜드보다 진해 위계가 뒤집혀 있었다 */
.domain {
  margin-top: var(--sp-3);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--fg-faint);
}

.tagline {
  margin-top: var(--sp-5);
  max-width: 34ch;
  font-size: var(--fs-lg);
  line-height: var(--lh-loose);
  color: var(--fg-soft);
}

.actions {
  margin-top: var(--sp-7);
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  flex-wrap: wrap;
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-6);
  border-radius: var(--r-md);
  background: var(--accent);
  color: var(--fg-on-accent);
  font-size: var(--fs-md);
  font-weight: 600;
  text-decoration: none;
  transition:
    background 0.15s ease,
    box-shadow 0.15s ease;
}

/* 버튼에 상시 그림자를 두지 않는다. hover 에서만 살짝 든다 */
.cta:hover {
  background: var(--accent-strong);
  box-shadow: var(--shadow-1);
}

.cta .ico {
  color: var(--accent-soft);
}

.cta-note {
  font-size: var(--fs-sm);
  color: var(--fg-faint);
}

/* ── 소개 카드 ─────────────────────────────────────────────
   2 x 2. 예전에는 3 + 1 이라 마지막 한 장이 혼자 3칸을 차지했다.
   경계선 한 겹을 공유해 네 칸이 한 덩어리로 읽히게 한다. */
.features {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}

.feature {
  display: flex;
  gap: var(--sp-5);
  align-items: flex-start;
  padding: var(--sp-6);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
}

.feature .ico {
  flex: none;
  margin-top: 2px;
  color: var(--accent);
}

.feature h2 {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: var(--fs-lg);
  line-height: var(--lh-tight);
  color: var(--fg);
}

.feature p {
  margin-top: var(--sp-2);
  font-size: var(--fs-sm);
  color: var(--fg-soft);
  line-height: var(--lh);
}

a.feature {
  transition: background 0.15s ease;
}

a.feature:hover {
  background: var(--surface-sunken);
}

a.feature:hover h2 {
  color: var(--accent-strong);
}

/* 링크인 칸에만 화살표를 붙여 눌리는 것과 아닌 것을 가른다 */
a.feature h2::after {
  content: "→";
  margin-left: var(--sp-3);
  color: var(--accent);
  font-weight: 400;
}

footer {
  border-top: 1px solid var(--line);
  padding: var(--sp-6);
  display: flex;
  justify-content: space-between;
  gap: var(--sp-4);
  width: min(1080px, 100%);
  margin: 0 auto;
  font-size: var(--fs-xs);
  color: var(--fg-faint);
}

/* 태블릿 경계에서 세로로 쌓는다. 휴대폰 최적화 자체는 별도 묶음(M)에서 다룬다.
   분기점은 site.css 머리말의 셋만 쓴다 (카드 #570) */
@media (max-width: 900px) {
  main {
    padding: var(--sp-7) var(--sp-5) var(--sp-6);
    gap: var(--sp-7);
  }
  .hero {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    text-align: center;
    gap: var(--sp-6);
  }
  .hero-img {
    width: min(240px, 60vw);
  }
  .tagline {
    max-width: none;
  }
  .actions {
    justify-content: center;
  }
  .features {
    grid-template-columns: minmax(0, 1fr);
  }
}
