:root {
  --bg:        #14171c;
  --surface:   #1c2026;
  --surface-2: #232830;
  --line:      #2e343d;
  --text:      #e6e8ec;
  --muted:     #8b93a0;
  --accent:    #e8a33d;   /* amber — primary action, caution, burn */
  --accent-2:  #4fb6a4;   /* teal — links, success */
  --danger:    #e0695c;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono",
          "Roboto Mono", Menlo, Consolas, monospace;
  --r: 8px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: 0.01em;
}

.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;
}

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--accent); color: #1a1205; padding: 8px 14px;
  z-index: 10; border-radius: 0 0 var(--r) 0;
}
.skip:focus { left: 0; }

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- masthead ---------- */
.masthead {
  max-width: 760px; width: 100%;
  margin: 0 auto; padding: 40px 20px 8px;
}
.brand { display: inline-flex; align-items: baseline; gap: 10px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark {
  color: var(--accent); font-weight: 700; font-size: 1.3rem;
  letter-spacing: -0.05em;
}
.brand-name { font-size: 1.3rem; font-weight: 600; letter-spacing: -0.02em; }
.tagline { color: var(--muted); margin: 6px 0 0; font-size: 0.85rem; }

/* ---------- layout ---------- */
#main {
  flex: 1; width: 100%; max-width: 760px;
  margin: 0 auto; padding: 24px 20px 60px;
}
.view { animation: rise 0.35s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

/* ---------- editor ---------- */
.editor-shell {
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface); overflow: hidden;
}
.editor-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--line);
}
.editor-bar-label {
  margin-left: auto; color: var(--muted);
  font-size: 0.78rem; letter-spacing: 0.04em;
}
.editor {
  width: 100%; min-height: 320px; resize: vertical;
  border: 0; outline: 0; padding: 18px;
  background: transparent; color: var(--text);
  font-family: var(--mono); font-size: 0.95rem; line-height: 1.6;
  tab-size: 2;
}
.editor::placeholder { color: var(--muted); opacity: 0.7; }

/* ---------- controls ---------- */
.controls {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 14px; margin-top: 18px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: 0.72rem; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--muted);
}
select, input[type="text"], input[type="password"] {
  width: 100%; padding: 11px 12px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--r);
  font-family: var(--mono); font-size: 0.9rem;
}
select:focus, input:focus {
  outline: 2px solid var(--accent-2); outline-offset: 1px;
  border-color: transparent;
}

/* ---------- burn toggle (signature element) ---------- */
.burn-row { margin-top: 18px; }
.switch {
  display: flex; align-items: center; gap: 14px; cursor: pointer;
  padding: 14px; border: 1px solid var(--line);
  border-radius: var(--r); background: var(--surface);
}
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track {
  position: relative; flex: 0 0 46px; height: 24px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 999px; transition: background 0.2s;
}
.fuse {
  position: absolute; top: 50%; left: 4px;
  width: 16px; height: 16px; margin-top: -8px;
  background: var(--muted); border-radius: 50%;
  transition: left 0.25s ease, background 0.25s, box-shadow 0.25s;
}
.switch input:checked + .switch-track { background: rgba(232,163,61,0.18); }
.switch input:checked + .switch-track .fuse {
  left: 26px; background: var(--accent);
  box-shadow: 0 0 10px 2px rgba(232,163,61,0.6);
}
.switch input:focus-visible + .switch-track {
  outline: 2px solid var(--accent-2); outline-offset: 2px;
}
.switch-text { display: flex; flex-direction: column; }
.switch-text strong { font-weight: 600; font-size: 0.9rem; }
.switch-text small { color: var(--muted); font-size: 0.78rem; }

/* ---------- buttons ---------- */
.primary {
  margin-top: 20px; width: 100%; padding: 14px;
  background: var(--accent); color: #1a1205;
  border: 0; border-radius: var(--r);
  font-family: var(--mono); font-size: 0.95rem; font-weight: 700;
  letter-spacing: 0.02em; cursor: pointer; transition: filter 0.15s;
}
.primary:hover { filter: brightness(1.08); }
.primary:active { filter: brightness(0.94); }
.primary.danger { background: var(--danger); color: #2a0f0b; }
.primary:disabled { opacity: 0.5; cursor: progress; }

.ghost {
  padding: 9px 14px; background: transparent; color: var(--text);
  border: 1px solid var(--line); border-radius: var(--r);
  font-family: var(--mono); font-size: 0.82rem; cursor: pointer;
}
.ghost:hover { border-color: var(--accent-2); color: var(--accent-2); }
.ghost-link { display: inline-block; margin-top: 22px; font-size: 0.85rem; }

/* ---------- result view ---------- */
.result-title { font-size: 1.1rem; font-weight: 600; margin: 0 0 16px; }
.link-box, .gate-row { display: flex; gap: 10px; }
.share-link {
  flex: 1; font-size: 0.85rem; color: var(--accent-2);
}
.result-note { color: var(--muted); font-size: 0.82rem; margin: 14px 0 0; }
.token-box {
  margin-top: 18px; padding: 14px; border: 1px dashed var(--accent);
  border-radius: var(--r); background: rgba(232,163,61,0.06);
}
.token-label { margin: 0 0 10px; font-size: 0.8rem; color: var(--accent); }

/* ---------- paste view ---------- */
.paste-meta {
  display: flex; flex-wrap: wrap; gap: 8px 16px;
  color: var(--muted); font-size: 0.8rem; margin-bottom: 16px;
}
.paste-meta .tag {
  padding: 3px 9px; border: 1px solid var(--line);
  border-radius: 999px; color: var(--text);
}
.paste-meta .tag.warn { color: var(--accent); border-color: var(--accent); }

.gate {
  padding: 20px; border: 1px solid var(--line);
  border-radius: var(--r); background: var(--surface); margin-bottom: 16px;
}
.gate-text { margin: 0 0 14px; }
.gate-warn { color: var(--accent); }
.gate-row { gap: 10px; }

.output-bar { display: flex; gap: 10px; margin-bottom: 10px; }
.code {
  margin: 0; padding: 18px; overflow-x: auto;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r);
}
.code code {
  font-family: var(--mono); font-size: 0.9rem; line-height: 1.6;
  white-space: pre; color: var(--text);
}

/* ---------- errors ---------- */
.form-error {
  margin: 14px 0 0; padding: 10px 12px;
  background: rgba(224,105,92,0.1); border: 1px solid var(--danger);
  border-radius: var(--r); color: var(--danger); font-size: 0.85rem;
}

/* ---------- footer ---------- */
.footer {
  border-top: 1px solid var(--line); padding: 20px;
  text-align: center; color: var(--muted); font-size: 0.75rem;
}

/* ---------- disclosure page ---------- */
.doc { max-width: 100%; }
.doc h1 {
  font-size: 1.4rem; font-weight: 600; letter-spacing: -0.02em;
  margin: 0 0 18px; color: var(--text);
}
.doc h2 {
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--accent); margin: 30px 0 10px;
}
.doc p { color: var(--text); margin: 0 0 14px; }
.doc ul { margin: 0 0 14px; padding-left: 20px; }
.doc li { margin: 0 0 8px; color: var(--text); }
.doc a { color: var(--accent-2); }
.doc-thanks {
  margin-top: 28px; padding-top: 18px;
  border-top: 1px solid var(--line); color: var(--muted);
}
.footer a { color: var(--muted); text-decoration: underline; }
.footer a:hover { color: var(--accent-2); }

/* ---------- responsive ---------- */
@media (max-width: 560px) {
  .controls { grid-template-columns: 1fr; }
  .masthead { padding-top: 28px; }
}

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