/* NoSocial CRT Design System */

:root {
  --green: #00ff41;
  --green-dim: #00cc33;
  --green-glow: rgba(0, 255, 65, 0.6);
  --bg: #0a0a0a;
  --bg-code: #111;
  --border: #00ff41;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--green);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  text-shadow: 0 0 8px var(--green-glow);
  -webkit-font-smoothing: antialiased;
}

/* Scan lines overlay */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1000;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 1px,
    rgba(0, 0, 0, 0.15) 2px,
    rgba(0, 0, 0, 0.15) 3px
  );
}

/* Screen flicker */
@keyframes flicker {
  0%, 95% { opacity: 1; }
  96% { opacity: 0.97; }
  100% { opacity: 1; }
}

body {
  animation: flicker 6s infinite;
}

/* Glitch effect */
@keyframes glitch {
  0%, 92%, 100% {
    transform: translate(0);
    clip-path: none;
  }
  93% {
    transform: translate(-4px, 0);
    clip-path: inset(20% 0 60% 0);
  }
  94% {
    transform: translate(4px, 0);
    clip-path: inset(60% 0 10% 0);
  }
  95% {
    transform: translate(-2px, 0);
    clip-path: inset(40% 0 30% 0);
  }
  96% {
    transform: translate(0);
    clip-path: none;
  }
}

.glitch {
  animation: glitch 8s infinite;
}

/* Blinking cursor */
@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.cursor {
  animation: blink 1s step-end infinite;
}

/* Links */
a {
  color: var(--green);
  text-decoration: none;
  text-shadow: 0 0 8px var(--green-glow);
}

a:hover {
  text-decoration: underline;
}

a:visited {
  color: var(--green-dim);
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  color: var(--green);
  font-family: inherit;
  font-weight: 700;
  margin: 2rem 0 1rem;
  line-height: 1.3;
}

h1 { font-size: 1.8rem; }
h2 {
  font-size: 1.4rem;
  border-bottom: 1px solid var(--green);
  padding-bottom: 0.4rem;
}
h3 { font-size: 1.15rem; }

/* Paragraphs */
p {
  margin: 0.8rem 0;
}

/* Lists */
ul, ol {
  margin: 0.8rem 0;
  padding-left: 1.5rem;
}

li {
  margin: 0.3rem 0;
}

/* Inline code */
code {
  background: var(--bg-code);
  color: var(--green);
  border: 1px solid #222;
  border-radius: 3px;
  padding: 0.15rem 0.4rem;
  font-size: 0.9em;
  font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
}

/* Code blocks */
pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1rem;
  margin: 1rem 0;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.5;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.85rem;
}

th, td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.7rem;
  text-align: left;
}

th {
  font-weight: 700;
}

/* Blockquotes */
blockquote {
  border-left: 3px solid var(--green);
  padding-left: 1rem;
  margin: 1rem 0;
  opacity: 0.85;
}

/* Horizontal rule */
hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* Strong / em */
strong { font-weight: 700; }
em { font-style: italic; }

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--green-dim);
  border-radius: 3px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  body {
    animation: none;
  }
  body::after {
    display: none;
  }
  .glitch {
    animation: none;
  }
  .cursor {
    animation: none;
    opacity: 1;
  }
}

/* --- Landing page --- */

.landing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  text-align: center;
  padding: 2rem;
}

.landing-title {
  font-size: 4rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.landing-tagline {
  font-size: 1rem;
  opacity: 0.8;
  font-style: italic;
  margin-bottom: 2rem;
}

.landing-nav {
  display: flex;
  gap: 2rem;
  font-size: 1rem;
  margin-bottom: 3rem;
}

.landing-nav a::before {
  content: '> ';
}

.landing-install {
  width: 100%;
  max-width: 680px;
  margin: 0 auto 3rem;
  text-align: left;
}

.landing-install-label {
  font-size: 0.75rem;
  opacity: 0.5;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
  text-align: center;
}

.install-row {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  margin: 0 0 0.6rem;
  padding: 0.85rem 1.1rem;
  font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
  font-size: 0.82rem;
  background: #0f1410;
  border: 1px solid #1e2a1e;
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  overflow-x: auto;
}

.install-row:hover {
  border-color: #2e4a2e;
  background: #121a12;
}

.install-tag {
  flex: 0 0 auto;
  width: 10ch;
  opacity: 0.55;
  font-size: inherit;
  user-select: none;
  -webkit-user-select: none;
}

/* Override global `code` rule so the command is flush with the row */
.install-row .install-cmd {
  flex: 1 1 auto;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  font-size: inherit;
  font-family: inherit;
  color: inherit;
  white-space: nowrap;
  user-select: text;
  -webkit-user-select: text;
}

.install-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: 0.25rem;
  opacity: 0.35;
  transition: opacity 0.15s ease;
  user-select: none;
  -webkit-user-select: none;
  color: var(--green);
}

.install-row:hover .install-icon {
  opacity: 0.75;
}

.install-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.install-icon .icon-check {
  display: none;
}

.install-row[data-copied="true"] {
  border-color: var(--green);
}

.install-row[data-copied="true"] .install-icon {
  opacity: 1;
}

.install-row[data-copied="true"] .install-icon .icon-copy {
  display: none;
}

.install-row[data-copied="true"] .install-icon .icon-check {
  display: block;
}

.landing-footer {
  font-size: 0.75rem;
  opacity: 0.5;
}

/* --- Spec page --- */

.spec-nav {
  padding: 1rem 2rem;
  border-bottom: 1px solid #222;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.spec-nav a {
  opacity: 0.7;
}

.spec-nav a:hover {
  opacity: 1;
}

.spec-content {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 2rem 4rem;
}

/* Heading anchors */
.spec-content h1[id],
.spec-content h2[id],
.spec-content h3[id],
.spec-content h4[id] {
  cursor: pointer;
}

.spec-content h1[id]:hover::after,
.spec-content h2[id]:hover::after,
.spec-content h3[id]:hover::after,
.spec-content h4[id]:hover::after {
  content: ' #';
  opacity: 0.4;
}

/* --- Schemas index --- */

.schema-entry {
  margin: 2rem 0;
  padding: 1.25rem 1.5rem;
  background: var(--bg-code);
  border: 1px solid #222;
}

.schema-entry h2 {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}

.schema-version {
  font-size: 0.7rem;
  opacity: 0.5;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: normal;
}

.schema-entry p {
  margin: 0 0 0.75rem;
  opacity: 0.85;
}

.schema-links {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.85rem;
}

.schema-links li {
  margin: 0.25rem 0;
}

.schema-links li::before {
  content: '> ';
  opacity: 0.5;
}

/* Responsive */
@media (max-width: 600px) {
  .landing-title {
    font-size: 2.5rem;
  }
  .landing-nav {
    flex-direction: column;
    gap: 1rem;
  }
  .spec-content {
    padding: 0 1rem 2rem;
  }
}
