/* David Roncero: one quiet reading column on a dark slate ground.
   Choices recorded in docs/definition.md (Look and feel). */

@font-face {
  font-family: "Source Serif 4";
  src: url("/static/fonts/source-serif-4-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("/static/fonts/source-serif-4-latin-wght-italic.woff2") format("woff2");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #171a1e;
  --surface: color-mix(in srgb, var(--bg) 90%, #ffffff);
  --text: #ddd6cb;
  --muted: #979086;
  --line: color-mix(in srgb, var(--text) 13%, transparent);
  --accent: #eea464;
  --hl: color-mix(in srgb, var(--accent) 40%, transparent);
  --hl-strong: color-mix(in srgb, var(--accent) 70%, transparent);
  --danger: #e57b6f;
  --ok: #8fbf8a;
  --serif: "Source Serif 4", Charter, "Bitstream Charter", Georgia, serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --fs: 17px;
  --column: 48rem;
  --wide: 68rem;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: var(--fs);
  line-height: 1.8;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  -webkit-font-smoothing: antialiased;
  font-kerning: normal;
}
h1, h2, h3 { font-weight: 700; line-height: 1.3; text-wrap: balance; margin: 0; }
p { margin: 0; }
a { color: inherit; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

/* Highlighter links */
.hl, .prose a, .cv-about a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-color: var(--hl);
  text-decoration-thickness: .42em;
  text-underline-offset: -.22em;
  text-decoration-skip-ink: none;
  transition: text-decoration-color .15s ease-out;
}
.hl:hover, .prose a:hover, .cv-about a:hover { text-decoration-color: var(--hl-strong); }

/* Header */
.site-header {
  max-width: var(--wide);
  margin: 0 auto;
  padding-block: 1.75rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: .5rem 1.5rem;
}
.brand { font-weight: 700; text-decoration: none; font-size: 1.05rem; }
.site-nav { display: flex; flex-wrap: wrap; gap: .3rem 1.4rem; font-size: .95rem; }
.site-nav a { color: var(--muted); text-decoration: none; }
.site-nav a:hover { color: var(--text); }
.site-nav a[aria-current="page"] {
  color: var(--text);
  text-decoration-line: underline;
  text-decoration-color: var(--hl);
  text-decoration-thickness: .42em;
  text-underline-offset: -.22em;
  text-decoration-skip-ink: none;
}

.page { max-width: var(--wide); margin: 0 auto; padding-block: 3rem 7rem; }
.column { max-width: var(--column); margin-inline: auto; }
.page-title { font-size: 1.6rem; margin-bottom: 2.5rem; }
.small { font-size: .82rem; }
.muted { color: var(--muted); }

.site-footer {
  max-width: var(--wide);
  margin: 0 auto;
  padding-block: 2rem 3rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .8rem;
}

/* Notices */
.notice {
  margin-bottom: 2rem;
  padding: .8rem 1rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  font-size: .92rem;
}
.notice-ok { border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.notice-error { border-color: color-mix(in srgb, var(--danger) 55%, transparent); }
.notice ul { margin: .5rem 0 0; padding-left: 1.2rem; }

/* Long-form text */
.prose { display: flex; flex-direction: column; gap: 1.5rem; }
.prose h1 { font-size: 1.9rem; }
.prose h2 { font-size: 1.25rem; margin-top: 1rem; }
.prose h3 { font-size: 1.05rem; margin-top: .5rem; }
.prose ul, .prose ol { margin: 0; padding-left: 1.4rem; display: flex; flex-direction: column; gap: .4rem; }
.prose img { display: block; border-radius: 2px; margin-inline: auto; }
.prose hr { width: 100%; border: 0; border-top: 1px solid var(--line); margin: 1rem 0; }
.prose code { font-family: var(--mono); font-size: .85em; background: var(--surface); padding: .1em .35em; border-radius: 3px; }
.prose pre { overflow-x: auto; background: var(--surface); padding: 1rem; border-radius: 4px; margin: 0; line-height: 1.5; }
.prose pre code { background: none; padding: 0; }
.prose table { border-collapse: collapse; font-size: .92rem; display: block; overflow-x: auto; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: .4rem .8rem; text-align: left; }
.prose blockquote {
  position: relative;
  margin: 1.5rem -1.75rem;
  padding: 1.75rem;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 14px 30px rgba(0, 0, 0, .28);
  font-style: italic;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.prose blockquote::before {
  content: "✻ ✻ ✻";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -55%);
  padding: 0 .6rem;
  background: var(--bg);
  color: var(--muted);
  font-style: normal;
  font-size: .75rem;
  letter-spacing: .25em;
  line-height: 1;
}

/* Home */
.home { margin-top: 1rem; }

/* Post */
.post-title { font-size: 1.6rem; }
.post-meta { margin-top: .6rem; margin-bottom: 3rem; color: var(--muted); font-size: .88rem; }
.post-meta .label { color: var(--accent); }

/* Blog list */
.years { display: flex; flex-direction: column; gap: 3rem; }
.year h2 { font-size: .8rem; color: var(--muted); letter-spacing: .14em; margin-bottom: .8rem; font-weight: 400; }
.posts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.posts li {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: baseline;
  padding-block: .45rem;
  border-bottom: 1px solid var(--line);
}
.posts time { color: var(--muted); font-size: .82rem; font-variant-numeric: tabular-nums; }
.posts a { text-decoration: none; }
.posts a:hover {
  text-decoration-line: underline;
  text-decoration-color: var(--hl);
  text-decoration-thickness: .42em;
  text-underline-offset: -.22em;
  text-decoration-skip-ink: none;
}
.posts .label { color: var(--accent); font-size: .8rem; }

/* Videos */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
  gap: 2.75rem 1.75rem;
}
.video-card { text-decoration: none; display: flex; flex-direction: column; gap: .7rem; }
.thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  max-width: 100%;
  border-radius: 3px;
  overflow: hidden;
  background: linear-gradient(170deg, #2a3038, #1e2227);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: rgba(20, 18, 17, .6);
  border: 1px solid rgba(255, 255, 255, .25);
  display: grid;
  place-items: center;
  transition: background .15s ease-out;
}
.play::before {
  content: "";
  margin-left: .2rem;
  border-style: solid;
  border-width: .5rem 0 .5rem .8rem;
  border-color: transparent transparent transparent #f1ebe2;
}
.video-card:hover .play { background: color-mix(in srgb, var(--accent) 75%, #000); }
.video-card h2 { font-size: 1rem; }
.video-card time { color: var(--muted); font-size: .82rem; }
.video-card .text { display: flex; flex-direction: column; gap: .15rem; }

.player { max-width: 54rem; margin: 0 auto 2.5rem; }
.player video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 3px;
}

/* Sobre mí */
.cv {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 4rem;
}
.cv-side {
  position: sticky;
  top: calc(2rem + env(safe-area-inset-top, 0px));
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}
.cv-id { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.4rem; }
.cv-photo { width: 5.5rem; height: 5.5rem; border-radius: 50%; object-fit: cover; flex: none; }
.cv-side h1 { font-size: 2rem; }
.cv-role { font-size: 1.05rem; margin-top: .2rem; }
.cv-tagline { color: var(--muted); margin-top: 1.4rem; max-width: 22rem; font-size: .95rem; }
.example-note {
  font-size: .75rem;
  color: var(--muted);
  border: 1px dashed var(--line);
  padding: .35rem .6rem;
  border-radius: 3px;
  align-self: flex-start;
}
.cv-nav { display: flex; flex-direction: column; gap: .3rem; }
.cv-nav a {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-block: .45rem;
  color: var(--muted);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .72rem;
  font-weight: 700;
}
.cv-nav a::before {
  content: "";
  width: 2rem;
  height: 1px;
  background: currentColor;
  transition: width .2s ease-out;
}
.cv-nav a:hover, .cv-nav a[aria-current="true"] { color: var(--text); }
.cv-nav a[aria-current="true"]::before { width: 4rem; }
.profiles { display: flex; flex-wrap: wrap; gap: 1.1rem; }
.profiles a { color: var(--muted); display: inline-flex; align-items: center; gap: .4rem; text-decoration: none; font-size: .82rem; }
.profiles a:hover { color: var(--text); }
.profiles svg { width: 1.3rem; height: 1.3rem; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }

.cv-main { display: flex; flex-direction: column; gap: 5rem; }
.cv-main section { display: flex; flex-direction: column; gap: 2.5rem; scroll-margin-top: 2rem; }
.cv-main section > h2 { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.cv-about { display: flex; flex-direction: column; gap: 1.2rem; color: color-mix(in srgb, var(--text) 85%, var(--bg)); }
.cv-about strong { color: var(--text); font-weight: 700; }
.entry { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: 1.5rem; }
.entry .when { color: var(--muted); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; padding-top: .35rem; font-variant-numeric: tabular-nums; }
.entry h3 { font-size: 1rem; }
.entry h3 a { text-decoration: none; }
.entry h3 a:hover { text-decoration: underline; text-decoration-color: var(--hl); }
.entry .earlier { color: var(--muted); font-size: .92rem; line-height: 1.5; margin-top: .2rem; }
.entry .desc { color: var(--muted); font-size: .9rem; margin-top: .6rem; line-height: 1.7; display: flex; flex-direction: column; gap: .6rem; }
.entry .desc ul, .entry .desc ol { margin: 0; padding-left: 1.2rem; display: flex; flex-direction: column; gap: .25rem; }
.entry .desc a { color: inherit; }
.tags { display: flex; flex-wrap: wrap; gap: .5rem; margin: .9rem 0 0; padding: 0; list-style: none; }
.tags li {
  font-size: .75rem;
  line-height: 1;
  padding: .45rem .75rem;
  border-radius: 999px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 13%, transparent);
}
.skills { display: flex; flex-direction: column; gap: 1.5rem; }
.skills h3 { font-size: .95rem; }

@media (max-width: 760px) {
  .page { padding-block: 1.5rem 5rem; }
  .cv { grid-template-columns: 1fr; gap: 3rem; }
  .cv-side { position: static; }
  .cv-nav { display: none; }
  .entry { grid-template-columns: 1fr; gap: .3rem; }
  .prose blockquote { margin-inline: 0; padding: 1.4rem 1.2rem; }
  .posts li { grid-template-columns: 3.8rem minmax(0, 1fr); }
  .posts .label { grid-column: 2; margin-top: -.6rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
