/* ═══════════════════════════════════════════════════════════════════════════
   OBSIDIAN EDGE — Cyber-Minimalist Design System
   Herbert Cuba Garcia · Personal Blog
   ═══════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&family=Space+Grotesk:wght@500;700&display=swap');

/* ─────────────────────────────────────────────────────────────────────────────
   TOKENS
   ───────────────────────────────────────────────────────────────────────────── */
:root {
  /* Abyss Palette */
  --abyss: #000000;
  --void: #0a0a0a;
  --obsidian: #111111;
  --graphite: #1a1a1a;
  --slate: #2a2a2a;
  
  /* Text */
  --bone: #f5f5f5;
  --ash: #a0a0a0;
  --smoke: #666666;
  
  /* Electric Accents */
  --acid: #b0ff00;
  --acid-dim: #8acc00;
  --volt: #00ff88;
  --hyper: #7c3aed;
  --ember: #ff4d00;
  
  /* Lines */
  --line: #1f1f1f;
  --line-bright: #333333;
  
  /* Layout */
  --max-width: 1400px;
  --content-width: 720px;
  --grid-gap: 1.5rem;
  --section-spacing: clamp(4rem, 10vh, 8rem);
  
  /* Typography Scale */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;

  --radius: 2px;
  --radius-lg: 4px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--ash);
  background: var(--abyss);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Selection */
::selection {
  background: var(--acid);
  color: var(--abyss);
}

/* ─────────────────────────────────────────────────────────────────────────────
   LINKS
   ───────────────────────────────────────────────────────────────────────────── */
a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--acid);
}

/* ─────────────────────────────────────────────────────────────────────────────
   LAYOUT CONTAINERS
   ───────────────────────────────────────────────────────────────────────────── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 5vw, 3rem);
}

.container--narrow {
  max-width: var(--content-width);
}
.container--full {
  max-width: 100%;
}

/* ─────────────────────────────────────────────────────────────────────────────
   HEADER — Minimal, floating
   ───────────────────────────────────────────────────────────────────────────── */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1.5rem 0;
  transition: background 0.3s ease, backdrop-filter 0.3s ease;
}

.site-header.scrolled {
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--bone);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.brand::before {
  content: "//";
  color: var(--acid);
  margin-right: 0.5rem;
}

.nav {
  display: flex;
  gap: 2rem;
}

.nav a {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-xs);
  color: var(--smoke);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  position: relative;
}

.nav a::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--acid);
  transition: width 0.3s ease;
}

.nav a:hover {
  color: var(--bone);
}

.nav a:hover::after {
  width: 100%;
}

/* ─────────────────────────────────────────────────────────────────────────────
   HERO — Typographic brutalism
   ───────────────────────────────────────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: var(--section-spacing) 0;
  position: relative;
}

/* Subtle grid overlay */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.3;
  pointer-events: none;
  mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 1000px;
}

.hero .tagline {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-xs);
  color: var(--acid);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.hero .tagline::before {
  content: "";
  width: 40px;
  height: 1px;
  background: var(--acid);
}

.hero h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(3.5rem, 10vw, 7rem);
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.04em;
  color: var(--bone);
  margin-bottom: 2rem;
}

/* Electric highlight on specific words */
.hero h1 .highlight {
  color: var(--acid);
  position: relative;
  display: inline-block;
}

.hero h1 .highlight::after {
  content: "";
  position: absolute;
  bottom: 0.1em;
  left: 0;
  right: 0;
  height: 0.15em;
  background: var(--acid);
  opacity: 0.3;
}

.hero .lead {
  font-size: var(--text-xl);
  color: var(--ash);
  max-width: 600px;
  line-height: 1.7;
}

/* ─────────────────────────────────────────────────────────────────────────────
   BENTO GRID — Featured Section
   ───────────────────────────────────────────────────────────────────────────── */
.bento {
  padding: var(--section-spacing) 0;
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: minmax(200px, auto);
  gap: var(--grid-gap);
}

/* Cell Styles */
.bento-cell {
  background: var(--void);
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.3s ease, transform 0.3s ease;
  border-radius: var(--radius-lg);
}

.bento-cell:hover {
  border-color: var(--line-bright);
}

/* Span variations */
.bento-cell--hero {
  grid-column: span 8;
  grid-row: span 2;
}

.bento-cell--tall {
  grid-column: span 4;
  grid-row: span 2;
}

.bento-cell--wide {
  grid-column: span 6;
  grid-row: span 1;
}

.bento-cell--square {
  grid-column: span 4;
  grid-row: span 1;
}

.bento-cell--small {
  grid-column: span 3;
  grid-row: span 1;
}

/* Cell content */
.bento-cell__image {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.bento-cell__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%) contrast(1.1);
  transition: filter 0.5s ease, transform 0.5s ease;
}

.bento-cell:hover .bento-cell__image img {
  filter: grayscale(0%) contrast(1);
  transform: scale(1.03);
}

.bento-cell__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--abyss) 0%, transparent 60%);
  z-index: 2;
}

.bento-cell__content {
  position: relative;
  z-index: 3;
  padding: 1.5rem;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.bento-cell__eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-xs);
  color: var(--acid);
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.bento-cell__title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  font-weight: 700;
  color: var(--bone);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.bento-cell--hero .bento-cell__title {
  font-size: clamp(2rem, 4vw, 3rem);
}

.bento-cell__meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-xs);
  color: var(--smoke);
}

/* Hover accent line */
.bento-cell::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--acid);
  transition: width 0.4s ease;
  z-index: 10;
}

.bento-cell:hover::after {
  width: 100%;
}

/* ─────────────────────────────────────────────────────────────────────────────\
   POST LIST — Fallback / Secondary\
   ───────────────────────────────────────────────────────────────────────────── */
.posts {
  padding: var(--section-spacing) 0;
}

.posts__header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.posts__header::before {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.posts__header::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.posts__title {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-xs);
  color: var(--smoke);
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

.post-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.post-item {
  background: var(--abyss);
}

.post-link {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 2rem;
  padding: 1.5rem 2rem;
  transition: background 0.2s ease;
}

.post-link:hover {
  background: var(--void);
}

.post-number {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-xs);
  color: var(--smoke);
  min-width: 3rem;
}

.post-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--bone);
  transition: color 0.2s ease;
}

.post-link:hover .post-title {
  color: var(--acid);
}

.post-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-xs);
  color: var(--smoke);
}

/* ─────────────────────────────────────────────────────────────────────────────\
   SINGLE POST LAYOUT\
   ───────────────────────────────────────────────────────────────────────────── */
.post {
  padding-top: 8rem;
  padding-bottom: var(--section-spacing);
}

.post-hero-image {
  width: 100%;
  aspect-ratio: 21/9;
  object-fit: cover;
  margin-bottom: 4rem;
  filter: grayscale(100%) contrast(1.1);
  transition: filter 0.5s ease;
}

.post-hero-image:hover {
  filter: grayscale(0%) contrast(1);
}

.post-header {
  max-width: var(--content-width);
  margin: 0 auto 4rem;
  padding: 0 clamp(1.5rem, 5vw, 3rem);
}

.post-header h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--bone);
  margin-bottom: 1.5rem;
}

.meta {
  display: flex;
  gap: 2rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-xs);
  color: var(--smoke);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.meta time {
  color: var(--acid);
}

.post-header .lead {
  margin-top: 2rem;
  font-size: var(--text-xl);
  color: var(--ash);
  line-height: 1.7;
  border-left: 2px solid var(--acid);
  padding-left: 1.5rem;
}

/* ─────────────────────────────────────────────────────────────────────────────\
   PROSE — Article Body\
   ───────────────────────────────────────────────────────────────────────────── */
.prose {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 5vw, 3rem);
  font-size: var(--text-lg);
  line-height: 1.8;
  color: var(--ash);
}

.prose p {
  margin-bottom: 1.75rem;
}

.prose h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  color: var(--bone);
  margin: 4rem 0 1.5rem;
  letter-spacing: -0.02em;
}

.prose h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--bone);
  margin: 3rem 0 1rem;
}

.prose a {
  color: var(--acid);
  text-decoration: underline;
  text-decoration-color: var(--acid-dim);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s ease;
}

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

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

.prose ul,
.prose ol {
  margin: 0 0 1.75rem 1.5rem;
}

.prose li {
  margin-bottom: 0.5rem;
}

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

.prose blockquote {
  margin: 3rem 0;
  padding: 2rem 2rem 2rem 1.5rem;
  border-left: 3px solid var(--acid);
  background: var(--void);
  font-style: italic;
  color: var(--bone);
}
.prose blockquote p:last-child{
  margin-bottom:0;
}

.prose code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9em;
  background: var(--graphite);
  padding: 0.2em 0.4em;
  color: var(--acid);
}

.prose pre {
  margin: 2rem 0;
  padding: 1.5rem;
  background: var(--void);
  border: 1px solid var(--line);
  overflow-x: auto;
  font-size: var(--text-sm);
  line-height: 1.6;
}

.prose pre code {
  background: none;
  padding: 0;
  color: var(--ash);
}

.prose hr {
  border: none;
  height: 1px;
  background: var(--line);
  margin: 4rem 0;
}

.prose img {
  width: 100%;
  margin: 2rem 0;
  filter: grayscale(100%);
  transition: filter 0.5s ease;
}

.prose img:hover {
  filter: grayscale(0%);
}

/* ─────────────────────────────────────────────────────────────────────────────\
   FOOTER\
   ───────────────────────────────────────────────────────────────────────────── */
.site-footer {
  padding: 4rem 0;
  border-top: 1px solid var(--line);
  margin-top: var(--section-spacing);
}

.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-xs);
  color: var(--smoke);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.footer-row .muted {
  color: var(--smoke);
}

/* ─────────────────────────────────────────────────────────────────────────────\
   UTILITIES & ANIMATIONS\
   ───────────────────────────────────────────────────────────────────────────── */

/* Stagger animation for list items */
.animate-stagger > * {
  opacity: 0;
  animation: slideUp 0.5s ease forwards;
}

.animate-stagger > *:nth-child(1) { animation-delay: 0.1s; }
.animate-stagger > *:nth-child(2) { animation-delay: 0.15s; }
.animate-stagger > *:nth-child(3) { animation-delay: 0.2s; }
.animate-stagger > *:nth-child(4) { animation-delay: 0.25s; }
.animate-stagger > *:nth-child(5) { animation-delay: 0.3s; }
.animate-stagger > *:nth-child(6) { animation-delay: 0.35s; }
.animate-stagger > *:nth-child(7) { animation-delay: 0.4s; }
.animate-stagger > *:nth-child(8) { animation-delay: 0.45s; }

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Glitch hover effect (use sparingly) */
.glitch-hover:hover {
  animation: glitch 0.2s ease-in-out;
}

@keyframes glitch {
  0%, 100% { transform: translate(0); }
  25% { transform: translate(-2px, 1px); }
  50% { transform: translate(2px, -1px); }
  75% { transform: translate(-1px, -1px); }
}

/* Scanline overlay (optional, add to body or hero) */
.scanlines::after {
  content: "";
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.05) 2px,
    rgba(0, 0, 0, 0.05) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

/* Focus styles for accessibility */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--acid);
  outline-offset: 4px;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--acid);
  color: var(--abyss);
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  z-index: 10000;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 1rem;
}

/* ─────────────────────────────────────────────────────────────────────────────\
   RESPONSIVE\
   ───────────────────────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .bento-cell--hero {
    grid-column: span 12;
  }
  
  .bento-cell--tall,
  .bento-cell--wide {
    grid-column: span 6;
  }
  
  .bento-cell--square,
  .bento-cell--small {
    grid-column: span 6;
  }
}

@media (max-width: 768px) {
  .bento-grid {
    grid-template-columns: 1fr;
  }
  
  .bento-cell--hero,
  .bento-cell--tall,
  .bento-cell--wide,
  .bento-cell--square,
  .bento-cell--small {
    grid-column: span 1;
    grid-row: span 1;
    min-height: 300px;
  }
  
  .post-link {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  
  .post-number {
    display: none;
  }
  
  .nav {
    gap: 1rem;
  }
}

/* ─────────────────────────────────────────────────────────────────────────────\
   REDUCED MOTION\
   ───────────────────────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,\
  *::before,\
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  html {
    scroll-behavior: auto;
  }
}
