/* ===== Tokens ===== */
:root {
  --bg: #ffffff;
  --bg-alt: #f6f7f9;
  --surface: #ffffff;
  --text: #15171c;
  --text-muted: #5b6270;
  --border: #e4e7ec;
  --accent: #036636;
  --accent-strong: #024d28;
  --accent-soft: #e4f0e9;
  --on-accent: #ffffff;      /* 메인 컬러 위 글자색 */
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);

  --radius: 16px;
  --container: 1120px;
  --gutter: clamp(16px, 4vw, 32px);
  --section-y: clamp(64px, 10vw, 120px);

  --font: system-ui, -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --bg-alt: #151820;
    --surface: #1a1e27;
    --text: #eef0f4;
    --text-muted: #a2a9b6;
    --border: #2a2f3a;
    /* 어두운 배경에서는 #036636이 묻히므로 같은 계열의 밝은 초록을 쓰고 글자는 어둡게 한다 */
    --accent: #34c27a;
    --accent-strong: #5ad397;
    --accent-soft: rgba(52, 194, 122, .14);
    --on-accent: #04210f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  }
}

/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  word-break: keep-all;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* 고정 헤더 높이만큼 앵커 위치를 내린다 */
section[id] { scroll-margin-top: 72px; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  padding: 8px 14px;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 8px;
  z-index: 100;
}
.skip-link:focus { top: 12px; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 1rem;
  white-space: nowrap;
  transition: background-color .2s, border-color .2s, transform .2s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-strong); }
.btn-ghost { border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--text-muted); }
.btn-sm { min-height: 40px; padding: 0 18px; font-size: .9375rem; }
.btn-disabled { background: var(--bg-alt); color: var(--text-muted); border-color: var(--border); cursor: default; }

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -.01em;
}
.logo-mark { width: 32px; height: 32px; color: var(--accent); }
.logo-mark path { stroke: var(--on-accent); }
.nav { display: flex; gap: clamp(16px, 3vw, 32px); }
.nav a { font-weight: 600; color: var(--text-muted); padding: 8px 0; transition: color .2s; }
.nav a:hover { color: var(--text); }

/* ===== Hero ===== */
.hero {
  padding-block: clamp(56px, 10vw, 128px);
  background:
    radial-gradient(60% 60% at 85% 20%, var(--accent-soft), transparent 70%),
    var(--bg);
  overflow: hidden;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  align-items: center;
}
.eyebrow {
  font-size: .8125rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.hero h1 {
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  line-height: 1.15;
  letter-spacing: -.03em;
  font-weight: 800;
}
.accent { color: var(--accent); }
.lead {
  margin-top: 20px;
  max-width: 34em;
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
  color: var(--text-muted);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

/* 장식: 메인 컬러 계열의 공이 떠다니는 캔버스 (main.js가 그림) */
.hero-art {
  position: relative;
  width: min(100%, 300px);
  aspect-ratio: 1;
  margin-inline: auto;
  border-radius: 28px;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 15%, transparent);
  overflow: hidden;
}
.hero-balls { display: block; width: 100%; height: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ===== Sections ===== */
.section { padding-block: var(--section-y); }
.section-alt { background: var(--bg-alt); }
.section-head { max-width: 640px; margin-bottom: clamp(32px, 5vw, 56px); }
.section-head h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1.25;
  letter-spacing: -.02em;
  font-weight: 800;
}
.section-desc { margin-top: 16px; color: var(--text-muted); font-size: 1.0625rem; }

/* ===== Apps ===== */
.app-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
.app-card {
  display: flex;
  gap: 20px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
}
.app-card:hover { transform: translateY(-2px); }
.app-card-soon { box-shadow: none; border-style: dashed; }
.app-card-soon:hover { transform: none; }
.app-icon {
  flex: none;
  width: 72px;
  height: 72px;
  border-radius: 18px;
  object-fit: cover;
}
.app-icon-soon {
  display: grid;
  place-items: center;
  background: var(--bg-alt);
  border: 1px dashed var(--border);
  color: var(--text-muted);
}
.app-icon-soon svg { width: 28px; height: 28px; }
.app-body { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; }
.app-body h3 { font-size: 1.25rem; line-height: 1.3; }
.app-body p { color: var(--text-muted); margin-bottom: 8px; }
/* 설명 길이가 달라도 버튼이 카드 아래쪽에 맞춰지도록 */
.app-body .btn { margin-top: auto; }
.tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
  background: var(--accent-soft);
  color: var(--accent);
}
.tag-muted { background: var(--bg-alt); color: var(--text-muted); }

/* ===== Values ===== */
.value-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
.value {
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.value-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 16px;
}
.value-icon svg { width: 24px; height: 24px; }
.value h3 { font-size: 1.125rem; margin-bottom: 8px; }
.value p { color: var(--text-muted); }

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 32px;
  font-size: .9375rem;
  color: var(--text-muted);
}
.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.footer-brand strong { color: var(--text); }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.footer-links a { text-decoration: underline; text-underline-offset: 3px; }
.footer-links a:hover { color: var(--text); }
.copyright { font-size: .875rem; }

/* ===== Responsive ===== */
/* 아주 작은 화면: 아이콘을 카드 위로 올려 설명 폭을 확보 */
@media (max-width: 380px) {
  .app-card { flex-direction: column; }
}

/* 태블릿 이상 */
@media (min-width: 720px) {
  .hero-art { width: 360px; }
  .app-grid { grid-template-columns: repeat(2, 1fr); }
  .value-grid { grid-template-columns: repeat(3, 1fr); }
  .app-icon { width: 96px; height: 96px; border-radius: 22px; }
  .footer-inner {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
  }
  .copyright { flex-basis: 100%; }
}

/* PC */
@media (min-width: 960px) {
  .hero-inner { grid-template-columns: 1.2fr 1fr; gap: 64px; }
  .hero-art { width: 100%; max-width: 400px; margin-inline: auto 0; }
  /* 앱 카드 3열: 폭이 좁아지므로 아이콘을 위로 올린다 */
  .app-grid { grid-template-columns: repeat(3, 1fr); }
  .app-card { flex-direction: column; }
  .app-icon { width: 80px; height: 80px; border-radius: 20px; }
}
