/* pypackpack guide: shared thisisthepy family tokens (copied from toolchain's guide). */
:root {
  --bg: #fbfbfa; --fg: #16181d; --muted: #5b6270; --line: #e6e6e3; --code-bg: #f3f3f1;
  --radius: 10px; --maxw: 72rem;
  --font-sans: "Inter", "IBM Plex Sans KR", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --accent: #0f9d76;
  --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);
  --ok: #0f9d76; --part: #b7791f; --plan: #6b7280;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0f1115; --fg: #e8e9ec; --muted: #9aa1ad; --line: #252a33; --code-bg: #161a21;
  --accent: #2bc59a; --part: #e0a84a; --plan: #9aa1ad; color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #0f1115; --fg: #e8e9ec; --muted: #9aa1ad; --line: #252a33; --code-bg: #161a21;
  --accent: #2bc59a; --part: #e0a84a; --plan: #9aa1ad; color-scheme: dark; }

/* Language switching: only the active language is rendered. */
html[lang="ko"] [data-lang="en"], html:not([lang="ko"]) [data-lang="ko"] { display: none !important; }
html[lang="ko"] body { word-break: keep-all; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 400 16px/1.7 var(--font-sans); font-feature-settings: "ss01", "cv11";
  overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
code, pre, kbd { font-family: var(--font-mono); font-size: .88em; }
:not(pre) > code { background: var(--code-bg); border: 1px solid var(--line); border-radius: 6px; padding: .08em .38em; overflow-wrap: anywhere; }
pre {
  background: var(--code-bg); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem 1.15rem; overflow-x: auto; line-height: 1.6; margin: 1.25rem 0;
}
pre code { background: none; border: 0; padding: 0; font-size: .85rem; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 1rem; min-height: 3.75rem; }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 650; color: var(--fg); letter-spacing: -.01em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 1.35rem; height: 1.35rem; flex: none; }
.top-nav { display: flex; gap: .2rem; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.top-nav::-webkit-scrollbar { display: none; }
.top-nav a { color: var(--muted); padding: .35rem .6rem; border-radius: 8px; white-space: nowrap; font-size: .93rem; }
.top-nav a:hover { color: var(--fg); text-decoration: none; background: var(--code-bg); }
.top-nav a[aria-current="page"] { color: var(--fg); background: var(--accent-soft); }
.controls { display: flex; gap: .35rem; flex: none; }
.ctl { font: inherit; font-size: .85rem; color: var(--fg); background: transparent; border: 1px solid var(--line); border-radius: 8px; padding: .3rem .6rem; cursor: pointer; line-height: 1.4; }
.ctl:hover { border-color: var(--muted); }
.ctl svg { width: 1rem; height: 1rem; display: block; }
.icon-sun { display: none; }
:root[data-theme="dark"] .icon-sun { display: block; } :root[data-theme="dark"] .icon-moon { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .icon-sun { display: block; } :root:not([data-theme="light"]) .icon-moon { display: none; } }

/* Hero */
.hero { padding: 5.5rem 0 3rem; }
.eyebrow { font-family: var(--font-mono); font-size: .8rem; letter-spacing: .04em; color: var(--accent); text-transform: uppercase; margin: 0 0 1.25rem; }
.hero h1 { font-size: clamp(2.1rem, 5.4vw, 3.6rem); line-height: 1.08; letter-spacing: -.035em; font-weight: 700; margin: 0 0 1.25rem; max-width: 18ch; }
html[lang="ko"] .hero h1 { letter-spacing: -.02em; line-height: 1.2; max-width: 20ch; }
.lede { font-size: clamp(1.05rem, 2vw, 1.25rem); color: var(--muted); max-width: 46rem; margin: 0 0 2rem; }
.cta { display: flex; flex-wrap: wrap; gap: .75rem; }
.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .7rem 1.1rem; border-radius: var(--radius); border: 1px solid var(--line); color: var(--fg); font-weight: 550; }
.btn:hover { text-decoration: none; border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.06); }
:root[data-theme="dark"] .btn.primary { color: #06261d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primary { color: #06261d; } }

/* Sections */
section { padding: 2.75rem 0; }
section + section { border-top: 1px solid var(--line); }
h2 { font-size: clamp(1.45rem, 2.6vw, 1.9rem); letter-spacing: -.02em; line-height: 1.25; margin: 0 0 1rem; }
h3 { font-size: 1.12rem; letter-spacing: -.01em; margin: 2rem 0 .5rem; }
p { margin: 0 0 1rem; }
.muted { color: var(--muted); }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem 1.35rem; background: var(--bg); }
.card h3 { margin-top: 0; }
.card .num { font-family: var(--font-mono); color: var(--accent); font-size: .8rem; }
a.card { color: var(--fg); display: block; }
a.card:hover { text-decoration: none; border-color: var(--accent); }

/* Doc pages */
.doc { display: grid; grid-template-columns: 13rem minmax(0, 1fr); gap: 3rem; padding: 3rem 0 4rem; }
.doc-side { position: sticky; top: 5rem; align-self: start; font-size: .92rem; }
.doc-side p { font-family: var(--font-mono); font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 .5rem; }
.doc-side a { display: block; color: var(--muted); padding: .25rem 0 .25rem .75rem; border-left: 2px solid var(--line); }
.doc-side a:hover { color: var(--fg); text-decoration: none; }
.doc-side a[aria-current="page"] { color: var(--fg); border-left-color: var(--accent); }
.doc-body { min-width: 0; max-width: 48rem; }
.doc-body h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); letter-spacing: -.03em; line-height: 1.15; margin: 0 0 1rem; }
.doc-body section { padding: 1.75rem 0; }
@media (max-width: 52rem) { .doc { grid-template-columns: 1fr; gap: 1.5rem; padding-top: 2rem; } .doc-side { position: static; display: flex; flex-wrap: wrap; gap: .25rem .75rem; } .doc-side p { width: 100%; } .doc-side a { border-left: 0; padding: .15rem 0; } .doc-side a[aria-current="page"] { color: var(--accent); } }

/* Tables */
.table-wrap { overflow-x: auto; margin: 1.25rem 0; border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: .93rem; }
th, td { text-align: left; padding: .6rem .85rem; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th { font-weight: 600; color: var(--muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; background: var(--code-bg); }

.pill { display: inline-block; font-family: var(--font-mono); font-size: .74rem; padding: .1rem .5rem; border-radius: 999px; border: 1px solid currentColor; white-space: nowrap; }
.pill.ok { color: var(--ok); } .pill.part { color: var(--part); } .pill.plan { color: var(--plan); }

.note { border-left: 3px solid var(--accent); background: var(--accent-soft); padding: .85rem 1.1rem; border-radius: 0 var(--radius) var(--radius) 0; margin: 1.25rem 0; }
.note p:last-child { margin-bottom: 0; }

/* Diagram */
.diagram { margin: 2.5rem 0 0; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; background: var(--bg); overflow-x: auto; }
.diagram svg { display: block; width: 100%; min-width: 34rem; height: auto; }
.diagram .box { fill: var(--bg); stroke: var(--line); stroke-width: 1.5; }
.diagram .box.key { stroke: var(--accent); stroke-width: 2; fill: var(--accent-soft); }
.diagram .t { fill: var(--fg); font: 600 14px var(--font-sans); }
.diagram .s { fill: var(--muted); font: 400 10.5px var(--font-mono); }
.diagram .edge { stroke: var(--muted); stroke-width: 1.5; fill: none; }
.diagram .edge.dash { stroke-dasharray: 4 4; }
.diagram .ah { fill: var(--muted); }
.diagram figcaption { color: var(--muted); font-size: .88rem; margin-top: 1rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 2.5rem 0 3rem; color: var(--muted); font-size: .9rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; margin-bottom: 1rem; }
.site-footer nav a { color: var(--muted); }
.site-footer nav a:hover { color: var(--fg); }

@media (max-width: 40rem) {
  .hero { padding: 3.5rem 0 2rem; }
  .site-header .wrap { flex-wrap: wrap; gap: .25rem .75rem; padding-top: .5rem; padding-bottom: .5rem; }
  .top-nav { order: 3; width: 100%; margin-left: -.6rem; }
  .controls { margin-left: auto; }
  .wrap { padding: 0 1rem; }
}
