/* C4X website style: dark navy canvas, teal accent. Tokens as in the C4X design system. */
/* Colours, fonts and the light and dark themes live in tokens.css, loaded before this file. */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0; font-family: var(--font-body); background-color: var(--c4x-body-bg);
  background-image: var(--c4x-page-glow);
  background-repeat: no-repeat; background-attachment: fixed; color: var(--c4x-body-text); -webkit-font-smoothing: antialiased; line-height: 1.6;
}
h1, h2, h3, h4, .brand, .btn-primary, .btn-secondary { font-family: var(--font-heading); line-height: 1.15; }
h1 { font-size: clamp(2rem, 4vw, 2.9rem); font-weight: 800; margin: 0 0 1rem; }
h2 { font-size: clamp(1.4rem, 2.4vw, 1.8rem); font-weight: 700; margin: 0 0 1rem; }
h3 { font-size: 1.1rem; font-weight: 700; margin: 0 0 0.5rem; }
p { margin: 0 0 1rem; }
a { color: var(--c4x-link); }
code, .mono { font-family: var(--mono); font-size: 0.88em; }
:not(pre) > code { background: var(--c4x-surface-2); padding: 1px 6px; border-radius: 4px; overflow-wrap: anywhere; }
main { max-width: 1280px; margin: 0 auto; padding: 0 1.5rem 3rem; }
.muted { color: var(--c4x-muted); } .small { font-size: 0.85rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header */
header.site-header { background: linear-gradient(160deg, var(--c4x-hero-deep) 0%, var(--c4x-hero) 100%); color: #fff; position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12); }
.header-inner { max-width: 1280px; margin: 0 auto; padding: 0 1.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 72px; }
.brand { color: #fff; text-decoration: none; font-weight: 800; font-size: 1.15rem; }
nav.primary-nav { display: flex; align-items: center; gap: 0.35rem; }
.nav-link { color: rgba(255, 255, 255, 0.92); text-decoration: none; font-size: 0.94rem; font-weight: 500; padding: 0.6rem 0.85rem; border-radius: 6px; white-space: nowrap; }
.nav-link:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.nav-cta { border: 1px solid rgba(255, 255, 255, 0.4); }
.nav-toggle { display: none; background: none; border: none; color: #fff; font-size: 1.6rem; cursor: pointer; padding: 0.25rem 0.5rem; min-width: 44px; min-height: 44px; }
@media (max-width: 980px) {
  .nav-toggle { display: block; }
  nav.primary-nav { position: fixed; inset: 72px 0 0 0; background: var(--c4x-hero-deep); flex-direction: column; align-items: stretch; gap: 0; padding: 0.75rem; overflow-y: auto; transform: translateX(100%); transition: transform 0.25s ease; height: calc(100vh - 72px); }
  nav.primary-nav.open { transform: translateX(0); }
  .nav-link { padding: 0.9rem 0.75rem; border-bottom: 1px solid rgba(255, 255, 255, 0.08); border-radius: 0; }
  .nav-cta { border: none; }
}

/* Hero */
.page-hero { background: linear-gradient(150deg, var(--c4x-hero-deep), var(--c4x-hero) 65%, var(--c4x-accent) 190%); color: #fff; padding: 3.5rem 2rem; margin: 1.5rem 0 2.5rem; min-height: 320px; display: flex; align-items: center; border-radius: 20px; overflow: hidden; box-shadow: 0 24px 60px rgba(0, 20, 40, 0.32); }
.page-hero-inner { max-width: 1280px; margin: 0 auto; width: 100%; }
.page-hero-content { max-width: 680px; }
.page-hero p { color: rgba(255, 255, 255, 0.88); font-size: 1.08rem; }
.hero-eyebrow { text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.8rem; font-weight: 700; color: rgba(255, 255, 255, 0.85); margin-bottom: 0.75rem; display: block; }
.hero-buttons { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 0.5rem; }
.btn-primary, .btn-secondary { display: inline-block; padding: 0.8rem 1.6rem; border-radius: 8px; text-decoration: none; font-weight: 700; font-size: 0.95rem; transition: transform 0.15s ease, box-shadow 0.15s ease; border: none; cursor: pointer; }
.btn-primary { background: var(--c4x-accent); color: var(--c4x-on-accent); box-shadow: 0 6px 18px rgba(0, 164, 191, 0.35); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(0, 164, 191, 0.45); }
.btn-secondary { background: var(--c4x-surface-2); color: var(--c4x-body-text); border: 1px solid color-mix(in srgb, var(--c4x-body-text) 35%, transparent); }
.btn-secondary:hover { background: color-mix(in srgb, var(--c4x-body-text) 14%, transparent); }
@media (max-width: 720px) { .page-hero { min-height: 280px; border-radius: 14px; margin-top: 1rem; padding: 2.25rem 1.25rem; } }

/* Buttons and fields (app set, as used for tool chrome) */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-family: var(--font-body); font-size: 14px; font-weight: 600; padding: 10px 18px; border-radius: 6px; border: 1px solid transparent; cursor: pointer; text-decoration: none; min-height: 40px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-accent { background: var(--c4x-accent); color: var(--c4x-on-accent); } .btn-accent:hover:not(:disabled) { background: var(--c4x-accent-dark); }
.btn-outline { background: transparent; border-color: var(--c4x-border); color: var(--c4x-body-text); } .btn-outline:hover:not(:disabled) { border-color: var(--c4x-accent); color: var(--c4x-link); }
.btn-sm { padding: 6px 12px; font-size: 13px; min-height: 34px; }
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
input[type="text"], input[type="password"], input[type="search"], select, textarea {
  width: 100%; font-family: var(--font-body); font-size: 14px; color: #0e283a; background: #fff; border: 1px solid var(--c4x-border); border-radius: 6px; padding: 9px 11px;
}
input[type="text"], input[type="password"], input[type="search"] { height: 40px; }
textarea { font-family: var(--mono); font-size: 13px; min-height: 140px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--c4x-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c4x-accent) 25%, transparent); }

/* Layout */
.docs { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 2rem; align-items: start; }
.docs-side { position: sticky; top: 88px; max-height: calc(100vh - 104px); overflow-y: auto; background: var(--c4x-panel-bg); border: 1px solid var(--c4x-border); border-radius: 12px; padding: 1rem; }
.docs-side input { margin-bottom: 0.75rem; }
#toc a { display: flex; justify-content: space-between; gap: 8px; padding: 6px 8px; border-radius: 6px; color: var(--c4x-body-text); text-decoration: none; font-size: 0.92rem; }
#toc a:hover { background: var(--c4x-surface-2); color: var(--c4x-link); }
#toc a .n { color: var(--c4x-muted); font-size: 0.8rem; }
@media (max-width: 980px) { .docs { grid-template-columns: 1fr; } .docs-side { position: static; max-height: none; } }

.callout { margin: 0 0 2rem; background: var(--c4x-panel-bg); border: 1px solid var(--c4x-border); border-left: 3px solid var(--c4x-accent); border-radius: 14px; padding: 1.75rem 2rem; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.78rem; font-weight: 700; color: var(--c4x-link); margin-bottom: 0.5rem; display: block; }
.key-box { margin-top: 1rem; background: var(--c4x-inset); border: 1px solid var(--c4x-border); border-radius: 10px; padding: 1rem 1.1rem; }
.key-row { display: flex; gap: 8px; margin-bottom: 0.6rem; }
@media (max-width: 640px) { .callout { padding: 1.25rem; } .key-row { flex-direction: column; } .key-row .btn { width: 100%; min-height: 44px; } }

/* Tag sections and operations */
.tag { margin-bottom: 2.5rem; }
.tag > p { color: var(--c4x-muted); }
.op { background: var(--c4x-panel-bg); border: 1px solid var(--c4x-border); border-radius: 12px; margin-bottom: 0.75rem; overflow: hidden; }
.op[open] { border-color: rgba(0, 196, 204, 0.35); box-shadow: 0 10px 28px rgba(0, 196, 204, 0.12); }
.op > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 0.75rem; padding: 0.8rem 1rem; min-height: 52px; }
.op > summary::-webkit-details-marker { display: none; }
.op > summary:hover { background: var(--c4x-surface); }
.op .path { font-family: var(--mono); font-size: 0.9rem; overflow-wrap: anywhere; flex: 1; min-width: 0; }
.op .sum { color: var(--c4x-muted); font-size: 0.9rem; text-align: right; }
.method { flex: none; min-width: 62px; text-align: center; font-family: var(--font-heading); font-weight: 800; font-size: 0.75rem; letter-spacing: 0.04em; padding: 5px 8px; border-radius: 6px; color: #04222b; }
.m-get { background: var(--c4x-accent); color: var(--c4x-on-accent); } .m-post { background: var(--c4x-gold); } .m-put { background: var(--c4x-glow-cyan); } .m-patch { background: var(--c4x-muted); color: var(--c4x-panel-bg); } .m-delete { background: #ff9c92; }
.op-body { padding: 0.25rem 1.25rem 1.25rem; border-top: 1px solid var(--c4x-border); }
.op-body h4 { margin: 1.25rem 0 0.5rem; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--c4x-muted); }
.op-body p { margin: 0.75rem 0 0; }
@media (max-width: 640px) { .op .sum { display: none; } .op-body { padding: 0.25rem 1rem 1rem; } }

table.props { width: 100%; border-collapse: collapse; }
table.props th, table.props td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--c4x-border); font-size: 0.88rem; overflow-wrap: anywhere; }
table.props th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--c4x-muted); }
table.props .req { display: block; color: var(--c4x-warn); font-size: 0.72rem; font-weight: 700; margin-top: 2px; }
table.props td:first-child { min-width: 110px; }
table.props .nest td:first-child { padding-left: 28px; }
.scroll-x { overflow-x: auto; }
pre { margin: 0; color: var(--c4x-body-text); background: #04111c; border: 1px solid var(--c4x-border); border-radius: 8px; padding: 12px 14px; overflow: auto; font-family: var(--mono); font-size: 0.82rem; line-height: 1.5; max-height: 420px; white-space: pre; }
.resp { display: flex; gap: 10px; padding: 6px 0; font-size: 0.9rem; align-items: baseline; }
.code { font-family: var(--mono); font-weight: 700; flex: none; min-width: 40px; }
.code.c2 { color: var(--c4x-link); } .code.c3 { color: var(--c4x-warn); } .code.c4, .code.c5 { color: var(--c4x-danger); }
.chip { display: inline-block; font-size: 0.72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--c4x-border); color: var(--c4x-muted); margin-right: 6px; }
.try { margin-top: 1.25rem; background: var(--c4x-inset); border: 1px solid var(--c4x-border); border-radius: 10px; padding: 1rem; }
.try .row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.try .field { margin-bottom: 12px; }
.try .actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 4px; }
.status-banner { padding: 12px 14px; border-radius: 6px; font-size: 13px; margin: 12px 0; }
.status-banner-info { background: var(--c4x-surface); color: var(--c4x-muted); border: 1px solid var(--c4x-border); }
.status-banner-warn { background: color-mix(in srgb, var(--c4x-gold) 12%, transparent); color: var(--c4x-warn); border: 1px solid color-mix(in srgb, var(--c4x-gold) 40%, transparent); }
.status-banner-error { background: var(--c4x-danger-bg); color: var(--c4x-danger); border: 1px solid var(--c4x-danger-line); }
.result .meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 0.85rem; margin: 10px 0 6px; }
.copy { float: right; }
.empty { color: var(--c4x-muted); padding: 1rem 0; }

footer.site-footer { background: var(--c4x-hero-deep); color: rgba(255, 255, 255, 0.85); padding: 3rem 1.5rem 2rem; margin-top: 3rem; }
.footer-inner { max-width: 1280px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 2.5rem; justify-content: space-between; padding-bottom: 1.5rem; border-bottom: 1px solid rgba(255, 255, 255, 0.12); }
.footer-inner a { color: rgba(255, 255, 255, 0.85); text-decoration: none; } .footer-inner a:hover { color: #fff; text-decoration: underline; }
.footer-col strong { color: #fff; display: block; margin-bottom: 0.6rem; font-family: var(--font-heading); }
.footer-bottom { max-width: 1280px; margin: 1.25rem auto 0; font-size: 0.82rem; color: rgba(255, 255, 255, 0.55); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
