/* Security: how a request is checked, what you can set, and where the
   originals go. */

.sec-hero { --hero-copy: 470px; }
.sec-hero:lang(en) { --hero-copy: 530px; }
.sec-hero .hero-copy { position: relative; z-index: 3; padding-top: 170px; }
.sec-hero h1 { max-width: 660px; }
.sec-hero .stage { position: absolute; inset: 0; }
/* The office works below; its requests rise to the shield, and now and then
   one stops short. */
.sec-hero .crew { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; }
.sec-hero .threads { z-index: 2; }
.core { position: absolute; z-index: 3; left: 66.7%; top: max(84px, calc(50% - 300px)); width: 300px; height: 340px; display: grid; place-items: center; }
.core::before { content: ""; position: absolute; inset: -60px; background: radial-gradient(closest-side, rgba(32, 187, 199, 0.2), transparent); animation: breathe 6s ease-in-out infinite; }
.is-paused .core::before { animation-play-state: paused; }
@keyframes breathe { 0%, 100% { opacity: 0.75; transform: scale(0.96); } 50% { opacity: 1; transform: scale(1.04); } }
.core > span { position: relative; }

/* One request from Claude Code to the model and back, and the four steps
   below it light up as it goes. */
.relay { margin: 44px 0 0; border-radius: 20px; overflow: hidden; border: 1px solid var(--line); background: #fff; box-shadow: 0 24px 60px rgba(60, 50, 20, 0.06); }
.relay-stage { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); padding: 52px 0 26px; }
.relay-stage::before { content: ""; position: absolute; left: 16.67%; right: 16.67%; top: 100px; border-top: 2px dashed var(--rule); }
.relay .local { position: absolute; left: 14px; right: calc(33.33% + 14px); top: 14px; bottom: 14px; border: 1px dashed var(--rule); border-radius: 14px; padding: 8px 12px; font: 12.5px var(--mono); color: #8a7a52; }
.actor { position: relative; display: grid; justify-items: center; gap: 10px; }
.actor .icon { position: relative; width: 96px; height: 96px; display: grid; place-items: center; border-radius: 14px; background: #131a24; border: 2px solid #232d3d; transition: border-color 0.3s ease, box-shadow 0.3s ease; }
.actor b { font-size: 14px; font-weight: 600; color: var(--ink); }
.agent .icon { background: #1b2331 url(./crew/sprite-claude-code.webp) -77px -92px / 240px 220px no-repeat; image-rendering: pixelated; }
.model .icon img { width: 40px; height: 40px; }
.gate.is-checking .icon { border-color: var(--yellow); box-shadow: 0 0 0 6px rgba(246, 195, 68, 0.14); }
.model.is-hit .icon, .agent.is-hit .icon { border-color: var(--teal); box-shadow: 0 0 0 6px rgba(32, 187, 199, 0.14); }
.packet { position: absolute; left: 83.33%; top: 93px; width: 16px; height: 16px; margin-left: -8px; background: var(--teal); box-shadow: 0 0 0 4px rgba(32, 187, 199, 0.2); }
.relay.is-live .packet { left: 0; transition: transform 0.9s cubic-bezier(0.45, 0, 0.2, 1), background-color 0.3s ease, box-shadow 0.3s ease; }
.packet.is-secret { background: #ff6b80; box-shadow: 0 0 0 4px rgba(255, 107, 128, 0.2); }
.packet.is-restored { background: #5fd49a; box-shadow: 0 0 0 4px rgba(95, 212, 154, 0.2); }
.relay-card { padding: 20px 28px 24px; border-top: 1px solid var(--line); background: #fcfaf5; min-height: 104px; }
.relay-label span { display: none; font: 12.5px var(--mono); color: #8a7a52; }
.relay-label span.on { display: inline; }
.relay-card p { margin-top: 8px; font-size: 16px; color: var(--ink); }
.relay-card code { font-size: 14.5px; }

.steps { position: relative; margin-top: 40px; display: grid; grid-template-columns: repeat(4, 1fr); }
.step { position: relative; padding: 26px 32px 0 0; border-top: 1px solid var(--rule); }
.step::before { content: ""; position: absolute; top: -5px; left: 0; width: 9px; height: 9px; background: var(--teal); transition: background-color 0.3s ease, transform 0.3s ease; }
.step .n { font-family: var(--mono); font-size: 13px; color: #8a7a52; transition: color 0.3s ease; }
.step b { display: block; margin-top: 6px; font-size: 19px; }
.step p { margin-top: 8px; font-size: 14.5px; }
.step.is-active::before { background: var(--yellow); transform: scale(1.35); }
.step.is-active .n { color: var(--ink); }

/* What it recognizes. */
.kinds-wrap { background: var(--bg-2); }
.kinds { margin-top: 44px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.kind { padding: 18px 20px; }
.kind b { font-size: 15.5px; }
.kind .ex { margin-top: 10px; display: grid; gap: 6px; font-size: 15px; }
.kind .ex span { justify-self: start; }
.kind .by { margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.kind .stand.is-turning { background: #fde8eb; color: #c2364f; }
.kinds-wrap .textlink { margin-top: 32px; }

/* What you can set. */
.policy-grid { display: grid; grid-template-columns: 1fr 640px; gap: 60px; align-items: start; }
/* Pick how API keys are handled; the same request below follows along. */
.modes { margin-top: 28px; display: grid; gap: 4px; }
.mode { display: grid; grid-template-columns: 70px 1fr; gap: 10px; align-items: baseline; width: 100%; padding: 10px 14px; margin-left: -14px; border: 1px solid transparent; border-radius: 12px; background: none; text-align: left; cursor: pointer; transition: background-color 0.2s ease, border-color 0.2s ease; }
.mode:hover { background: rgba(255, 255, 255, 0.6); }
.mode[aria-pressed="true"] { background: #fff; border-color: var(--line); box-shadow: 0 6px 18px rgba(60, 50, 20, 0.06); }
.verdict { margin-top: 20px; display: grid; gap: 12px; padding: 16px 18px; border-radius: 14px; border: 1px solid var(--line); background: #fcfaf5; }
.v-row small { font: 12px var(--mono); color: #8a7a52; }
.v-row p { margin-top: 2px; font-size: 14.5px; color: var(--ink); }
.v-row code { font-size: 13px; color: #c2364f; }
.v-row em { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-style: normal; font-size: 13px; font-weight: 600; }
.v-row em::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.v-row em.warned { color: #a6700c; }
.v-row em.blocked { color: #c2364f; }
.v-row em.trusted { color: #35577a; }
.sel.is-flash, .panel-foot .row.is-lit { animation: flash 0.9s ease; }
.panel-foot .row.is-lit { color: var(--ink); }
@keyframes flash { 0% { background-color: rgba(246, 195, 68, 0.45); } 100% { background-color: transparent; } }
.mode .pill { justify-self: start; }
.mode p { font-size: 14.5px; }
:lang(en) .mode { grid-template-columns: 84px 1fr; }
.panel { margin: 0; border-radius: 20px; overflow: hidden; border: 1px solid var(--line); background: #fff; box-shadow: 0 30px 80px rgba(60, 50, 20, 0.06); }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 16px 22px; border-bottom: 1px solid var(--line); font-weight: 600; }
.tabs { display: flex; gap: 2px; padding: 3px; background: var(--bg-2); border-radius: 9px; font-size: 13px; font-weight: 500; margin-left: auto; }
.tabs span { padding: 4px 12px; border-radius: 7px; color: var(--muted); }
.tabs .on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
.panel table { width: 100%; border-collapse: collapse; font-size: 14px; }
.panel th { text-align: left; font-weight: 500; font-size: 12.5px; color: var(--muted); padding: 10px 22px; background: #fcfaf5; border-bottom: 1px solid var(--line); }
.panel td { padding: 12px 22px; border-bottom: 1px solid var(--line); }
.sel { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; white-space: nowrap; }
.sel::after { content: "⌄"; color: var(--muted); margin-left: 4px; }
.sel.block { color: #c2364f; }
.sel.warn { color: #a6700c; }
.panel td small { color: var(--muted); font-size: 12px; margin-left: 6px; }
.badge { font-size: 11px; padding: 1px 6px; border-radius: 5px; background: #ddf5f6; color: var(--teal-ink); margin-left: 6px; white-space: nowrap; }
.panel-foot { padding: 16px 22px; display: grid; gap: 12px; font-size: 13.5px; color: var(--muted); }
.panel-foot .row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.panel-foot code { font-size: 12.5px; padding: 2px 8px; border-radius: 6px; background: var(--bg-2); color: var(--ink); }
.panel-foot b { color: var(--ink); }
.toggle { width: 34px; height: 20px; border-radius: 10px; background: var(--teal); position: relative; display: inline-block; flex: none; }
.toggle::after { content: ""; position: absolute; right: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; }

/* The vault and the approval dialog, a light macOS window on the paper. */
.vault { background: var(--bg-2); }
.vault-grid { display: grid; grid-template-columns: 540px 1fr; gap: 80px; align-items: center; }
.dialog { margin: 0; border-radius: 16px; background: #fff; border: 1px solid rgba(24, 32, 58, 0.08); box-shadow: 0 30px 70px rgba(60, 50, 20, 0.12), 0 2px 6px rgba(60, 50, 20, 0.05); color: var(--ink); overflow: hidden; }
.dialog .titlebar { display: flex; gap: 8px; padding: 12px 14px; background: #f6f3ec; border-bottom: 1px solid var(--line); }
.dialog .titlebar i { width: 12px; height: 12px; border-radius: 50%; background: #ff5f57; }
.dialog .titlebar i:nth-child(2) { background: #febc2e; }
.dialog .titlebar i:nth-child(3) { background: #28c840; }
.dialog .body { padding: 22px 26px 24px; }
.dialog .head { display: flex; gap: 14px; align-items: center; }
.dialog .ava { width: 52px; height: 52px; border-radius: 12px; flex: none; background: #131a24 url(./crew/sprite-claude-code.webp) 50% 68% / 104px auto no-repeat; image-rendering: pixelated; }
.dialog h3 { font-size: 18px; }
.dialog p { font-size: 14px; margin-top: 4px; }
.dialog .reqline { margin-top: 18px; padding: 12px 14px; border-radius: 10px; background: #f6f3ec; font-size: 13px; color: var(--muted); font-family: var(--mono); }
.dialog .opts { margin-top: 16px; display: grid; gap: 8px; font-size: 14px; }
.dialog .opt { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); }
.dialog .opt.on { border-color: #0a84ff; background: rgba(10, 132, 255, 0.06); }
.dialog .opt i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #b5ae9c; flex: none; }
.dialog .opt.on i { border: 4px solid #0a84ff; }
.dialog .acts { position: relative; margin-top: 20px; display: flex; gap: 10px; justify-content: flex-end; min-height: 36px; }
.dialog .acts > span { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 9px; font-size: 14px; font-weight: 600; background: #ece8de; transition: transform 0.15s ease, filter 0.15s ease, opacity 0.3s ease; }
.dialog .acts .go { position: relative; background: #0a84ff; color: #fff; }
.dialog .acts .go svg { width: 16px; height: 16px; }
.dialog .acts .go::after { content: ""; position: absolute; inset: -4px; border-radius: 12px; border: 2px solid rgba(10, 132, 255, 0.6); opacity: 0; }
.dialog .done { position: absolute; right: 0; top: 0; bottom: 0; display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: #187a46; opacity: 0; transform: translateY(4px); transition: opacity 0.35s ease, transform 0.35s ease; }
.dialog .done::before { content: "✓"; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: rgba(31, 138, 82, 0.12); font-size: 13px; }
.dialog.is-pressing .go { transform: scale(0.96); filter: brightness(1.15); }
.dialog.is-pressing .go::after { animation: press 1.1s ease-out; }
@keyframes press { from { opacity: 1; transform: scale(0.9); } to { opacity: 0; transform: scale(1.25); } }
.dialog.is-approved .acts > span { opacity: 0; transform: none; }
.dialog.is-approved .done { opacity: 1; transform: none; }
.vault-list { margin-top: 32px; gap: 22px; }

/* Records. */
.audit-grid { margin-top: 44px; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; padding: 22px; }
.kpi small { font-size: 12.5px; color: var(--muted); }
.kpi b { display: block; font-size: 26px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi span { font-size: 12px; color: var(--muted); }
.chart { padding: 0 22px 22px; }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 130px; padding-top: 10px; border-bottom: 1px solid var(--line); }
.bars div { flex: 1; display: flex; gap: 3px; align-items: flex-end; height: 100%; }
.bars i { flex: 1; border-radius: 4px 4px 0 0; transform-origin: bottom; transition: transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) calc(var(--i, 0) * 70ms); }
.bars i.r { background: #20bbc7; }
.bars i.s { background: #c9d3dc; }
.chart.is-waiting .bars i { transform: scaleY(0); }
.axis { display: flex; gap: 10px; font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.axis span { flex: 1; text-align: center; }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--muted); margin-top: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.reqs { display: grid; }
.req { display: grid; grid-template-columns: 54px 1fr auto; gap: 14px; align-items: center; padding: 14px 22px; border-bottom: 1px solid var(--line); }
.req:last-child { border-bottom: 0; }
.req .t { font-size: 12px; color: var(--muted); font-family: var(--mono); }
.req b { font-size: 14px; }
.req p { font-size: 13px; margin-top: 2px; }

/* The playground. */
.try { background: var(--bg-2); }
.pick { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 4px 22px; }
.pick button { padding: 4px 0; border: 0; border-bottom: 2px solid transparent; background: none; font-size: 14.5px; font-weight: 600; color: var(--muted); cursor: pointer; }
.pick button:hover { color: var(--ink); }
.pick button[aria-pressed="true"] { color: var(--ink); border-color: var(--yellow); }
.try-grid { margin-top: 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.box { padding: 22px 24px; font-size: 15px; line-height: 2; min-width: 0; }
.box .lbl { font-size: 12.5px; line-height: 1.6; color: var(--muted); margin-bottom: 8px; display: flex; justify-content: space-between; gap: 12px; }
/* The text you type sits over a copy of itself that carries the marks; the
   copy sets the height, so the box grows with the text. */
.editor { position: relative; }
.editor textarea, .editor .marks { margin: 0; padding: 0; border: 0; width: 100%; font: inherit; line-height: 2; letter-spacing: normal; white-space: pre-wrap; overflow-wrap: anywhere; word-break: normal; tab-size: 4; }
.editor .marks { min-height: 6em; color: transparent; pointer-events: none; }
.editor textarea { position: absolute; inset: 0; z-index: 1; display: block; height: 100%; resize: none; overflow: hidden; background: transparent; color: var(--ink); caret-color: var(--ink); outline: none; }
.has-marks .editor textarea { color: transparent; }
.has-marks .editor .marks { color: var(--ink); }
.box:focus-within { border-color: #b7ae98; box-shadow: 0 0 0 3px rgba(32, 187, 199, 0.18); }
.marks mark { color: inherit; border-radius: 3px; }
.hit { background: #fde8eb; border-bottom: 2px solid #e5485f; }
.ign { background: none; border-bottom: 2px dashed #a6a08f; }
.try-out { display: block; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); }
.try-out .stand { display: inline-block; line-height: 1.6; font-size: 14px; }
/* A new sample: each mark fills in from the left, then its placeholder
   rises into place on the right. */
.hit { background: linear-gradient(#fde8eb, #fde8eb) 0 0 / 100% 100% no-repeat; }
.is-fresh .marks .hit { animation: mark-in 0.45s ease-out both; animation-delay: calc(var(--n, 0) * 160ms); }
.is-fresh .try-out .stand { animation: stand-in 0.4s ease-out both; animation-delay: calc(var(--n, 0) * 160ms + 320ms); }
@keyframes mark-in { from { background-size: 0 100%; } }
@keyframes stand-in { from { opacity: 0; transform: translateY(6px); } }
.try-foot { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 13.5px; color: var(--muted); }
.try-foot b { color: var(--ink); }
.try-foot .why { display: contents; }
.try-reset { margin-left: auto; padding: 0; border: 0; background: none; font-size: 13.5px; font-weight: 600; color: var(--teal-ink); cursor: pointer; }
.try-reset:hover { color: var(--ink); }
.try-reset[hidden] { display: none; }
.try-note { margin-top: 10px; font-size: 13px; }

.bounds { margin-top: 40px; grid-template-columns: repeat(3, 1fr); }

@media (max-width: 1180px) {
  .policy-grid { grid-template-columns: 1fr; gap: 40px; }
  .vault-grid { grid-template-columns: 1fr 1fr; gap: 48px; }
}
@media (max-width: 1080px) {
  .kinds { grid-template-columns: repeat(2, 1fr); }
  .audit-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .sec-hero { padding-bottom: 430px; }
  .sec-hero .hero-copy { padding-top: 120px; }
  .core { left: 50%; top: auto; bottom: 196px; margin-left: -150px; height: 250px; }
  .relay-stage::before { top: 86px; }
  .actor .icon { width: 72px; height: 72px; }
  .agent .icon { background-position: -89px -106px; }
  .gate .icon > span { transform: scale(0.75); }
  .packet { top: 79px; }
  .steps { grid-template-columns: repeat(2, 1fr); row-gap: 40px; }
  .try-grid, .vault-grid { grid-template-columns: 1fr; }
  .dialog { max-width: 540px; }
  .bounds { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .sec-hero { padding-bottom: 400px; }
  .sec-hero .hero-copy { padding-top: 104px; }
  .core { transform: scale(0.8); transform-origin: bottom center; }
  .relay .local { right: 33.33%; }
  .relay-stage { padding-top: 46px; }
  .actor b { font-size: 12.5px; }
  .relay-card { padding: 16px 18px 20px; }
  .relay-card p { font-size: 15px; }
  .steps { grid-template-columns: 1fr; row-gap: 32px; }
  .step { padding-right: 0; }
  .panel td small { display: block; margin: 2px 0 0; }
  .kinds { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .req { grid-template-columns: 1fr auto; }
  .req .t { display: none; }
  .panel td, .panel th { padding-left: 14px; padding-right: 14px; }
  .panel-head { flex-wrap: wrap; }
  .dialog .body { padding: 18px; }
  .dialog .acts > span { padding: 8px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .core::before { animation: none; }
  .packet, .bars i, .mode, .dialog .acts > span, .dialog .done, .step::before { transition: none; }
}
