/* ---------------------------------------------------------------------------
   javierllaca.com — austere, monospace, plaintext-leaning.
   Light palette on bare :root; dark palette swaps roles under the media query.

   No web font: text renders in the visitor's system monospace (--font
   below) — SF Mono / Menlo on macOS, Consolas on Windows, DejaVu / Liberation
   on Linux. No download, so no load flash or restyle.
--------------------------------------------------------------------------- */

:root {
  --bg: #fbfbf8;
  --fg: #17171a;
  --muted: #6a6a63;
  --rule: #d9d9d0;
  --accent: #1f6f43;
  --selection: #dfe9e2;

  /* Fixed width, not `ch` — `ch` is measured from the active font's glyph
     advance, so it varies with the system font. ~72 chars at the base size. */
  --measure: 37rem;
  --font: ui-monospace, SFMono-Regular, Menlo, Consolas, 'DejaVu Sans Mono',
      'Liberation Mono', monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0f0d;
    --fg: #d5d5cc;
    --muted: #7c7c72;
    --rule: #292a25;
    --accent: #6cc088;
    --selection: #1d2a22;
  }
}

* {
  box-sizing: border-box;
}

html {
  /* rem basis for the whole page — headings, spacing and --measure all scale
     from here, so this one value tunes the overall text size. */
  font-size: 15.5px;
  -webkit-text-size-adjust: 100%;
  /* Keep anchored jumps clear of the sticky (two-row) header. */
  scroll-padding-top: 6rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  font-variant-ligatures: none;
  font-synthesis: none;
  overflow-wrap: break-word;
}

img {
  max-width: 100%;
  height: auto;
}

::selection {
  background: var(--selection);
}

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1.4rem 5rem;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

/* --- links ------------------------------------------------------------- */

a {
  color: var(--fg);
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

/* --- headings & prose ------------------------------------------------- */

h1,
h2,
h3 {
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
}

h1 {
  font-size: 1.2rem;
  /* Page title — give it at least a paragraph's worth of air before the body. */
  margin-bottom: 1.25rem;
}

/* Markdown heading levels, spelled out: "# " on h1, "## " on h2. */
h1::before {
  content: '# ';
  color: var(--rule);
}

h2 {
  font-size: 1.1rem;
  margin-top: 2.75rem;
  margin-bottom: 0.6rem;
  color: var(--muted);
}

h2::before {
  content: '## ';
  color: var(--rule);
}

/* Concerts leads with an h2 ("upcoming") right after the h1; drop the section
   gap there so the title-to-content spacing matches the other pages. */
h1 + h2 {
  margin-top: 0;
}

p {
  margin: 0 0 1.1rem;
}

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 1.8rem 0;
}

small,
.muted {
  color: var(--muted);
}

code {
  background: var(--selection);
  padding: 0.05em 0.35em;
  border-radius: 2px;
  font-size: 0.95em;
}

pre {
  background: var(--selection);
  padding: 1rem;
  overflow-x: auto;
  border-radius: 2px;
}

pre code {
  background: none;
  padding: 0;
}

blockquote {
  margin: 1.1rem 0;
  padding-left: 1rem;
  border-left: 2px solid var(--rule);
  color: var(--muted);
}

/* --- site header / footer ------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  /* Two rows: wordmark + language toggle, then the section nav. Stacked in
     every language, not just when the nav happens to be wide enough to wrap. */
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.1rem 0;
  margin-bottom: 2.25rem;
  border-bottom: 1px solid var(--rule);
}

/* Wordmark + language toggle, grouped on the left. */
.site-id {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
}

.site-header .brand {
  font-weight: 700;
  text-decoration: none;
}

/* Language switch — sits by the wordmark, reads as a switch not a nav item.
   Renders as `[ en | es ]`: the current language is highlighted, the other is
   a link. inline-flex drops the markup's inter-element whitespace so `gap`
   alone controls the (sub-character) spacing. */
.lang {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4em;
  font-size: 0.8rem;
  color: var(--muted);
}

.lang::before {
  content: '[';
}

.lang::after {
  content: ']';
}

.lang-current {
  color: var(--accent);
  font-weight: 700;
}

/* The inactive locale reads like a nav link: muted, brightens on hover. */
.lang a {
  color: var(--muted);
  text-decoration: none;
}

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

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.site-nav a {
  text-decoration: none;
  color: var(--muted);
}

.site-nav a::before {
  content: '[';
  color: var(--rule);
}

.site-nav a::after {
  content: ']';
  color: var(--rule);
}

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

.site-nav a[aria-current='page'] {
  color: var(--accent);
  font-weight: 700;
}

.site-nav a[aria-current='page']::before,
.site-nav a[aria-current='page']::after {
  color: var(--accent);
}

.site-footer {
  margin-top: 4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: space-between;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--accent);
}

/* --- listing tables (concerts, writings, ...) ---------------------- */

.rows {
  list-style: none;
  /* Trailing margin matches a paragraph's, so a link right after the table
     (homepage "All concerts →") sits the same distance below it as
     "Full bio →" sits below the intro. */
  margin: 0 0 1.1rem;
  padding: 0;
}

.rows li {
  padding: 0.7rem 0;
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 0.2rem 1rem;
}

.rows li:last-child {
  border-bottom: 1px solid var(--rule);
}

.rows .when {
  color: var(--muted);
  white-space: nowrap;
}

.rows .what {
  margin: 0;
}

.rows .meta {
  grid-column: 2;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 34rem) {
  .rows li {
    grid-template-columns: 1fr;
  }
  .rows .meta {
    grid-column: 1;
  }
}

/* --- blinking cursor ---------------------------------------------------- */

/* Every page title trails a blinking terminal cursor, an extra space out. */
h1::after {
  content: '';
  display: inline-block;
  width: 0.34em;
  height: 1.05em;
  translate: 0 0.18em;
  margin-left: 0.3em;
  background: var(--accent);
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  h1::after {
    animation: none;
  }
}

/* --- utilities -------------------------------------------------------- */

.stack > * + * {
  margin-top: 1.1rem;
}

.tag {
  color: var(--muted);
}

.tag::before {
  content: '#';
  color: var(--rule);
}

.badge {
  color: var(--accent);
  border: 1px solid var(--rule);
  padding: 0 0.4em;
  font-size: 0.8rem;
}
