/* The Standard: shared base (fonts, colours, background, dividers, subscribe modal).
   Loaded by every page, followed by archive.css or issue.css. */

@font-face { font-family: 'DM Serif Display'; font-style: normal; font-weight: 400; font-display: swap; src: url('/assets/fonts/dm-serif-display-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'DM Serif Display'; font-style: italic; font-weight: 400; font-display: swap; src: url('/assets/fonts/dm-serif-display-latin-400-italic.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 300; font-display: swap; src: url('/assets/fonts/jetbrains-mono-latin-300-normal.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('/assets/fonts/jetbrains-mono-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url('/assets/fonts/jetbrains-mono-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Instrument Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url('/assets/fonts/instrument-sans-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Instrument Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url('/assets/fonts/instrument-sans-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Instrument Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url('/assets/fonts/instrument-sans-latin-600-normal.woff2') format('woff2'); }

:root {
  --bg: #0a0a0a;
  --bg-card: #111111;
  --bg-card-hover: #161616;
  --gold: #ffd700;
  --gold-dim: #c9a800;
  --gold-glow: rgba(255, 215, 0, 0.08);
  --text: #e0e0e0;
  --text-bright: #f2f2f2;
  --text-muted: #888888;
  --text-dim: #555555;
  --border: #1e1e1e;
  --border-hover: #2a2a2a;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Instrument Sans', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Subtle noise texture */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

.page-wrapper {
  position: relative;
  z-index: 1;
  margin: 0 auto;
  padding: 60px 24px 80px;
}

.divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), var(--gold-dim), var(--border), transparent);
}

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

/* Permanent canister address, every page */
.permanent {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  font-style: normal;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  overflow-wrap: anywhere;
  margin-top: 16px;
}
.permanent a { color: var(--text-dim); text-decoration: none; border-bottom: 1px solid var(--border); transition: color 0.2s ease; }
.permanent a:hover { color: var(--gold); }

/* ── SUBSCRIBE MODAL ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}
.modal-overlay.active { display: flex; }
.modal-box {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 40px 36px;
  max-width: 420px;
  width: 90%;
  text-align: center;
  animation: fadeUp 0.3s ease both;
}
.modal-close {
  position: absolute;
  top: 12px; right: 16px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.4rem;
  cursor: pointer;
  transition: color 0.2s ease;
  line-height: 1;
}
.modal-close:hover { color: var(--text); }
.modal-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--gold-dim);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.modal-title {
  font-family: 'DM Serif Display', serif;
  font-size: 1.5rem;
  color: var(--text-bright);
  margin-bottom: 12px;
}
.modal-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 24px;
}
.modal-input-row { display: flex; gap: 8px; }
.modal-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 10px 14px;
  font-family: 'Instrument Sans', sans-serif;
  font-size: 0.9rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease;
}
.modal-input::placeholder { color: var(--text-dim); }
.modal-input:focus { border-color: var(--gold-dim); }
.modal-input.invalid { border-color: #ff4444; }
.modal-btn {
  background: var(--gold);
  color: var(--bg);
  border: none;
  border-radius: 4px;
  padding: 10px 20px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: background 0.2s ease;
  white-space: nowrap;
}
.modal-btn:hover { background: var(--gold-dim); }

@media (max-width: 600px) {
  .page-wrapper { padding: 40px 16px 60px; }
  .modal-box { padding: 32px 24px; }
  .modal-input-row { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
