/* ============================================================
   mnemo — site stylesheet
   Dark, Dracula-flavored, zero-framework.
   ============================================================ */

:root {
  --bg-deep: #191a21;
  --bg-base: #1e1f29;
  --bg-elev: #282a36;
  --bg-elev-2: #2f3241;
  --fg: #f8f8f2;
  --fg-dim: #b6b7c4;
  --fg-muted: #8b8d9c;
  --purple: #bd93f9;
  --pink: #ff79c6;
  --cyan: #8be9fd;
  --green: #50fa7b;
  --yellow: #f1fa8c;
  --orange: #ffb86c;
  --red: #ff5555;
  --comment: #6272a4;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(189, 147, 249, 0.35);
  --shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.65);
  --radius: 14px;
  --font-ui: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  font-family: var(--font-ui);
  background: var(--bg-deep);
  color: var(--fg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection {
  background: var(--purple);
  color: var(--bg-deep);
}

a {
  color: var(--purple);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: min(1100px, 92%);
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--purple);
  color: var(--bg-deep);
  padding: 0.5rem 1rem;
  border-radius: 0 0 8px 0;
  font-weight: 600;
  z-index: 100;
}

.skip-link:focus {
  left: 0;
}

/* ---------- Nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem max(2rem, calc((100vw - 1100px) / 2));
  background: color-mix(in srgb, var(--bg-deep) 82%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--fg);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.nav__brand:hover {
  text-decoration: none;
}

.nav__logo {
  width: 26px;
  height: 26px;
}

.nav__links {
  display: flex;
  gap: 1.6rem;
}

.nav__links a {
  color: var(--fg-dim);
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 0.2s var(--ease);
}

.nav__links a:hover {
  color: var(--purple);
  text-decoration: none;
}

.nav__cta {
  font-size: 0.85rem;
  padding: 0.45rem 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.15s var(--ease), box-shadow 0.2s var(--ease),
    background 0.2s var(--ease), border-color 0.2s var(--ease);
  border: 1px solid transparent;
  text-decoration: none !important;
}

.btn--primary {
  background: var(--purple);
  color: #14151d;
  box-shadow: 0 8px 30px -8px rgba(189, 147, 249, 0.6);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 36px -8px rgba(189, 147, 249, 0.7);
}

.btn--ghost {
  border-color: var(--border);
  color: var(--fg);
  background: var(--bg-elev);
}

.btn--ghost:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
}

.btn:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding: clamp(4.5rem, 10vw, 7.5rem) 0 4rem;
  text-align: center;
  overflow: hidden;
}

.hero__glow {
  position: absolute;
  top: -30%;
  left: 50%;
  transform: translateX(-50%);
  width: min(900px, 120vw);
  height: 520px;
  background: radial-gradient(
    ellipse at center,
    rgba(189, 147, 249, 0.22) 0%,
    rgba(139, 233, 253, 0.08) 45%,
    transparent 70%
  );
  pointer-events: none;
}

.hero__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--cyan);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.35rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elev);
  margin-bottom: 1.6rem;
}

.hero__title {
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
}

.grad {
  background: linear-gradient(100deg, var(--purple), var(--cyan) 55%, var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__sub {
  max-width: 620px;
  margin-top: 1.4rem;
  font-size: clamp(1.02rem, 2vw, 1.2rem);
  color: var(--fg-dim);
}

.hero__sub strong {
  color: var(--fg);
}

.hero__cta {
  display: flex;
  gap: 1rem;
  margin-top: 2.2rem;
  flex-wrap: wrap;
  justify-content: center;
}

.hero__terminal {
  margin-top: 3.5rem;
  width: min(720px, 100%);
}

/* ---------- Terminal ---------- */

.terminal {
  text-align: left;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-base);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.terminal__bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
}

.terminal__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg-elev-2);
}

.terminal__dot:nth-of-type(1) { background: var(--red); }
.terminal__dot:nth-of-type(2) { background: var(--yellow); }
.terminal__dot:nth-of-type(3) { background: var(--green); }

.terminal__title {
  margin-left: auto;
  margin-right: auto;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--fg-muted);
}

.terminal__body {
  padding: 1.1rem 1.3rem;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.7;
  overflow-x: auto;
}

.terminal__body pre {
  white-space: pre;
}

.p { color: var(--green); }        /* prompt sigil */
.g { color: var(--green); }        /* success */
.c { color: var(--fg-dim); }       /* output */
.dim { color: var(--comment); }
.m { color: var(--fg-muted); }

.cursor {
  display: inline-block;
  width: 0.6em;
  height: 1.05em;
  background: var(--purple);
  vertical-align: text-bottom;
  animation: blink 1.1s steps(2) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* typing animation for lines marked .type */
.type {
  overflow: hidden;
  white-space: nowrap;
}

/* ---------- Trust bar ---------- */

.trust {
  padding: 1.2rem 0 2.5rem;
  border-bottom: 1px solid var(--border);
}

.trust__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  justify-content: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--fg-dim);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  background: var(--bg-elev);
}

.badge strong {
  color: var(--fg);
  font-weight: 600;
}

a.badge:hover {
  text-decoration: none;
  border-color: var(--border-strong);
}

/* ---------- Sections ---------- */

.section {
  padding: clamp(3.5rem, 8vw, 6rem) 0;
}

.section--alt {
  background: var(--bg-base);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section__head {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 3rem;
}

.section__head .eyebrow {
  margin-bottom: 1.1rem;
}

.section__head h2 {
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.section__sub {
  margin-top: 1rem;
  color: var(--fg-dim);
  font-size: 1.05rem;
}

/* ---------- Cards / grid ---------- */

.grid {
  display: grid;
  gap: 1.2rem;
}

.grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

.card {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem;
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease),
    background 0.25s var(--ease);
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
}

.card__icon {
  width: 26px;
  height: 26px;
  color: var(--purple);
  margin-bottom: 1rem;
}

.card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.45rem;
  letter-spacing: -0.01em;
}

.card p {
  color: var(--fg-dim);
  font-size: 0.92rem;
}

.card--link {
  display: block;
  position: relative;
  color: var(--fg);
  text-decoration: none !important;
}

.card--link h3 {
  color: var(--fg);
}

.card--link:hover h3 {
  color: var(--purple);
}

.card__arrow {
  position: absolute;
  top: 1.5rem;
  right: 1.4rem;
  color: var(--fg-muted);
  transition: transform 0.2s var(--ease), color 0.2s var(--ease);
}

.card--link:hover .card__arrow {
  transform: translateX(4px);
  color: var(--purple);
}

/* ---------- Steps ---------- */

.steps {
  list-style: none;
  max-width: 640px;
  margin: 0 auto;
}

.step {
  display: flex;
  gap: 1.5rem;
  padding: 1.2rem 0;
}

.step + .step {
  border-top: 1px solid var(--border);
}

.step__num {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--purple);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.15rem 0.55rem;
  height: fit-content;
  background: var(--bg-elev);
  white-space: nowrap;
}

.step__body h3 {
  font-size: 1.08rem;
  margin-bottom: 0.3rem;
}

.step__body p {
  color: var(--fg-dim);
  font-size: 0.95rem;
}

.inline {
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--cyan);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.05rem 0.4rem;
}

/* ---------- Demo ---------- */

.demo {
  text-align: center;
}

.demo img {
  width: min(820px, 100%);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin-inline: auto;
}

.demo figcaption {
  margin-top: 0.9rem;
  font-size: 0.85rem;
  color: var(--fg-muted);
}

.demo figcaption a {
  color: var(--cyan);
}

/* ---------- Code blocks ---------- */

.install {
  display: grid;
  gap: 1.4rem;
  max-width: 720px;
  margin: 0 auto;
}

.code {
  text-align: left;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-base);
  overflow: hidden;
}

.code__bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 1rem;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--fg-muted);
}

.copy {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--purple);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.2rem 0.6rem;
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.copy:hover {
  background: var(--purple);
  color: var(--bg-deep);
}

.copy[data-copied] {
  color: var(--green);
  border-color: var(--green);
}

.code pre {
  padding: 1.1rem 1.3rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.7;
}

.code .k { color: var(--pink); }
.code .s { color: var(--yellow); }
.code .b { color: var(--cyan); }
.code .c { color: var(--comment); font-style: italic; }
.code .p { color: var(--fg-muted); }
.code .g { color: var(--green); }
.code .dim { color: var(--comment); }

/* ---------- Quote ---------- */

.quote {
  max-width: 640px;
  margin: 2.4rem auto 0;
  text-align: center;
}

.quote blockquote {
  font-size: 1.05rem;
  color: var(--fg-dim);
  border-left: 3px solid var(--purple);
  padding-left: 1.2rem;
  text-align: left;
}

/* ---------- Final CTA ---------- */

.cta {
  text-align: center;
}

.cta__inner h2 {
  font-size: clamp(1.8rem, 4.5vw, 2.8rem);
  letter-spacing: -0.02em;
  margin-bottom: 2rem;
}

/* ---------- Footer ---------- */

.footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  background: var(--bg-base);
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer__brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
}

.footer__note {
  font-size: 0.85rem;
  color: var(--fg-muted);
}

/* ---------- Reveal on scroll ---------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .grid--3 {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .nav__links {
    display: none;
  }

  .nav {
    padding: 0.7rem 1.2rem;
  }

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

  .hero__cta {
    flex-direction: column;
    width: 100%;
    max-width: 320px;
  }

  .hero__cta .btn {
    width: 100%;
  }

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

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .cursor,
  .type {
    animation: none !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
