/* aisync.creco.dev
   Color: sage-tinted paper, ink, cobalt for links and actions; moss means "kept safe", amber means "plain text".
   Type: IBM Plex Sans KR for everything readable, IBM Plex Mono for config and commands.
   Layout: docs = sidebar | text (max 70ch) | on-this-page; home = one column of sections around the config demo. */
:root {
  --bg: #f3f5f1;
  --surface: #ffffff;
  --ink: #1c2320;
  --muted: #5d6862;
  --line: #d9dfd9;
  --accent: #2443c9;
  --accent-soft: #e3e8fb;
  --safe: #2f7a52;
  --safe-soft: #ddf0e4;
  --plain: #a8561a;
  --plain-soft: #fbebdb;
  --code-bg: #eaeee8;
  --sans: "IBM Plex Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121614; --surface: #181d1a; --ink: #e3e8e4; --muted: #96a39b; --line: #2a322d;
    --accent: #8ea6ff; --accent-soft: #1e2747; --safe: #7ccb9d; --safe-soft: #15281d;
    --plain: #f0a866; --plain-soft: #33230f; --code-bg: #0d110f;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.75 var(--sans); word-break: keep-all; overflow-wrap: anywhere; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
code, pre, kbd { font-family: var(--mono); }
img { max-width: 100%; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 6px 10px; z-index: 10; }
.beta { background: var(--plain-soft); color: var(--ink); font-size: 14px; padding: 8px 16px; text-align: center; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px clamp(16px, 4vw, 40px); border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 5; }
.brand { display: inline-flex; align-items: center; gap: 9px; font: 600 18px/1 var(--mono); color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.topnav { display: flex; gap: clamp(12px, 3vw, 28px); align-items: center; font-size: 15px; }
.topnav a { color: var(--muted); text-decoration: none; }
.topnav a:hover, .topnav a[aria-current="page"] { color: var(--ink); }
.topnav .lang { border: 1px solid var(--line); border-radius: 6px; padding: 3px 10px; color: var(--ink); }

/* ---------- docs ---------- */
.docs { display: grid; grid-template-columns: 220px minmax(0, 1fr) 200px; gap: 40px; max-width: 1240px; margin: 0 auto; padding: 32px clamp(16px, 4vw, 40px) 80px; }
.navtoggle { display: none; }
.sidenav ul, .toc ul { list-style: none; margin: 0; padding: 0; }
.sidenav { position: sticky; top: 84px; align-self: start; }
.sidenav a { display: block; padding: 6px 10px; border-radius: 6px; color: var(--muted); text-decoration: none; font-size: 15px; line-height: 1.5; }
.sidenav a:hover { color: var(--ink); }
.sidenav a[aria-current="page"] { color: var(--ink); background: var(--surface); font-weight: 600; box-shadow: inset 2px 0 0 var(--accent); }
.toc { position: sticky; top: 84px; align-self: start; font-size: 14px; }
.toc p { margin: 0 0 8px; color: var(--muted); font-weight: 600; }
.toc a { display: block; padding: 3px 0; color: var(--muted); text-decoration: none; line-height: 1.45; }
.toc a:hover { color: var(--ink); }

.doc { max-width: 70ch; min-width: 0; }
.doc h1 { font-size: clamp(28px, 4vw, 36px); line-height: 1.25; letter-spacing: -0.02em; margin: 0 0 12px; text-wrap: balance; }
.doc .lede { font-size: 18px; color: var(--muted); margin: 0 0 32px; }
.doc h2 { font-size: 23px; line-height: 1.35; letter-spacing: -0.01em; margin: 48px 0 12px; padding-top: 8px; text-wrap: balance; scroll-margin-top: 84px; }
.doc h3 { font-size: 18px; margin: 32px 0 8px; scroll-margin-top: 84px; }
.doc p, .doc ul, .doc ol { margin: 0 0 16px; }
.doc li { margin: 4px 0; }
.doc li > p { margin: 0; }
.doc :not(pre) > code { font-size: 0.88em; background: var(--code-bg); padding: 1px 5px; border-radius: 4px; }
.doc pre { position: relative; background: var(--code-bg); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; overflow-x: auto; font-size: 13.5px; line-height: 1.6; margin: 0 0 20px; }
.doc pre code { white-space: pre; }
.doc table { width: 100%; border-collapse: collapse; margin: 0 0 20px; font-size: 15px; display: block; overflow-x: auto; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.doc th { font-weight: 600; color: var(--muted); font-size: 14px; }
.doc blockquote { margin: 0 0 20px; padding: 12px 16px; background: var(--surface); border-left: 3px solid var(--accent); border-radius: 0 6px 6px 0; }
.doc blockquote p:last-child { margin: 0; }
.copy { position: absolute; top: 8px; right: 8px; font: 12px var(--sans); color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 5px; padding: 2px 8px; cursor: pointer; }
.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 56px; padding-top: 20px; border-top: 1px solid var(--line); }
.pager a { display: grid; text-decoration: none; color: var(--ink); font-weight: 600; max-width: 48%; }
.pager a span { font-weight: 400; font-size: 13px; color: var(--muted); }
.pager .next { text-align: right; margin-left: auto; }
.version { margin-top: 28px; font-size: 13px; color: var(--muted); }

/* ---------- home ---------- */
.home { max-width: 1120px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px) 80px; }
.hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: center; padding: clamp(40px, 8vw, 96px) 0 clamp(40px, 6vw, 72px); }
.hero h1 span { display: block; }
.hero h1 { font-size: clamp(32px, 4.3vw, 46px); line-height: 1.12; letter-spacing: -0.035em; margin: 0 0 20px; text-wrap: balance; font-weight: 700; }
.hero p { font-size: 18px; color: var(--muted); margin: 0 0 28px; max-width: 34em; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-block; padding: 11px 20px; border-radius: 8px; text-decoration: none; font-weight: 600; font-size: 16px; border: 1px solid var(--line); color: var(--ink); background: var(--surface); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) { .btn.primary { color: #0f1424; } }

/* the config demo: the one thing worth remembering */
.demo { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.demo-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); font: 13px var(--mono); color: var(--muted); }
.switch { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; font: 13px var(--sans); }
.switch button { border: 0; background: none; color: var(--muted); padding: 4px 12px; cursor: pointer; font: inherit; }
.switch button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.demo pre { margin: 0; padding: 18px 18px 20px; font: 13.5px/1.75 var(--mono); overflow-x: auto; }
.demo .k { color: var(--muted); }
.demo .tok { border-radius: 4px; padding: 1px 3px; transition: background-color .25s, color .25s; }
.demo[data-state="before"] .tok { background: var(--plain-soft); color: var(--plain); }
.demo[data-state="after"] .tok { background: var(--accent-soft); color: var(--accent); }
.demo [data-show] { display: none; }
.demo[data-state="before"] [data-show="before"], .demo[data-state="after"] [data-show="after"] { display: inline; }
.demo-note { padding: 12px 18px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); min-height: 3.6em; }
.demo-note strong { color: var(--ink); font-weight: 600; }
.demo[data-state="after"] .demo-note strong { color: var(--safe); }
.demo[data-state="before"] .demo-note strong { color: var(--plain); }
@media (prefers-reduced-motion: reduce) { .demo .tok { transition: none; } }

.band { padding: clamp(40px, 6vw, 72px) 0; border-top: 1px solid var(--line); }
.band h2 { font-size: clamp(24px, 3.2vw, 34px); line-height: 1.25; letter-spacing: -0.025em; margin: 0 0 12px; max-width: 26em; text-wrap: balance; }
.band > p { color: var(--muted); max-width: 40em; margin: 0 0 28px; font-size: 17px; }
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.cols h3 { font-size: 16px; margin: 0 0 10px; }
.cols ul { margin: 0; padding-left: 20px; }
.cols li { margin: 4px 0; }
.moves h3 { color: var(--safe); }
.stays h3 { color: var(--muted); }

.path { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.path > div { padding: 20px; }
.path > div + div { border-left: 1px solid var(--line); }
.path h3 { margin: 0 0 4px; font-size: 16px; }
.path .where { font: 13px var(--mono); color: var(--muted); margin: 0 0 12px; }
.path code { display: block; font-size: 13px; background: var(--code-bg); padding: 8px 10px; border-radius: 6px; margin: 0 0 10px; overflow-x: auto; white-space: nowrap; }
.path p { margin: 0; font-size: 15px; color: var(--muted); }
.path .live code { background: var(--safe-soft); color: var(--safe); }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; counter-reset: s; max-width: 760px; }
.steps li { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 14px; align-items: start; counter-increment: s; }
.steps li::before { content: counter(s); font: 600 14px/30px var(--mono); text-align: center; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); color: var(--muted); }
.steps code { display: block; font-size: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; margin: 0 0 4px; overflow-x: auto; white-space: nowrap; }
.steps span { color: var(--muted); font-size: 15px; }

.missing { max-width: 640px; margin: 0 auto; padding: 96px 16px; }
.foot { border-top: 1px solid var(--line); padding: 24px clamp(16px, 4vw, 40px) 40px; color: var(--muted); font-size: 14px; }
.foot p { max-width: 1160px; margin: 0 auto; }

@media (max-width: 1080px) {
  .docs { grid-template-columns: 200px minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 760px) {
  .docs { grid-template-columns: minmax(0, 1fr); gap: 16px; padding-top: 16px; }
  .navtoggle { display: inline-block; justify-self: start; font: 600 14px var(--sans); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 6px 12px; }
  .sidenav { position: static; display: none; }
  .sidenav.open { display: block; }
  .hero { grid-template-columns: minmax(0, 1fr); }
  .cols, .path { grid-template-columns: minmax(0, 1fr); }
  .path > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .topnav { gap: 12px; font-size: 14px; }
}
