/* ============================================================
   markovstate.sh — shared design system
   Minimal, premium, engineering-console aesthetic. Dark only.
   ============================================================ */

:root {
  --bg: #050505;
  --bg-soft: #0a0a0a;
  --text: #f2f2f2;
  --muted: #888888;
  --accent: #59f3b0;
  --accent-dim: rgba(89, 243, 176, 0.12);
  --border: #1a1a1a;
  --border-strong: #262626;

  --nav-h: 64px;
  --maxw: 1180px;
  --font-mono: "IBM Plex Mono", "JetBrains Mono", ui-monospace, SFMono-Regular,
    Menlo, Consolas, monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.6;
  font-weight: 400;
  letter-spacing: 0.2px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--accent);
  color: #021a10;
}

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

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 32px;
}

.accent {
  color: var(--accent);
}
.muted {
  color: var(--muted);
}

/* ----------------------------- Navigation ----------------------------- */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: rgba(5, 5, 5, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav__inner {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}

.brand .cursor {
  display: inline-block;
  width: 8px;
  height: 15px;
  margin-left: 2px;
  background: var(--accent);
  transform: translateY(2px);
  animation: blink 1.1s steps(1) infinite;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 38px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__links a {
  position: relative;
  font-size: 13.5px;
  color: var(--muted);
  padding: 4px 0;
  transition: color 0.25s var(--ease);
}

.nav__links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}

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

.nav__links a:hover::after,
.nav__links a.is-active::after {
  transform: scaleX(1);
}

.nav__links a.is-active {
  color: var(--text);
}

.nav__status {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(89, 243, 176, 0.55);
  animation: pulse 2.4s var(--ease) infinite;
}

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 6px;
}
.nav__toggle span {
  width: 22px;
  height: 1.5px;
  background: var(--text);
  transition: 0.3s var(--ease);
}

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

.footer {
  border-top: 1px solid var(--border);
  margin-top: 96px;
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 0;
  gap: 24px;
  flex-wrap: wrap;
}

.footer__copy {
  font-size: 13px;
  color: var(--muted);
}

.footer__social {
  display: flex;
  align-items: center;
  gap: 22px;
}

.footer__social a {
  color: var(--muted);
  display: inline-flex;
  transition: color 0.25s var(--ease), transform 0.25s var(--ease);
}

.footer__social a:hover {
  color: var(--accent);
  transform: translateY(-2px);
}

.footer__social svg {
  width: 17px;
  height: 17px;
  display: block;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--text);
  border: 1px solid var(--border-strong);
  padding: 12px 20px;
  cursor: pointer;
  background: transparent;
  transition: border-color 0.25s var(--ease), color 0.25s var(--ease),
    background 0.25s var(--ease);
}

.btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.btn .arrow {
  transition: transform 0.25s var(--ease);
}
.btn:hover .arrow {
  transform: translateX(4px);
}

.link-arrow {
  color: var(--muted);
  font-size: 13.5px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: color 0.25s var(--ease);
}
.link-arrow:hover {
  color: var(--accent);
}
.link-arrow .arrow {
  transition: transform 0.25s var(--ease);
}
.link-arrow:hover .arrow {
  transform: translateX(4px);
}

/* --------------------------- Reveal animation -------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  will-change: opacity, transform;
}
.reveal.is-in {
  opacity: 1;
  transform: none;
}

/* -------------------------------- Page --------------------------------- */

.page {
  padding-top: var(--nav-h);
}

.section-label {
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: 1.5px;
}

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

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(89, 243, 176, 0.5);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(89, 243, 176, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(89, 243, 176, 0);
  }
}

/* ---------------------------- Mobile / nav ----------------------------- */

@media (max-width: 820px) {
  .container,
  .nav__inner {
    padding-left: 22px;
    padding-right: 22px;
  }

  .nav__toggle {
    display: flex;
  }

  .nav__status {
    display: none;
  }

  .nav__links {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: rgba(5, 5, 5, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 8px 22px 16px;
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
  }

  .nav__links.is-open {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }

  .nav__links a {
    width: 100%;
    padding: 14px 0;
    font-size: 15px;
    border-bottom: 1px solid var(--border);
  }
  .nav__links a::after {
    display: none;
  }

  .nav.is-open .nav__toggle span:nth-child(1) {
    transform: translateY(6.5px) rotate(45deg);
  }
  .nav.is-open .nav__toggle span:nth-child(2) {
    opacity: 0;
  }
  .nav.is-open .nav__toggle span:nth-child(3) {
    transform: translateY(-6.5px) rotate(-45deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}
