/* edmpl.io — shared design system
   Tokens unified from the index page (reference design), extended with the
   raised/code/chip/warn tokens the article pages use. */

:root {
  --bg: #191B1F;
  --bg-deep: #0C0D0F;
  --bg-header: #0E0F11;
  --bg-raised: #23262B;
  --bg-code: #14161A;
  --panel: rgba(22, 24, 27, 0.74);
  --panel-strong: rgba(13, 14, 16, 0.86);
  --text: #E9E5DC;
  --text-muted: #B6AFA4;
  --text-dim: #777167;
  --accent: #7FA98C;
  --accent-bright: #A8D1B5;
  --amber: #D5A05F;
  --red: #C87976;
  --divider: rgba(233, 229, 220, 0.11);
  --divider-strong: rgba(168, 209, 181, 0.22);
  --chip-bg: rgba(127, 169, 140, 0.08);
  --chip-border: rgba(127, 169, 140, 0.22);
  --warn-border: #B85A5E;
  --warn-bg: rgba(184, 90, 94, 0.10);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Source Serif 4', Georgia, serif;
  color: var(--text);
  background:
    radial-gradient(ellipse 72% 58% at 70% 5%, rgba(127, 169, 140, 0.12), transparent 62%),
    linear-gradient(135deg, var(--bg) 0%, #16181C 46%, var(--bg-deep) 100%);
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; }

/* ---------- Header / nav ---------- */

.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 18px clamp(22px, 5vw, 60px);
  background: rgba(12, 13, 15, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--divider);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  transition: transform 260ms var(--ease-out);
}

.header.hidden { transform: translateY(-100%); }

.logo {
  font-size: clamp(24px, 4vw, 30px);
  color: var(--text);
  text-decoration: none;
  font-family: "Jacquard 12", sans-serif;
  white-space: nowrap;
}

.navbar {
  display: flex;
  gap: clamp(18px, 4vw, 32px);
  align-items: center;
}

.navbar a {
  font-family: "Oswald", sans-serif;
  font-size: 15px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 160ms ease;
}

.navbar a:hover,
.navbar a:focus-visible,
.navbar a.active { color: var(--accent-bright); }

@media (max-width: 640px) {
  .header { padding: 14px 18px; }
  .navbar a { font-size: 12px; letter-spacing: 0.08em; }
}

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

.footerContainer {
  background-color: var(--bg-header);
  border-top: 1px solid var(--divider);
  padding: 22px;
  text-align: center;
  margin-top: 80px;
  position: relative;
  z-index: 1;
}
.socialIcons { margin-bottom: 8px; }
.socialIcons a {
  color: var(--accent);
  font-size: 20px;
  margin: 0 12px;
  text-decoration: none;
  transition: color 0.2s ease;
}
.socialIcons a:hover { color: var(--accent-bright); }
.Closing {
  font-family: 'Fira Code', monospace;
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}

/* ---------- Signal glitch (logo, profile name) ---------- */

@keyframes rgb-flicker {
  0%, 93.4%, 100% { text-shadow: none; transform: translateX(0); }
  93.8% {
    text-shadow: -2px 0 rgba(200, 121, 118, 0.85), 2px 0 rgba(127, 169, 140, 0.85);
    transform: translateX(1px);
  }
  94.6% {
    text-shadow: 2px 0 rgba(200, 121, 118, 0.55), -2px 0 rgba(168, 209, 181, 0.65);
    transform: translateX(-1px);
  }
  95.2% { text-shadow: none; transform: translateX(0); }
}

.glitchable { animation: rgb-flicker 9s steps(1) infinite; }
.logo.glitchable { animation-duration: 13s; animation-delay: 4.5s; }

/* ---------- Entrance ---------- */

.stagger-in {
  opacity: 0;
  transform: translateY(12px);
  animation: enter 620ms var(--ease-out) forwards;
}

.stagger-in:nth-child(2) { animation-delay: 60ms; }
.stagger-in:nth-child(3) { animation-delay: 120ms; }
.stagger-in:nth-child(4) { animation-delay: 180ms; }
.stagger-in:nth-child(5) { animation-delay: 240ms; }
.stagger-in:nth-child(6) { animation-delay: 300ms; }

@keyframes enter {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

  .glitchable { animation: none; }

  .stagger-in {
    animation: fade 180ms ease forwards;
    transform: none;
  }

  @keyframes fade { to { opacity: 1; } }
}
