/* agent-kakao homepage. Plain CSS, no build step. */

:root {
  --bg: #f5f6f3;
  --bg-deep: #eceee8;
  --surface: #ffffff;
  --line: #d9ddd4;
  --line-strong: #b9bfb3;
  --text: #13161a;
  --muted: #5a626b;
  --accent: #ffd43b;
  --accent-ink: #6b5200;
  --ok: #0c7c55;
  --deny: #c2352a;
  --info: #2557a7;
  --term-bg: #0f1215;
  --term-line: #262b31;
  --term-text: #dfe4e8;
  --term-muted: #8d98a3;
  --term-ok: #5fd3a1;
  --term-deny: #ff7a6b;
  --term-key: #8fc1ff;
  --term-str: #ffe08a;
  --radius: 14px;
  --shadow: 0 1px 0 rgba(19, 22, 26, .04), 0 12px 32px -18px rgba(19, 22, 26, .25);
  --font-sans: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "SFMono-Regular", "Cascadia Mono", Consolas, "D2Coding", Menlo, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0e10;
    --bg-deep: #111417;
    --surface: #15191c;
    --line: #252a2f;
    --line-strong: #3a4148;
    --text: #e9ecee;
    --muted: #98a2ab;
    --accent: #ffd43b;
    --accent-ink: #ffd43b;
    --ok: #5fd3a1;
    --deny: #ff7a6b;
    --info: #8fc1ff;
    --term-bg: #080a0b;
    --term-line: #20252a;
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 18px 40px -20px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0c0e10;
  --bg-deep: #111417;
  --surface: #15191c;
  --line: #252a2f;
  --line-strong: #3a4148;
  --text: #e9ecee;
  --muted: #98a2ab;
  --accent: #ffd43b;
  --accent-ink: #ffd43b;
  --ok: #5fd3a1;
  --deny: #ff7a6b;
  --info: #8fc1ff;
  --term-bg: #080a0b;
  --term-line: #20252a;
  --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 18px 40px -20px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

a { color: inherit; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--info); outline-offset: 3px; border-radius: 4px; }

code, pre, kbd { font-family: var(--font-mono); font-size: .92em; }
:not(pre) > code {
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: .12em .45em;
}

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 10; background: var(--surface); padding: 12px 16px; }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }

/* Header */
.top {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; gap: 20px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-weight: 500; text-decoration: none; }
.brand svg { width: 26px; height: 26px; }
.nav { display: flex; gap: 18px; margin-left: auto; font-size: 14px; color: var(--muted); }
.nav a { text-decoration: none; }
.nav a:hover { color: var(--text); }
.lang { font-family: var(--font-mono); font-size: 13px; border: 1px solid var(--line); border-radius: 999px; padding: 5px 14px; text-decoration: none; }
@media (max-width: 760px) { .nav { display: none; } .lang { margin-left: auto; } }

/* Hero */
.hero { padding: 72px 0 40px; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: 48px; align-items: center; }
.hero .wrap > div { min-width: 0; }
@media (max-width: 960px) { .hero .wrap { grid-template-columns: minmax(0, 1fr); } .hero { padding-top: 44px; } }
.term-bar span, .replay { white-space: nowrap; }

.eyebrow {
  display: inline-flex; flex-wrap: wrap; gap: 6px; margin: 0 0 20px; padding: 0; list-style: none;
  font-family: var(--font-mono); font-size: 12.5px; color: var(--muted);
}
.eyebrow li { border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; background: var(--surface); }

h1 {
  font-size: clamp(40px, 5.6vw, 62px);
  line-height: 1.16;
  letter-spacing: -0.025em;
  font-weight: 700;
  margin: 0 0 20px;
}
h1 mark {
  background: linear-gradient(transparent 58%, var(--accent) 58%, var(--accent) 92%, transparent 92%);
  color: inherit;
  padding: 0 .06em;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) h1 mark { background: linear-gradient(transparent 88%, var(--accent) 88%, var(--accent) 96%, transparent 96%); color: var(--accent); }
}
:root[data-theme="dark"] h1 mark { background: linear-gradient(transparent 88%, var(--accent) 88%, var(--accent) 96%, transparent 96%); color: var(--accent); }
.lede { font-size: 18px; color: var(--muted); max-width: 34em; margin: 0 0 28px; }

.cta { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 500; font-size: 15px; text-decoration: none;
  padding: 10px 18px; border-radius: 10px; border: 1px solid var(--line-strong);
  background: var(--surface); transition: transform .15s ease, border-color .15s ease;
}
.btn:hover { transform: translateY(-1px); border-color: var(--text); }
.btn.primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn svg { width: 16px; height: 16px; }

.oneliner {
  display: flex; align-items: center; gap: 10px; max-width: 100%;
  font-family: var(--font-mono); font-size: 14px;
  border: 1px dashed var(--line-strong); border-radius: 12px; padding: 12px 12px 12px 16px; background: var(--bg-deep);
}
.oneliner code { background: none; border: 0; padding: 0; white-space: nowrap; overflow-x: auto; flex: 1; }
.oneliner .dollar { color: var(--muted); user-select: none; }

.copy {
  flex: none; font: inherit; font-size: 12px; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
  border-radius: 8px; padding: 5px 12px;
}
.copy[data-done] { border-color: var(--ok); color: var(--ok); }

/* Terminal */
.term {
  background: var(--term-bg);
  border: 1px solid var(--term-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--term-text);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.65;
  overflow: hidden;
  min-width: 0;
}
.term-bar { display: flex; align-items: center; gap: 7px; padding: 10px 14px; border-bottom: 1px solid var(--term-line); }
.term-bar i { width: 10px; height: 10px; border-radius: 50%; background: #2b3137; }
.term-bar span { margin-left: 8px; color: var(--term-muted); font-size: 12px; }
.term-bar .tag { margin-left: auto; font-size: 11px; color: var(--term-muted); border: 1px solid var(--term-line); border-radius: 999px; padding: 2px 10px; }
.term-body { padding: 18px 20px 22px; min-height: 418px; overflow-x: auto; }
.term-body p { margin: 0; white-space: pre; }
.term .ps { color: var(--term-muted); user-select: none; }
.term .cmd { color: #fff; }
.term .note { color: var(--term-muted); }
.term .k { color: var(--term-key); }
.term .s { color: var(--term-str); }
.term .ok { color: var(--term-ok); }
.term .no { color: var(--term-deny); }
.term .gap { height: .65em; }
.term .caret { display: inline-block; width: .55em; height: 1.05em; vertical-align: -2px; background: var(--term-text); animation: blink 1s steps(1) infinite; }

.term.play .ln { opacity: 0; transform: translateY(3px); animation: ln .28s ease-out forwards; animation-delay: calc(var(--i) * 0.42s + 0.3s); }
@keyframes ln { to { opacity: 1; transform: none; } }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .term.play .ln { opacity: 1; transform: none; animation: none; }
  .term .caret { animation: none; }
}
.replay { font: inherit; font-size: 11px; cursor: pointer; background: none; color: var(--term-muted); border: 1px solid var(--term-line); border-radius: 999px; padding: 2px 10px; margin-left: 6px; }
.replay:hover { color: var(--term-text); }
.term-foot { font-size: 12.5px; color: var(--muted); margin: 10px 2px 0; }

/* Sections */
section { padding: 72px 0; border-top: 1px solid var(--line); }
.kicker { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); letter-spacing: .04em; margin: 0 0 10px; text-transform: uppercase; }
h2 { font-size: clamp(28px, 3.8vw, 42px); line-height: 1.25; letter-spacing: -0.02em; margin: 0 0 14px; }
h3 { font-size: 20px; line-height: 1.4; margin: 0 0 6px; }
.intro { color: var(--muted); max-width: 44em; margin: 0 0 36px; font-size: 17px; }

/* What */
.does { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.does div { background: var(--surface); padding: 24px; }
.does h3 { font-size: 18px; margin-bottom: 10px; }
.does p { margin: 0; font-family: var(--font-mono); font-size: 13px; color: var(--muted); line-height: 1.8; }
@media (max-width: 900px) { .does { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .does { grid-template-columns: 1fr; } }

/* Safety gates */
.gates { list-style: none; margin: 0; padding: 0; counter-reset: gate; display: grid; gap: 0; position: relative; }
.gates::before { content: ""; position: absolute; left: 21px; top: 22px; bottom: 22px; width: 2px; background: repeating-linear-gradient(to bottom, var(--line-strong) 0 6px, transparent 6px 12px); }
.gate { counter-increment: gate; display: grid; grid-template-columns: 44px 1fr auto; gap: 18px; align-items: start; padding: 16px 0; position: relative; }
.gate::before {
  content: counter(gate, decimal-leading-zero);
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 13px; font-weight: 500;
  background: var(--surface); border: 1px solid var(--line-strong); position: relative; z-index: 1;
}
.gate p { margin: 0; color: var(--muted); }
.gate .code { font-family: var(--font-mono); font-size: 12px; color: var(--deny); border: 1px solid color-mix(in srgb, var(--deny) 40%, transparent); border-radius: 999px; padding: 4px 12px; white-space: nowrap; margin-top: 4px; }
.gate .code.on { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
@media (max-width: 640px) { .gate { grid-template-columns: 44px 1fr; } .gate .code { grid-column: 2; justify-self: start; } }

.callout { margin-top: 28px; padding: 20px 24px; border-radius: var(--radius); background: var(--bg-deep); border: 1px solid var(--line); }
.callout p { margin: 0; }

/* Install */
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 820px) { .grid2 { grid-template-columns: minmax(0, 1fr); } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; min-width: 0; }
.card > p { color: var(--muted); margin: 0 0 12px; font-size: 15px; }
.card .os { font-family: var(--font-mono); font-size: 12px; color: var(--muted); float: right; }

pre.code {
  position: relative; margin: 0; padding: 16px 18px; border-radius: 10px;
  background: var(--term-bg); color: var(--term-text); border: 1px solid var(--term-line);
  overflow-x: auto; font-size: 13px; line-height: 1.65;
}
pre.code + pre.code { margin-top: 10px; }
pre.code .c { color: var(--term-muted); }
.codehead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 14px 0 6px; font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); }
.codehead:first-of-type { margin-top: 0; }

/* Steps after install */
.after { margin-top: 18px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.after div { border-top: 2px solid var(--text); padding-top: 12px; }
.after p { margin: 0 0 8px; color: var(--muted); font-size: 15px; }
@media (max-width: 820px) { .after { grid-template-columns: 1fr; } }

/* Compare */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; min-width: 760px; font-size: 14.5px; }
th, td { text-align: left; vertical-align: top; padding: 14px 18px; border-bottom: 1px solid var(--line); }
tr:last-child th, tr:last-child td { border-bottom: 0; }
thead th { font-family: var(--font-mono); font-size: 13px; font-weight: 500; background: var(--bg-deep); position: sticky; top: 0; }
thead th a { text-decoration: none; }
tbody th { font-weight: 500; color: var(--muted); width: 15%; }
td.us { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.fine { font-size: 13.5px; color: var(--muted); margin-top: 14px; }

/* FAQ */
.faq { display: grid; gap: 10px; }
details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0 24px; }
summary { cursor: pointer; list-style: none; padding: 16px 0; font-weight: 500; display: flex; gap: 12px; align-items: baseline; }
summary::-webkit-details-marker { display: none; }
summary::before { content: "+"; font-family: var(--font-mono); color: var(--muted); width: 1ch; flex: none; }
details[open] summary::before { content: "\2212"; }
details > div { padding: 0 0 16px 24px; color: var(--muted); }
details > div p { margin: 0 0 10px; }
details > div p:last-child { margin: 0; }

/* Disclaimer + footer */
.disclaimer { border: 1px solid color-mix(in srgb, var(--deny) 35%, var(--line)); background: color-mix(in srgb, var(--deny) 5%, var(--surface)); border-radius: var(--radius); padding: 28px 32px; }
.disclaimer h2 { font-size: 22px; }
.disclaimer p { margin: 0 0 10px; color: var(--muted); }
.disclaimer p:last-child { margin: 0; }
footer { border-top: 1px solid var(--line); padding: 28px 0 44px; color: var(--muted); font-size: 14px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between; }
footer nav { display: flex; flex-wrap: wrap; gap: 16px; }

/* Small screens: placed last so it wins over the component rules above. */
@media (max-width: 520px) { .term { font-size: 12px; } .term-body { min-height: 0; } .term-bar .tag { display: none; } .term-body p { white-space: pre-wrap; } }
