/* SPDX-License-Identifier: LicenseRef-Oxhee-Proprietary */
/* Copyright (c) 2026 oxhee */

/*
 * 소개 사이트 하나의 스타일. 색·반경·그림자·모션 값은 src/web/app/tokens.css와 같다(앱과 같은 제품으로 보이게).
 * 앱은 라이트가 :root, 다크가 .dark지만 여기는 클래스 전환이 없으므로 다크를 기본으로 두고
 * prefers-color-scheme: light에서 앱의 라이트 짝으로 바꾼다.
 */

:root {
  color-scheme: dark light;
  --radius: 1rem;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 120ms;
  --dur-base: 200ms;

  --background: oklch(0.16 0.01 15);
  --foreground: oklch(0.96 0.006 15);
  --card: oklch(0.205 0.012 15);
  --sidebar: oklch(0.185 0.011 15);
  --primary: oklch(0.72 0.17 8);
  --primary-foreground: oklch(0.18 0.03 10);
  --muted: oklch(0.245 0.012 15);
  --muted-foreground: oklch(0.72 0.014 15);
  --accent: oklch(0.29 0.04 8);
  --accent-foreground: oklch(0.95 0.02 8);
  --border: oklch(1 0 0 / 8%);
  --ring: oklch(0.72 0.17 8 / 55%);
  --caution: oklch(0.84 0.14 80);
  --caution-soft: oklch(0.84 0.14 80 / 14%);
  --risk: oklch(0.7 0.19 25);
  --risk-soft: oklch(0.7 0.19 25 / 16%);
  --shadow-card: 0 1px 0 oklch(1 0 0 / 4%) inset, 0 12px 32px -16px oklch(0 0 0 / 60%);

  --font-sans: "Pretendard Variable", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Pretendard Variable", monospace;
  --page-max: 72rem;
  --read-max: 40rem;
  --gutter: 1rem;
}

@media (prefers-color-scheme: light) {
  :root {
    --background: oklch(0.985 0.005 30);
    --foreground: oklch(0.2 0.018 15);
    --card: oklch(1 0 0);
    --sidebar: oklch(0.97 0.006 25);
    --primary: oklch(0.58 0.19 8);
    --primary-foreground: oklch(0.99 0.005 8);
    --muted: oklch(0.95 0.007 20);
    --muted-foreground: oklch(0.5 0.015 15);
    --accent: oklch(0.94 0.03 8);
    --accent-foreground: oklch(0.3 0.06 8);
    --border: oklch(0.2 0.02 15 / 10%);
    --ring: oklch(0.58 0.19 8 / 60%);
    --caution: oklch(0.52 0.13 70);
    --caution-soft: oklch(0.95 0.05 85);
    --risk: oklch(0.56 0.2 25);
    --risk-soft: oklch(0.95 0.03 25);
    --shadow-card: 0 1px 2px oklch(0.2 0.02 15 / 6%), 0 8px 24px -12px oklch(0.2 0.02 15 / 18%);
  }
}

@media (min-width: 48rem) {
  :root { --gutter: 2rem; }
}

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

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

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.7;
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent); color: var(--accent-foreground); }

a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: var(--primary); }

:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  border-radius: 0.6rem;
}

h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; }

code, pre { font-family: var(--font-mono); font-size: 0.875em; }
:not(pre) > code {
  padding: 0.1em 0.4em;
  border-radius: 0.6rem;
  background: var(--muted);
  overflow-wrap: anywhere;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  background: var(--primary);
  color: var(--primary-foreground);
  font-weight: 600;
  z-index: 20;
}
.skip:focus { top: 0.75rem; }

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

/* 머리줄 */
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in oklch, var(--background) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}
.top .wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: 3.5rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  text-decoration: none;
  margin-right: auto;
}
.brand-tile {
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.6rem;
  background: var(--primary);
  color: var(--primary-foreground);
  font-size: 0.875rem;
  font-weight: 820;
}
.top nav { display: flex; align-items: center; gap: 0.25rem; }
.top nav a {
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
  color: var(--muted-foreground);
  font-size: 0.875rem;
  text-decoration: none;
  transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.top nav a:hover { background: var(--muted); color: var(--foreground); }
.top nav a[aria-current="page"] { color: var(--foreground); font-weight: 600; }
@media (max-width: 26rem) {
  .top nav a.nav-about { display: none; }
}

/* 버튼 — 알약 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 3rem;
  padding: 0 1.25rem;
  border: 0;
  border-radius: 9999px;
  font: inherit;
  font-weight: 650;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 1rem; height: 1rem; flex: none; }
.btn-primary { background: var(--primary); color: var(--primary-foreground); }
.btn-primary:hover { background: color-mix(in oklch, var(--primary) 85%, var(--foreground)); }
.btn-secondary { background: var(--muted); color: var(--foreground); }
.btn-secondary:hover { background: color-mix(in oklch, var(--muted) 80%, var(--foreground)); }
.btn-sm { height: 2.25rem; padding: 0 0.875rem; font-size: 0.875rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* 히어로 */
.hero {
  display: grid;
  gap: 2.5rem;
  padding-block: 3.5rem 4rem;
}
.hero h1 {
  font-size: clamp(2.5rem, 1.6rem + 4.6vw, 4.5rem);
  font-weight: 820;
  line-height: 1.08;
  letter-spacing: -0.04em;
}
.hero h1 .soft { color: var(--muted-foreground); }
.lede {
  max-width: 36rem;
  margin-top: 1.25rem;
  color: var(--muted-foreground);
  font-size: 1.125rem;
  line-height: 1.7;
}
.hero .actions { margin-top: 2rem; }
.fine {
  margin-top: 1rem;
  color: var(--muted-foreground);
  font-size: 0.875rem;
}
.pill {
  display: inline-flex;
  align-items: center;
  height: 1.5rem;
  padding: 0 0.625rem;
  border-radius: 9999px;
  background: var(--muted);
  color: var(--foreground);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

/* 질문 목차 */
.asks {
  align-self: end;
  list-style: none;
  border-radius: 1.8rem;
  background: var(--card);
  box-shadow: var(--shadow-card), 0 0 0 1px var(--border);
  padding: 0.5rem;
}
.asks a {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 1rem;
  border-radius: 1.3rem;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color var(--dur-fast) var(--ease-out);
}
.asks a:hover { background: var(--muted); }
.asks a span { flex: 1; }
.asks svg { width: 1.125rem; height: 1.125rem; color: var(--muted-foreground); flex: none; transition: transform var(--dur-base) var(--ease-out); }
.asks a:hover svg { transform: translateY(2px); color: var(--primary); }
.asks li + li { border-top: 1px solid var(--border); }

@media (min-width: 64rem) {
  .hero {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    align-items: end;
    gap: 4rem;
    padding-block: 5.5rem 6rem;
  }
}

/* 질문 절 */
.ask {
  padding-block: 4.5rem;
  border-top: 1px solid var(--border);
}
.ask > header { max-width: var(--read-max); margin-bottom: 2.5rem; }
.ask h2 {
  font-size: clamp(1.75rem, 1.3rem + 2vw, 2.5rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.035em;
}
.ask h2 + p { margin-top: 1rem; color: var(--muted-foreground); font-size: 1rem; }
@media (min-width: 64rem) {
  .ask { padding-block: 6rem; }
}

/* 무엇을 해 줘요 — 정의 목록 줄 */
.does { display: grid; }
.does > div {
  display: grid;
  gap: 0.75rem;
  padding-block: 1.75rem;
  border-top: 1px solid var(--border);
}
.does > div:last-child { border-bottom: 1px solid var(--border); }
.does dt { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.does dt strong {
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
  font-weight: 820;
  letter-spacing: -0.035em;
  line-height: 1.2;
}
.does dd { margin: 0; display: grid; gap: 0.625rem; color: var(--muted-foreground); max-width: 38rem; }
.does dd p:first-child { color: var(--foreground); }
@media (min-width: 48rem) {
  .does > div { grid-template-columns: 16rem minmax(0, 1fr); gap: 2rem; padding-block: 2.25rem; }
  .does dt { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
}

/* 요청 흐름 그림 */
.flow {
  display: grid;
  gap: 0;
  margin: 0;
}
.node {
  display: grid;
  gap: 0.125rem;
  padding: 1rem 1.125rem;
  border-radius: 1.4rem;
  background: var(--card);
  box-shadow: var(--shadow-card), 0 0 0 1px var(--border);
}
.node b { font-size: 1rem; font-weight: 700; letter-spacing: -0.02em; }
.node small { color: var(--muted-foreground); font-size: 0.875rem; }
.node.is-pc { box-shadow: var(--shadow-card), 0 0 0 2px var(--foreground); }
.node.is-out { background: transparent; box-shadow: 0 0 0 1px var(--border); }
.link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 3.25rem;
  padding: 0.5rem 0 0.5rem 1.6rem;
  color: var(--muted-foreground);
  font-size: 0.875rem;
  line-height: 1.45;
}
.link::before {
  content: "";
  position: absolute;
  left: 1.1rem;
  top: 0;
  bottom: 0;
  width: 2px;
  border-radius: 2px;
  background: color-mix(in oklch, var(--muted-foreground) 35%, transparent);
}
.link.is-pc::before { background: var(--foreground); }
.link svg { width: 1rem; height: 1rem; flex: none; margin-left: 0.6rem; }
.link.is-pc { color: var(--foreground); }
.lane { display: grid; align-content: start; }
.lane-label {
  margin: 0.25rem 0 0.75rem;
  color: var(--muted-foreground);
  font-size: 0.75rem;
  font-weight: 600;
}
.lanes { display: grid; gap: 1.5rem; }
.fork { display: grid; gap: 0.75rem; }
@media (min-width: 48rem) {
  .lanes { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 2rem; }
  .fork { grid-template-columns: 1fr 1fr; }
}
.flow-notes {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
  list-style: none;
  max-width: 52rem;
}
.flow-notes li { display: grid; grid-template-columns: 1.25rem minmax(0, 1fr); gap: 0.75rem; color: var(--muted-foreground); }
.flow-notes svg { width: 1.25rem; height: 1.25rem; margin-top: 0.2rem; color: var(--foreground); }
@media (min-width: 64rem) {
  .flow-notes { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: none; gap: 2rem; }
}

/* 원칙 */
.vows { list-style: none; display: grid; }
.vows li {
  display: grid;
  gap: 0.375rem;
  padding-block: 1.5rem;
  border-top: 1px solid var(--border);
}
.vows strong { font-size: 1.25rem; font-weight: 750; letter-spacing: -0.025em; line-height: 1.35; }
.vows p { color: var(--muted-foreground); max-width: 40rem; }
@media (min-width: 64rem) {
  .vows li { grid-template-columns: minmax(0, 26rem) minmax(0, 1fr); gap: 2rem; align-items: baseline; }
}

/* 어떻게 시작해요 — 두 갈래 */
.paths { display: grid; gap: 1rem; }
.path {
  display: grid;
  align-content: start;
  gap: 0.75rem;
  padding: 1.5rem;
  border-radius: 1.8rem;
  background: var(--card);
  box-shadow: var(--shadow-card), 0 0 0 1px var(--border);
}
.path h3 { font-size: 1.5rem; font-weight: 750; letter-spacing: -0.025em; }
.path p { color: var(--muted-foreground); }
.path .actions { margin-top: 0.75rem; }
@media (min-width: 48rem) {
  .paths { grid-template-columns: 1fr 1fr; }
  .path { padding: 2rem; }
}
.note {
  display: grid;
  gap: 0.5rem;
  max-width: var(--read-max);
  margin-top: 2.5rem;
  color: var(--muted-foreground);
}
.note strong { color: var(--foreground); }

/* 푸터 */
.foot {
  padding-block: 3rem 4rem;
  border-top: 1px solid var(--border);
  color: var(--muted-foreground);
  font-size: 0.875rem;
}
.foot .wrap { display: grid; gap: 0.5rem; }
.foot p:first-child { color: var(--foreground); max-width: 40rem; }
.foot nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; margin-top: 0.75rem; }

/* 설치 페이지 */
.doc-head { padding-block: 3rem 2.5rem; max-width: var(--read-max); }
.doc-head h1 {
  font-size: clamp(2.25rem, 1.6rem + 3vw, 3.5rem);
  font-weight: 820;
  line-height: 1.1;
  letter-spacing: -0.04em;
}
.doc-head .meta { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.doc-head .lede { margin-top: 1rem; }

.doc { display: grid; gap: 2.5rem; padding-bottom: 5rem; }
.doc > *, .step, .cmd-stack, .cmd { min-width: 0; }
.toc { font-size: 0.875rem; }
.toc ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.toc a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 2.25rem;
  padding: 0 0.875rem 0 0.375rem;
  border-radius: 9999px;
  background: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--dur-fast) var(--ease-out);
}
.toc a:hover { background: color-mix(in oklch, var(--muted) 80%, var(--foreground)); }
.toc .n {
  display: grid;
  place-items: center;
  min-width: 1.5rem;
  height: 1.5rem;
  border-radius: 9999px;
  background: var(--background);
  color: var(--muted-foreground);
  font-size: 0.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
@media (min-width: 64rem) {
  .doc { grid-template-columns: 14rem minmax(0, 46rem); gap: 4rem; }
  .toc { position: sticky; top: 5rem; align-self: start; }
  .toc ol { flex-direction: column; gap: 0.125rem; }
  .toc a { background: transparent; width: 100%; color: var(--muted-foreground); }
  .toc a:hover { background: var(--muted); color: var(--foreground); }
}

.step { display: grid; gap: 1rem; padding-block: 2.5rem; border-top: 1px solid var(--border); }
.step:first-child { border-top: 0; padding-top: 0; }
.step > h2 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem);
  font-weight: 780;
  letter-spacing: -0.03em;
  line-height: 1.25;
}
.step > h2 .n {
  display: grid;
  place-items: center;
  flex: none;
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  background: var(--foreground);
  color: var(--background);
  font-size: 0.875rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.step > h2 .opt { color: var(--muted-foreground); font-size: 0.875rem; font-weight: 500; letter-spacing: 0; }
.step p, .step li { color: var(--muted-foreground); }
.step strong { color: var(--foreground); font-weight: 650; }
.step ol, .step ul { display: grid; gap: 0.5rem; padding-left: 1.25rem; }
.step ol > li::marker { color: var(--foreground); font-weight: 700; }
.step ul > li::marker { color: var(--muted-foreground); }
.small { font-size: 0.875rem; }

.callout {
  display: grid;
  grid-template-columns: 1.25rem minmax(0, 1fr);
  gap: 0.75rem;
  padding: 1rem 1.125rem;
  border-radius: 1.4rem;
  background: var(--caution-soft);
}
.callout svg { width: 1.25rem; height: 1.25rem; margin-top: 0.2rem; color: var(--caution); }
.callout p { color: var(--foreground); }

/* 명령 블록 */
.cmd {
  position: relative;
  border-radius: 1.4rem;
  background: var(--sidebar);
  box-shadow: 0 0 0 1px var(--border);
}
.cmd pre {
  margin: 0;
  padding: 1rem 1.125rem;
  overflow-x: auto;
  line-height: 1.7;
  font-size: 0.875rem;
  tab-size: 2;
}
.cmd-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.5rem 0 1.125rem;
  min-height: 2.75rem;
  color: var(--muted-foreground);
  font-size: 0.75rem;
}
.cmd-head .label { margin-right: auto; font-weight: 600; }
.copy {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  height: 2rem;
  padding: 0 0.75rem;
  border: 0;
  border-radius: 9999px;
  background: var(--muted);
  color: var(--foreground);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out);
}
.copy:hover { background: color-mix(in oklch, var(--muted) 80%, var(--foreground)); }
.copy svg { width: 0.875rem; height: 0.875rem; }
.copy[hidden] { display: none; }
.copy[data-done] { background: var(--accent); color: var(--accent-foreground); }

/* 탭(Apple Silicon / Intel) — 스크립트가 없으면 두 블록이 다 보인다 */
.tabs { display: none; gap: 0.25rem; padding: 0.25rem; width: fit-content; border-radius: 9999px; background: var(--muted); }
.js .tabs { display: inline-flex; }
.tabs button {
  height: 2rem;
  padding: 0 0.875rem;
  border: 0;
  border-radius: 9999px;
  background: transparent;
  color: var(--muted-foreground);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.tabs button[aria-selected="true"] { background: var(--foreground); color: var(--background); }
.js [data-arch-panel][hidden] { display: none; }
.cmd-stack { display: grid; gap: 0.75rem; }

/* 다운로드 안내 */
.solo { min-height: calc(100svh - 3.5rem - 12rem); display: grid; align-content: center; padding-block: 4rem; }
.solo h1 {
  max-width: 22ch;
  font-size: clamp(2.25rem, 1.6rem + 3vw, 3.5rem);
  font-weight: 820;
  line-height: 1.12;
  letter-spacing: -0.04em;
}
.solo .actions { margin-top: 2rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0ms !important; }
}

.cmd pre { scrollbar-width: thin; scrollbar-color: var(--muted-foreground) transparent; }
.cmd pre[data-overflow] { mask-image: linear-gradient(to right, #000 calc(100% - 2.5rem), transparent); }
.cmd pre[data-overflow][data-end] { mask-image: none; }

/* 목록 위험 신호 칩 — 앱의 chip-signal-risk와 같은 모양 */
.chip-risk {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  background: var(--risk-soft);
  color: var(--risk);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}
.chip-risk svg { width: 0.875rem; height: 0.875rem; }
.step > h2 .n svg { width: 1rem; height: 1rem; }
.toc .n svg { width: 0.875rem; height: 0.875rem; }

.cmd .c { font-family: var(--font-sans); color: var(--muted-foreground); }

/* 좁은 폭: 두 갈래가 위아래로 쌓이므로 머리글과 구분선으로 나눈다(서버가 PC로 넘겨주는 것처럼 읽히지 않게) */
.lane-label { display: none; }
@media (max-width: 47.99rem) {
  .lanes > .lane > .lane-label { display: block; margin: 1rem 0 0; }
  .lanes > .is-pc-lane { padding-top: 0.5rem; border-top: 1px dashed color-mix(in oklch, var(--muted-foreground) 35%, transparent); }
}
