/* Agent District prototype — foundation.
   Design tokens, reset, typography, navigation, buttons, dialog and shared pieces.
   Direction "Light Gallery": porcelain canvas, ink type, colour only inside artwork.
   System fonts on purpose (SF Pro on Apple devices) — no web-font dependency. */

:root {
  --bg: #f4f5f7; --surface: #fff; --sunk: #eceef1;
  --ink: #0c0e12; --ink-2: #353a45; --muted: #636a78; --soft: #8a909d;
  --line: rgba(12, 14, 18, .08); --line-2: rgba(12, 14, 18, .15);
  --stage: #0e1015; --stage-2: #171a21; --stage-line: rgba(255, 255, 255, .1);
  --ok: #17794f; --warn: #a15c00;
  --r-xl: 32px; --r-lg: 24px; --r-md: 16px; --r-sm: 10px;
  --shadow-1: 0 1px 2px rgba(12, 14, 18, .04), 0 8px 24px rgba(12, 14, 18, .05);
  --shadow-2: 0 2px 6px rgba(12, 14, 18, .05), 0 28px 56px -16px rgba(12, 14, 18, .18);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

/* Hue families: --t tint (card background), --m mid, --d deep. Used only by artwork and its frame. */
.hue-amber  { --t: #fbf0e2; --m: #f2bd7c; --d: #b4611a; }
.hue-moss   { --t: #eef2e1; --m: #bdcf7d; --d: #4c6b1e; }
.hue-violet { --t: #ecebfb; --m: #b3abf2; --d: #4a3fc4; }
.hue-teal   { --t: #e1f4f0; --m: #8ed4c6; --d: #0e7767; }
.hue-plum   { --t: #f6e9f1; --m: #dea9cb; --d: #8a2f6a; }
.hue-blue   { --t: #e5eefb; --m: #9dbdf1; --d: #1f5cbd; }
.hue-sky    { --t: #e2f3fa; --m: #8dcdeb; --d: #0c6c98; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
h1, h2, h3, h4, p, ul, ol, pre { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; text-align: left; }
svg { display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.skip { position: fixed; left: 16px; top: -60px; z-index: 100; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 999px; }
.skip:focus { top: 16px; }
.ic { width: 18px; height: 18px; flex: none; }

.wrap { width: min(1200px, 100% - 48px); margin-inline: auto; }
.section { padding-top: 112px; scroll-margin-top: 0; }

/* Type scale — hierarchy comes from size and weight, not colour. */
h1 { font-size: clamp(42px, 7vw, 88px); line-height: .98; letter-spacing: -.042em; font-weight: 600; }
h2 { font-size: clamp(30px, 3.8vw, 46px); line-height: 1.05; letter-spacing: -.032em; font-weight: 600; }
h3 { font-size: 22px; line-height: 1.2; letter-spacing: -.02em; font-weight: 600; }
.kicker { font-size: 14px; font-weight: 550; color: var(--muted); margin-bottom: 10px; letter-spacing: -.005em; }
.fine { font-size: 13px; line-height: 1.5; color: var(--muted); }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; margin-bottom: 32px; }
.head h2 { max-width: 20ch; }
.head-note { max-width: 36ch; color: var(--muted); font-size: 15px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 22px; border-radius: 999px; font-weight: 550; font-size: 15px; letter-spacing: -.01em; transition: transform .2s var(--ease), background .2s, box-shadow .2s, opacity .2s; white-space: nowrap; }
.btn:active { transform: scale(.98); }
.btn-sm { height: 40px; padding: 0 16px; font-size: 14px; }
.btn-ink { background: var(--ink); color: #fff; }
.btn-ink:hover { background: #262a33; }
.btn-ghost { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn-ghost:hover { box-shadow: inset 0 0 0 1px var(--ink); }
.btn-light { background: #fff; color: var(--ink); }
.btn-dim { background: rgba(255, 255, 255, .1); color: #fff; }
.btn-dim:hover { background: rgba(255, 255, 255, .17); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.link { display: inline-flex; align-items: center; gap: 6px; font-weight: 550; font-size: 15px; }
.link span { width: 16px; height: 16px; background: currentColor; transition: transform .2s var(--ease); -webkit-mask: var(--arrow) center/contain no-repeat; mask: var(--arrow) center/contain no-repeat; }
.link:hover span { transform: translateX(3px); }
:root { --arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E"); }

/* Navigation — the one place glass is used on the light canvas. */
.nav { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 50; width: min(1200px, 100% - 24px); height: 60px; border-radius: 999px; background: rgba(255, 255, 255, .72); -webkit-backdrop-filter: saturate(1.8) blur(22px); backdrop-filter: saturate(1.8) blur(22px); box-shadow: 0 0 0 1px var(--line), 0 10px 30px -12px rgba(12, 14, 18, .14); }
.nav-layer { position: absolute; inset: 0; padding: 0 10px 0 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; transition: opacity .28s var(--ease), transform .28s var(--ease), visibility 0s; }
/* Only one layer is ever visible. The hidden one fades out, then stops existing for pointer and keyboard. */
.nav.ctx .nav-global, .nav:not(.ctx) .nav-context { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .18s var(--ease), transform .18s var(--ease), visibility 0s .18s; }
.nav.ctx .nav-global { transform: translateY(-8px); }
.nav:not(.ctx) .nav-context { transform: translateY(8px); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -.02em; font-size: 16px; }
.brand svg { width: 28px; height: 28px; color: var(--ink); }
.nav-links { display: flex; gap: 2px; }
.nav-links a { padding: 8px 14px; border-radius: 999px; font-size: 14.5px; font-weight: 500; color: var(--ink-2); transition: background .2s, color .2s; }
.nav-links a:hover { background: rgba(12, 14, 18, .05); color: var(--ink); }
.nav-links a.on { background: var(--ink); color: #fff; }
.nav-end { display: flex; align-items: center; gap: 8px; }
.nav-menu { display: none; width: 40px; height: 40px; border-radius: 50%; background: rgba(12, 14, 18, .06) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230c0e12' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M5 9h14M5 15h14'/%3E%3C/svg%3E") center/22px no-repeat; }

/* Chips (filters and tags) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.chip { height: 38px; padding: 0 16px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; font-weight: 500; color: var(--ink-2); display: inline-flex; align-items: center; gap: 8px; transition: box-shadow .2s, background .2s, color .2s; }
.chip:hover { box-shadow: inset 0 0 0 1px var(--line-2); }
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; box-shadow: none; }
.chip small { font-size: 12px; opacity: .6; font-variant-numeric: tabular-nums; }
.tag { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 8px; background: var(--sunk); font-size: 12.5px; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* Demo-type badge: the dot tells you how real the experience is. */
.badge { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 550; color: var(--ink-2); white-space: nowrap; }
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; box-shadow: inset 0 0 0 1.6px currentColor; }
.badge.live::before { background: var(--ok); box-shadow: none; }

.card { background: var(--surface); border-radius: var(--r-xl); box-shadow: 0 0 0 1px var(--line), var(--shadow-1); padding: 36px; }

/* Search */
.search input { width: 300px; max-width: 100%; height: 46px; border-radius: 999px; border: 0; padding: 0 18px 0 44px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23636a78' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='M16 16l4 4'/%3E%3C/svg%3E") 16px center/18px no-repeat; box-shadow: inset 0 0 0 1px var(--line); font-size: 15px; }
.search input:focus { outline: none; box-shadow: inset 0 0 0 1.5px var(--ink); }

/* Dialog sheet */
.sheet { border: 0; padding: 0; border-radius: var(--r-xl); width: min(540px, 100% - 24px); background: var(--surface); box-shadow: var(--shadow-2); color: var(--ink); }
.sheet::backdrop { background: rgba(12, 14, 18, .35); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.sheet-in { padding: 32px; display: grid; gap: 14px; position: relative; }
.sheet-x { position: absolute; right: 18px; top: 18px; width: 36px; height: 36px; border-radius: 50%; background: var(--sunk) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230c0e12' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M7 7l10 10M17 7L7 17'/%3E%3C/svg%3E") center/18px no-repeat; }
.sheet label { display: grid; gap: 6px; font-size: 13px; font-weight: 550; color: var(--ink-2); }
.sheet input, .sheet select, .sheet textarea { border: 0; border-radius: 12px; padding: 12px 14px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); font-size: 15px; font-weight: 400; resize: vertical; width: 100%; }
.sheet input:focus, .sheet select:focus, .sheet textarea:focus { outline: none; box-shadow: inset 0 0 0 1.5px var(--ink); }
.sheet-out pre { background: var(--stage); color: #dfe3ea; border-radius: 14px; padding: 16px; font: 12.5px/1.6 var(--mono); white-space: pre-wrap; max-height: 180px; overflow: auto; }
.sheet-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 4px; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px; font-size: 14px; font-weight: 500; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s var(--ease); z-index: 80; box-shadow: var(--shadow-2); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

.footer { display: flex; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; padding: 56px 0 44px; margin-top: 112px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }

/* Gentle entrance for blocks as they scroll in. Only applied when JS is running. */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .nav-links { position: absolute; top: 70px; left: 0; right: 0; flex-direction: column; padding: 10px; border-radius: 24px; background: rgba(255, 255, 255, .96); box-shadow: 0 0 0 1px var(--line), var(--shadow-2); display: none; }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 13px 16px; font-size: 16px; }
  .nav-menu { display: block; }
  .head { flex-direction: column; align-items: flex-start; gap: 14px; }
  .section { padding-top: 80px; }
  .search, .search input { width: 100%; }
}
@media (max-width: 560px) {
  .wrap { width: calc(100% - 32px); }
  .card { padding: 24px; border-radius: var(--r-lg); }
  .nav .btn-sm { padding: 0 13px; }
  .brand span { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}
