/* ───────────────────────────────────────────────
   METANOIA — cypherpunk / terminal / mobile-first
   ─────────────────────────────────────────────── */

:root {
  --bg:        #07090a;
  --bg-2:      #0c0f10;
  --bg-3:      #11161a;
  --line:      rgba(159, 239, 0, 0.16);
  --line-soft: rgba(255, 255, 255, 0.07);
  --text:      #c4ccc8;
  --dim:       #6f7d78;
  --white:     #edf5ef;
  --accent:    #9fef00;
  --accent-2:  #00e0ff;
  --glow:      rgba(159, 239, 0, 0.35);
  --max:       1080px;
}

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

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  font-weight: 400;
  line-height: 1.65;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}

/* ── Texture overlays ── */
.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0) 0px,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, 0.18) 3px,
    rgba(0, 0, 0, 0) 4px
  );
  opacity: 0.35;
  mix-blend-mode: multiply;
}
.grid-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 10%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 10%, transparent 75%);
  opacity: 0.5;
}

main, .nav, .footer { position: relative; z-index: 1; }

a { color: inherit; text-decoration: none; }

/* ── Nav ── */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line-soft);
  position: sticky;
  top: 0;
  background: rgba(7, 9, 10, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.brand { display: inline-flex; align-items: baseline; }
.brand-mark {
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--white);
  font-size: 0.95rem;
}
.cursor {
  color: var(--accent);
  font-weight: 700;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.nav-links { display: flex; align-items: center; gap: 18px; font-size: 0.78rem; }
.nav-links > a:not(.nav-apply) { display: none; color: var(--dim); letter-spacing: 0.02em; }
.nav-links > a:not(.nav-apply):hover { color: var(--accent); }
.nav-apply {
  color: var(--accent);
  border: 1px solid var(--line);
  padding: 7px 14px;
  letter-spacing: 0.02em;
  transition: all 0.18s ease;
}
.nav-apply:hover { background: var(--accent); color: var(--bg); box-shadow: 0 0 18px var(--glow); }

/* ── Layout primitives ── */
.hero, .block { padding: 0 20px; max-width: var(--max); margin: 0 auto; }

/* ── Hero ── */
.hero { padding-top: 64px; padding-bottom: 80px; }
.kicker {
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 22px;
}
.prompt { color: var(--accent); margin-right: 6px; }

h1.glitch {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: clamp(2.1rem, 9vw, 4.2rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--white);
  position: relative;
  text-wrap: balance;
}
.hero h1 + h1 { margin-top: 0.35em; }
h1.accent-line { color: var(--accent); text-shadow: 0 0 26px var(--glow); }

.lede {
  margin-top: 26px;
  max-width: 56ch;
  color: var(--text);
  font-size: 0.98rem;
  line-height: 1.75;
}

.actions { display: flex; flex-direction: column; gap: 12px; margin-top: 32px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px 24px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.18s ease;
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--accent);
  color: var(--bg);
  font-weight: 700;
  box-shadow: 0 0 0 rgba(159, 239, 0, 0);
}
.btn-primary:hover { box-shadow: 0 0 26px var(--glow); transform: translateY(-1px); }
.btn-ghost { border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-block { width: 100%; }

/* ── Content blocks ── */
.block {
  padding-top: 64px;
  padding-bottom: 64px;
  border-top: 1px solid var(--line-soft);
}
.label {
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 16px;
  text-transform: uppercase;
}
.block h2 {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: clamp(1.6rem, 5.5vw, 2.6rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
  color: var(--white);
  max-width: 22ch;
  margin-bottom: 28px;
}
.prose p, .prose-lead { color: var(--text); max-width: 62ch; font-size: 0.96rem; }
.prose p + p { margin-top: 18px; }
.hl { color: var(--accent); }

/* ── Man-page / definition block ── */
.manpage {
  background: var(--bg-2);
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  padding: 20px 18px;
  max-width: 640px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.4);
}
.man-cmd { color: var(--dim); font-size: 0.85rem; margin-bottom: 18px; }
.man-cmd .prompt { color: var(--accent); }
.defs { display: flex; flex-direction: column; gap: 14px; }
.def { display: flex; flex-direction: column; gap: 4px; }
.def dt {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}
.def dd { color: var(--text); font-size: 0.9rem; line-height: 1.55; padding-left: 14px; border-left: 1px solid var(--line); }
.def .pos { color: var(--dim); font-style: italic; margin-right: 8px; }
.def .here { color: var(--accent-2); }

@media (min-width: 768px) {
  .manpage { padding: 26px 24px; }
  .def { flex-direction: row; gap: 18px; align-items: baseline; }
  .def dt { min-width: 160px; text-align: right; }
  .def dd { padding-left: 18px; }
}

/* ── Cards ── */
.cards { display: grid; grid-template-columns: 1fr; gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); }
.card {
  background: var(--bg-2);
  padding: 26px 22px;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { background: var(--bg-3); box-shadow: inset 2px 0 0 var(--accent); }
.card-id { font-size: 0.78rem; color: var(--accent); letter-spacing: 0.08em; }
.card h3 {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: 1.3rem;
  color: var(--white);
  margin: 10px 0 10px;
}
.card p { color: var(--dim); font-size: 0.9rem; line-height: 1.6; }

/* ── Access / form ── */
.access .prose-lead { margin-bottom: 32px; }
.form { display: flex; flex-direction: column; gap: 20px; max-width: 560px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 0.78rem; color: var(--accent); letter-spacing: 0.04em; }
.field input, .field textarea {
  background: var(--bg-2);
  border: 1px solid var(--line-soft);
  border-radius: 2px;
  padding: 14px 14px;
  color: var(--white);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.92rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  resize: vertical;
  width: 100%;
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 0 18px rgba(159, 239, 0, 0.12);
}
.field input::placeholder, .field textarea::placeholder { color: var(--dim); }
.form-note { font-size: 0.78rem; color: var(--dim); text-align: center; }

/* ── Footer ── */
.footer {
  border-top: 1px solid var(--line-soft);
  padding: 48px 20px 64px;
  max-width: var(--max);
  margin: 0 auto;
  text-align: center;
}
.footer-brand { display: inline-flex; align-items: baseline; font-weight: 700; color: var(--white); margin-bottom: 12px; }
.footer-tag { font-size: 0.8rem; color: var(--dim); letter-spacing: 0.04em; }
.footer-quote { font-size: 0.85rem; color: var(--accent); margin-top: 16px; opacity: 0.85; }

/* ── Glitch effect (desktop, reduced-motion safe) ── */
@media (hover: hover) and (min-width: 768px) {
  .glitch::before, .glitch::after {
    content: attr(data-text);
    position: absolute;
    left: 0; top: 0;
    width: 100%;
    overflow: hidden;
    clip-path: inset(0 0 0 0);
  }
  .glitch:hover::before {
    color: var(--accent-2);
    transform: translate(-2px, 0);
    animation: glitch-x 0.4s steps(2) 2;
    opacity: 0.8;
  }
  .glitch:hover::after {
    color: #ff2e74;
    transform: translate(2px, 0);
    animation: glitch-x 0.4s steps(2) reverse 2;
    opacity: 0.8;
  }
  @keyframes glitch-x {
    0% { clip-path: inset(10% 0 80% 0); }
    50% { clip-path: inset(60% 0 10% 0); }
    100% { clip-path: inset(30% 0 50% 0); }
  }
}

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

/* ── Tablet / desktop enhancements ── */
@media (min-width: 768px) {
  body { font-size: 16px; }
  .nav { padding: 22px 36px; }
  .nav-links > a:not(.nav-apply) { display: inline; }
  .hero, .block { padding-left: 36px; padding-right: 36px; }
  .hero { padding-top: 96px; padding-bottom: 120px; }
  .actions { flex-direction: row; }
  .block { padding-top: 100px; padding-bottom: 100px; }
  .cards { grid-template-columns: 1fr 1fr; }
  .footer { padding: 64px 36px 88px; }
}

@media (min-width: 1024px) {
  .hero { padding-top: 120px; }
}
