/* Desmodus site.
   Palette is taken from the logo: a bruised, red-undertoned black rather
   than neutral grey, the logo's outline red, and bone-white text. */

@font-face {
  font-family: "Bodoni Moda";
  src: url("fonts/bodoni-moda.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Bodoni Moda";
  src: url("fonts/bodoni-moda-italic.woff2") format("woff2");
  font-weight: 400 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Blackcraft";
  src: url("fonts/blackcraft.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Protest Revolution";
  src: url("fonts/protest-revolution.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("fonts/hanken-grotesk.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/ibm-plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/ibm-plex-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

:root {
  --night:      #110b0e;  /* page */
  --hide:       #1a1115;  /* raised surfaces */
  --vein:       #2e1d24;  /* borders, rules */
  --blood:      #e0303f;  /* the logo's outline red */
  --blood-deep: #9c1a2a;
  --bone:       #f1e8e3;  /* text */
  --ash:        #a8959c;  /* secondary text */

  /* Headline face for the big titles only; Bodoni stays on smaller headings
     (feature cards, wordmark, signature) where the brush face gets hard to read. */
  /* Trying Blackcraft; if it reads too rough, swap back to "Protest Revolution"
     (still in fonts/) and move the preload in index.html with it. */
  --font-headline: "Blackcraft", "Bodoni Moda", Georgia, serif;
  --font-display: "Bodoni Moda", "Didot", Georgia, serif;
  --font-body:    "Hanken Grotesk", system-ui, sans-serif;
  --font-mono:    "IBM Plex Mono", ui-monospace, monospace;

  --wrap: 1180px;
  --gutter: clamp(20px, 4vw, 40px);
  --radius: 10px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  background: var(--night);
  color: var(--bone);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  color: var(--bone);
  background: var(--vein);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

:focus-visible {
  outline: 2px solid var(--blood);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -100px;
  z-index: 100;
  background: var(--bone);
  color: var(--night);
  padding: 8px 14px;
  border-radius: 6px;
}
.skip-link:focus { top: 12px; }

/* ── Type ─────────────────────────────────────── */

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blood);
  margin-bottom: 18px;
}

.section-title {
  font-family: var(--font-headline);
  font-weight: 400;
  font-size: clamp(2rem, 4.2vw, 3.1rem);
  line-height: 1.08;
  letter-spacing: 0;
  max-width: 20ch;
  margin-bottom: 28px;
}

/* ── Buttons ──────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.btn-primary {
  background: var(--blood);
  color: #fff;
}
.btn-primary:hover { background: var(--blood-deep); }
.btn-ghost {
  border-color: var(--vein);
  color: var(--bone);
}
.btn-ghost:hover { border-color: var(--ash); }
.btn-small {
  padding: 8px 16px;
  font-size: 0.9rem;
  background: var(--bone);
  color: var(--night);
}
.btn-small:hover { background: #fff; }
.btn-sub {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 400;
  opacity: 0.8;
}

/* ── Header ───────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgb(17 11 14 / 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--vein);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.3rem;
  letter-spacing: 0.01em;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
  padding: 0;
}
.nav-links a:not(.btn) {
  text-decoration: none;
  color: var(--ash);
  font-size: 0.95rem;
}
.nav-links a:not(.btn):hover { color: var(--bone); }

@media (max-width: 720px) {
  .nav-links li:not(:last-child) { display: none; }
}

/* ── Hero ─────────────────────────────────────── */

.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--vein);
}
.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  align-items: center;
  gap: 40px;
  min-height: min(760px, calc(100vh - 64px));
  padding-block: 72px;
}
.hero-title {
  font-family: var(--font-headline);
  font-weight: 400;
  font-size: clamp(2.6rem, 6.4vw, 5.2rem);
  line-height: 1.02;
  letter-spacing: 0;
  margin-bottom: 28px;
}
.hero-title em {
  font-style: normal;
  color: var(--blood);
}
.hero-lede {
  font-size: 1.2rem;
  color: var(--ash);
  max-width: 34em;
  margin-bottom: 36px;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.hero-meta {
  margin-top: 18px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ash);
}

/* Signature: echolocation. Rings leave the mark and fade into the dark,
   the way a call goes out from a bat. */
.sonar {
  position: relative;
  aspect-ratio: 1;
  width: 100%;
  max-width: 520px;
  justify-self: center;
  display: grid;
  place-items: center;
}
.sonar::before {
  content: "";
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  background: radial-gradient(circle, rgb(224 48 63 / 0.22), transparent 70%);
}
.sonar-mark {
  position: relative;
  width: 44%;
  height: auto;
  filter: drop-shadow(0 0 28px rgb(224 48 63 / 0.35));
}
.ring {
  position: absolute;
  inset: 0;
  border: 1.5px solid var(--blood);
  border-radius: 50%;
  opacity: 0;
  transform: scale(0.3);
  animation: ping 6s cubic-bezier(0.2, 0.6, 0.3, 1) infinite;
}
.ring:nth-child(2) { animation-delay: 1.5s; }
.ring:nth-child(3) { animation-delay: 3s; }
.ring:nth-child(4) { animation-delay: 4.5s; }

@keyframes ping {
  0%   { transform: scale(0.3); opacity: 0; }
  8%   { opacity: 0.55; }
  100% { transform: scale(1); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .ring { animation: none; opacity: 0.18; }
  .ring:nth-child(1) { transform: scale(0.55); }
  .ring:nth-child(2) { transform: scale(0.7); opacity: 0.12; }
  .ring:nth-child(3) { transform: scale(0.85); opacity: 0.07; }
  .ring:nth-child(4) { transform: scale(1); opacity: 0.04; }
}

@media (max-width: 860px) {
  .hero-inner {
    grid-template-columns: 1fr;
    min-height: 0;
    padding-block: 48px 64px;
  }
  .sonar {
    order: -1;
    max-width: 280px;
  }
}

/* ── Sections ─────────────────────────────────── */

.section {
  padding-block: clamp(72px, 10vw, 128px);
  border-bottom: 1px solid var(--vein);
}

/* About + slideshow */
.about-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
.about-copy p:not(.eyebrow) {
  color: var(--ash);
  margin-bottom: 1em;
  max-width: 36em;
}
@media (max-width: 960px) {
  .about-inner { grid-template-columns: 1fr; }
}

.slideshow {
  position: relative;
}
.slides {
  position: relative;
  aspect-ratio: var(--slide-ratio, 16 / 10);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--hide);
  border: 1px solid var(--vein);
  box-shadow: 0 30px 80px -30px rgb(0 0 0 / 0.8), 0 0 0 1px rgb(255 255 255 / 0.02);
}
.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s;
}
.slide.is-active {
  opacity: 1;
  visibility: visible;
}
/* Server console shots are a wide terminal window. */
.slideshow-wide { --slide-ratio: 1675 / 749; }

.slide img,
.slide-placeholder {
  width: 100%;
  height: 100%;
}
.slide img {
  object-fit: contain;
  background: var(--night);
}
.slide-placeholder {
  display: grid;
  place-items: center;
  background:
    repeating-linear-gradient(135deg, transparent 0 14px, rgb(255 255 255 / 0.015) 14px 28px),
    var(--hide);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ash);
}
/* Captions are shown under the frame (main.js copies the active one into
   .slide-caption) so they don't cover the screenshot. */
.slide figcaption { display: none; }
.slide-caption {
  margin-top: 14px;
  min-height: 1.5em;
  text-align: center;
  font-size: 0.92rem;
  color: var(--ash);
}
@media (prefers-reduced-motion: reduce) {
  .slide { transition: none; }
}

.slide-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 10px;
}
.slide-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--vein);
  background: transparent;
  color: var(--bone);
  cursor: pointer;
}
.slide-btn:hover { border-color: var(--ash); }
.slide-dots {
  display: flex;
  gap: 4px;
}
.slide-dot {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.slide-dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--vein);
  transition: background-color 0.2s, transform 0.2s;
}
.slide-dot:hover::before { background: var(--ash); }
.slide-dot[aria-current="true"]::before {
  background: var(--blood);
  transform: scale(1.25);
}

/* Why */
.why-inner {
  max-width: 760px;
}
.why-inner p:not(.eyebrow, .why-sign, .why-ps) {
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--bone);
  margin-bottom: 1.1em;
}
.why-inner .why-sign {
  margin: 36px 0 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 2rem;
  line-height: 1;
  color: var(--bone);
}
.why-sign {
  text-shadow: 0 0 18px rgb(224 48 63 / 0.35);
  animation: glow 4s ease-in-out infinite alternate;
}
/* Drawn rather than typed: the ~ glyph sits at a different height in
   Firefox and Chromium. */
.why-sign .tilde {
  display: inline-block;
  width: 0.62em;
  height: 0.26em;
  margin-right: 0.08em;
  vertical-align: 0.2em;
  fill: none;
  stroke: var(--blood);
  stroke-width: 2.2;
  stroke-linecap: round;
  overflow: visible;
}
.why-ps {
  margin-top: 28px;
  font-size: 0.95rem;
  color: var(--ash);
}
.why-ps a { color: var(--bone); }
.why-ps a:hover { color: var(--blood); }

/* A slow breath, kept faint so it doesn't compete with the hero rings. */
@keyframes glow {
  from { text-shadow: 0 0 14px rgb(224 48 63 / 0.25); }
  to   { text-shadow: 0 0 24px rgb(224 48 63 / 0.65); }
}
@media (prefers-reduced-motion: reduce) {
  .why-sign { animation: none; }
}

/* Features */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 56px;
  background: var(--vein);
  border: 1px solid var(--vein);
  border-radius: var(--radius);
  overflow: hidden;
}
.feature {
  background: var(--night);
  padding: 32px 30px 36px;
  transition: background-color 0.2s;
}
.feature:hover { background: var(--hide); }
.feature h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.45rem;
  line-height: 1.2;
  margin-bottom: 12px;
}
.feature p {
  color: var(--ash);
  font-size: 0.98rem;
}
@media (max-width: 960px) {
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .feature-grid { grid-template-columns: 1fr; }
}

.extras {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  padding: 0;
  margin-top: 28px;
}
.extras li {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ash);
  border: 1px solid var(--vein);
  border-radius: 999px;
  padding: 6px 14px;
}

/* Self-host */
.self-host-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}
.host-notes {
  display: grid;
  gap: 28px;
}
.note h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 4px;
}
.note p { color: var(--ash); }
.steps {
  list-style: none;
  padding: 0;
  counter-reset: step;
  display: grid;
  gap: 26px;
}
.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 52px;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -2px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--vein);
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--blood);
}
.steps h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 4px;
}
.steps p { color: var(--ash); }

.terminal {
  background: #0a0608;
  border: 1px solid var(--vein);
  border-radius: var(--radius);
  padding: 22px 24px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.8;
  color: var(--bone);
}
.terminal code {
  background: none;
  padding: 0;
  font-size: inherit;
}
.t-dim { color: var(--ash); }
.t-ok { color: var(--blood); }

@media (max-width: 860px) {
  .self-host-inner { grid-template-columns: 1fr; }
}

.server-shots {
  margin-top: clamp(56px, 8vw, 96px);
}
.server-shots-title {
  font-family: var(--font-headline);
  font-weight: 400;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  line-height: 1.15;
  margin-bottom: 8px;
}
.server-shots-lede {
  color: var(--ash);
  margin-bottom: 28px;
}

/* Download */
.download {
  text-align: center;
  background: radial-gradient(ellipse 60% 80% at 50% 100%, rgb(224 48 63 / 0.12), transparent 70%);
}
.download-title {
  font-family: var(--font-headline);
  font-weight: 400;
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  line-height: 1.05;
  margin-bottom: 14px;
}
.download-lede {
  color: var(--ash);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  margin-bottom: 36px;
}
.download-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}
.download-buttons .btn {
  flex-direction: column;
  gap: 2px;
  min-width: 220px;
  padding: 14px 28px;
}
.download-note {
  margin-top: 32px;
  color: var(--ash);
  font-size: 0.92rem;
}
.download-note a { color: var(--bone); }

/* ── Footer ───────────────────────────────────── */

.site-footer {
  padding-block: 40px;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 32px;
}
.site-footer .brand { font-size: 1.1rem; }
.footer-links {
  display: flex;
  gap: 24px;
  list-style: none;
  padding: 0;
}
.footer-links a {
  color: var(--ash);
  text-decoration: none;
  font-size: 0.92rem;
}
.footer-links a:hover { color: var(--bone); }
.footer-fine {
  margin-left: auto;
  color: var(--ash);
  font-size: 0.85rem;
}
@media (max-width: 620px) {
  .footer-fine { margin-left: 0; width: 100%; }
}
