/* secdigest public site — blade runner / neuromancer cyber-noir.
   This file is editable; the matching markup lives in secdigest/public/templates/.
   Palette is dim-base + sparingly-used neon, not rainbow cyberpunk cosplay. */

:root {
  /* deep blacks, pulled slightly cool */
  --bg-0:     #04060a;
  --bg-1:     #0a0f1a;
  --bg-2:     #111827;
  --border:   #1a2230;
  --border-2: #2a3346;

  /* foreground */
  --fg:       #c5d6e0;
  --muted:    #5a6b7a;
  --dim:      #3a4654;

  /* dim-neon accents — used on accents only, never on whole text blocks */
  --cyan:     #00e5ff;          /* tyrell-cyan */
  --cyan-dim: #00b8cc;
  --magenta:  #ff2e7a;          /* blade-runner pink */
  --magenta-dim: #cc2562;
  --amber:    #ffb86b;
  --green:    #5fffa6;

  --font-mono: 'IBM Plex Mono', 'JetBrains Mono', 'SF Mono', 'Fira Code',
               Menlo, Consolas, 'Liberation Mono', monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-0);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  position: relative;
  overflow-x: hidden;
}

/* ── Background atmospherics ───────────────────────────────────────── */
/* Faint repeating scanlines — barely there but keep your eye reading the page
   like it's a CRT in a poorly-lit room. */
.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.008) 0px,
    rgba(255, 255, 255, 0.008) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: overlay;
}

/* Distant grid that suggests perspective without being graph paper. The
   subtle radial gradient pushes the corners darker for vignetting. */
.grid-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(ellipse at center, transparent 0%, rgba(0,0,0,0.55) 100%),
    linear-gradient(rgba(0, 229, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 229, 255, 0.035) 1px, transparent 1px);
  background-size: 100% 100%, 48px 48px, 48px 48px;
}

/* ── Topbar ────────────────────────────────────────────────────────── */
.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  background: rgba(4, 6, 10, 0.7);
  backdrop-filter: blur(2px);
}
.prompt {
  color: var(--cyan);
  text-shadow: 0 0 6px rgba(0, 229, 255, 0.6);
}
.brand {
  color: var(--cyan);
  font-weight: 700;
  letter-spacing: 0.5px;
  text-shadow: 0 0 12px rgba(0, 229, 255, 0.45);
}
.cursor {
  display: inline-block;
  margin-left: 1px;
  animation: blink 1.05s steps(2, start) infinite;
}
@keyframes blink {
  to { visibility: hidden; }
}
.topbar-meta {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.06em;
}
.topbar-link {
  color: var(--cyan);
  text-decoration: none;
  border-bottom: 1px dotted rgba(0, 229, 255, 0.4);
  transition: color 0.15s, border-color 0.15s, text-shadow 0.15s;
}
.topbar-link:hover,
.topbar-link:focus {
  color: var(--magenta);
  border-bottom-color: var(--magenta);
  text-shadow: 0 0 6px rgba(255, 46, 122, 0.55);
  outline: none;
}

/* ── Hero ──────────────────────────────────────────────────────────── */
main.hero {
  position: relative;
  z-index: 2;
  max-width: 720px;
  margin: 0 auto;
  padding: 80px 28px 60px;
}
main.hero.narrow { max-width: 540px; padding-top: 90px; }

h1 {
  font-size: clamp(2em, 6vw, 3em);
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.05;
  margin: 0 0 28px;
  color: var(--fg);
  text-shadow: 0 0 18px rgba(0, 229, 255, 0.18);
}

/* Subtle glitch — only on the landing headline. The pseudo-elements offset
   slightly with chromatic-fringe colors so it reads as a hairline shimmer
   rather than a full glitch animation that gives people a headache. */
.glitch {
  position: relative;
  display: inline-block;
}
.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0.28;
}
.glitch::before {
  color: var(--magenta);
  transform: translate(-1px, 0);
  text-shadow: 0 0 4px rgba(255, 46, 122, 0.25);
}
.glitch::after {
  color: var(--cyan);
  transform: translate(1px, 0);
  text-shadow: 0 0 4px rgba(0, 229, 255, 0.25);
}

.lead {
  color: var(--fg);
  font-size: 1.05em;
  line-height: 1.7;
  margin: 0 0 36px;
  max-width: 600px;
}
.lead strong.hl,
.hl {
  color: var(--cyan);
  font-weight: 600;
}

/* ── Flash messages ────────────────────────────────────────────────── */
.flash {
  padding: 14px 18px;
  margin-bottom: 24px;
  font-size: 0.95em;
  background: rgba(10, 15, 26, 0.7);
  border-left: 2px solid var(--cyan);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
}
.flash-prefix {
  color: var(--cyan);
  font-weight: 600;
  margin-right: 8px;
  text-transform: lowercase;
}
.flash-error { border-left-color: var(--magenta); }
.flash-error .flash-prefix { color: var(--magenta); }
.flash-ok { border-left-color: var(--green); }
.flash-ok .flash-prefix { color: var(--green); }

/* ── The "terminal" form panel ─────────────────────────────────────── */
.terminal {
  background: linear-gradient(180deg, rgba(10,15,26,0.92), rgba(10,15,26,0.75));
  border: 1px solid var(--border-2);
  border-radius: 4px;
  box-shadow:
    0 0 0 1px rgba(0, 229, 255, 0.04),
    0 8px 40px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.02);
  margin-top: 28px;
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px 4px 0 0;
}
.terminal-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--dim);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.4);
}
.terminal-dot:nth-child(1) { background: #ff5f57; }
.terminal-dot:nth-child(2) { background: #febc2e; }
.terminal-dot:nth-child(3) { background: #28c840; }
.terminal-title {
  margin-left: 6px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.subscribe-form {
  padding: 24px 28px 28px;
}

/* ── Form fields ───────────────────────────────────────────────────── */
.field { display: block; margin-bottom: 22px; }
.field-label,
.cadence-group legend {
  display: block;
  font-size: 12px;
  color: var(--cyan-dim);
  letter-spacing: 0.06em;
  margin-bottom: 8px;
  text-transform: lowercase;
  padding: 0;
}

.field input,
.subscribe-form input[type="email"] {
  width: 100%;
  padding: 11px 14px;
  font-size: 0.95em;
  background: rgba(0, 0, 0, 0.4);
  color: var(--fg);
  border: 1px solid var(--border-2);
  border-radius: 2px;
  font-family: inherit;
  caret-color: var(--cyan);
  transition: border-color 0.12s, box-shadow 0.12s;
}
.field input::placeholder { color: var(--dim); }
.field input:focus,
.subscribe-form input[type="email"]:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow:
    0 0 0 1px var(--cyan),
    0 0 12px rgba(0, 229, 255, 0.25);
}

/* ── Cadence radios — terminal selection markers ──────────────────── */
.cadence-group {
  border: none;
  padding: 0;
  margin: 0 0 22px;
}
.radio {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border-2);
  border-radius: 2px;
  cursor: pointer;
  margin-bottom: 8px;
  background: rgba(0, 0, 0, 0.25);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.radio:hover { border-color: var(--border-2); background: rgba(0, 229, 255, 0.03); }

/* hide the native radio; we draw our own '[ ]' / '[•]' marker */
.radio input { position: absolute; opacity: 0; pointer-events: none; }
.radio-marker {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border: 1px solid var(--border-2);
  border-radius: 1px;
  background: rgba(0, 0, 0, 0.5);
  position: relative;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.radio-marker::before {
  content: "";
  position: absolute;
  inset: 4px;
  background: transparent;
  border-radius: 1px;
  transition: background 0.12s, box-shadow 0.12s;
}
.radio:has(input:checked) {
  border-color: var(--cyan);
  background: rgba(0, 229, 255, 0.06);
  box-shadow: 0 0 0 1px rgba(0, 229, 255, 0.3),
              0 0 16px rgba(0, 229, 255, 0.12);
}
.radio:has(input:checked) .radio-marker {
  border-color: var(--cyan);
}
.radio:has(input:checked) .radio-marker::before {
  background: var(--cyan);
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.7);
}

.radio-text strong {
  display: block;
  font-weight: 600;
  color: var(--fg);
  letter-spacing: 0.02em;
}
.radio-text em {
  display: block;
  font-style: normal;
  color: var(--muted);
  font-size: 0.86em;
  margin-top: 2px;
}
.radio:has(input:checked) .radio-text strong { color: var(--cyan); }

/* ── Submit button ────────────────────────────────────────────────── */
.btn {
  display: block;
  width: 100%;
  padding: 13px;
  font-size: 0.95em;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: transparent;
  color: var(--cyan);
  border: 1px solid var(--cyan);
  border-radius: 2px;
  cursor: pointer;
  font-family: inherit;
  text-transform: lowercase;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.4);
}
.btn:hover {
  background: var(--cyan);
  color: var(--bg-0);
  text-shadow: none;
  box-shadow: 0 0 24px rgba(0, 229, 255, 0.5);
}
.btn:active {
  transform: translateY(1px);
}

.fineprint {
  margin: 16px 0 0;
  font-size: 0.78em;
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
  letter-spacing: 0.02em;
}

/* honeypot stays invisible to humans */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* ── Footer / links ───────────────────────────────────────────────── */
.footer {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 36px 24px 48px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
}
.footer-line { opacity: 0.7; }

.back { margin-top: 32px; }
.link-back {
  color: var(--cyan);
  text-decoration: none;
  letter-spacing: 0.04em;
  border-bottom: 1px solid transparent;
  transition: border-color 0.12s;
}
.link-back:hover { border-color: var(--cyan); }

/* ── Reduced motion ───────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .cursor { animation: none; }
  .glitch::before, .glitch::after { display: none; }
}

/* ── Small screens ────────────────────────────────────────────────── */
@media (max-width: 520px) {
  main.hero { padding: 56px 20px 40px; }
  .topbar { padding: 14px 18px; }
  .topbar-meta { display: none; }
  h1 { font-size: 2em; }
  .subscribe-form { padding: 20px; }
  .terminal-bar { padding: 8px 12px; }
}
