:root {
  --bg: #07070b;
  --bg-soft: #10111a;
  --surface: #171926;
  --text: #f7f8ff;
  --muted: #b4bbcf;
  --border: rgba(255, 255, 255, 0.16);
  --accent: #ad9bff;
  --accent-strong: #8e79ff;
  --success: #49d68e;
  --danger: #ff6688;
  --warning: #ffd77c;
  --demo-max-width: 960px;
  --page-pad-y: 24px;
  --page-pad-x: 30px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 12%, rgba(173, 155, 255, 0.2), transparent 35%),
    radial-gradient(circle at 78% 18%, rgba(142, 121, 255, 0.16), transparent 32%),
    linear-gradient(180deg, #09090d 0%, #06060a 100%);
  display: block;
  padding: var(--page-pad-y) var(--page-pad-x);
  position: relative;
  overflow: hidden;
}

.shell {
  width: 100%;
  min-height: calc(100vh - (var(--page-pad-y) * 2));
  display: grid;
  grid-template-rows: 1fr;
  gap: 0;
  position: relative;
  z-index: 1;
}

.hero {
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: clamp(18px, 2.8vw, 32px) clamp(16px, 3vw, 36px);
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: none;
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero-brand {
  display: inline-flex;
  align-items: center;
  margin-bottom: 18px;
  color: #ffffff;
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.eyebrow {
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 12px;
}

h1 {
  font-size: clamp(38px, 6.8vw, 68px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  max-width: 850px;
}

.headline-keyword {
  display: inline-block;
  white-space: nowrap;
  vertical-align: baseline;
  text-align: left;
  transition: color 0.25s ease, text-shadow 0.25s ease;
}

.headline-keyword.anon {
  min-width: 8ch;
}

.headline-keyword.anon {
  color: #d9ffe9;
  text-shadow: 0 0 16px rgba(73, 214, 142, 0.32);
}

.headline-keyword.deanon {
  min-width: 10ch;
  color: #ffe6ad;
  text-shadow: 0 0 16px rgba(255, 209, 102, 0.32);
}

.subtitle {
  margin-top: 20px;
  color: var(--muted);
  font-size: clamp(17px, 2.4vw, 22px);
  line-height: 1.55;
  max-width: 760px;
}

.dev-inline {
  font-family: "Press Start 2P", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.62em;
  letter-spacing: 0.04em;
  color: #ffffff;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.14);
  vertical-align: baseline;
}

.identity-proof {
  margin-top: 24px;
  margin-inline: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  padding: 12px 14px;
  color: #d6dced;
  font-size: 14px;
  line-height: 1.5;
  width: min(100%, 960px);
}

.cta-group {
  margin-top: 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

button {
  border: 1px solid var(--border);
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  padding: 11px 16px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.2);
}

.primary {
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
  border-color: rgba(173, 155, 255, 0.78);
  color: #120a30;
  box-shadow: 0 10px 24px rgba(142, 121, 255, 0.4);
}

.primary:hover {
  box-shadow: 0 14px 28px rgba(127, 109, 246, 0.46);
}

.secondary {
  background: rgba(255, 255, 255, 0.02);
}

.oauth-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}

.cta-group #loginBtn,
.cta-group #saveBtn {
  width: 220px;
}

.oauth-btn svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

#saveBtn svg {
  width: 20px;
  height: 20px;
}

#saveBtn span {
  font-size: 16px;
  font-weight: 600;
}

.meta {
  margin-top: 16px;
  color: var(--muted);
  font-size: 14px;
}

.status {
  margin-top: 20px;
  font-size: 14px;
  min-height: 21px;
}

.status.success {
  color: var(--success);
}

.status.error {
  color: var(--danger);
}

.status.loading {
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.status.loading::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: var(--accent);
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1200;
  backdrop-filter: blur(4px);
}

.modal-overlay.open {
  display: flex;
}

.modal {
  width: min(420px, 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, #161827, #11131f);
  padding: 18px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
}

.modal h2 {
  font-size: 20px;
  margin-bottom: 6px;
}

.modal-copy {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 12px;
  line-height: 1.45;
}

.field {
  margin-bottom: 10px;
  position: relative;
}

.field label {
  display: block;
  color: #d6dcef;
  font-size: 13px;
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #0f111c;
  color: var(--text);
  font-size: 14px;
  padding: 10px 11px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input:focus {
  border-color: rgba(173, 155, 255, 0.75);
  box-shadow: 0 0 0 3px rgba(142, 121, 255, 0.2);
}

.modal-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.status.compact {
  margin-top: 8px;
  min-height: 18px;
  font-size: 13px;
}

.legend {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.legend span::before {
  content: "•";
  margin-right: 6px;
}

.legend .safe {
  color: var(--success);
}

.legend .controlled {
  color: var(--warning);
}

.demo-panel {
  margin-top: 16px;
  margin-inline: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: rgba(9, 10, 16, 0.6);
  padding: 12px;
  width: min(100%, 960px);
}

.demo-panel.maximized {
  position: fixed;
  top: 16px;
  bottom: 16px;
  left: 50%;
  width: var(--demo-max-width);
  max-width: calc(100vw - 24px);
  transform: translateX(-50%);
  margin-top: 0;
  border-radius: 14px;
  padding: 20px 24px;
  z-index: 1000;
  background: rgba(9, 10, 16, 0.96);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  overflow: auto;
}

body.demo-maximized {
  overflow: hidden;
}

.demo-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.demo-title {
  font-size: 13px;
  color: #d7dbee;
}

.demo-state {
  font-size: 12px;
  color: var(--muted);
}

.demo-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mini-btn {
  font-size: 12px;
  padding: 7px 10px;
  border-radius: 10px;
}

.record-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.record {
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.02);
}

.record .k {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}

.record .v {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  color: #f2f4fb;
  transition: color 0.2s ease;
}

.response-preview {
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  padding: 8px;
  font-size: 12px;
  color: #cfd5e7;
  line-height: 1.5;
  background: rgba(255, 255, 255, 0.01);
}

.shell.is-deanon .record {
  border-color: rgba(255, 209, 102, 0.35);
  background: rgba(255, 209, 102, 0.06);
}

.shell.is-deanon .record .v {
  color: #ffe6ad;
}

.shell.is-deanon .response-preview {
  border-color: rgba(255, 209, 102, 0.45);
}

.local-pill {
  color: var(--warning);
  font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 900px) {
  :root {
    --page-pad-y: 18px;
    --page-pad-x: 20px;
  }
}

@media (max-width: 720px) {
  :root {
    --page-pad-y: 14px;
    --page-pad-x: 14px;
  }

  .shell {
    width: 100%;
    min-height: calc(100vh - (var(--page-pad-y) * 2));
    gap: 0;
  }

  .hero {
    padding: 14px 12px 18px;
    background: transparent;
  }

  .record-grid {
    grid-template-columns: 1fr;
  }

  .demo-panel.maximized {
    top: 0;
    bottom: 0;
    left: 0;
    width: 100vw;
    max-width: 100vw;
    transform: none;
    border-radius: 0;
    padding: 12px;
  }
}
