:root {
  color-scheme: dark;
  --bg: #0b0d10;
  --text: #e8eaed;
  --muted: #9aa3b2;
  --line: #1d2229;
  --panel: #12161c;
  --orange: #f97316;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
}

main {
  max-width: 76rem;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

.page-head,
.concept,
.integrate,
.dev {
  max-width: 40rem;
}

h1,
h2 {
  font-weight: 650;
  line-height: 1.2;
}

h1 {
  margin: 0 0 0.7rem;
  font-size: clamp(1.9rem, 4vw, 2.4rem);
  letter-spacing: -0.02em;
}

.eyebrow {
  margin: 0 0 0.7rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.5;
}

.eyebrow a {
  color: inherit;
  text-decoration: none;
}

.lede {
  margin: 0 0 1.35rem;
  max-width: 36rem;
  font-size: 1.08rem;
  line-height: 1.55;
  color: #d5dbe3;
}

.pcoc-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 3rem;
  margin: 0;
  padding: 0.7rem 1.15rem;
  border: 1px solid #e09858;
  border-radius: 8px;
  background: #f3e4d4;
  color: #3a2718;
  font: 650 1rem/1.2 ui-sans-serif, system-ui, sans-serif;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.pcoc-button svg {
  width: 1.05rem;
  height: 1.05rem;
  display: block;
  flex: none;
}

.pcoc-button:hover {
  background: #f8eee4;
  border-color: #efb27a;
}

.pcoc-button:focus-visible {
  outline: 2px solid #f97316;
  outline-offset: 3px;
}

.pcoc-button:active,
.pcoc-button[aria-pressed="true"] {
  background: #e8d2ba;
  border-color: #c9843e;
  transform: translateY(1px);
}

.pcoc-button[aria-busy="true"] {
  cursor: progress;
  opacity: 0.85;
}

.visitor-status {
  margin: 1.15rem 0 0;
  min-height: 2.6rem;
  font-size: 1.45rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.visitor-status[data-kind="accept"] {
  color: #9ddeb4;
}

.visitor-status[data-kind="deny"] {
  color: #ffb15a;
}

.visitor-status[data-kind="checking"] #visitor-title::before {
  content: "";
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  margin-right: 0.45rem;
  border-radius: 50%;
  background: var(--orange);
  vertical-align: 0.12rem;
  animation: code-pulse 1s ease-in-out infinite;
}

#visitor-reason {
  display: block;
  max-width: 36rem;
  margin-top: 0.4rem;
  color: #d5dbe3;
  font-size: 1.02rem;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.45;
}

#visitor-reason[hidden] {
  display: none;
}

.concept {
  margin: 2.4rem 0 0;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
}

.concept h2 {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.5;
}

.concept p {
  margin: 0;
  max-width: 38rem;
  color: #d5dbe3;
  font-size: 1.02rem;
  line-height: 1.6;
}

.concept p + p {
  margin-top: 0.8rem;
}

.integrate {
  margin: 2.4rem 0 0;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
}

.integrate h2 {
  margin: 0 0 0.7rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.5;
}

.integrate ul {
  margin: 0 0 0.9rem;
  padding-left: 1.15rem;
  max-width: 38rem;
}

.integrate li {
  margin: 0.35rem 0;
}

.integrate a {
  color: inherit;
}

dialog {
  width: min(32rem, calc(100vw - 1.5rem));
  max-height: calc(100vh - 1.5rem);
  margin: auto;
  padding: 1.15rem 1.2rem 1.3rem;
  border: 0;
  border-radius: 16px;
  background: #fff;
  color: #1c1915;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.45);
}

dialog::backdrop {
  background: rgba(6, 8, 12, 0.68);
}

.dialog-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.85rem;
}

.dialog-bar h2 {
  margin: 0.15rem 0 0;
  font-size: 1.15rem;
}

.dialog-close {
  flex: 0 0 auto;
  margin: 0;
  padding: 0.35rem 0.7rem;
  border: 1px solid #d9d3cb;
  border-radius: 8px;
  background: #fff;
  color: #1c1915;
  font: 650 0.92rem/1.2 ui-sans-serif, system-ui, sans-serif;
  cursor: pointer;
}

.dialog-close:hover {
  background: #f6f3ee;
}

.steps {
  margin: 0 0 0.9rem;
  padding-left: 1.25rem;
  font-size: 0.98rem;
  line-height: 1.4;
}

.steps li {
  margin: 0.4rem 0;
}

.dialog-hash {
  margin: 0 0 0.85rem;
}

.dialog-hash label {
  margin-top: 0;
  color: #1c1915;
}

.hash-note {
  min-height: 1.2em;
  margin: 0.35rem 0 0;
  color: #6b6258;
  font-size: 0.88rem;
}

.visitor-status[data-kind="result"] {
  color: #ffb15a;
}

#qr {
  display: flex;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  min-height: 8rem;
  margin: 0 0 0.85rem;
  padding: 0.7rem;
  background: #fff;
  border-radius: 12px;
  line-height: 0;
}
#qr[hidden],
#sign-in-code[hidden],
#sign-in-steps[hidden] {
  display: none;
}
.sign-in-steps {
  margin: 0.2rem 0 0.85rem;
  padding-left: 1.2rem;
}
.sign-in-steps li[data-state="now"] { font-weight: 650; }
.sign-in-steps li[data-state="wait"] { opacity: 0.55; }

#qr:empty {
  min-height: 0;
}

#qr svg {
  width: min(100%, 16rem);
  height: auto;
  display: block;
}

#sign-in-code {
  margin: 0 0 0.85rem;
}

#sign-in-code[hidden] {
  display: none;
}

.sign-in-panel {
  margin: 0.2rem 0 0;
  max-width: 36rem;
}

.sign-in-payload {
  margin: 0;
  color: #d5dbe3;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.4;
  word-break: break-all;
  overflow-wrap: anywhere;
}

.copy-code-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.7rem;
  margin: 0.55rem 0 0;
}

#copy-code,
#new-code {
  display: inline-flex;
  align-items: center;
  min-height: 2.2rem;
  margin: 0;
  padding: 0.4rem 0.75rem;
  border: 1px solid #4a5568;
  border-radius: 6px;
  background: #1a1f27;
  color: #e8eaed;
  font: 600 0.95rem/1.2 ui-sans-serif, system-ui, sans-serif;
  cursor: pointer;
}

#copy-code:hover,
#new-code:hover {
  border-color: #6b7c99;
}

#copy-code:focus-visible,
#new-code:focus-visible {
  outline: 2px solid #e8eaed;
  outline-offset: 3px;
}

#copy-code-note {
  min-height: 1.2em;
  color: #1f7a45;
  font-size: 0.92rem;
  font-weight: 650;
}

#dialog-status {
  margin: 0;
  color: #4b453c;
  font-size: 0.95rem;
}

#dialog-status.is-loading::before {
  content: "";
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  margin-right: 0.45rem;
  border-radius: 50%;
  background: var(--orange);
  vertical-align: 0.05rem;
  animation: code-pulse 1s ease-in-out infinite;
}

@keyframes code-pulse {
  50% { opacity: 0.35; }
}

@media (prefers-reduced-motion: reduce) {
  #dialog-status.is-loading::before,
  .visitor-status[data-kind="checking"] #visitor-title::before { animation: none; }
}

.dev {
  margin-top: 2.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.dev summary {
  width: fit-content;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}

.dev summary:hover {
  color: var(--text);
}

.dev-body {
  margin-top: 1rem;
}

.dev-body > p,
.panel p {
  margin: 0.35rem 0 0.7rem;
  color: #d5dbe3;
  font-size: 0.95rem;
  line-height: 1.5;
}

.panel {
  margin: 0 0 0.9rem;
  padding: 0.9rem 1rem 1rem;
  border: 1px solid #2a3140;
  border-radius: 10px;
  background: var(--panel);
}

.panel h2 {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
}

.panel-result {
  background: #14120b;
}

.fine,
.status,
#session,
#progress,
label {
  font-size: 0.88rem;
}

.fine,
.status,
#session {
  color: var(--muted);
}

.hash,
pre,
code,
textarea,
input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.hash,
pre {
  word-break: break-all;
  white-space: pre-wrap;
}

.hash {
  margin: 0.55rem 0 0.2rem;
  font-size: 0.82rem;
  color: var(--text);
}

#header-height {
  margin-top: 0;
  color: var(--muted);
}

#progress {
  margin: 0.2rem 0 0;
  padding-left: 1.15rem;
  color: #d5dbe3;
}

#progress li {
  margin: 0.25rem 0;
}

label {
  display: block;
  margin-top: 0.85rem;
  font-weight: 700;
}

textarea,
input[type="text"],
input:not([type]),
input[type="file"] {
  width: 100%;
  margin-top: 0.3rem;
}

textarea,
input:not([type="file"]) {
  padding: 0.55rem 0.6rem;
  border: 1px solid #3a4558;
  border-radius: 8px;
  background: #0b0d10;
  color: var(--text);
  font-size: 0.95rem;
}

.dev-submit {
  margin-top: 0.9rem;
  min-height: 2.6rem;
  padding: 0.5rem 0.95rem;
  border: 0;
  border-radius: 8px;
  background: #e8eaed;
  color: #14120b;
  font: 700 0.95rem/1.2 ui-sans-serif, system-ui, sans-serif;
  cursor: pointer;
}

.dev-submit:hover {
  background: #fff;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
}

#session {
  margin-bottom: 0.3rem;
}

#decision {
  margin: 0.2rem 0 0.6rem;
  font-size: 1.25rem;
  font-weight: 800;
}

#decision[data-kind="accept"] {
  color: #b7e3c4;
}

#decision[data-kind="deny"] {
  color: #ffbf3c;
}

#decision[data-kind="provisional"] {
  color: #f0d7b0;
}

#result {
  margin: 0;
  min-height: 2.5rem;
  font-size: 0.82rem;
  color: #fffdf8;
}

.noscript {
  max-width: 40rem;
  margin: 0 auto 2rem;
  padding: 0 1.25rem;
}

a {
  color: inherit;
}

code {
  font-size: 0.9em;
}
