:root {
  --paper: #f4efe3;
  --paper-deep: #ebe3d1;
  --ink: #14201a;
  --muted: #5d655d;
  --line: #c9c0ac;
  --accent: #e4572e;
  --accent-soft: #f4c4b1;
  --green: #25533f;
  --yellow: #f2c14e;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --shadow: 6px 6px 0 var(--ink);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(1100px 620px at 82% -12%, #fff8e8 0%, transparent 62%),
    repeating-linear-gradient(0deg, transparent 0 39px, rgba(20, 32, 26, 0.035) 39px 40px),
    var(--paper);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 50; opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

/* masthead */
.masthead {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: baseline; gap: 24px;
  padding: 22px 4vw 18px; border-bottom: 1px solid var(--ink);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
}
.wordmark { font-weight: 600; font-size: 15px; letter-spacing: 0.08em; text-decoration: none; }
.wordmark span { color: var(--accent); }
.masthead-note { margin: 0; text-align: center; color: var(--muted); white-space: nowrap; }
.masthead-status { margin: 0; text-align: right; color: var(--muted); white-space: nowrap; }
.dot { display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: var(--green); animation: pulse 2.6s infinite; }

/* landing */
.landing-grid {
  display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.55fr);
  gap: 5vw; max-width: 1440px; margin: 0 auto; padding: 8vh 4vw 7vh;
}
.hero { min-width: 0; animation: rise 0.8s cubic-bezier(.2,.7,.2,1) both; }
.kicker, .note-label, .kicker-small {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
  margin: 0 0 26px;
}
h1 {
  font-weight: 500; font-size: clamp(3.2rem, 7.8vw, 7.4rem); line-height: 0.92; letter-spacing: -0.055em;
  margin: 0 0 30px; max-width: 14ch;
}
h1 em { font-weight: 400; color: var(--accent); font-style: italic; margin-right: 0.06em; }
.lede { max-width: 54ch; font-size: clamp(1.05rem, 1.6vw, 1.3rem); line-height: 1.5; color: #2d3a31; margin: 0 0 7vh; }

.resolve-form {
  display: flex; align-items: center; gap: 14px; max-width: 760px;
  border-bottom: 2px solid var(--ink); padding-bottom: 8px;
}
.resolve-form input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font-family: var(--serif); font-size: clamp(1.4rem, 2.6vw, 2.1rem); letter-spacing: -0.02em;
  padding: 8px 0;
}
.resolve-form input::placeholder { color: #9a9588; opacity: 1; }
.resolve-form button, .btn {
  border: 1px solid var(--ink); background: var(--accent); color: #fff8ec;
  font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 13px 18px; box-shadow: 3px 3px 0 var(--ink); transition: transform .14s ease, box-shadow .14s ease;
}
.resolve-form button:hover, .btn:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--ink); }
.resolve-form button:disabled { opacity: .55; transform: none; cursor: wait; }
.btn--ghost { background: var(--paper); color: var(--ink); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: 3px 3px 0 var(--ink); }
.examples { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 16px; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.examples span { letter-spacing: .12em; text-transform: uppercase; margin-right: 4px; }
.examples button {
  border: 1px solid var(--line); background: transparent; padding: 4px 9px; border-radius: 999px;
  font-family: var(--mono); font-size: 11px; color: var(--ink);
}
.examples button:hover { border-color: var(--ink); background: var(--paper-deep); }

.resolution { margin-top: 34px; }
.resolution-card {
  border: 1px solid var(--ink); background: #fbf7ed; padding: 24px 26px; box-shadow: var(--shadow);
  animation: rise .4s ease both;
}
.resolution-top { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.resolution h2 { font-size: 2rem; line-height: 1; margin: 0 0 4px; letter-spacing: -0.03em; }
.resolution .mono { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.badge {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--ink);
  padding: 5px 9px; font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase;
  background: var(--paper); white-space: nowrap;
}
.badge--self_serve_oauth { background: #d9ead9; }
.badge--api_key_only { background: #f6e2b8; }
.badge--approval_gated { background: var(--accent-soft); }
.badge--oidc_only { background: #d8e6ee; }
.badge--unknown { background: #e6e0d4; }
.badge--complete { background: #d9ead9; }
.badge--partial { background: #f8e7b9; }
.badge--failed { background: #f4c4b1; }
.badge--queued, .badge--running { background: #d8e6ee; }
.resolution-actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: 20px; }
.resolution-actions .link { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.candidates { display: grid; gap: 10px; margin-top: 16px; }
.candidate {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; text-align: left;
  border: 1px solid var(--line); background: transparent; padding: 14px 16px;
}
.candidate:hover { border-color: var(--ink); background: var(--paper-deep); }
.candidate strong { font-size: 1.15rem; font-weight: 500; }
.error-box {
  margin-top: 24px; border: 1px solid var(--ink); border-left: 6px solid var(--accent);
  background: #fbe9df; padding: 14px 18px; font-family: var(--mono); font-size: 12px;
}

/* how + side */
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 11vh; border-top: 1px solid var(--line); padding-top: 26px; }
.how-item span { font-family: var(--mono); font-size: 10px; color: var(--accent); letter-spacing: .1em; }
.how-item h2 { font-size: 1.1rem; margin: 8px 0 6px; font-weight: 500; letter-spacing: -0.01em; }
.how-item p { margin: 0; font-size: .88rem; line-height: 1.5; color: var(--muted); }
.side-notes { display: flex; flex-direction: column; gap: 18px; padding-top: 42px; animation: rise .9s .12s cubic-bezier(.2,.7,.2,1) both; }
.note-card { border: 1px solid var(--ink); background: #fbf7ed; padding: 20px 20px 22px; }
.note-card .note-label { margin-bottom: 14px; }
.note-card ol { margin: 0; padding-left: 20px; font-size: .93rem; line-height: 1.75; }
.note-card--dark { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.note-card--dark .note-label, .note-card--dark .note-small { color: #b8c2b8; }
.big-quote { font-size: clamp(1.9rem, 3vw, 2.7rem); line-height: 1; letter-spacing: -.04em; margin: 4px 0 16px; color: var(--yellow); }
.note-small { font-family: var(--mono); font-size: 10px; line-height: 1.5; margin: 0; }
.note-card--plain p { margin: 0; font-size: .9rem; line-height: 1.55; color: #38443b; }
.colophon {
  display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  border-top: 1px solid var(--ink); padding: 18px 4vw 24px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}

/* result */
.result-shell { max-width: 1280px; margin: 0 auto; padding: 0 4vw 8vh; }
.result-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
  border-bottom: 1px solid var(--ink); padding: 18px 0 14px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
}
.result-bar a { text-decoration: none; color: var(--muted); }
.result-bar a:hover { color: var(--ink); }
.result-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 30px; align-items: end; padding: 6vh 0 4vh; }
.result-hero h1 { font-size: clamp(3rem, 7vw, 6.4rem); margin: 0 0 10px; max-width: 16ch; }
.result-hero .lede { margin: 0; max-width: 62ch; }
.result-metrics { display: flex; gap: 18px; flex-wrap: wrap; justify-content: flex-end; }
.metric { border-left: 1px solid var(--line); padding-left: 14px; min-width: 92px; }
.metric .n { display: block; font-size: 1.6rem; line-height: 1; letter-spacing: -.03em; }
.metric .l { font-family: var(--mono); font-size: 9px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.warning-banner {
  border: 1px solid var(--ink); background: #f8e7b9; padding: 12px 16px; margin: 0 0 26px;
  font-family: var(--mono); font-size: 11px; line-height: 1.6;
}
.guide-tabs {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 4px;
  border-bottom: 1px solid var(--ink); background: var(--paper); padding-top: 8px;
}
.tab {
  border: 1px solid transparent; border-bottom: 0; background: transparent; padding: 12px 16px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}
.tab[aria-selected="true"] { color: var(--ink); border-color: var(--ink); background: #fbf7ed; }
.tab:hover { color: var(--ink); }
.tab-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; padding-right: 2px; }
.tab-actions .btn { padding: 8px 12px; font-size: 10px; box-shadow: 2px 2px 0 var(--ink); }
.panel { padding: 34px 0 20px; }
.panel[hidden] { display: none; }
.prose { max-width: 78ch; }
.prose h1 { font-size: 2.6rem; margin: 0 0 18px; letter-spacing: -.04em; }
.prose h2 { font-size: 1.65rem; margin: 42px 0 14px; letter-spacing: -.03em; }
.prose h3 { font-size: 1.12rem; margin: 26px 0 8px; font-weight: 500; }
.prose p, .prose li { font-size: 1rem; line-height: 1.7; }
.prose table { width: 100%; border-collapse: collapse; margin: 16px 0 24px; font-family: var(--mono); font-size: 11px; line-height: 1.5; }
.prose th, .prose td { border: 1px solid var(--line); padding: 9px 10px; text-align: left; vertical-align: top; }
.prose th { background: var(--paper-deep); text-transform: uppercase; letter-spacing: .06em; font-size: 10px; }
.prose code { font-family: var(--mono); font-size: .82em; background: #e7dfcd; padding: 1px 5px; }
.prose pre { background: var(--ink); color: #f6f0e2; padding: 16px 18px; overflow: auto; font-family: var(--mono); font-size: 12px; line-height: 1.6; border-left: 4px solid var(--accent); }
.prose pre code { background: transparent; padding: 0; color: inherit; }
.prose blockquote { border-left: 3px solid var(--accent); margin: 20px 0; padding-left: 16px; color: #3d493f; }
.prose a { color: var(--green); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 36px 0 18px; }
.agent-view { margin: 0; background: var(--ink); color: #efe8d8; border: 1px solid var(--ink); padding: 22px; overflow: auto; max-height: 72vh; font-family: var(--mono); font-size: 12px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; }
.progress-card { border: 1px solid var(--ink); background: #fbf7ed; padding: 26px; box-shadow: var(--shadow); margin: 5vh 0; }
.progress-head { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.progress-track { height: 10px; border: 1px solid var(--ink); margin: 18px 0; background: var(--paper); }
.progress-fill { height: 100%; width: 2%; background: var(--accent); transition: width .5s ease; }
.progress-stage { font-size: 1.7rem; letter-spacing: -.03em; margin: 0 0 6px; }
.progress-note { font-family: var(--mono); font-size: 11px; color: var(--muted); margin: 0; }
.failed-card { border: 1px solid var(--ink); border-left: 6px solid var(--accent); background: #fbe9df; padding: 22px; margin: 5vh 0; }
.failed-card h2 { margin: 0 0 6px; font-size: 1.6rem; }
.empty-result { font-family: var(--mono); font-size: 12px; color: var(--muted); padding: 20px 0; }

@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%,100% { opacity: .35; } 50% { opacity: 1; } }

@media (max-width: 900px) {
  .masthead { grid-template-columns: 1fr auto; }
  .masthead-note { display: none; }
  .landing-grid { grid-template-columns: 1fr; padding-top: 6vh; }
  .side-notes { padding-top: 0; display: grid; grid-template-columns: 1fr 1fr; }
  .note-card--plain { grid-column: 1 / -1; }
  .how { grid-template-columns: 1fr; gap: 16px; }
  .result-hero { grid-template-columns: 1fr; }
  .result-metrics { justify-content: flex-start; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .prose table { display: block; width: 100%; overflow-x: auto; }
  .prose pre { white-space: pre-wrap; word-break: break-word; }
  .resolve-form { flex-direction: column; align-items: stretch; gap: 10px; }
  .resolve-form button { width: 100%; }
  .resolution-top { flex-direction: column; }
  .side-notes { grid-template-columns: 1fr; }
  .tab { padding: 10px 9px; font-size: 10px; }
  .tab-actions { display: none; }
  .result-hero h1 { font-size: 2.8rem; }
}
