:root {
  color-scheme: light;
  --canvas: #f7f4ec;
  --surface: #fcfaf5;
  --muted: #eee9de;
  --ink: #24211d;
  --soft: #625d55;
  --faint: #8b847a;
  --line: #d8d1c5;
  --line-strong: #b8b0a3;
  --accent: #d97757;
  --accent-dark: #c86648;
  --accent-soft: #f1d8cb;
  --green: #557a63;
  --green-soft: #dce7dc;
  --dark: #282621;
  --dark-soft: #34312b;
  --display: "Noto Serif SC", "Source Han Serif SC", "Songti SC", Georgia, serif;
  --body: Inter, "SF Pro Text", "Noto Sans SC", "PingFang SC", system-ui, sans-serif;
  --mono: "SFMono-Regular", "JetBrains Mono", "IBM Plex Mono", monospace;
  --max: 1200px;
  --shadow-subtle: 0 1px 2px rgba(36, 33, 29, .05), 0 8px 24px rgba(36, 33, 29, .04);
  --shadow-floating: 0 16px 42px rgba(36, 33, 29, .12);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: var(--body); line-height: 1.65; -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: .22em; }
button { font: inherit; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 3px solid rgba(217, 119, 87, .45); outline-offset: 3px; }

.container { width: min(calc(100% - 3rem), var(--max)); margin-inline: auto; }
.narrow { width: min(calc(100% - 3rem), 780px); margin-inline: auto; }
.eyebrow { color: var(--accent-dark); font-size: .72rem; font-weight: 700; letter-spacing: .14em; line-height: 1.2; text-transform: uppercase; }

.nav { position: sticky; top: 0; z-index: 20; background: rgba(247, 244, 236, .95); border-bottom: 1px solid transparent; transition: border-color 180ms ease, box-shadow 180ms ease; }
.nav.scrolled { border-color: var(--line); box-shadow: 0 1px 10px rgba(36, 33, 29, .04); }
.nav-inner { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.brand { display: inline-flex; align-items: center; gap: .7rem; font-weight: 700; letter-spacing: -.02em; text-decoration: none; }
.brand-logo { width: 34px; height: 34px; object-fit: contain; border: 1px solid var(--line); border-radius: .4rem; background: var(--surface); }
.nav-links { display: flex; gap: 1.45rem; padding: 0; margin: 0; list-style: none; }
.nav-links a { color: var(--soft); font-size: .82rem; text-decoration: none; }
.nav-links a:hover, .nav-links a.active { color: var(--accent-dark); }
.nav-tools { display: flex; align-items: center; gap: .75rem; }
.language-switch { display: inline-flex; gap: .2rem; padding: .2rem; border: 1px solid var(--line); border-radius: .4rem; }
.language-switch button { min-width: 30px; min-height: 30px; padding: .2rem .35rem; color: var(--faint); background: transparent; border: 0; border-radius: .3rem; cursor: pointer; font-size: .72rem; font-weight: 700; }
.language-switch button.active { color: var(--ink); background: var(--surface); box-shadow: var(--shadow-subtle); }
.menu-toggle { display: none; min-width: 44px; min-height: 44px; padding: .5rem; color: var(--ink); background: transparent; border: 1px solid var(--line); border-radius: .4rem; cursor: pointer; white-space: nowrap; }

.hero { padding: clamp(5rem, 11vw, 9rem) 0 clamp(4.5rem, 8vw, 7rem); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(320px, .92fr); gap: clamp(3rem, 8vw, 8rem); align-items: center; }
.hero h1, .page-hero h1 { max-width: 11ch; margin: .9rem 0 1.5rem; font-family: var(--display); font-size: clamp(3.7rem, 8vw, 7rem); font-weight: 400; line-height: 1.02; letter-spacing: -.07em; white-space: pre-line; text-wrap: balance; }
.hero h1 em, .page-hero h1 em { color: var(--accent-dark); font-style: normal; }
.hero-sub { max-width: 34rem; margin: 0 0 1rem; font-family: var(--display); font-size: clamp(1.35rem, 2.4vw, 1.8rem); line-height: 1.35; }
.hero-detail, .section-desc, .page-hero p { max-width: 38rem; margin: 0; color: var(--soft); font-size: 1rem; line-height: 1.85; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }
.btn { display: inline-flex; min-height: 46px; align-items: center; justify-content: center; gap: .55rem; padding: .72rem 1.2rem; border: 1px solid var(--line-strong); border-radius: .55rem; font-size: .9rem; font-weight: 650; text-decoration: none; transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease; }
.btn:hover { transform: translateY(-1px); }
.btn.primary { color: #fffaf4; background: var(--accent); border-color: var(--accent); }
.btn.primary:hover { color: #fffaf4; background: var(--accent-dark); border-color: var(--accent-dark); }
.btn.ghost:hover { color: var(--accent-dark); border-color: var(--accent-dark); }
.btn.dark { color: #f5f0e7; background: var(--dark); border-color: var(--dark); }
.btn.dark:hover { background: var(--dark-soft); border-color: var(--dark-soft); }

.hero-art { position: relative; min-height: 410px; display: grid; place-items: center; overflow: hidden; }
.hero-art::before { content: ""; position: absolute; inset: 7% -5% 5% 4%; border: 1px solid var(--line-strong); border-radius: 50%; transform: rotate(-16deg); }
.hero-art::after { content: ""; position: absolute; inset: 18% 16% 14% 18%; border: 1px solid var(--line); border-radius: 50%; transform: rotate(42deg); }
.orbit-dot { position: absolute; z-index: 2; right: 8%; top: 8%; width: 52px; height: 52px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 14px var(--accent-soft); }
.desktop-window { position: relative; z-index: 1; width: min(100%, 540px); overflow: hidden; background: var(--surface); border: 1px solid var(--line-strong); border-radius: .75rem; box-shadow: var(--shadow-floating); transform: rotate(-2.5deg); }
.window-bar { display: flex; align-items: center; gap: .38rem; min-height: 34px; padding: .55rem .75rem; background: var(--muted); border-bottom: 1px solid var(--line); }
.window-bar i { width: 8px; height: 8px; display: block; border-radius: 50%; background: var(--line-strong); }
.window-bar span { margin-left: .45rem; color: var(--faint); font-family: var(--mono); font-size: .62rem; }
.window-body { display: grid; grid-template-columns: 116px 1fr; min-height: 300px; }
.window-sidebar { padding: 1rem .7rem; background: var(--dark); color: #e8e0d5; }
.window-brand { display: flex; align-items: center; gap: .45rem; margin-bottom: 1.4rem; font-family: var(--display); font-size: .88rem; }
.window-brand img { width: 24px; height: 24px; border-radius: 6px; }
.window-nav { display: grid; gap: .35rem; }
.window-nav span { padding: .38rem .45rem; color: #aaa297; font-family: var(--mono); font-size: .58rem; }
.window-nav span:first-child { color: #f2b26d; background: rgba(255, 255, 255, .08); }
.window-sidebar small { display: block; margin-top: 4rem; color: #aaa297; font-size: .57rem; }
.window-workspace { padding: 1rem; background: #faf8f2; }
.workspace-heading { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: .8rem; }
.workspace-heading strong { font-family: var(--display); font-size: 1.25rem; font-weight: 400; }
.workspace-heading span { color: var(--green); font-family: var(--mono); font-size: .6rem; }
.mini-stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .45rem; }
.mini-stat { padding: .6rem; background: var(--surface); border: 1px solid var(--line); }
.mini-stat b { display: block; color: var(--accent-dark); font-family: var(--display); font-size: 1.35rem; font-weight: 400; line-height: 1; }
.mini-stat span { display: block; margin-top: .25rem; color: var(--faint); font-size: .58rem; }
.window-section-label { display: block; margin: 1rem 0 .45rem; color: var(--faint); font-family: var(--mono); font-size: .6rem; letter-spacing: .08em; text-transform: uppercase; }
.window-task { display: grid; grid-template-columns: 9px 1fr auto; gap: .55rem; align-items: center; padding: .5rem .55rem; border-bottom: 1px solid var(--line); font-size: .66rem; }
.window-task i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.window-task span { color: var(--soft); }
.window-task em { color: var(--faint); font-family: var(--mono); font-size: .55rem; font-style: normal; }
.window-note { position: absolute; z-index: 3; right: -2%; bottom: 1%; max-width: 180px; padding: .85rem; color: #f5f0e7; background: var(--dark); box-shadow: var(--shadow-floating); font-family: var(--mono); font-size: .63rem; line-height: 1.65; }
.window-note strong { display: block; margin-bottom: .25rem; color: #f2b26d; font-weight: 500; }

.stats { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.stat { padding: 1.65rem 1rem; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat-value { color: var(--accent-dark); font-family: var(--display); font-size: 2.55rem; line-height: 1; }
.stat-label { margin-top: .5rem; color: var(--faint); font-size: .78rem; }

.section { padding: clamp(5rem, 10vw, 9rem) 0; }
.alt { background: var(--muted); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-heading { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, .7fr); gap: 3rem; align-items: end; margin-bottom: clamp(3.5rem, 7vw, 6rem); }
.section h2 { max-width: 14ch; margin: .8rem 0 0; font-family: var(--display); font-size: clamp(2.7rem, 5.5vw, 5rem); font-weight: 400; line-height: 1.08; letter-spacing: -.055em; white-space: pre-line; text-wrap: balance; }
.feature-grid, .architecture, .security-list, .endpoint-list { display: grid; gap: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.feature-grid { grid-template-columns: repeat(4, 1fr); }
.feature { min-height: 275px; padding: 2rem; background: var(--canvas); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.feature:hover { background: var(--surface); }
.feature .index { display: inline-flex; min-width: 34px; min-height: 34px; align-items: center; justify-content: center; margin-bottom: 1.5rem; color: var(--accent-dark); border-bottom: 2px solid var(--accent); font-family: var(--mono); font-size: .76rem; }
.feature h3, .panel h3 { margin: 0 0 .6rem; font-family: var(--display); font-size: 1.5rem; font-weight: 400; }
.feature p, .panel p { margin: 0; color: var(--soft); font-size: .9rem; line-height: 1.75; }
.feature ul { display: grid; gap: .45rem; padding: 0; margin: 1.25rem 0 0; list-style: none; }
.feature li { position: relative; padding-left: 1rem; color: var(--soft); font-size: .84rem; line-height: 1.55; }
.feature li::before { content: ""; position: absolute; left: 0; top: .65em; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }

.flow { display: grid; gap: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.flow-row { display: grid; grid-template-columns: 2.5rem minmax(145px, .35fr) 1fr; gap: 1rem; padding: 1.25rem 1.4rem; background: var(--canvas); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.flow-row b { color: var(--accent-dark); font-family: var(--mono); font-size: .78rem; font-weight: 500; }
.flow-row strong { font-family: var(--display); font-size: 1.15rem; font-weight: 400; }
.flow-row span { color: var(--soft); font-size: .88rem; }

.provider-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.provider-card { min-height: 220px; padding: 2rem; background: var(--canvas); }
.provider-card:first-child { background: var(--surface); }
.provider-card .provider-label { display: inline-flex; min-height: 26px; align-items: center; padding: .25rem .65rem; margin-bottom: 1.6rem; color: var(--soft); background: var(--muted); border: 1px solid var(--line); border-radius: 999px; font-family: var(--mono); font-size: .66rem; }
.provider-card h3 { margin: 0 0 .55rem; font-family: var(--display); font-size: 1.45rem; font-weight: 400; }
.provider-card p { max-width: 30rem; margin: 0; color: var(--soft); font-size: .9rem; line-height: 1.75; }

.workspace-showcase { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: clamp(2.5rem, 8vw, 8rem); align-items: start; }
.tree { padding: 1.5rem 1.7rem; overflow: auto; color: #e8e0d5; background: var(--dark); border-radius: .55rem; font-family: var(--mono); font-size: .78rem; line-height: 1.8; box-shadow: var(--shadow-subtle); }
.tree .folder { color: #f2b26d; }
.tree .comment { color: #aaa297; }
.boundary-list { display: grid; gap: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.boundary-row { display: grid; grid-template-columns: minmax(120px, .45fr) 1fr; gap: 1rem; padding: 1rem 1.15rem; background: var(--canvas); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.boundary-row strong { font-family: var(--display); font-size: 1.1rem; font-weight: 400; }
.boundary-row span { color: var(--soft); font-size: .86rem; line-height: 1.65; }

.architecture { grid-template-columns: repeat(5, 1fr); }
.arch-node { min-height: 220px; padding: 1.4rem; background: var(--canvas); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.arch-node:nth-child(3) { background: var(--surface); }
.arch-node .number { color: var(--accent-dark); font-family: var(--mono); font-size: .72rem; }
.arch-node h3 { margin: 1.8rem 0 .45rem; font-family: var(--display); font-size: 1.35rem; font-weight: 400; }
.arch-node p { margin: 0; color: var(--soft); font-size: .82rem; line-height: 1.65; }
.split { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(3rem, 8vw, 8rem); align-items: start; }
.code-panel { padding: 2rem; color: #f5f0e7; background: var(--dark); border-radius: .65rem; box-shadow: var(--shadow-subtle); }
.code-top { display: flex; justify-content: space-between; gap: 1rem; padding-bottom: 1rem; border-bottom: 1px solid rgba(245, 240, 231, .2); font-family: var(--mono); font-size: .72rem; }
.code-top span { color: #f2b26d; }
.code { padding-top: 1.5rem; white-space: pre-wrap; color: #d8d1c5; font-family: var(--mono); font-size: .78rem; line-height: 2; }
.code .key { color: #f2b26d; }
.code .comment { color: #9b9489; }
.stack { display: flex; flex-wrap: wrap; gap: .55rem; padding: 0; margin: 2rem 0 0; list-style: none; }
.stack li { padding: .3rem .7rem; color: var(--soft); border: 1px solid var(--line); border-radius: 999px; font-size: .78rem; }

.security-list { grid-template-columns: 1fr; list-style: none; }
.security-list li { display: grid; grid-template-columns: 2.5rem 1fr; gap: 1rem; padding: 1.2rem 1.3rem; background: var(--canvas); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.security-list li b { color: var(--accent-dark); font-family: var(--mono); font-size: .78rem; font-weight: 500; }
.security-list strong { display: block; margin-bottom: .3rem; font-family: var(--display); font-size: 1.25rem; font-weight: 400; }
.security-list span { color: var(--soft); font-size: .88rem; line-height: 1.7; }
.callout { padding: 1.5rem; margin-top: 2rem; color: var(--ink); background: var(--accent-soft); border-left: 3px solid var(--accent); line-height: 1.75; }
.callout strong { display: block; margin-bottom: .3rem; font-family: var(--display); font-size: 1.3rem; font-weight: 400; }
.warning-callout { background: #f0e3cd; border-left-color: #a86f32; }
.table-wrap { overflow-x: auto; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
table { width: 100%; min-width: 680px; border-collapse: collapse; background: var(--canvas); font-size: .86rem; }
th, td { padding: 1rem 1.1rem; text-align: left; vertical-align: top; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
th { color: var(--faint); background: var(--surface); font-size: .7rem; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
td { color: var(--soft); }
td code, code { color: var(--accent-dark); font-family: var(--mono); font-size: .82em; }

.step-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.step { min-height: 250px; padding: 2rem; background: var(--canvas); }
.step:nth-child(even) { background: var(--surface); }
.step-number { color: var(--accent-dark); font-family: var(--mono); font-size: .76rem; }
.step h3 { margin: 1.6rem 0 .6rem; font-family: var(--display); font-size: 1.4rem; font-weight: 400; }
.step p { margin: 0; color: var(--soft); font-size: .88rem; line-height: 1.75; }
.endpoint-list { grid-template-columns: repeat(2, 1fr); }
.endpoint { padding: 1.25rem; background: var(--canvas); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.endpoint code { display: block; margin-bottom: .45rem; }
.endpoint p { margin: 0; color: var(--soft); font-size: .86rem; }

.page-hero { padding: clamp(5rem, 10vw, 8rem) 0 4rem; }
.page-hero h1 { max-width: 12ch; margin: .8rem 0 1.3rem; font-size: clamp(3.4rem, 7vw, 6rem); }
.breadcrumb { display: flex; gap: .5rem; color: var(--faint); font-size: .78rem; }
.breadcrumb a { text-decoration: none; }
.breadcrumb a:hover { color: var(--accent-dark); }
.cta { display: grid; grid-template-columns: 1fr auto; gap: 2rem; align-items: center; margin-top: 7rem; }
.cta h2 { max-width: 12ch; }

.footer { padding: 4rem 0 2rem; border-top: 1px solid var(--line); }
.footer-inner { display: grid; grid-template-columns: 1.5fr repeat(4, 1fr); gap: 2rem; }
.footer-brand { max-width: 16rem; font-family: var(--display); font-size: 1.5rem; line-height: 1.15; }
.footer-col h5 { margin: 0 0 .9rem; color: var(--faint); font-size: .7rem; letter-spacing: .13em; text-transform: uppercase; }
.footer-col ul { display: grid; gap: .45rem; padding: 0; margin: 0; list-style: none; }
.footer-col a { color: var(--soft); font-size: .82rem; text-decoration: none; }
.footer-col a:hover { color: var(--accent-dark); }
.footer-bottom { display: flex; justify-content: space-between; gap: 1rem; padding-top: 1.5rem; margin-top: 3rem; border-top: 1px solid var(--line); color: var(--faint); font-size: .76rem; }

@media (max-width: 1020px) {
  .nav-links { gap: .85rem; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .architecture { grid-template-columns: repeat(3, 1fr); }
  .arch-node:last-child { grid-column: 2; }
  .footer-inner { grid-template-columns: repeat(3, 1fr); }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .hero-grid, .section-heading, .split, .workspace-showcase { grid-template-columns: 1fr; gap: 3rem; }
  .hero-art { max-width: 560px; }
  .cta { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .container, .narrow { width: min(calc(100% - 2rem), var(--max)); }
  .nav-inner { min-height: 68px; }
  .menu-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .nav-links { position: absolute; top: 68px; right: 1rem; left: 1rem; display: none; flex-direction: column; gap: 0; padding: .5rem; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-subtle); }
  .nav-links.open { display: flex; }
  .nav-links a { display: block; padding: .8rem; }
  .nav-cta { display: none; }
  .hero { padding-top: 5rem; }
  .hero h1, .page-hero h1 { font-size: clamp(3.5rem, 17vw, 5.8rem); }
  .hero-art { min-height: 315px; }
  .desktop-window { transform: rotate(-1deg) scale(.93); }
  .window-note { right: -3%; bottom: -1%; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .section { padding-block: 5rem; }
  .feature-grid, .provider-grid, .architecture, .endpoint-list, .step-grid { grid-template-columns: 1fr; }
  .feature, .step { min-height: auto; }
  .arch-node:last-child { grid-column: auto; }
  .flow-row { grid-template-columns: 2rem 1fr; }
  .flow-row span { grid-column: 2; }
  .boundary-row { grid-template-columns: 1fr; gap: .35rem; }
  .footer-inner { grid-template-columns: repeat(2, 1fr); }
  .footer-brand { grid-column: 1 / -1; }
  .footer-bottom { flex-direction: column; }
  .cta { margin-top: 5rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
