/* ---------------------------------------------------------------
   Matías Buonfrate — single scroll
   Warm dark ground, project names as strata, system-sans body.
   --------------------------------------------------------------- */

:root {
  color-scheme: dark;

  --ground: #16140f;
  --ink: #ece7dd;
  --ink-soft: #968f82;
  --rule: #322e27;

  --mono: ui-monospace, "SF Mono", "Cascadia Code", "Roboto Mono",
          Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica,
          Arial, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Single column, left-aligned, generous gutters */
header,
main,
footer {
  max-width: 600px;
  margin-inline: auto;
  padding-inline: 28px;
}

/* ---- Header --------------------------------------------------- */

header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  padding-top: 5.5rem;
  padding-bottom: 0.5rem;
}

.identity { min-width: 0; }

h1 {
  margin: 0;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 1.5rem;
  letter-spacing: -0.015em;
}

.tagline {
  margin: 0.55rem 0 0;
  font-family: var(--sans);
  font-size: 0.95rem;
  font-style: italic;
  letter-spacing: 0.005em;
  color: var(--ink-soft);
}

/* ---- Language toggle ------------------------------------------ */

.toggle {
  flex: none;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--rule);
  white-space: nowrap;
}

.toggle button {
  appearance: none;
  border: 0;
  background: none;
  margin: 0;
  padding: 0 0.2em;
  font: inherit;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  cursor: pointer;
}

.toggle button.is-active {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---- About / lead --------------------------------------------- */

.about {
  margin-top: 2.4rem;
}

.about p {
  margin: 0;
  max-width: 48ch;
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--ink);
}

/* ---- Era strata ----------------------------------------------- */

.era {
  border-top: 1px solid var(--rule);
  padding-top: 1.6rem;
  margin-top: 2.6rem;
  scroll-margin-top: 2rem;
}

/* The year range marks the layer — a small tabular eyebrow above the
   project name, which now carries the structural hierarchy. */
.years {
  margin: 0 0 0.35rem;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.85rem;
  line-height: 1;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
}

.years .dash {
  padding-inline: 0.04em;
}

/* The project name is the anchor — large and tight, so the sections
   read as stacked geological layers. */
.era-title {
  margin: 0 0 1.1rem;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 2.1rem;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.era p {
  margin: 0 0 1.2rem;
  color: var(--ink-soft);
  max-width: 52ch;
}

/* Sub-label separators (Académico, Prensa…) need space from the
   preceding list, not from the title above them. */
.entries + .years {
  margin-top: 1.6rem;
}

/* ---- Entry lists ---------------------------------------------- */

.entries {
  list-style: none;
  margin: 0;
  padding: 0;
}

.entries li {
  position: relative;
  padding-left: 1.4em;
  margin-bottom: 0.25rem;
}

.entries li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--ink-soft);
}

/* ---- Links ---------------------------------------------------- */

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--rule);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s ease;
}

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

/* ---- Footer --------------------------------------------------- */

footer {
  border-top: 1px solid var(--rule);
  margin-top: 3rem;
  padding-top: 1.6rem;
  padding-bottom: 4.5rem;
  font-family: var(--mono);
  font-size: 0.9rem;
}

/* ---- Language visibility -------------------------------------- */

body.lang-es [lang="en"] { display: none; }
body.lang-en [lang="es"] { display: none; }

/* ---- Narrow viewports ----------------------------------------- */

@media (max-width: 460px) {
  body { font-size: 16px; }

  header,
  main,
  footer { padding-inline: 20px; }

  header {
    padding-top: 3rem;
    gap: 1rem;
  }

  .era-title { font-size: 1.7rem; }
}
