/* Agent District prototype — project page.
   Case-study layout: header, sticky section bar, overview, architecture walkthrough,
   build guide and the agent-ready brief. The demo stage itself lives in stage.css. */

.p-head { padding-top: 116px; }
.back { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; color: var(--muted); padding: 8px 0; }
.back:hover { color: var(--ink); }
.p-hero { display: grid; grid-template-columns: 1.35fr .65fr; gap: 48px; align-items: center; margin-top: 18px; }
.p-ind { font-size: 15px; font-weight: 600; color: var(--d); margin-bottom: 14px; }
.p-head h1 { font-size: clamp(38px, 5.4vw, 72px); max-width: 14ch; }
.p-head .lede { margin-top: 22px; }
.p-meta { display: flex; flex-wrap: wrap; gap: 10px; margin: 28px 0 16px; }
.p-meta li { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; font-weight: 550; }
.p-meta small { font-weight: 400; color: var(--muted); font-size: 13px; padding-left: 8px; border-left: 1px solid var(--line-2); }
.p-art { background: var(--t); border-radius: var(--r-xl); aspect-ratio: 1 / .92; display: flex; align-items: flex-end; overflow: hidden; }
.p-art svg { width: 100%; }

/* In-page section bar. It scrolls away with the intro; the nav's project layer then takes over. */
.p-nav { margin-top: 44px; }
.p-nav > div { pointer-events: auto; width: max-content; max-width: calc(100% - 24px); margin: 0 auto; display: flex; gap: 2px; padding: 5px; border-radius: 999px; background: rgba(255, 255, 255, .78); -webkit-backdrop-filter: saturate(1.8) blur(20px); backdrop-filter: saturate(1.8) blur(20px); box-shadow: 0 0 0 1px var(--line), 0 10px 26px -14px rgba(12, 14, 18, .2); overflow-x: auto; scrollbar-width: none; }
.p-nav a { padding: 8px 16px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--ink-2); white-space: nowrap; transition: background .2s, color .2s; }
.p-nav a:hover { background: rgba(12, 14, 18, .05); }
.p-nav a.on { background: var(--ink); color: #fff; }
.p-sec { padding-top: 96px; }
#s-overview { padding-top: 64px; }

/* Project layer of the floating nav: back, project identity, sections. */
.nav-context { padding-left: 10px; }
.ctx-back { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 15px 0 11px; border-radius: 999px; background: rgba(12, 14, 18, .06); font-size: 14px; font-weight: 550; flex: none; transition: background .2s; }
.ctx-back:hover { background: rgba(12, 14, 18, .1); }
.ctx-id { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; padding-left: 4px; }
.ctx-id i { width: 9px; height: 9px; border-radius: 50%; background: var(--d); flex: none; }
.ctx-id b { font-size: 15px; font-weight: 600; letter-spacing: -.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctx-secs { display: flex; gap: 2px; flex: none; }
.ctx-secs a { padding: 8px 14px; border-radius: 999px; font-size: 14.5px; font-weight: 500; color: var(--ink-2); white-space: nowrap; transition: background .2s, color .2s; }
.ctx-secs a:hover { background: rgba(12, 14, 18, .05); color: var(--ink); }
.ctx-secs a.on { background: var(--ink); color: #fff; }
.ctx-menu { display: none; }

/* Overview */
.ov { display: grid; grid-template-columns: 1.15fr .85fr; gap: 64px; align-items: start; }
.statement { font-size: clamp(22px, 2.5vw, 32px); line-height: 1.28; letter-spacing: -.025em; font-weight: 500; }
.ov-side { display: grid; gap: 0; }
.ov-side > div { padding: 22px 0; border-top: 1px solid var(--line-2); }
.ov-side > div:first-child { padding-top: 0; border-top: 0; }
.ov-side p:not(.kicker) { color: var(--ink-2); }
.plain li { position: relative; padding: 7px 0 7px 18px; color: var(--ink-2); font-size: 15px; line-height: 1.45; }
.plain li::before { content: ""; position: absolute; left: 2px; top: 16px; width: 5px; height: 5px; border-radius: 50%; background: var(--d, var(--ink)); }

/* Experience modes */
.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 12px; }
.modes li { background: var(--surface); border-radius: 20px; padding: 18px 20px; box-shadow: inset 0 0 0 1px var(--line); display: grid; gap: 4px; align-content: start; }
.modes b { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.modes b::before { content: ""; width: 8px; height: 8px; border-radius: 50%; box-shadow: inset 0 0 0 1.6px var(--soft); }
.modes .on b::before { background: var(--ink); box-shadow: none; }
.modes span { font-size: 13.5px; color: var(--muted); }
.modes em { font-style: normal; font-size: 12.5px; font-weight: 550; color: var(--muted); margin-top: 8px; }
.modes .on em { color: var(--ink); }
.modes .btn { justify-self: start; margin-top: 8px; }

/* Architecture */
.arch { padding: 28px; }
.lanes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.lane { position: relative; background: var(--bg); border-radius: 22px; padding: 16px 12px 12px; display: flex; flex-direction: column; gap: 10px; }
.lane + .lane::before { content: ""; position: absolute; left: -15px; top: 50%; width: 16px; height: 16px; margin-top: -8px; background: var(--soft); -webkit-mask: var(--arrow) center/contain no-repeat; mask: var(--arrow) center/contain no-repeat; z-index: 1; }
.lane-name { font-size: 13px; font-weight: 600; color: var(--muted); padding: 0 6px 2px; }
.node { background: var(--surface); border-radius: 14px; padding: 13px 14px; display: grid; gap: 2px; box-shadow: 0 0 0 1px var(--line); opacity: .45; transition: opacity .35s, box-shadow .35s, transform .35s var(--ease); }
.node.on { opacity: 1; box-shadow: 0 0 0 1.5px var(--ink), 0 12px 24px -12px rgba(12, 14, 18, .25); transform: translateY(-2px); }
.node b { font-size: 14.5px; font-weight: 600; letter-spacing: -.01em; }
.node span { font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.node em, .walk-text em { font-style: normal; display: inline-flex; align-items: center; gap: 5px; width: max-content; height: 22px; padding: 0 9px 0 6px; margin-top: 6px; border-radius: 999px; background: var(--d); color: #fff; font-size: 11.5px; font-weight: 600; }
.node em .ic, .walk-text em .ic { width: 13px; height: 13px; }
.walk { display: grid; grid-template-columns: auto 1fr auto; gap: 28px; align-items: center; margin-top: 22px; padding: 22px 8px 4px; border-top: 1px solid var(--line); }
.walk-steps { display: flex; gap: 6px; flex-wrap: wrap; }
.walk-steps button { width: 36px; height: 36px; border-radius: 50%; text-align: center; font-size: 13.5px; font-weight: 600; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-2); font-variant-numeric: tabular-nums; transition: background .2s, color .2s; }
.walk-steps button.human { box-shadow: inset 0 0 0 1.5px var(--d); color: var(--d); }
.walk-steps button[aria-selected="true"] { background: var(--ink); color: #fff; box-shadow: none; }
.walk-text { min-height: 74px; }
.walk-text b { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 18px; letter-spacing: -.02em; font-weight: 600; }
.walk-text em { margin-top: 0; }
.walk-text p { color: var(--ink-2); font-size: 15px; margin-top: 4px; max-width: 62ch; }
.walk-ctl { display: flex; gap: 8px; }
.walk-ctl .btn-ghost { width: 40px; padding: 0; }
.arch-note { margin-top: 14px; padding: 0 6px; }

/* Build */
.resources { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.res { display: grid; gap: 2px; padding: 18px 20px; border-radius: 20px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .2s, transform .3s var(--ease); }
.res .ic { width: 22px; height: 22px; margin-bottom: 14px; }
.res b { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.res span { font-size: 13px; color: var(--muted); }
.res:not([disabled]):hover { box-shadow: inset 0 0 0 1.5px var(--ink); transform: translateY(-2px); }
.res[disabled] { background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); cursor: not-allowed; color: var(--soft); }
.res[disabled] span { color: var(--soft); }
.res[data-copybrief] { background: var(--ink); color: #fff; box-shadow: none; }
.res[data-copybrief] span { color: rgba(255, 255, 255, .65); }
.res[data-copybrief]:hover { box-shadow: none; background: #262a33; }
.bgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.bgrid .card { padding: 32px; }
.bgrid .span { grid-column: 1 / -1; }
.bgrid h3 { margin-bottom: 14px; }
.bgrid h3.mt, .kicker.mt { margin-top: 28px; }
.checks li { position: relative; padding: 9px 0 9px 30px; font-size: 15px; color: var(--ink-2); border-top: 1px solid var(--line); }
.checks li:first-child { border-top: 0; }
.checks li::before { content: ""; position: absolute; left: 0; top: 11px; width: 19px; height: 19px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--line-2); }
.techs li { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 15px; }
.techs li:first-child { border-top: 0; }
.techs span { color: var(--muted); text-align: right; font-size: 14px; }
.steps { counter-reset: s; display: grid; grid-template-columns: 1fr 1fr; gap: 0 40px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 34px 1fr; gap: 0 10px; padding: 14px 0; border-top: 1px solid var(--line); }
.steps li::before { content: counter(s); grid-row: span 2; width: 26px; height: 26px; border-radius: 50%; background: var(--bg); font-size: 12.5px; font-weight: 600; display: grid; place-items: center; margin-top: 1px; }
.steps b { font-size: 15.5px; font-weight: 600; letter-spacing: -.01em; }
.steps span { grid-column: 2; font-size: 14px; color: var(--muted); }
.faq details { border-top: 1px solid var(--line); }
.faq details:first-child { border-top: 0; }
.faq summary { list-style: none; cursor: pointer; padding: 16px 40px 16px 0; font-weight: 600; font-size: 16px; letter-spacing: -.01em; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: 4px; top: 50%; width: 12px; height: 12px; margin-top: -8px; border-right: 1.8px solid var(--ink); border-bottom: 1.8px solid var(--ink); transform: rotate(45deg); transition: transform .25s var(--ease); }
.faq details[open] summary::after { transform: rotate(225deg); margin-top: -2px; }
.faq p { color: var(--ink-2); padding: 0 40px 18px 0; max-width: 72ch; }

/* Agent brief */
.brief { display: grid; grid-template-columns: .85fr 1.15fr; gap: 48px; align-items: start; background: var(--surface); border-radius: var(--r-xl); padding: 48px; box-shadow: 0 0 0 1px var(--line), var(--shadow-1); }
.brief-copy > p:not(.kicker) { color: var(--ink-2); margin-top: 16px; }
.brief-copy code { font: 13px var(--mono); background: var(--sunk); padding: 2px 6px; border-radius: 6px; }
.howto { counter-reset: h; margin-top: 20px; display: grid; gap: 10px; }
.howto li { counter-increment: h; display: grid; grid-template-columns: 26px 1fr; gap: 10px; font-size: 15px; color: var(--ink-2); }
.howto li::before { content: counter(h); width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 12px; font-weight: 600; display: grid; place-items: center; }
.manifest li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font: 13px var(--mono); color: var(--ink-2); }
.manifest em { font: 550 12px var(--font); color: var(--ink); }
.manifest em.dim { color: var(--muted); }
.code { background: var(--stage); border-radius: 24px; overflow: hidden; color: #dfe3ea; position: sticky; top: 100px; }
.code-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 10px 10px 12px; border-bottom: 1px solid var(--stage-line); }
.code-tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.code-tabs button { padding: 8px 12px; border-radius: 10px; font: 500 12.5px var(--mono); color: rgba(255, 255, 255, .55); white-space: nowrap; }
.code-tabs button[aria-selected="true"] { background: rgba(255, 255, 255, .1); color: #fff; }
.code pre { padding: 22px 24px 28px; font: 12.5px/1.7 var(--mono); white-space: pre-wrap; overflow: auto; max-height: 520px; overflow-wrap: anywhere; }
:is(.code, .stage, .brief-teaser) :focus-visible { outline-color: #fff; }

.next { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 36px 40px; border-radius: var(--r-xl); background: var(--t); transition: transform .35s var(--ease), box-shadow .35s; }
.next:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.next small { display: block; font-size: 14px; font-weight: 550; color: var(--d); margin-bottom: 6px; }
.next b { font-size: clamp(22px, 3vw, 34px); letter-spacing: -.03em; font-weight: 600; line-height: 1.1; }

@media (max-width: 1000px) {
  /* Compact project nav: back icon, title, and one button that opens the section list. */
  .ctx-back { width: 40px; padding: 0; }
  .ctx-back span { display: none; }
  .ctx-menu { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px 0 16px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 14px; font-weight: 550; flex: none; white-space: nowrap; }
  .ctx-menu::after { content: ""; width: 7px; height: 7px; margin-top: -4px; border-right: 1.8px solid #fff; border-bottom: 1.8px solid #fff; transform: rotate(45deg); transition: transform .25s var(--ease); }
  .ctx-menu[aria-expanded="true"]::after { transform: rotate(225deg); margin-top: 4px; }
  .ctx-secs { position: absolute; top: 70px; left: 0; right: 0; flex-direction: column; padding: 10px; border-radius: 24px; background: #fff; box-shadow: 0 0 0 1px var(--line), var(--shadow-2); display: none; }
  .ctx-secs.open { display: flex; }
  .ctx-secs a { padding: 13px 16px; font-size: 16px; }
  .p-hero { grid-template-columns: 1fr; }
  .p-art { display: none; }
  .ov, .brief { grid-template-columns: 1fr; gap: 36px; }
  .lanes, .resources { grid-template-columns: repeat(2, 1fr); }
  .lane + .lane::before { display: none; }
  .arch { display: flex; flex-direction: column; }
  .walk { order: -1; grid-template-columns: 1fr; gap: 14px; margin: 0 0 18px; padding: 4px 4px 20px; border-top: 0; border-bottom: 1px solid var(--line); }
  .code { position: static; }
  .brief { padding: 36px; }
}
@media (max-width: 680px) {
  .p-head { padding-top: 96px; }
  .p-nav { margin-top: 32px; }
  .p-sec { padding-top: 72px; }
  .modes, .bgrid, .steps { grid-template-columns: 1fr; }
  .lanes { grid-template-columns: 1fr; }
  .arch { padding: 16px; }
  .bgrid .card { padding: 24px; }
  .brief { padding: 24px 18px; border-radius: var(--r-lg); }
  .next { padding: 26px 22px; border-radius: var(--r-lg); }
  .p-meta small { display: none; }
  .resources { grid-template-columns: 1fr 1fr; gap: 10px; }
  .res { padding: 16px; }
}
