:root {
  --bg: #0c0c0c;
  --bg-2: #141414;
  --ink: #f2f0ea;
  --muted: #9a968c;
  --line: #2a2a2a;
  --btn: #f2f0ea;
  --btn-ink: #0c0c0c;
  --btn-ghost: transparent;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 50% -10%, #1c1c1c 0%, transparent 55%),
    var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.08;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  z-index: 0;
}

.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(920px, calc(100% - 40px));
  margin: 0 auto;
  padding: 18px 0 0;
}

.topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 0.02em;
}

.topbar-logo {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: block;
}

.topbar-nav {
  display: flex;
  gap: 6px;
}

.topbar-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 8px 10px;
  border: 1px solid transparent;
}

.topbar-nav a:hover {
  color: var(--ink);
}

.topbar-nav a[aria-current="page"] {
  color: var(--ink);
  border-color: var(--line);
}

.stage {
  position: relative;
  z-index: 1;
  width: min(560px, calc(100% - 40px));
  margin: auto;
  padding: 48px 0 40px;
  text-align: center;
}

.stage-settings {
  width: min(920px, calc(100% - 40px));
  text-align: left;
}

.settings-hero {
  text-align: center;
  margin-bottom: 20px;
}

.mark-sm {
  width: 88px;
  height: 88px;
  margin-bottom: 18px;
}

.settings-shell {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 16px;
  margin-top: 18px;
  text-align: left;
}

.settings-nav {
  border: 1px solid var(--line);
  background: #121212;
  padding: 8px;
  max-height: min(70vh, 640px);
  overflow: auto;
}

.site-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.site-nav button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  text-align: left;
  padding: 9px 10px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.site-nav button:hover {
  color: var(--ink);
  background: #1a1a1a;
}

.site-nav button[aria-current="page"] {
  color: var(--ink);
  background: #1f1f1f;
  box-shadow: inset 0 0 0 1px var(--line);
}

.settings-panel {
  border: 1px solid var(--line);
  background: #121212;
  padding: 16px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2 {
  margin: 0;
  font-family: "Newsreader", Georgia, serif;
  font-size: 1.4rem;
  font-weight: 600;
}

.hosts {
  margin: 4px 0 0;
  font-size: 11px;
  color: var(--muted);
}

.enable-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  padding-top: 4px;
}

.settings-form {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
}

.settings-form .setting {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 4px 12px;
  align-items: start;
  margin: 0;
  padding: 11px 0;
  border-bottom: 1px solid #222;
  cursor: pointer;
}

.settings-form .setting:last-child {
  border-bottom: none;
}

.settings-form .label {
  color: var(--ink);
  font-size: 13px;
}

.settings-form .desc {
  grid-column: 2;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.hint-foot {
  margin: 14px 0 0;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.45;
}

.note[data-state="pending"] {
  border-style: solid;
}

.note[data-state="error"] {
  color: #e0a8a8;
  border-color: #5a3030;
}

@media (max-width: 760px) {
  .settings-shell {
    grid-template-columns: 1fr;
  }

  .settings-nav {
    max-height: none;
  }

  .site-nav {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }

  .panel-head {
    flex-direction: column;
  }
}

.brand {
  margin: 0 0 28px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.mark {
  display: block;
  width: 140px;
  height: 140px;
  margin: 0 auto 28px;
  border-radius: 28px;
  image-rendering: auto;
  animation: rise 700ms ease-out both;
}

h1 {
  margin: 0 0 14px;
  font-family: "Newsreader", Georgia, serif;
  font-weight: 600;
  font-size: clamp(1.5rem, 5vw, 3.2rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  white-space: nowrap;
  animation: rise 700ms ease-out 60ms both;
}

.lede {
  margin: 0 auto 32px;
  max-width: 38ch;
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
  animation: rise 700ms ease-out 120ms both;
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
  animation: rise 700ms ease-out 180ms both;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 18px;
  border: 1px solid var(--line);
  text-decoration: none;
  font: inherit;
  font-size: 14px;
  transition:
    transform 160ms ease,
    background 160ms ease,
    color 160ms ease,
    border-color 160ms ease;
}

.btn-primary {
  background: var(--btn);
  color: var(--btn-ink);
  border-color: var(--btn);
}

.btn-primary:hover {
  transform: translateY(-1px);
  background: #ffffff;
}

.btn-secondary {
  background: var(--btn-ghost);
  color: var(--ink);
}

.btn-secondary:hover {
  border-color: #5a5a5a;
  background: #171717;
}

.note {
  margin: 22px 0 0;
  padding: 12px 14px;
  border: 1px dashed #3a3a3a;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  text-align: left;
}

.note code {
  color: var(--ink);
}

.about {
  margin: 40px auto 0;
  padding-top: 32px;
  border-top: 1px solid var(--line);
  max-width: 40ch;
  animation: rise 700ms ease-out 240ms both;
}

.portrait {
  display: block;
  width: 96px;
  height: 96px;
  margin: 0 auto 16px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  box-shadow: 0 0 0 1px var(--line);
}

.about-copy {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}

.feedback {
  margin: 36px auto 0;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  max-width: 40ch;
  animation: rise 700ms ease-out 300ms both;
}

.feedback h2 {
  margin: 0 0 10px;
  font-family: "Newsreader", Georgia, serif;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.feedback p {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}

.feedback-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.field em {
  font-style: normal;
  opacity: 0.7;
}

.field input,
.field textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #121212;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  line-height: 1.45;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  outline: 1px solid #6a6a6a;
  border-color: #6a6a6a;
}

.field textarea {
  min-height: 120px;
}

.hp {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  width: 0;
}

.feedback-status {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}

.feedback-status[data-state="ok"] {
  color: #b7d7b0;
}

.feedback-status[data-state="error"] {
  color: #e0a8a8;
}

.feedback-status a {
  color: var(--ink);
}

.feedback .btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

footer {
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding: 20px;
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.02em;
}

footer a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.sep {
  margin: 0 6px;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 480px) {
  .stage {
    padding-top: 48px;
  }

  .mark {
    width: 112px;
    height: 112px;
  }
}
