/* Jesús Bravo — the blog. Same evening palette as the map, set for long reading: one column of prose,
   warm ink on a dark page, gold only where something can be clicked or is being pointed at. */
:root {
  --bg: #0f0c09;
  --panel: #19140f;
  --card: #1d1712;
  --line: #3a2e24;
  --line-2: #2a221b;
  --ink: #f3efe6;
  --ink-2: #d4ccbf;
  --ink-3: #a39a8c;
  --gold: #ffcd75;
  --gold-2: #e0a94a;
  --display: "Funnel Display", system-ui, sans-serif;
  --text: "Funnel Sans", system-ui, sans-serif;
  --pixel: "Pixelify Sans", system-ui, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --measure: 68ch;
  --gutter: clamp(20px, 5vw, 48px);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.6 var(--text); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: inherit; }
img, video { max-width: 100%; height: auto; display: block; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 2px; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; padding: 10px 14px; background: var(--gold); color: #1a1208; font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }

/* ------------------------------------------------------------------ header */
.bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 20px;
  padding: 14px var(--gutter);
  background: rgb(15 12 9 / .86); backdrop-filter: blur(10px) saturate(1.2); -webkit-backdrop-filter: blur(10px) saturate(1.2);
  border-bottom: 1px solid var(--line-2);
}
.logo { display: inline-flex; align-items: center; gap: 10px; font: 500 19px/1 var(--display); letter-spacing: -0.02em; text-decoration: none; white-space: nowrap; }
.logo svg { width: 20px; height: 20px; shape-rendering: crispEdges; }
.bar nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.bar nav a { padding: 8px 10px; color: var(--ink-3); text-decoration: none; font: 500 15px/1 var(--text); transition: color 160ms var(--ease); }
.bar nav a[aria-current="page"], .bar nav a:hover { color: var(--ink); }
.bar .lang { font: 500 14px/1 var(--pixel); color: var(--ink-3); padding: 8px 6px; text-decoration: none; }
.bar .lang:hover { color: var(--gold); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 40px; padding: 0 16px; border: 0; cursor: pointer;
  background: var(--gold); color: #1a1208; font: 600 15px/1 var(--text); text-decoration: none;
  box-shadow: 0 0 0 2px #1a1208, 3px 3px 0 2px #0a0806;
  transition: translate 140ms var(--ease), box-shadow 140ms var(--ease);
}
.btn:active { translate: 2px 2px; box-shadow: 0 0 0 2px #1a1208, 1px 1px 0 2px #0a0806; }
@media (hover: hover) and (pointer: fine) { .btn:hover { translate: -1px -1px; box-shadow: 0 0 0 2px #1a1208, 4px 4px 0 2px #0a0806; } }
.btn--ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
@media (hover: hover) and (pointer: fine) { .btn--ghost:hover { box-shadow: inset 0 0 0 2px var(--gold); } }
@media (max-width: 620px) { .bar .btn { display: none; } .bar nav a { padding: 8px 7px; } }

/* reading progress: a hairline of gold under the bar */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 30; pointer-events: none; transform-origin: 0 50%; transform: scaleX(var(--p, 0)); background: var(--gold); }

/* ------------------------------------------------------------------ index */
.index { max-width: 1080px; margin: 0 auto; padding: clamp(48px, 9vh, 104px) var(--gutter) 96px; }
.index__head { max-width: 44rem; margin-bottom: clamp(40px, 7vh, 72px); }
.index h1 { margin: 0 0 18px; font: 500 clamp(2.6rem, 6vw, 4.4rem)/1 var(--display); letter-spacing: -0.035em; }
.index__lead { margin: 0; font-size: clamp(1.1rem, 1.6vw, 1.25rem); line-height: 1.5; color: var(--ink-2); text-wrap: pretty; }
.index__feeds { display: flex; gap: 18px; margin-top: 20px; font-size: 15px; color: var(--ink-3); }
.index__feeds a { text-decoration-color: var(--line); text-underline-offset: 4px; }
.index__feeds a:hover { color: var(--gold); text-decoration-color: currentColor; }

.posts { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.post { position: relative; display: grid; grid-template-columns: minmax(0, 23rem) minmax(0, 1fr); gap: 18px 36px; align-items: center; padding: 28px 0; border-bottom: 1px solid var(--line); }
.post__meta { margin: 0 0 10px; font: 500 13.5px/1.4 var(--pixel); color: var(--ink-3); }
.post__meta span::before { content: " · "; }
.post :is(h2, h3) { margin: 0 0 10px; font: 500 clamp(1.45rem, 2.4vw, 1.9rem)/1.15 var(--display); letter-spacing: -0.02em; color: var(--ink); text-wrap: balance; }
.post :is(h2, h3) a { text-decoration: none; background: linear-gradient(var(--gold), var(--gold)) 0 100% / 0 1px no-repeat; transition: background-size 320ms var(--ease), color 200ms var(--ease); }
.post :is(h2, h3) a::after { content: ""; position: absolute; inset: 0; z-index: 2; }
.post p { margin: 0; max-width: 62ch; color: var(--ink-2); text-wrap: pretty; }
.post .tags { margin-top: 14px; }
@media (hover: hover) and (pointer: fine) { .post:hover :is(h2, h3) a { color: var(--gold); background-size: 100% 1px; } }
.post:has(a:focus-visible) { outline: 2px solid var(--gold); outline-offset: 6px; }
.post :is(h2, h3) a:focus-visible { outline: none; }

/* the picture: a still, a muted preview on hover, a label for the kind of piece */
.post__media { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; border: 1px solid var(--line-2); border-radius: 10px; background: var(--panel); box-shadow: 0 10px 30px -18px rgb(0 0 0 / .8); }
.post__media :is(img, video) { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.post__media img { transition: transform 700ms var(--ease), filter 400ms var(--ease); }
.post__media video { opacity: 0; transition: opacity 300ms var(--ease); }
.post__media video.is-on { opacity: 1; }
@media (hover: hover) and (pointer: fine) { .post:hover .post__media img { transform: scale(1.035); } }
.post__media::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgb(255 255 255 / .04); pointer-events: none; }
.post__kind { position: absolute; left: 10px; bottom: 10px; z-index: 1; display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px 6px 8px; border-radius: 999px; background: rgb(15 12 9 / .78); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); font: 500 12.5px/1 var(--text); color: var(--ink); }
.post__kind svg { width: 12px; height: 12px; color: var(--gold); }
.post__media--blank { display: grid; place-items: center; background: radial-gradient(120% 90% at 30% 20%, #2a2018, var(--panel) 60%); }
.post__media--blank > svg { width: 56px; height: 56px; shape-rendering: crispEdges; }
@media (max-width: 680px) { .post { grid-template-columns: 1fr; gap: 16px; padding: 24px 0 28px; } }
.empty { padding: 40px 0; color: var(--ink-3); }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.tags li { padding: 4px 9px 5px; font: 500 13px/1 var(--text); color: var(--ink-2); background: var(--card); border: 1px solid var(--line-2); border-radius: 999px; }

/* ------------------------------------------------------------------ article */
.article { padding: clamp(40px, 8vh, 88px) var(--gutter) 40px; }
.article__wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, var(--measure)) minmax(0, 1fr); column-gap: 48px; max-width: 1240px; margin: 0 auto; }
.article__wrap > * { grid-column: 2; }
.crumbs { margin: 0 0 28px; font: 500 14px/1 var(--pixel); color: var(--ink-3); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--gold); }
.article h1 { margin: 0 0 22px; font: 500 clamp(2.3rem, 5.2vw, 3.7rem)/1.04 var(--display); letter-spacing: -0.035em; text-wrap: balance; }
.article__lead { margin: 0 0 26px; font-size: clamp(1.15rem, 1.7vw, 1.32rem); line-height: 1.5; color: var(--ink-2); text-wrap: pretty; }
.byline { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding-bottom: 28px; margin-bottom: 8px; border-bottom: 1px solid var(--line); font-size: 15px; color: var(--ink-3); }
.byline__who { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 500; }
.byline__who svg { width: 28px; height: 28px; padding: 5px; background: var(--card); border: 1px solid var(--line); shape-rendering: crispEdges; }
.byline time, .byline__read { font: 500 14px/1 var(--pixel); }

/* the table of contents rides in the left margin on wide screens */
.toc { font-size: 14px; }
.toc p { margin: 0 0 12px; font: 500 13px/1 var(--pixel); color: var(--ink-3); }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc a { display: block; padding: 6px 0 6px 14px; margin-left: -1px; border-left: 1px solid transparent; color: var(--ink-3); text-decoration: none; line-height: 1.35; transition: color 160ms var(--ease), border-color 160ms var(--ease); }
.toc a:hover { color: var(--ink); }
.toc a[aria-current="true"] { color: var(--gold); border-left-color: var(--gold); }
@media (min-width: 1180px) {
  .toc { grid-column: 1; grid-row: 4 / span 2; justify-self: end; width: 100%; max-width: 15rem; }
  .toc__in { position: sticky; top: 104px; }
  .article__wrap:has(.hero) .toc { grid-row: 6 / span 2; }
}
@media (max-width: 1179px) {
  .toc { margin: 28px 0 8px; padding: 18px 20px; background: var(--panel); border: 1px solid var(--line-2); }
  .toc ol { border: 0; }
  .toc a { padding: 5px 0; margin: 0; border: 0; }
}

/* prose */
.prose { padding-top: 12px; font-size: 18.5px; line-height: 1.72; color: var(--ink-2); }
.prose > * { margin: 0 0 1.15em; }
.prose h2 { margin: 2.2em 0 .6em; color: var(--ink); font: 500 clamp(1.55rem, 2.6vw, 1.95rem)/1.18 var(--display); letter-spacing: -0.022em; text-wrap: balance; }
.prose h3 { margin: 1.8em 0 .5em; color: var(--ink); font: 600 1.18rem/1.3 var(--display); letter-spacing: -0.01em; }
.prose h2 + *, .prose h3 + * { margin-top: 0; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--gold-2); text-decoration-thickness: 1px; text-underline-offset: 4px; transition: color 160ms var(--ease); }
.prose a:hover { color: var(--gold); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: .35em 0; padding-left: .2em; }
.prose li::marker { color: var(--gold-2); }
.prose hr { border: 0; height: 1px; background: var(--line); margin: 2.6em 0; }
.prose blockquote { margin: 1.8em 0; padding: 0 0 0 22px; border-left: 1px solid var(--gold-2); color: var(--ink); font: 400 1.18em/1.5 var(--display); letter-spacing: -0.01em; }
.prose blockquote p { margin: 0; }
.prose :not(pre) > code { padding: .12em .38em; font: 500 .86em/1 var(--mono); color: var(--ink); background: var(--card); border: 1px solid var(--line-2); border-radius: 4px; }
.prose pre { position: relative; margin: 1.6em 0; padding: 18px 20px; overflow-x: auto; background: var(--panel); border: 1px solid var(--line-2); border-radius: 6px; font: 400 14.5px/1.65 var(--mono); color: #e9e2d4; tab-size: 2; }
.prose pre code { font: inherit; }
.prose pre[data-lang]::before { content: attr(data-lang); position: absolute; top: 10px; right: 52px; font: 500 12px/1 var(--pixel); color: var(--ink-3); text-transform: lowercase; }
.copy { position: absolute; top: 6px; right: 6px; width: 34px; height: 30px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 4px; background: transparent; color: var(--ink-3); cursor: pointer; transition: color 160ms var(--ease), background-color 160ms var(--ease); }
.copy:hover { color: var(--ink); background: var(--card); }
.copy svg { width: 16px; height: 16px; }
.copy[data-done] { color: var(--gold); }
.prose table { width: 100%; border-collapse: collapse; font-size: .9em; line-height: 1.5; display: block; overflow-x: auto; }
.prose th, .prose td { padding: 10px 14px 10px 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.prose th { color: var(--ink); font-weight: 600; white-space: nowrap; }
.prose td { min-width: 9rem; }
.prose td:first-child { min-width: 6.5rem; color: var(--ink); }
.prose figure { margin: 2em 0; }
.prose figure video, .prose figure img { width: 100%; background: var(--panel); border: 1px solid var(--line-2); border-radius: 6px; }
.prose figure.is-tall { max-width: 360px; margin-inline: auto; }
.prose figcaption { margin-top: 10px; font-size: 14.5px; line-height: 1.5; color: var(--ink-3); }
.prose .note { margin: 1.8em 0; padding: 18px 20px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 6px; font-size: .94em; }
.prose .note > :last-child { margin-bottom: 0; }
.prose .note strong:first-child { color: var(--gold); }

/* end of the article: who wrote it and what to do next */
.outro { margin-top: 56px; padding: 28px; background: var(--panel); border: 1px solid var(--line); display: grid; grid-template-columns: auto 1fr; gap: 18px 22px; align-items: start; }
.outro svg { width: 48px; height: 48px; padding: 8px; background: var(--card); border: 1px solid var(--line); shape-rendering: crispEdges; }
.outro h2 { margin: 0 0 6px; font: 500 1.35rem/1.2 var(--display); letter-spacing: -0.015em; }
.outro p { margin: 0; color: var(--ink-2); max-width: 54ch; }
.outro .actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 12px 16px; }
@media (max-width: 560px) { .outro { grid-template-columns: 1fr; padding: 22px; } }

.more { margin-top: 64px; }
.more h2 { margin: 0 0 6px; font: 500 13px/1 var(--pixel); color: var(--ink-3); }
.more .post { grid-template-columns: minmax(0, 13rem) minmax(0, 1fr); gap: 14px 24px; padding: 22px 0 24px; }
.more .post :is(h2, h3) { font-size: 1.3rem; margin-bottom: 6px; }
.more .post .tags { display: none; }
@media (max-width: 560px) { .more .post { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------ footer */
.foot { max-width: 1080px; margin: 0 auto; padding: 40px var(--gutter) 56px; display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; border-top: 1px solid var(--line-2); font-size: 14px; color: var(--ink-3); }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--gold); }

/* ------------------------------------------------------------------ the one entrance: the title settles in */
@media (prefers-reduced-motion: no-preference) {
  .rise { animation: rise 700ms var(--ease) both; }
  .rise--2 { animation-delay: 70ms; }
  .rise--3 { animation-delay: 140ms; }
  @keyframes rise { from { opacity: 0; transform: translateY(10px); filter: blur(4px); } }
}
@media (prefers-reduced-motion: reduce) { .progress { display: none; } }

/* the showreel that opens an article: under the title, wider than the column on big screens */
.hero { margin: 6px 0 30px; }
.hero video { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--panel); border: 1px solid var(--line-2); border-radius: 8px; }
.hero figcaption { margin-top: 10px; font-size: 14.5px; line-height: 1.5; color: var(--ink-3); }
@media (min-width: 1180px) { .hero { margin-inline: -7rem; } }
.prose ol > li > strong:first-child a { text-decoration-color: var(--gold); }
