:root {
  --bg: #FBFAF7;
  --text: #16181C;
  --muted: #62666D;
  --line: #E4E0D6;
  --accent: #FF5F1F;
  --device: #16181C;
  --screen: #FFFFFF;
  --tile: #F1EFEA;
  --tile-text: #16181C;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141518;
    --text: #EDEBE6;
    --muted: #A0A3A9;
    --line: #2B2E33;
    --device: #000000;
    --screen: #1C1D21;
    --tile: #2A2C31;
    --tile-text: #EDEBE6;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.7 -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Apple SD Gothic Neo", "Hiragino Sans", "Noto Sans KR", "Noto Sans JP", sans-serif;
  overflow-wrap: break-word;
}

/* 한국어는 어절 단위로 줄을 바꾼다. 띄어쓰기가 없는 일본어에 쓰면 줄이 넘친다. */
html:lang(ko) body { word-break: keep-all; }

main {
  max-width: 680px;
  margin: 0 auto;
  padding: 56px 20px 40px;
}

a { color: var(--accent); text-underline-offset: 3px; }

/* 언어 바꾸기: 맨 위 오른쪽 */
.langs {
  text-align: right;
  margin: -32px 0 24px;
  font-size: 14px;
  color: var(--muted);
}

.langs a { color: var(--muted); text-decoration: none; }
.langs a:hover { color: var(--text); }
.langs strong { color: var(--text); font-weight: 600; }

header .icon { border-radius: 16px; display: block; }

h1 {
  font-size: 40px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 20px 0 4px;
}

h1 .hi { color: var(--accent); }

.tagline { margin: 0; color: var(--muted); font-size: 19px; }

.intro { font-size: 19px; margin: 28px 0; }

.cta { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }

.download {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 650;
  padding: 11px 20px;
  border-radius: 10px;
}

.download:hover { filter: brightness(1.06); }

.meta, .note { color: var(--muted); font-size: 15px; }

.note { margin: 8px 0 0; }

/* 실제 앱 화면 구성(상태 바 + 4×2 버튼)을 그대로 그린다. */
.device {
  margin: 48px 0 8px;
  background: var(--device);
  border-radius: 34px;
  padding: 12px;
  aspect-ratio: 19.5 / 9;
  max-width: 640px;
}

.screen {
  height: 100%;
  background: var(--screen);
  border-radius: 24px;
  padding: 3% 4%;
  display: flex;
  flex-direction: column;
  gap: 3%;
}

.bar {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: clamp(9px, 1.9vw, 13px);
  color: var(--muted);
}

.bar .dot { width: 7px; height: 7px; border-radius: 50%; background: #34C759; }
.bar .more { margin-left: auto; }

.grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 3%;
}

/* 실제 앱처럼 아이콘 위, 이름 아래, 실행 중이면 점. 아이콘은 칸의 짧은 변에 맞춘다. */
.tile {
  background: var(--tile);
  color: var(--tile-text);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4%;
  padding: 4px;
  min-width: 0;
  container-type: size;
}

.tile .art { width: 42cqmin; height: 42cqmin; display: block; }
.tile .art img, .tile .art svg { width: 100%; height: 100%; display: block; }
.tile .art svg { padding: 6%; }

.tile .label {
  font-size: clamp(9px, 1.7vw, 12px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.tile .run { width: 4px; height: 4px; border-radius: 50%; background: var(--muted); opacity: 0; }
.tile.running .run { opacity: 1; }

.tile.front { outline: 2px solid var(--accent); outline-offset: -2px; }
.tile.front .label { font-weight: 600; }

article h2 {
  font-size: 24px;
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin: 56px 0 8px;
}

article h3 { font-size: 17px; margin: 28px 0 4px; }
article h3 + p { margin-top: 0; }

article p { margin: 0 0 12px; }

ol, ul { padding-left: 22px; margin: 0 0 12px; }
li { margin-bottom: 6px; }

kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 0 5px;
  margin: 0 1px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  font: 600 0.9em/1.5 inherit;
  text-align: center;
}

code { font-size: 0.88em; background: var(--line); padding: 1px 5px; border-radius: 4px; }

footer {
  margin-top: 72px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

footer p { margin: 0 0 6px; }
footer a { color: var(--muted); }

.doc h1 { font-size: 32px; margin-top: 8px; }
.doc h2 { font-size: 19px; margin: 32px 0 6px; }
.doc p { margin: 0 0 12px; }
.back { margin: 0; font-size: 15px; }
.back a { color: var(--muted); text-decoration: none; }

@media (max-width: 520px) {
  main { padding-top: 36px; }
  .langs { margin-top: -20px; }
  h1 { font-size: 34px; }
  .intro { font-size: 18px; }
  .device { border-radius: 22px; padding: 8px; }
  .screen { border-radius: 15px; }
  .tile { border-radius: 8px; }
}
