:root {
  --bg: #0a0a0b;
  --bg-elevated: #111113;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-hover: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.09);
  --border-hover: rgba(255, 255, 255, 0.18);
  --text: #f2f1ed;
  --text-muted: rgba(242, 241, 237, 0.62);
  --text-faint: rgba(242, 241, 237, 0.38);
  --accent: #ff4e2d;
  --accent-soft: rgba(255, 78, 45, 0.14);
  --cream: #f5f3ee;
  --container: 860px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  background: var(--bg);
  color-scheme: dark;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

a:hover {
  text-decoration: underline;
}

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

::selection {
  background: var(--accent);
  color: #0a0a0b;
}

.noise {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 10, 11, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1100px;
  margin-inline: auto;
  padding: 16px clamp(20px, 5vw, 48px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.logo {
  font-family: "Bricolage Grotesque", "Inter", sans-serif;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
  color: var(--text);
}

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

.logo span {
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(14px, 3vw, 30px);
  list-style: none;
  flex-wrap: wrap;
}

.nav-links a {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.25s var(--ease-out);
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--text);
  text-decoration: none;
}

/* ---------- layout ---------- */

main {
  flex: 1;
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding: clamp(48px, 8vw, 96px) clamp(20px, 5vw, 32px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}

h1 {
  font-family: "Bricolage Grotesque", "Inter", sans-serif;
  font-size: clamp(2rem, 5.5vw, 3.1rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.035em;
  color: var(--cream);
  margin-bottom: 20px;
  text-wrap: balance;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  font-size: 0.88rem;
  color: var(--text-faint);
  padding-bottom: 28px;
  margin-bottom: 36px;
  border-bottom: 1px solid var(--border);
}

.tag {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 5px 11px;
}

.lede {
  color: var(--text-faint);
  font-size: 0.92rem;
  margin-bottom: 32px;
}

/* ---------- prose ---------- */

.prose h2 {
  font-family: "Bricolage Grotesque", "Inter", sans-serif;
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--cream);
  margin: 48px 0 16px;
}

.prose h3 {
  font-family: "Bricolage Grotesque", "Inter", sans-serif;
  font-size: clamp(1.15rem, 2.4vw, 1.35rem);
  font-weight: 600;
  color: var(--cream);
  margin: 34px 0 12px;
}

.prose p {
  color: var(--text-muted);
  margin-bottom: 20px;
}

.prose strong {
  color: var(--text);
  font-weight: 600;
}

.prose ul,
.prose ol {
  margin: 0 0 22px 22px;
  color: var(--text-muted);
}

.prose li {
  margin-bottom: 10px;
  padding-left: 6px;
}

.prose li::marker {
  color: var(--accent);
}

.prose a {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(255, 78, 45, 0.4);
}

.prose a:hover {
  text-decoration-color: var(--accent);
}

.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88em;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 6px;
}

/* ---------- related project ---------- */

.related {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 26px 28px;
  margin-bottom: 40px;
}

.related h2 {
  font-family: "Bricolage Grotesque", "Inter", sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 10px;
}

.related p {
  color: var(--text-muted);
  font-size: 0.96rem;
  margin-bottom: 16px;
}

.related-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.related-links a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 9px 17px;
  transition: background 0.28s var(--ease-out), border-color 0.28s var(--ease-out);
}

.related-links a:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
  text-decoration: none;
}

/* ---------- post list ---------- */

.post-list {
  list-style: none;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

.post-list li {
  border-bottom: 1px solid var(--border);
}

.post-list a {
  display: block;
  padding: 28px 14px;
  color: inherit;
  transition: background 0.32s var(--ease-out), padding-inline 0.32s var(--ease-out);
}

.post-list a:hover {
  background: var(--surface);
  padding-inline: 22px;
  text-decoration: none;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 11px;
  font-size: 0.82rem;
  color: var(--text-faint);
}

.post-title {
  font-family: "Bricolage Grotesque", "Inter", sans-serif;
  font-size: clamp(1.15rem, 2.6vw, 1.55rem);
  font-weight: 600;
  line-height: 1.28;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 10px;
  transition: color 0.28s var(--ease-out);
}

.post-list a:hover .post-title {
  color: var(--accent);
}

.post-excerpt {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0;
}

/* ---------- article footer nav ---------- */

.article-footer {
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 12px 22px;
  transition: background 0.28s var(--ease-out), border-color 0.28s var(--ease-out);
}

.btn:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
  text-decoration: none;
}

.btn-solid {
  background: var(--accent);
  border-color: var(--accent);
  color: #0a0a0b;
  font-weight: 600;
}

.btn-solid:hover {
  background: #ff6748;
  border-color: #ff6748;
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px clamp(20px, 5vw, 48px);
  margin-top: auto;
}

.footer-inner {
  max-width: 1100px;
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

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

.footer-links a {
  font-size: 0.88rem;
  color: var(--text-muted);
  transition: color 0.25s var(--ease-out);
}

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

.copyright {
  font-size: 0.85rem;
  color: var(--text-faint);
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
  }
}
