/* swayam.li project-site base (shared by dnsr, Folio, api2mcp): black ground, white ink, one sky-blue
   accent, navy fields, square corners, Instrument Sans. */

:root {
  --bg: #000;
  --surface: #1c1c1c;
  --raised: #333;
  --ink: #fff;
  --muted: #cfcfcf;
  --faint: #a8a8a8;
  --accent: #4cb3f0;
  --accent-strong: #7cc8f5;
  --accent-ink: #00263a;
  --deep: #245f84;
  --field: #0d3a55;
  --paper: #f2f2f2;
  --paper-ink: #000;

  --t-bg: #1e1e2e;
  --t-box: #45475a;
  --t-ink: #cdd6f4;
  --t-dim: #9399b2;
  --t-ok: #8cc98f;
  --t-warn: #e5c07b;
  --t-err: #ef7a7a;

  --m: clamp(16px, 2.8vw, 40px);
  --gap: 24px;
  --section: clamp(80px, 8vw, 128px);

  --step-small: .875rem;
  --step-body: 1.0625rem;
  --step-lead: clamp(1.125rem, .95rem + .5vw, 1.3125rem);
  --step-head: clamp(1.75rem, 1.2rem + 1.9vw, 2.625rem);
  --step-display: clamp(2.75rem, 1rem + 5vw, 5.5rem);

  --font: "Instrument Sans", system-ui, sans-serif;
  --code: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.22, 1, .36, 1);

  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(--ink); font-family: var(--font); font-size: var(--step-body); line-height: 1.5; -webkit-font-smoothing: antialiased; overflow-x: clip; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ul, ol, figure, pre { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
code, pre { font-family: var(--code); font-size: .86em; }
p { text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
[data-c="accent"] :focus-visible, .band :focus-visible { outline-color: var(--accent-ink); }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: var(--m); top: 12px; background: var(--accent); color: var(--accent-ink); padding: 10px 16px; z-index: 10; transform: translateY(-200%); }
.skip:focus { transform: none; }

.wrap { padding-inline: var(--m); max-width: 1440px; margin-inline: auto; }
.display { font-size: var(--step-display); line-height: .98; font-weight: 600; letter-spacing: -.035em; }
.head { font-size: var(--step-head); line-height: 1.08; font-weight: 600; letter-spacing: -.02em; }
.dot { color: var(--accent); }
.eyebrow { font-size: var(--step-small); color: var(--faint); letter-spacing: .02em; margin-bottom: 20px; }
:not(pre) > code { background: var(--surface); padding: .1em .35em; }

.link { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 4px; text-decoration-thickness: 2px; transition: color .2s; }
.link:hover { color: var(--accent-strong); }

.btn { display: inline-flex; align-items: center; min-height: 48px; padding: 0 22px; background: var(--accent); color: var(--accent-ink); font-weight: 600; text-decoration: none; border: 0; transition: background .2s, transform .2s var(--ease); }
.btn:hover { background: var(--accent-strong); }
.btn:active { transform: translateY(1px); }
.btn-small { min-height: 40px; padding: 0 16px; font-size: var(--step-small); }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--accent); }
.btn-ghost:hover { background: var(--field); }

/* Nav */
.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 20px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.25rem; text-decoration: none; letter-spacing: -.02em; }
.wordmark svg { width: 26px; height: 26px; }
.nav ul { display: flex; gap: clamp(12px, 2vw, 28px); flex-wrap: wrap; justify-content: flex-end; }
.nav .link { font-size: var(--step-small); }
@media (max-width: 640px) { .nav nav { display: none; } }

.actions { display: flex; align-items: center; gap: 24px; margin-top: 32px; flex-wrap: wrap; }
.lede { margin-top: 28px; font-size: var(--step-lead); color: var(--muted); max-width: 40ch; }

/* Section heads */
section + section { padding-top: var(--section); }
.sec-head { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: var(--gap) clamp(32px, 5vw, 80px); align-items: end; margin-bottom: 40px; }
.sec-head p { color: var(--muted); max-width: 52ch; }
@media (max-width: 900px) { .sec-head { grid-template-columns: minmax(0, 1fr); } }

/* Board of tiles */
.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.tile { padding: clamp(20px, 2.5vw, 32px); min-height: 280px; display: flex; flex-direction: column; gap: 14px; }
.tile h3 { font-size: 1.35rem; line-height: 1.15; font-weight: 600; letter-spacing: -.01em; }
.tile p:last-child { margin-top: auto; color: var(--muted); }
.tile-k { font-family: var(--code); font-size: .8rem; color: var(--faint); }
.tile[data-c="surface"] { background: var(--surface); }
.tile[data-c="raised"] { background: var(--raised); }
.tile[data-c="field"] { background: var(--field); }
.tile[data-c="deep"] { background: var(--deep); }
.tile[data-c="accent"] { background: var(--accent); color: var(--accent-ink); }
.tile[data-c="accent"] p, .tile[data-c="accent"] .tile-k { color: var(--accent-ink); }
.tile[data-c="raised"] code { background: var(--surface); }
.tile[data-c="accent"] code { background: rgba(0, 38, 58, .15); }
.tile.wide { grid-column: span 2; }
@media (max-width: 1000px) { .board { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .board { grid-template-columns: minmax(0, 1fr); } .tile { min-height: 0; } .tile.wide { grid-column: auto; } }

/* Ruled list */
.rules { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 2px solid var(--raised); }
.rules li { padding: 24px 24px 28px 0; border-bottom: 2px solid var(--raised); display: grid; gap: 8px; align-content: start; }
.rules li:not(:nth-child(3n + 1)) { padding-left: 24px; border-left: 2px solid var(--raised); }
.rules h3 { font-size: 1.1rem; font-weight: 600; }
.rules h3::before { content: ""; display: inline-block; width: 10px; height: 10px; background: var(--accent); margin-right: 10px; }
.rules p { color: var(--muted); font-size: .98rem; }
@media (max-width: 900px) {
  .rules { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rules li:not(:nth-child(3n + 1)) { padding-left: 0; border-left: 0; }
  .rules li:nth-child(even) { padding-left: 24px; border-left: 2px solid var(--raised); }
}
@media (max-width: 560px) { .rules { grid-template-columns: minmax(0, 1fr); } .rules li:nth-child(even) { padding-left: 0; border-left: 0; } }

/* Accent band */
.band { background: var(--accent); color: var(--accent-ink); padding-block: var(--section); margin-top: var(--section); }
.band + section { padding-top: var(--section); }
.nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 40px 32px; margin-top: 48px; }
.nums b { display: block; font-size: clamp(3rem, 2rem + 4vw, 5.5rem); line-height: 1; font-weight: 600; letter-spacing: -.04em; }
.nums b span { font-size: .4em; letter-spacing: 0; margin-left: 4px; }
.nums p { margin-top: 10px; max-width: 28ch; }
@media (max-width: 900px) { .nums { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .nums { grid-template-columns: minmax(0, 1fr); } }

/* Interface fragments */
.panel { background: var(--surface); padding: clamp(20px, 3vw, 36px); }
.term { background: var(--t-bg); color: var(--t-ink); min-width: 0; }
.term-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 16px; background: var(--t-box); font-family: var(--code); font-size: .8rem; color: var(--t-dim); }
.term pre { padding: 18px 16px; overflow-x: auto; font-size: .84rem; line-height: 1.65; }
.term .d { color: var(--t-dim); }
.term .ok { color: var(--t-ok); }
.term .warn { color: var(--t-warn); }
.term .err { color: var(--t-err); }
.term .k { color: var(--accent-strong); }
.term .s { color: var(--t-ok); }

.field { display: grid; gap: 6px; font-size: var(--step-small); color: var(--faint); }
.field input, .field select { background: var(--bg); border: 0; box-shadow: inset 0 0 0 2px var(--raised); padding: 12px 14px; font-family: var(--code); font-size: .95rem; color: #fff; border-radius: 0; min-height: 48px; width: 100%; }
.field input:focus, .field select:focus { outline: none; box-shadow: inset 0 0 0 2px var(--accent); }
.toggle { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; min-height: 48px; font-size: var(--step-small); }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch { width: 48px; height: 26px; background: var(--raised); position: relative; transition: background .2s; flex: none; }
.knob { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; background: var(--paper); transition: transform .25s var(--ease); }
.toggle input:checked + .switch { background: var(--accent); }
.toggle input:checked + .switch .knob { transform: translateX(22px); background: var(--accent-ink); }
.toggle input:focus-visible + .switch { outline: 3px solid var(--accent); outline-offset: 3px; }

.seg { display: inline-grid; grid-auto-flow: column; gap: 4px; }
.seg button { background: var(--raised); border: 0; min-height: 44px; padding: 0 16px; font-weight: 600; font-size: var(--step-small); transition: background .2s, color .2s; }
.seg button:hover { background: var(--deep); }
.seg button[aria-pressed="true"], .seg button[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }

/* CTA */
.cta { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 4vw, 64px); padding-bottom: var(--section); align-items: start; }
.cta-copy p { margin-top: 20px; color: var(--muted); max-width: 40ch; }
.cmds { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
.cmd { background: var(--t-bg); color: var(--t-ink); padding: 18px 20px; position: relative; min-width: 0; }
.cmd-k { font-size: .78rem; color: var(--t-dim); margin-bottom: 8px; }
.cmd pre { overflow-x: auto; font-size: .88rem; line-height: 1.7; padding-right: 72px; }
.copy { position: absolute; top: 12px; right: 12px; background: var(--t-box); border: 0; padding: 0 14px; min-height: 36px; font-size: .8rem; transition: background .2s; }
.copy:hover { background: var(--deep); }
.copy.done { background: var(--accent); color: var(--accent-ink); }
@media (max-width: 900px) { .cta { grid-template-columns: minmax(0, 1fr); } }

/* Footer */
.foot { border-top: 2px solid var(--surface); padding-block: 48px 32px; }
.mark { font-size: clamp(5rem, 22vw, 20rem); font-weight: 700; letter-spacing: -.06em; line-height: .8; margin-bottom: 48px; }
.foot-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.foot-grid h3 { font-size: var(--step-small); color: var(--faint); font-weight: 500; margin-bottom: 12px; }
.foot-grid ul { display: grid; gap: 8px; }
.foot-last { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 48px; padding-top: 24px; border-top: 2px solid var(--surface); font-size: var(--step-small); color: var(--muted); }
@media (max-width: 640px) { .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; } }
