/* vpablo.dev — shared styles.
   Bump the ?v= on the <link> in every page when this file changes;
   Cloudflare caches .css at the edge by default and the query string is
   what busts it. */

:root {
  /* Warm near-black rather than pure grey — reads softer over long text. */
  --bg:          #101012;
  --surface:     #17171a;
  --surface-h:   #1d1d21;
  --fg:          #f1f0ee;
  --body:        #c7c6c2;
  --muted:       #8b8a87;
  --border:      #26262b;
  --border-h:    #3a3a41;
  --accent:      #8ab4ff;

  /* Charter is Medium's own body face and ships with macOS/iOS; Sitka and
     Cambria cover Windows; Georgia is the universal floor. No webfont, so
     text paints on the first frame with no flash and no third-party request. */
  --serif: Charter, "Bitstream Charter", "Sitka Text", Cambria, "Iowan Old Style",
           "Palatino Linotype", Palatino, Georgia, serif;
  --sans:  -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto,
           "Helvetica Neue", Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--body);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  display: flex;
  justify-content: center;
  padding: clamp(2.5rem, 7vw, 5.5rem) 1.5rem 6rem;
}

::selection { background: rgba(138, 180, 255, 0.25); color: var(--fg); }

a { color: inherit; }

/* ---------- layout ---------- */

main { width: 100%; max-width: 34rem; }
main.reading { max-width: 40rem; }

/* ---------- home ---------- */

.site-header { margin-bottom: 3.25rem; }

.site-header h1 {
  font-family: var(--serif);
  font-size: clamp(2rem, 1.6rem + 1.6vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--fg);
  line-height: 1.15;
  margin-bottom: 0.4rem;
}

.tagline {
  color: var(--muted);
  font-size: 0.98rem;
  letter-spacing: 0.005em;
}

section + section { margin-top: 3rem; }

section h2 {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.35rem;
}

/* Editorial list rather than boxed cards — closer to a publication index. */
.entries { list-style: none; }

.entries a {
  display: block;
  padding: 1.15rem 0.75rem 1.15rem 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  border-radius: 4px;
  transition: background-color 0.18s ease, padding-left 0.18s ease;
}

.entries li:last-child a { border-bottom: none; }

.entries a:hover {
  background: var(--surface);
  padding-left: 0.75rem;
}

.entry-title {
  display: block;
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--fg);
  letter-spacing: -0.005em;
  line-height: 1.35;
  margin-bottom: 0.3rem;
  transition: color 0.18s ease;
}

.entries a:hover .entry-title { color: var(--accent); }

.entry-meta {
  display: block;
  color: var(--muted);
  font-size: 0.86rem;
  letter-spacing: 0.01em;
}

/* ---------- elsewhere ---------- */

.social { display: flex; flex-wrap: wrap; gap: 0.6rem; padding-top: 1.1rem; }

.social a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: color 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.social a:hover {
  color: var(--fg);
  border-color: var(--border-h);
  background: var(--surface);
}

.social svg { width: 15px; height: 15px; fill: currentColor; }

/* ---------- article ---------- */

.back {
  display: inline-block;
  font-size: 0.88rem;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 3rem;
  transition: color 0.18s ease;
}

.back:hover { color: var(--fg); }

.article-header {
  margin-bottom: 2.75rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.article-header h1 {
  font-family: var(--serif);
  font-size: clamp(1.95rem, 1.5rem + 2.1vw, 2.7rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.18;
  color: var(--fg);
  margin-bottom: 0.9rem;
  /* Let a long title break rather than overflow on narrow screens. */
  overflow-wrap: break-word;
}

.article-meta {
  color: var(--muted);
  font-size: 0.88rem;
  letter-spacing: 0.015em;
}

.article-meta .dot { opacity: 0.5; margin: 0 0.45rem; }

article {
  font-family: var(--serif);
  /* ~17.5px on a phone up to ~20px on a wide screen. */
  font-size: clamp(1.09rem, 1.02rem + 0.3vw, 1.25rem);
  line-height: 1.75;
  letter-spacing: 0.002em;
  color: var(--body);
}

article p + p { margin-top: 1.65em; }

article em { font-style: italic; color: var(--fg); }

article a { color: var(--accent); text-decoration: underline; text-underline-offset: 0.15em; }

.article-footer {
  margin-top: 4rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
  font-family: var(--sans);
}

.article-footer a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.18s ease;
}

.article-footer a:hover { color: var(--fg); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
