/* ── RESET & TOKENS ─────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0d0d0f;
  --bg2: #13131a;
  --bg3: #1a1a26;
  --border: #2a2a3d;
  --text: #e8e0d0;
  --text-muted: #a0a0b0;
  --neon-cyan: #3fa9bf;
  --neon-orange: #ff8c42;
  --neon-pink: #ff55ff;
  --accent-purple: #a855f7;
  --accent-green: #00aa00;
  --code-green: #22c55e;
  --content-max: 75ch;
  --font-mono: "Courier New", Courier, monospace;
  --font-sans: "Segoe UI", system-ui, sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.7;
  overflow-x: hidden;
}

a {
  color: var(--neon-cyan);
  text-decoration: underline;
  transition: all 0.2s;
}

a:hover {
  color: var(--bg);
  background-color: var(--neon-cyan);
}

/* ── GRAIN TEXTURE (bg only) ────────────────────────────── */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  opacity: 0.5;
}

/* ── SCROLLBAR ──────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--neon-orange);
  border-radius: 3px;
}

/* ── LAYOUT SHELL ───────────────────────────────────────── */
.shell {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ── MAIN CONTENT ───────────────────────────────────────── */
.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ── HERO ───────────────────────────────────────────────── */
.hero {
  height: 38vh;
  min-height: 280px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  padding: 2rem;
}

/* Sunset gradient */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 50% 110%, #ff7b3a55 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 50% 90%, #ffd96633 0%, transparent 60%),
    linear-gradient(to bottom, #0d0d0f 0%, #1a0d1a 40%, #2a0d0d 100%);
  z-index: 0;
}

/* Retro grid floor */
.hero-grid {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60%;
  background-image:
    linear-gradient(to bottom, transparent 0%, rgba(255, 123, 58, 0.15) 100%),
    repeating-linear-gradient(
      90deg,
      rgba(255, 123, 58, 0.15) 0px,
      rgba(255, 123, 58, 0.15) 1px,
      transparent 1px,
      transparent 40px
    ),
    repeating-linear-gradient(
      0deg,
      rgba(255, 123, 58, 0.15) 0px,
      rgba(255, 123, 58, 0.15) 1px,
      transparent 1px,
      transparent 40px
    );
  transform: perspective(400px) rotateX(40deg);
  transform-origin: bottom;
  z-index: 0;
}

/* Sun orb */
.hero-sun {
  position: absolute;
  bottom: 25%;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffd966 0%, #ff7b3a 55%, transparent 75%);
  box-shadow:
    0 0 40px 20px rgba(255, 123, 58, 0.4),
    0 0 80px 40px rgba(255, 123, 58, 0.15);
  z-index: 1;
}

/* Scanlines on hero */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.15) 2px,
    rgba(0, 0, 0, 0.15) 4px
  );
  z-index: 2;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 3;
}

.hero h1 {
  font-family: var(--font-mono);
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  text-shadow:
    0 0 20px var(--neon-orange),
    0 0 40px rgba(255, 123, 58, 0.5),
    0 0 80px rgba(255, 123, 58, 0.2);
  animation: flicker 4s infinite;
}

@keyframes flicker {
  0%,
  96%,
  100% {
    opacity: 1;
  }

  97% {
    opacity: 0.85;
  }

  98% {
    opacity: 1;
  }

  99% {
    opacity: 0.9;
  }
}

.hero-tag {
  margin-top: 0.5rem;
  font-family: var(--font-mono);
  font-size: clamp(0.75rem, 2vw, 1rem);
  color: var(--code-green);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-shadow: 0 0 10px var(--neon-cyan);
}

.hero-btns {
  margin-top: 1.5rem;
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.6rem 1.4rem;
  border-radius: 3px;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--neon-orange);
  color: #0d0d0f;
  box-shadow: 0 0 15px rgba(255, 123, 58, 0.5);
}

.btn-primary:hover {
  background: #fff;
  box-shadow: 0 0 25px rgba(255, 123, 58, 0.8);
}

.btn-ghost {  
  color: var(--code-green);  
  background-color: rgba(58, 255, 234, 0.3);
  border: 1px solid var(--code-green);
  box-shadow: 0 0 10px rgba(58, 255, 234, 0.2);
}

.btn-ghost:hover {
  background: rgba(58, 255, 234, 0.1);
  box-shadow: 0 0 20px rgba(58, 255, 234, 0.5);
}

/* ── SECTION WRAPPERS ───────────────────────────────────── */
.section {
  padding: 3.5rem 2.5rem;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--neon-orange);
  margin-bottom: 0.5rem;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.section-divider {
  width: 40px;
  height: 2px;
  background: linear-gradient(to right, var(--neon-orange), transparent);
  margin-bottom: 2rem;
  margin-top: 0.5rem;
}

/* ── FOOTER ─────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem 2.5rem;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

footer span {
  color: var(--neon-orange);
}

.rss-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  color: #3affea;
  text-decoration: none;
  opacity: 0.5;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: opacity 0.2s, color 0.2s;
}

.rss-link:hover {
  opacity: 1;
  color: #ff7b3a;
}


/* ── FEATURED ARTICLE CARDS ─────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition:
    transform 0.25s,
    box-shadow 0.25s;
  position: relative;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 6px;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(58, 255, 234, 0.02) 3px,
    rgba(58, 255, 234, 0.02) 6px
  );
  opacity: 0.5;
  transition: opacity 0.3s;
  pointer-events: none;
  z-index: 1;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow:
    0 0 0 1px var(--neon-orange),
    0 8px 30px rgba(255, 123, 58, 0.25);
  background-color: var(--bg3);
}

.card:hover::before {
  opacity: 1;
}

.card-thumb {
  height: 140px;
  overflow: hidden;
  position: relative;
}

.card-thumb-inner {
  width: 100%;
  height: 100%;
  display: flex;
  position: relative; /* required anchor for ::after */
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.card-thumb-inner::before {
  opacity: 0;
  background-color: #00aa00;
}

.card-thumb-inner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(58, 255, 234, 0.08) 3px,
    rgba(58, 255, 234, 0.08) 6px
  );
  opacity: 0.5;
  pointer-events: none;
  z-index: 2;
}

.card-image {
  display: block;
  width: 85%;
  position: relative;
  z-index: 1;
}

.card:nth-child(1) .card-thumb-inner {
  background: linear-gradient(135deg, #0d0d1a, #1a0d2a);
}

.card:nth-child(2) .card-thumb-inner {
  background: linear-gradient(135deg, #0d1a0d, #0d2a1a);
}

.card:nth-child(3) .card-thumb-inner {
  background: linear-gradient(135deg, #1a0d0d, #2a1a0d);
}

.card-body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--neon-cyan);
  margin-bottom: 0.5rem;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.card-excerpt {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
  flex: 1;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}

.card-meta .read-time {
  color: var(--neon-orange);
}

/* ── Modal Pop Up ──────────────────────────────────────────── */
/* Coming Soon Modal - enhanced */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(13, 13, 15, 0.92); /* almost black, matches --bg */
  backdrop-filter: blur(6px); /* nice modern touch */
  -webkit-backdrop-filter: blur(6px);
  z-index: 100;
  justify-content: center;
  align-items: center;
}

.modal-backdrop.active {
  display: flex;
}

.modal-box {
  background: var(--bg2);
  border: 1px solid var(--neon-orange);
  border-radius: 8px;
  padding: 2.5rem 2rem;
  max-width: 420px;
  width: 90%;
  text-align: center;
  box-shadow:
    0 0 30px rgba(255, 123, 58, 0.35),
    inset 0 0 15px rgba(255, 123, 58, 0.08);
  position: relative;
  overflow: hidden;
}

/* subtle scanline / grain overlay */
.modal-box::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent 0px,
    transparent 2px,
    rgba(255, 123, 58, 0.04) 2px,
    rgba(255, 123, 58, 0.04) 4px
  );
  pointer-events: none;
  z-index: 0;
}

.modal-box > * {
  position: relative;
  z-index: 1;
}

.modal-box h3 {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  color: var(--neon-orange);
  margin-bottom: 0.5rem;
  text-shadow: 0 0 12px rgba(255, 123, 58, 0.6);
  letter-spacing: 0.05em;
}

.modal-box h4 {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--code-green);
  margin: 0.5rem 0 1.25rem;
  opacity: 0.9;
}

.modal-box p {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0.75rem 0;
}

.modal-box .read-time {
  display: inline-block;
  margin-top: 1.5rem;
  padding: 0.5rem 1.2rem;
  background: rgba(58, 255, 234, 0.12);
  border: 1px solid var(--code-green);
  border-radius: 4px;
  color: var(--code-green);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.modal-box .read-time:hover {
  background: var(--code-green);
  color: #0d0d0f;
  box-shadow: 0 0 15px rgba(34, 197, 94, 0.5);
}

/* ── BLOG FEED ──────────────────────────────────────────── */
#blog {
  border-top: 1px solid var(--border);
}

.blog-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.blog-item {
  display: flex;
  gap: 1.5rem;
  padding: 1.25rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
  transition:
    box-shadow 0.25s,
    border-color 0.25s;
}

.blog-item:hover {
  border-color: var(--neon-pink);
  box-shadow: 0 0 20px rgba(255, 58, 170, 0.15);
  background-color: var(--bg3);
}

.blog-icon {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
}

.blog-info {
  flex: 1;
}

.blog-info h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.blog-info p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.blog-meta {
  display: flex;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}

.blog-meta .author {
  color: var(--neon-cyan);
  text-decoration: underline;
}

.blog-meta .read-time {
  color: var(--neon-pink);
}

.blog-header-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.blog-header-row .blog-icon {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.blog-header-row .section-title {
  margin-bottom: 0.1rem;
  /* tighten spacing above h3 */
}

.blog-image {
  flex-shrink: 0;
  display: flex;
  width: 85%;
  justify-content: center;
  align-items: center;
}

/* ── DOCS SECTION ───────────────────────────────────────── */
#docs {
  border-top: 1px solid var(--border);
  background: var(--bg2);
}

.docs-prose {
  max-width: 80ch;
  margin-left: auto;
  margin-right: auto;
  /* center within the column */
  padding-left: 2rem;
  padding-right: 2rem;
  /* same as left so wrap matches */
  box-sizing: border-box;
  /* include padding in max-width */
}

.docs-prose h2 {
  font-size: 1.5rem;
  color: var(--neon-orange);
  margin: 2rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.docs-prose h3 {
  font-size: 1.1rem;
  color: var(--neon-cyan);
  font-family: var(--font-mono);
  margin: 1.75rem 0 0.75rem;
}

.docs-prose p {
  margin-bottom: 1rem;
  color: var(--text);
}

.docs-prose li {
  margin-left: 1rem;
  /* list item aligns to list padding */
}

.docs-prose ul,
.docs-prose ol {
  padding-left: 1.5rem;
  /* indentation */
  margin-left: 0;
  /* avoid double offset */
}

.docs-prose li {
  margin-left: 1rem;
  /* list item aligns to list padding */
}

.docs-prose .lede {
  font-size: 1.15rem;
  font-style: italic;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.docs-prose .figure {
  margin: 1.5rem 0;
  text-align: center;
}

.docs-prose img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.docs-prose figcaption {
  font-size: 1rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

/* ── CODE BLOCKS ────────────────────────────────────────── */
.code-block {
  background: #000;
  border: 1px solid var(--code-green);
  border-radius: 4px;
  padding: 1.25rem;
  margin: 1.25rem 0;
  position: relative;
  box-shadow:
    0 0 15px rgba(57, 255, 110, 0.1),
    inset 0 0 30px rgba(0, 0, 0, 0.5);
  overflow-x: auto;
}

.code-block::before {
  content: attr(data-lang);
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--code-green);
  opacity: 0.6;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.code-block pre {
  font-family: var(--font-mono);
  font-size: 0.825rem;
  line-height: 1.6;
  color: var(--code-green);
  text-shadow: 0 0 5px rgba(57, 255, 110, 0.4);
}

.code-block pre .kw {
  color: #ff3aaa;
  text-shadow: 0 0 6px rgba(255, 58, 170, 0.5);
}

.code-block pre .str {
  color: #ffd966;
}

.code-block pre .cm {
  color: #555;
}

.code-block pre .fn {
  color: var(--neon-cyan);
}

.mermaid {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin: 2rem auto;
  /* max-width: 720px; */
}

.mermaid svg {
  max-width: 100%;
  height: auto;
}



/* ── PULL QUOTE ─────────────────────────────────────────── */
.pull-quote {
  border-left: 3px solid var(--neon-pink);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  background: rgba(255, 58, 170, 0.06);
  border-radius: 0 4px 4px 0;
  font-size: 1.05rem;
  font-style: italic;
  color: var(--text);
  box-shadow: 0 0 15px rgba(255, 58, 170, 0.1);
}

.pull-quote cite {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  font-style: normal;
  font-family: var(--font-mono);
  color: var(--neon-pink);
}

/* ── ACCORDION ──────────────────────────────────────────── */
.accordion-item {
  border-bottom: 1px solid var(--border);
}

.accordion-header {
  width: 100%;
  background: none;
  border: none;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 1rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  text-align: left;
  transition: color 0.2s;
}

.accordion-header:hover {
  color: var(--neon-orange);
}

.accordion-icon {
  font-size: 0.7rem;
  color: var(--neon-orange);
  transition: transform 0.25s;
  font-family: var(--font-mono);
}

.accordion-body {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease;
}

.accordion-body.open {
  max-height: 500px;
}

.accordion-body p {
  padding: 0 0 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ── ARTICLE CONTENT ──────────────────────────────────────────── */

.article-gallery {
  background-color: transparent;
}

.article-gallery-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.15rem;
  margin: 1.25rem 0;
}

.article-gallery-item {
  padding: 1rem;
  max-width: 500px; /* cap the width so it doesn't stretch full row */
  width: 80%;
}

.article-gallery-item img {
  width: 80%;
  height: auto;
  display: block;
}

.article-video {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin: 2rem 0;
}

.article-video-frame {
  width: 100%;
  max-width: 720px;
  aspect-ratio: 16 / 9; /* maintains YouTube's native ratio */
}

.article-video-frame iframe {
  width: 100%;
  height: 100%;
  display: block;
}

.article-video-caption {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: #888;
}

/* ── MOBILE (430px and below) ───────────────────────────── */
@media (max-width: 480px) {
  .section {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

@media (max-width: 480px) {
  .section {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .docs-prose {
    max-width: 100%; 
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
}
