/* ── 0xPaste — terminal/hacker theme ── */

:root {
  /* Palette */
  --bg:          #0a0c10;
  --bg2:         #0d1117;
  --surface:     #111418;
  --surface2:    #161b22;
  --border:      #21262d;
  --border2:     #30363d;
  --text:        #cdd9e5;
  --muted:       #636e7b;
  --muted2:      #768390;
  --green:       #57ab5a;
  --green-glow:  rgba(87,171,90,0.18);
  --cyan:        #39c5cf;
  --cyan-dim:    rgba(57,197,207,0.12);
  --amber:       #e3b341;
  --red:         #f47067;
  --purple:      #a371f7;

  /* Typography */
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --sans: var(--mono); /* all-mono for authenticity */

  /* Misc */
  --radius: 8px;
  --radius-lg: 12px;
  --header-h: 54px;
}

/* ── Reset ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 15px; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--mono);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

a { color: var(--cyan); text-decoration: none; transition: color 0.15s; }
a:hover { color: #fff; }

/* ── Scanline overlay ───────────────────────────── */
.scanline {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 3px,
    rgba(0,0,0,0.04) 3px,
    rgba(0,0,0,0.04) 4px
  );
}

/* ── Container ──────────────────────────────────── */
.container {
  width: min(980px, 100% - 2rem);
  margin-inline: auto;
}

/* ── Header ─────────────────────────────────────── */
.site-header {
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

/* Logo */
.logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 1px;
  text-decoration: none;
}
.logo-bracket { color: var(--green); }
.logo:hover { color: #fff; }
.logo:hover .logo-bracket { color: #7ee787; }

.logo-cursor {
  color: var(--green);
  font-size: 1rem;
  animation: blink 1.1s step-end infinite;
  margin-left: 1px;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* Nav */
.nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8125rem;
  color: var(--muted);
}
.nav-prefix { color: var(--muted); }
.nav-link { color: var(--muted2); transition: color 0.15s; }
.nav-link:hover { color: var(--text); }
.nav-divider { color: var(--border2); }
.nav-version {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--border2);
  border-radius: 4px;
  color: var(--muted);
}

/* ── Main ───────────────────────────────────────── */
.main { flex: 1; padding: 2rem 0 3rem; }

/* ── Footer ─────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.75rem;
}
.footer-inner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 0;
}
.footer-prompt { color: var(--green); }
.footer-text   { color: var(--muted); }

/* ── Flash messages ─────────────────────────────── */
.flash-list { list-style: none; margin: 0 0 1.5rem; padding: 0; }

.flash {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  border-left: 3px solid transparent;
}
.flash-prefix { font-weight: 700; font-size: 0.75rem; letter-spacing: 0.05em; }

.flash-success {
  background: rgba(87,171,90,0.08);
  border-color: var(--green);
  color: #7ee787;
}
.flash-success .flash-prefix { color: var(--green); }

.flash-error {
  background: rgba(244,112,103,0.08);
  border-color: var(--red);
  color: #ff9189;
}
.flash-error .flash-prefix { color: var(--red); }

/* ── Terminal window chrome ─────────────────────── */
.terminal-window {
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.03),
    0 24px 64px rgba(0,0,0,0.6),
    0 0 80px rgba(57,197,207,0.03);
}

.terminal-titlebar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  min-height: 36px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-red    { background: #f47067; }
.dot-yellow { background: #e3b341; }
.dot-green  { background: var(--green); }

.titlebar-label {
  font-size: 0.75rem;
  color: var(--muted);
  margin-left: 0.25rem;
  flex: 1;
}

.titlebar-actions {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
}

.tbar-btn {
  font-family: var(--mono);
  font-size: 0.7rem;
  padding: 0.2rem 0.6rem;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 4px;
  color: var(--muted2);
  cursor: pointer;
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s;
}
.tbar-btn:hover {
  color: var(--cyan);
  border-color: var(--cyan);
}

.terminal-body {
  background: var(--bg2);
  padding: 1.25rem 1.5rem 1.5rem;
}

/* ── Terminal lines ─────────────────────────────── */
.term-line {
  font-size: 0.875rem;
  margin-bottom: 0.35rem;
  line-height: 1.6;
}
.prompt { color: var(--green); }
.cmd    { color: var(--cyan); }
.hero-line { margin-bottom: 1.5rem; }

.warn-line {
  background: rgba(227,179,65,0.08);
  border-left: 3px solid var(--amber);
  padding: 0.5rem 0.75rem;
  border-radius: 0 4px 4px 0;
  font-size: 0.8125rem;
  color: #f0c060;
  margin-bottom: 1.25rem;
}
.warn-line code {
  background: rgba(0,0,0,0.3);
  padding: 0.1em 0.4em;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 0.85em;
}
.prompt-warn { color: var(--amber); font-weight: 700; margin-right: 0.4rem; }

/* ── Editor ─────────────────────────────────────── */
.editor-wrap {
  display: flex;
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
}

.line-gutter {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding: 0.75rem 0.6rem;
  background: var(--surface);
  border-right: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--muted);
  user-select: none;
  min-width: 2.8rem;
  line-height: 1.6;
  gap: 0;
}
.line-gutter span { display: block; line-height: 1.6; }

textarea {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.875rem;
  line-height: 1.6;
  padding: 0.75rem;
  resize: none;
  min-height: 340px;
  tab-size: 2;
}
textarea::placeholder { color: var(--muted); }

/* ── Options bar ────────────────────────────────── */
.options-bar {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.option-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.opt-label {
  font-size: 0.75rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
}
.opt-icon { font-style: normal; }
.opt-optional {
  font-size: 0.65rem;
  color: var(--muted);
  font-weight: 400;
}

.password-row {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.password-field {
  width: 100%;
  max-width: 28rem;
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: 5px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.8125rem;
  padding: 0.45rem 0.65rem;
  outline: none;
}
.password-field:focus {
  border-color: var(--cyan);
}

/* Not a login password: type=text + masking avoids most “save password” prompts (Chromium/Safari). Firefox may show plain text. */
.passphrase-masked {
  -webkit-text-security: disc;
}

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

input[type="text"],
select {
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: 5px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.8125rem;
  padding: 0.3rem 0.6rem;
  outline: none;
  transition: border-color 0.15s;
}
input[type="text"]:focus,
input[type="password"]:focus,
select:focus {
  border-color: var(--cyan);
}
input[type="text"] { width: 150px; }
select { cursor: pointer; }

/* ── Toggle ─────────────────────────────────────── */
.toggle-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  font-size: 0.8125rem;
  color: var(--muted2);
  user-select: none;
  margin-left: auto;
}
.toggle-input { display: none; }

.toggle-track {
  width: 34px;
  height: 18px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 100px;
  position: relative;
  transition: background 0.2s, border-color 0.2s;
  flex-shrink: 0;
}
.toggle-thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 12px; height: 12px;
  background: var(--muted);
  border-radius: 50%;
  transition: transform 0.2s, background 0.2s;
}
.toggle-input:checked + .toggle-track {
  background: rgba(87,171,90,0.25);
  border-color: var(--green);
}
.toggle-input:checked + .toggle-track .toggle-thumb {
  transform: translateX(16px);
  background: var(--green);
}
.toggle-text { transition: color 0.2s; }
.toggle-input:checked ~ .toggle-text { color: var(--green); }

.burn-hint {
  font-size: 0.75rem;
  cursor: help;
  margin-left: 0.15rem;
  opacity: 0.7;
}

/* ── Submit row ─────────────────────────────────── */
.submit-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.25rem;
}

.btn-submit {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.4rem;
  background: var(--green-glow);
  border: 1px solid var(--green);
  border-radius: var(--radius);
  color: var(--green);
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  text-decoration: none;
}
.btn-submit:hover:not(:disabled) {
  background: var(--green);
  color: #0a0c10;
  box-shadow: 0 0 18px rgba(87,171,90,0.35);
}
.btn-submit:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-prompt { opacity: 0.7; }

.submit-hint {
  font-size: 0.75rem;
  color: var(--muted);
}

/* ── Feature strip ──────────────────────────────── */
.feature-strip {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 2rem;
  padding: 1rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.feature {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8125rem;
  color: var(--muted);
}
.feat-icon { font-size: 0.9rem; }

/* ── Paste viewer ───────────────────────────────── */
.paste-view-window { }

.paste-terminal-body { padding: 0; }

.paste-meta-bar {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 0.6rem 1.25rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  font-size: 0.75rem;
}
.meta-item { display: flex; align-items: center; gap: 0.25rem; }
.meta-key  { color: var(--muted); }
.meta-sep  { color: var(--border2); }
.meta-val  { color: var(--cyan); }
.mono      { font-family: var(--mono); }

.code-container {
  display: flex;
  overflow: auto;
  max-height: min(75vh, 900px);
}

.line-nums {
  display: flex;
  flex-direction: column;
  padding: 1rem 0.75rem;
  background: var(--surface);
  border-right: 1px solid var(--border);
  font-size: 0.8125rem;
  color: var(--muted);
  user-select: none;
  text-align: right;
  min-width: 2.8rem;
  line-height: 1.6;
  flex-shrink: 0;
}
.line-nums span { display: block; line-height: 1.6; }

.paste-pre {
  margin: 0;
  padding: 1rem 1.25rem;
  background: var(--bg);
  flex: 1;
  overflow: visible;
}
.paste-pre code {
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.6;
  white-space: pre;
  display: block;
  background: transparent !important;
  padding: 0 !important;
}

/* Override hljs background */
.hljs { background: transparent !important; }

/* ── Paste unlock (passphrase) ─────────────────── */
.lock-hint {
  font-size: 0.8125rem;
  margin: 0 0 1rem;
}
.unlock-form {
  max-width: 22rem;
}
.unlock-form .label {
  margin-bottom: 0.35rem;
}
.unlock-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: 5px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.875rem;
  padding: 0.55rem 0.75rem;
  outline: none;
}
.unlock-input:focus {
  border-color: var(--cyan);
}

/* ── Error page ─────────────────────────────────── */
.err-output {
  color: var(--red);
  margin: 0.25rem 0 1.25rem 1rem;
  font-size: 0.875rem;
}
.blink-cursor { animation: blink 1.1s step-end infinite; }
.error-actions { margin-top: 1.5rem; }

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 640px) {
  .terminal-body { padding: 1rem; }
  .options-bar   { flex-direction: column; align-items: flex-start; }
  .toggle-label  { margin-left: 0; }
  .submit-hint   { display: none; }
  .titlebar-actions .tbar-btn:nth-child(n+3) { display: none; }
  .feature-strip { gap: 1rem; }
}
