:root {
  --bg: #0c0d0f;
  --bg-elev: #14161a;
  --bg-elev-2: #1c1f26;
  --line: #2a2e37;
  --text: #f0ebe1;
  --muted: #9a9386;
  --accent: #d7a35c;
  --accent-dim: #8a6a38;
  --ok: #8eb69b;
  --danger: #d36c6c;
  --sans: "Segoe UI", "Helvetica Neue", sans-serif;
  --mono: "IBM Plex Mono", "ui-monospace", "SFMono-Regular", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(1200px 600px at 10% -10%, #1a1712 0%, var(--bg) 55%);
  color: var(--text);
  font: 16px/1.5 var(--sans);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre { font-family: var(--mono); font-size: 0.92em; }

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--line);
  background: rgba(12, 13, 15, 0.85);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 2;
}
.brand {
  color: var(--text);
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
}
.brand span { color: var(--accent); }
.top nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.top nav a[aria-current="page"] { color: var(--text); }
.who { color: var(--muted); font-size: 0.9rem; }

main { flex: 1; width: min(1080px, calc(100% - 2rem)); margin: 0 auto; padding: 2.5rem 0 4rem; }
footer {
  border-top: 1px solid var(--line);
  padding: 1rem 1.5rem 1.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0.3rem 0 1rem;
  max-width: 14ch;
}
.eyebrow {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
  margin: 0;
}
.lede { max-width: 46rem; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin-top: 1.5rem; }
.hint { color: var(--muted); font-size: 0.9rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #1a1208;
  border: 0;
  border-radius: 999px;
  padding: 0.55rem 1.05rem;
  font-weight: 650;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { filter: brightness(1.06); text-decoration: none; }
.btn.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}
.linkish {
  background: none;
  border: 0;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  padding: 0;
}
.linkish.danger { color: var(--danger); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 3rem 0;
}
.grid article {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.1rem 1.2rem;
}
.grid h2 { margin: 0 0 0.4rem; font-size: 1.05rem; }
.grid p { margin: 0; color: var(--muted); }

.codeblock {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.codeblock header {
  display: flex;
  justify-content: space-between;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}
.codeblock pre, .result {
  margin: 0;
  padding: 1rem 1.1rem 1.2rem;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.pagehead {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-end;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.pagehead h1 { margin: 0 0 0.3rem; }
.pagehead p { margin: 0; color: var(--muted); }
.create-key { display: flex; gap: 0.5rem; }

input, textarea, select, button {
  font: inherit;
}
input, textarea, select {
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
}
textarea { width: 100%; resize: vertical; }

.flash {
  background: #1c241c;
  border: 1px solid var(--ok);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1.25rem;
}
.secret {
  display: block;
  background: var(--bg);
  padding: 0.7rem 0.8rem;
  border-radius: 8px;
  margin: 0.6rem 0;
  overflow-wrap: anywhere;
}

table.keys {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
table.keys th, table.keys td {
  text-align: left;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}
table.keys th { color: var(--muted); font-weight: 550; }
table.keys tr.revoked td { color: var(--muted); }
.empty { color: var(--muted); }
.pill {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.play {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}
.play-form {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
}
.play-form label { display: flex; flex-direction: column; gap: 0.35rem; color: var(--muted); font-size: 0.9rem; }
.result {
  min-height: 28rem;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 14px;
}

@media (max-width: 860px) {
  .play { grid-template-columns: 1fr; }
  .hero h1 { max-width: none; }
}
