/* Pablo Abreu — blog articles & FAQ. Editorial reading layout aligned with the landing:
   warm near-black + amber, open text (no boxed blocks), hairline rhythm, sharp code. */
:root {
  --bg: #0b0c0f;
  --bg-2: #111318;
  --text: #f2f0ea;
  --muted: #9a9da5;
  --accent: #b9ff66;
  --accent-2: #8aa6ff;
  --accent-3: #d9ffae;
  --line: rgba(242, 240, 234, 0.16);
  --line-strong: rgba(242, 240, 234, 0.34);
  --radius: 10px;
  /* Consumed by the FAQ page's inline <style> (faq-nav / faq-section). */
  --heading: var(--text);
  --pill-bg: rgba(185, 255, 102, 0.12);
  --pill-color: #b9ff66;
  --pill-hover: rgba(185, 255, 102, 0.22);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "IBM Plex Mono", "SFMono-Regular", "Cascadia Code", Consolas, monospace;
  color: var(--text);
  background:
    radial-gradient(circle at 70% -10%, rgba(138, 166, 255, 0.13), transparent 32rem),
    linear-gradient(180deg, #0d0e12, #090a0c 72%);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(242, 240, 234, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(242, 240, 234, 0.03) 1px, transparent 1px);
  background-size: clamp(64px, 8vw, 128px) clamp(64px, 8vw, 128px);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), transparent 80%);
}

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

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

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

.article-shell {
  position: relative;
  z-index: 1;
  width: min(820px, 92vw);
  margin: 0 auto;
  padding: clamp(32px, 6vw, 60px) 0 clamp(64px, 10vw, 100px);
}

/* ---------- Hero ---------- */
.article-hero {
  display: grid;
  gap: 18px;
  margin-bottom: 40px;
}

.article-back {
  width: fit-content;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: color 0.2s ease, transform 0.2s ease;
}

.article-back:hover {
  color: var(--accent);
  transform: translateX(-3px);
}

.article-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  margin: 0;
  color: var(--accent);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.article-eyebrow::before {
  content: "";
  width: 20px;
  height: 1px;
  background: currentColor;
}

h1 {
  margin: 0;
  font-size: clamp(2.3rem, 5.2vw, 4rem);
  line-height: 0.96;
  letter-spacing: -0.065em;
  font-weight: 500;
  text-wrap: balance;
}

.article-lead {
  margin: 0;
  max-width: 68ch;
  color: rgba(242, 240, 234, 0.72);
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  line-height: 1.6;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.article-pill {
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---------- Cover ---------- */
.article-cover {
  margin: 0 0 34px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(18, 18, 17, 0.5);
}

.article-cover img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.article-cover figcaption {
  padding: 12px 16px 15px;
  color: var(--muted);
  font-size: 0.78rem;
}

/* ---------- Content: open editorial text, no boxes ---------- */
.article-content {
  display: grid;
  gap: 40px;
}

.article-block {
  min-width: 0;
  padding: 0;
  border: 0;
  border-top: 1px solid var(--line);
  padding-top: 32px;
  background: none;
  box-shadow: none;
}

.article-content > .article-block:first-child {
  border-top: 0;
  padding-top: 0;
}

h2 {
  margin: 0 0 16px;
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  line-height: 1.06;
  letter-spacing: -0.04em;
  font-weight: 800;
}

h3 {
  margin: 22px 0 8px;
  font-size: 1.12rem;
  line-height: 1.3;
  letter-spacing: -0.02em;
  font-weight: 700;
  color: var(--text);
}

p,
li {
  color: rgba(242, 240, 234, 0.82);
  line-height: 1.75;
  font-size: 1rem;
}

p {
  margin: 0;
}

strong {
  color: var(--text);
  font-weight: 700;
}

.article-block p + p,
.article-block p + ul,
.article-block p + ol,
.article-block ul + p,
.article-block ol + p,
.article-block h3 + p,
.article-block h3 + ul,
.article-block p + h3 {
  margin-top: 14px;
}

ul,
ol {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 9px;
}

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

/* ---------- Quote ---------- */
.quote {
  margin: 4px 0;
  padding: 6px 0 6px 22px;
  border-left: 2px solid var(--accent);
  background: none;
  border-radius: 0;
}

.quote p {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.4;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.quote cite {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-style: normal;
  font-size: 0.85rem;
}

/* ---------- Inline link chips ---------- */
.article-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.article-link {
  padding: 11px 16px;
  border: 1px solid rgba(185, 255, 102, 0.34);
  border-radius: 3px;
  background: rgba(185, 255, 102, 0.08);
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.article-link:hover {
  transform: translate(-2px, -2px);
  border-color: var(--accent);
  background: rgba(185, 255, 102, 0.16);
  box-shadow: 0 12px 30px rgba(185, 255, 102, 0.14);
}

/* ---------- Code ---------- */
code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.86em;
  background: rgba(185, 255, 102, 0.12);
  border: 1px solid rgba(185, 255, 102, 0.2);
  border-radius: 4px;
  padding: 0.12em 0.4em;
  color: var(--accent);
}

pre[class*="language-"] {
  margin: 4px 0 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0c0c0b !important;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.65;
}

pre[class*="language-"] code {
  background: none;
  border: none;
  padding: 0;
  color: #e9e2d4;
  font-size: inherit;
}

.article-block pre + p,
.article-block p + pre {
  margin-top: 14px;
}

.token.comment {
  color: #7d7a70;
  font-style: italic;
}

.token.keyword,
.token.builtin {
  color: var(--accent-2);
}

.token.string,
.token.template-string {
  color: #b7d68a;
}

.token.function,
.token.class-name {
  color: #ffe0b0;
}

.token.decorator {
  color: var(--accent);
}

.token.punctuation {
  color: var(--muted);
}

.token.property,
.token.parameter {
  color: #efe7da;
}

.token.number,
.token.boolean {
  color: var(--accent-2);
}

.token.operator {
  color: var(--muted);
}

.code-copy-wrap {
  position: relative;
}

.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid rgba(185, 255, 102, 0.28);
  border-radius: 4px;
  background: rgba(16, 16, 15, 0.86);
  color: var(--muted);
  font-family: "IBM Plex Mono", "SFMono-Regular", "Cascadia Code", Consolas, monospace;
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.15s ease, color 0.2s ease;
}

.copy-btn:hover {
  color: var(--text);
  background: rgba(185, 255, 102, 0.16);
  border-color: rgba(185, 255, 102, 0.5);
}

.copy-btn:active {
  transform: scale(0.96);
}

.copy-btn .icon-check {
  display: none;
}

.copy-btn.is-copied {
  border-color: rgba(143, 224, 163, 0.55);
  color: #8fe0a3;
}

.copy-btn.is-copied .icon-copy {
  display: none;
}

.copy-btn.is-copied .icon-check {
  display: block;
}

/* ---------- FAQ items ---------- */
.faq-item + .faq-item {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.faq-item h3 {
  margin: 0 0 6px;
  color: var(--text);
}

/* ---------- Reveal ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s ease;
  transition-delay: var(--reveal-delay, 0ms);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 760px) {
  .article-content {
    gap: 32px;
  }

  .article-block {
    padding-top: 26px;
  }

  h1 {
    font-size: clamp(2rem, 9vw, 2.9rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }

  * {
    scroll-behavior: auto !important;
  }
}
