/* monolithannex.com — Dark sovereign theme */
/* No frameworks. No preprocessors. Pure CSS. */

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

:root {
  --bg: #0a0a0a;
  --bg-elevated: #111111;
  --bg-surface: #161616;
  --red: #8b0000;
  --red-bright: #f06060;
  --red-dim: #5a0000;
  --text: #f5f5f5;
  --text-muted: #a0a0a0;
  --text-dim: #555555;
  --border: #222222;
  --glow-red: rgba(139, 0, 0, 0.3);
  --glow-red-strong: rgba(139, 0, 0, 0.6);
  --card-radius: 6px;
  --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", "Cascadia Code", "Fira Code", Consolas,
    "Liberation Mono", Menlo, monospace;
  --max-width: 960px;
}

/* Custom red scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--red-dim);
  border-radius: 5px;
  border: 2px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--red);
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Firefox scrollbar */
  scrollbar-width: thin;
  scrollbar-color: var(--red-dim) var(--bg);
}

body {
  background:
    radial-gradient(circle, rgba(255,255,255,0.03) 1px, transparent 1px)
    0 0 / 24px 24px,
    var(--bg);
  color: var(--text);
  font-family: var(--font-stack);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Keyframes */
@keyframes hero-glow {
  from { opacity: 0.4; transform: translateX(-50%) scale(1); }
  to   { opacity: 0.7; transform: translateX(-50%) scale(1.15); }
}

@keyframes logo-pulse {
  from { filter: drop-shadow(0 0 12px rgba(139, 0, 0, 0.4)); }
  to   { filter: drop-shadow(0 0 28px rgba(139, 0, 0, 0.8)); }
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes scroll-fade-in {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

a {
  color: var(--red-bright);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--text);
}

/* Layout */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* Hero */
.hero {
  padding: 120px 0 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 600px;
  background: radial-gradient(
    ellipse at center,
    rgba(139, 0, 0, 0.25) 0%,
    rgba(139, 0, 0, 0.08) 40%,
    transparent 70%
  );
  animation: hero-glow 6s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 0;
  will-change: transform, opacity;
}

.hero::after {
  content: none;
}

.hero .container {
  position: relative;
  z-index: 1;
  animation: fade-up 0.8s ease-out both;
}

.hero-logo {
  display: block;
  margin: 0 auto 32px;
  width: 96px;
  height: auto;
  animation: logo-pulse 4s ease-in-out infinite alternate;
  will-change: filter;
}

.hero h1 {
  font-size: 4rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 24px;
  color: var(--text);
}

.hero-tagline {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto 12px;
  line-height: 1.7;
}

.hero-subline {
  font-size: 1.4rem;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 40px;
  text-shadow: 0 0 30px rgba(139, 0, 0, 0.3);
}

.hero-ctas {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 12px 28px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font-stack);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--red);
  color: var(--text);
  box-shadow: 0 0 0 0 rgba(139, 0, 0, 0);
  transition: background 0.2s ease, box-shadow 0.3s ease, transform 0.2s ease;
}

.btn-primary:hover {
  background: var(--red-bright);
  color: var(--text);
  box-shadow: 0 0 20px rgba(139, 0, 0, 0.4);
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  transition: color 0.2s ease, border-color 0.2s ease, box-shadow 0.3s ease;
}

.btn-secondary:hover {
  color: var(--text);
  border-color: var(--text-dim);
  box-shadow: 0 0 12px rgba(139, 0, 0, 0.15);
}

.btn-large {
  padding: 16px 36px;
  font-size: 1.05rem;
}

/* Sections */
.section {
  padding: 64px 0;
  border-top: 1px solid var(--border);
}

.section-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red-bright);
  margin-bottom: 12px;
}

.section h2 {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text);
}

.section p {
  color: var(--text-muted);
  max-width: 640px;
  line-height: 1.7;
}

/* Feature grid */
.features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  padding: 80px 0;
}

.feature {
  padding: 32px;
  border-top: none;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.feature:last-child {
  grid-column: 1 / -1;
}

.feature:hover {
  border-color: var(--red-dim);
  box-shadow: 0 0 24px rgba(139, 0, 0, 0.12), inset 0 1px 0 rgba(139, 0, 0, 0.1);
  transform: translateY(-2px);
}

.feature-icon {
  width: 28px;
  height: 28px;
  margin-bottom: 12px;
  fill: none;
  stroke: var(--red-bright);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.feature-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red-bright);
  margin-bottom: 12px;
}

.feature h3 {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text);
}

.feature p {
  color: var(--text-muted);
  max-width: 600px;
  line-height: 1.7;
}

/* Scroll-triggered fade-in */
.feature,
.downloads {
  animation: scroll-fade-in linear both;
  animation-timeline: view();
  animation-range: entry 0% entry 30%;
}

/* Download section */
.downloads {
  padding: 100px 0;
  border-top: 1px solid rgba(139, 0, 0, 0.3);
  text-align: center;
}

.downloads h2 {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.downloads-sub {
  color: var(--text-muted);
  margin-bottom: 32px;
}

.download-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 32px;
  justify-content: center;
}

.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  background: var(--bg-surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.95rem;
  font-weight: 500;
  font-family: var(--font-stack);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  text-decoration: none;
}

.download-btn:hover {
  border-color: var(--text-dim);
  background: var(--bg-elevated);
  color: var(--text);
}

.download-btn.primary {
  border-color: var(--red);
  background: var(--red-dim);
  box-shadow: 0 0 16px rgba(139, 0, 0, 0.3);
}

.download-btn.primary:hover {
  background: var(--red);
  box-shadow: 0 0 24px rgba(139, 0, 0, 0.5);
}

.downloads-alt {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.downloads-alt a {
  color: var(--text-muted);
}

/* Code block */
.code-block {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 20px 24px;
  overflow-x: auto;
  margin-top: 16px;
  max-width: 640px;
}

.code-block code {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text-muted);
  white-space: pre;
  line-height: 1.6;
}

.code-label {
  font-size: 0.8rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  font-weight: 600;
}

/* Terminal chrome */
.terminal {
  max-width: 640px;
  margin: 16px auto 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-elevated);
  text-align: left;
}

.terminal-bar {
  display: flex;
  gap: 6px;
  padding: 10px 14px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-dim);
}

.terminal .code-block {
  border: none;
  border-radius: 0;
  margin-top: 0;
}

.cmd-prompt { color: var(--red-bright); }
.cmd-keyword { color: var(--red-bright); }
.cmd-arg { color: var(--text-muted); }

/* Footer */
.footer {
  padding: 48px 0;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.85rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  color: var(--text-dim);
  font-size: 0.85rem;
}

.footer-links a:hover {
  color: var(--text-muted);
}

.footer-org a {
  color: var(--text-dim);
}

.footer-org a:hover {
  color: var(--text-muted);
}

/* Invite card */
.invite-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.invite-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 48px 40px;
  max-width: 480px;
  width: 100%;
  text-align: center;
}

.invite-card .invite-logo {
  width: 56px;
  height: auto;
  margin: 0 auto 24px;
  display: block;
}

.invite-card h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.invite-card .invite-description {
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.6;
}

.invite-server-url {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  background: var(--bg);
  padding: 8px 12px;
  border-radius: 4px;
  margin-bottom: 28px;
  word-break: break-all;
}

.invite-open-btn {
  display: block;
  width: 100%;
  padding: 16px;
  background: var(--red);
  color: var(--text);
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-stack);
  cursor: pointer;
  transition: background 0.15s ease;
  margin-bottom: 20px;
}

.invite-open-btn:hover {
  background: var(--red-bright);
}

.invite-fallback {
  opacity: 0;
  transition: opacity 0.3s ease;
  margin-top: 8px;
}

.invite-fallback.visible {
  opacity: 1;
}

.invite-fallback p {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.invite-security {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.6;
}

/* Open / protocol page */
.page {
  padding: 80px 0 64px;
}

.page h1 {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 12px;
  margin-top: 24px;
}

.page h2 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-top: 40px;
  margin-bottom: 12px;
  color: var(--text);
}

.page p {
  color: var(--text-muted);
  max-width: 640px;
  line-height: 1.7;
  margin-bottom: 16px;
}

.page ul {
  color: var(--text-muted);
  max-width: 640px;
  line-height: 1.8;
  padding-left: 20px;
  margin-bottom: 16px;
}

.page li {
  margin-bottom: 8px;
}

.back-link {
  color: var(--text-dim);
  font-size: 0.85rem;
}

.inline-code {
  font-family: var(--font-mono);
  background: var(--bg-elevated);
  padding: 2px 6px;
  border-radius: 3px;
}

.code-block-narrow {
  max-width: 640px;
  margin-bottom: 16px;
}

.download-buttons-spaced {
  margin-top: 16px;
}

/* Error / invite error page */
.btn-block {
  display: inline-block;
  margin-top: 20px;
}

/* 404 */
.not-found {
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.not-found h1 {
  font-size: 6rem;
  font-weight: 700;
  color: var(--red);
  margin-bottom: 8px;
  line-height: 1;
}

.not-found p {
  color: var(--text-muted);
  margin-bottom: 32px;
}

/* Responsive */
@media (max-width: 640px) {
  .hero {
    padding: 80px 0 48px;
  }

  .hero h1 {
    font-size: 2.5rem;
  }

  .hero-tagline {
    font-size: 0.95rem;
  }

  .hero-subline {
    font-size: 1.1rem;
  }

  .hero-ctas {
    flex-direction: column;
    align-items: center;
  }

  .features {
    grid-template-columns: 1fr;
  }

  .feature:last-child {
    grid-column: auto;
  }

  .section h2,
  .downloads h2 {
    font-size: 1.4rem;
  }

  .feature h3 {
    font-size: 1.2rem;
  }

  .download-buttons {
    flex-direction: column;
  }

  .download-btn {
    justify-content: center;
  }

  .terminal {
    margin-left: auto;
    margin-right: auto;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  .footer-links {
    justify-content: center;
  }

  .invite-card {
    padding: 32px 24px;
  }

  .not-found h1 {
    font-size: 4rem;
  }
}

/* JS scroll animation fallback (for browsers without animation-timeline) */
.scroll-ready .feature,
.scroll-ready .downloads {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.scroll-ready .feature.visible,
.scroll-ready .downloads.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Screen-reader only utility */
.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;
}

/* Browsers with animation-timeline support don't need the JS fallback */
@supports (animation-timeline: view()) {
  .scroll-ready .feature,
  .scroll-ready .downloads {
    opacity: initial;
    transform: initial;
    transition: none;
  }
}
