/* ==========================================================================
   bds.com.py · Marcos Codas
   One typeface (Archivo, variable width), paper and ink, the photographs do
   the colour. Red belongs to MosquitOFF only.

   Home:   .topbar .intro .piece(.piece--night) .numbers .photos .outro
   CV:     .section .section__label .section__body .section__notes
           table.record  dl.figures  ol.timeline  .note  sup.ref
   Shared: .wrap .kicker .muted .small .btn-link  mark.ph
   ========================================================================== */

:root {
  --paper: #f3f3f0;
  --paper-2: #e7e7e3;
  --ink: #111110;
  --ink-2: #393936;
  --ink-3: #64645f;
  --rule: #cfcfca;
  --red: #c4271b;
  --red-ink: #a81f14;

  /* the MosquitOFF night band keeps its own palette in both themes */
  --night: #0c0e12;
  --night-2: #181b21;
  --night-ink: #ecebe6;
  --night-ink-2: #a9a8a2;
  --risk-0: #2b2f37;
  --risk-1: #5a3a35;
  --risk-2: #96432f;
  --risk-3: #d4532f;
  --risk-4: #ff9a6b;

  --ph-bg: #ffe27a;
  --ph-ink: #111110;

  --sans: "Archivo", "Helvetica Neue", Arial, system-ui, sans-serif;

  --t-xs: 0.8125rem;
  --t-s: 0.9375rem;
  --t-base: 1.125rem;
  --t-l: clamp(1.25rem, 1.05rem + 0.7vw, 1.6rem);
  --t-xl: clamp(1.6rem, 1.1rem + 2vw, 2.75rem);
  --t-num: clamp(2.8rem, 1rem + 4.6vw, 6.25rem);
  --t-name: clamp(3.6rem, 0.8rem + 11vw, 11.5rem);

  --gutter: clamp(1rem, 4.5vw, 4rem);
  --gap: clamp(1.25rem, 3vw, 3rem);
  --block: clamp(3.5rem, 2rem + 5vw, 7rem);

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121211;
    --paper-2: #1d1d1b;
    --ink: #edede8;
    --ink-2: #c3c3bc;
    --ink-3: #96968f;
    --rule: #34342f;
    --red: #ff6a52;
    --red-ink: #ff8a76;
    --night: #08090b;
    --ph-bg: #6b5a10;
    --ph-ink: #fff6d6;
  }
}

/* ---------- Base -------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--t-base);
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
}
h1, h2, h3 { margin: 0 0 1rem; line-height: 1.05; font-weight: 700; letter-spacing: -0.015em; text-wrap: balance; }
h2 { font-size: var(--t-xl); font-stretch: 112%; }
h3 { font-size: var(--t-l); }
p { margin: 0 0 1rem; text-wrap: pretty; }
ul, ol { margin: 0 0 1rem; padding-left: 1.2em; }
img { display: block; max-width: 100%; height: auto; }
svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--red-ink); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
strong { font-weight: 700; }

.wrap { max-width: 96rem; margin: 0 auto; padding-inline: var(--gutter); }
.kicker { font-size: var(--t-xs); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 0.75rem; }
.muted { color: var(--ink-3); }
.small { font-size: var(--t-s); }
.btn-link { font-weight: 600; text-decoration: none; border-bottom: 2px solid currentColor; padding-bottom: 0.1em; }
.btn-link:hover { color: var(--red-ink); }
.skip-link { position: absolute; left: var(--gutter); top: -3rem; background: var(--ink); color: var(--paper); padding: 0.5rem 0.75rem; z-index: 10; }
.skip-link:focus { top: 0.5rem; }
mark.ph { background: var(--ph-bg); color: var(--ph-ink); padding: 0.05em 0.3em; font-size: 0.85em; box-decoration-break: clone; -webkit-box-decoration-break: clone; }

/* ---------- Top bar ----------------------------------------------------- */
.topbar {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0.5rem 1.5rem;
  padding-block: 1.1rem; font-size: var(--t-s);
}
.topbar__home { font-weight: 700; font-stretch: 125%; text-decoration: none; letter-spacing: 0.01em; }
.topbar nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.topbar nav a { text-decoration: none; padding-block: 0.35rem; }
.topbar nav a:hover, .topbar nav a[aria-current] { text-decoration: underline; }

/* ---------- Intro (home, first screen) ---------------------------------- */
.intro { display: grid; gap: var(--gap); padding-block: clamp(1.5rem, 4vw, 4rem) var(--block); align-items: end; }
.intro__name {
  font-size: var(--t-name); font-stretch: 125%; font-weight: 800; line-height: 0.82;
  letter-spacing: -0.035em; text-transform: uppercase; margin: 0; grid-column: 1 / -1;
}
.intro__name span { display: block; }
.intro__photo { margin: 0; }
.intro__photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 30%; filter: grayscale(1) contrast(1.05); }
.intro__text { max-width: 38rem; }
.intro__text p:first-child { font-size: var(--t-l); line-height: 1.38; }
.intro__mail { font-size: var(--t-l); font-weight: 600; }
.intro__now { font-size: var(--t-s); color: var(--ink-2); border-top: 1px solid var(--ink); padding-top: 0.75rem; margin-top: 1.75rem; }
@media (min-width: 52rem) {
  .intro { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .intro__photo { max-width: 34rem; }
}

/* ---------- Work pieces ------------------------------------------------- */
.piece { padding-block: var(--block); border-top: 1px solid var(--ink); display: grid; gap: var(--gap); }
.piece__head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 1rem; align-items: baseline; }
.piece__title { font-size: var(--t-xl); font-stretch: 118%; font-weight: 800; letter-spacing: -0.02em; margin: 0; }
.piece__role { font-size: var(--t-s); color: var(--ink-3); margin: 0; }
.piece__text { max-width: 36rem; }
.piece__text > p:first-child { font-size: var(--t-l); line-height: 1.4; }
.piece__facts { list-style: none; padding: 0; margin: 1.5rem 0; font-size: var(--t-s); border-top: 1px solid var(--rule); }
.piece__facts li { padding: 0.55rem 0; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: 5.5rem 1fr; gap: 1rem; }
.piece__facts time { font-weight: 600; }
.piece__links { display: flex; flex-wrap: wrap; gap: 0.75rem 1.75rem; font-size: var(--t-s); margin-top: 1.5rem; }
.piece figure { margin: 0; }
.piece figcaption { font-size: var(--t-xs); color: var(--ink-3); margin-top: 0.6rem; }
@media (min-width: 60rem) {
  .piece--split { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: start; }
  .piece--split-rev { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: start; }
  .piece--split .piece__head, .piece--split-rev .piece__head { grid-column: 1 / -1; }
}

/* MosquitOFF: full-bleed night band */
.piece--night {
  background: var(--night); color: var(--night-ink); border-top: 0;
  margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter);
  --ink-3: var(--night-ink-2); --rule: #2c3038; --ink: var(--night-ink);
}
.piece--night a:hover { color: var(--risk-4); }
.piece--night :focus-visible { outline-color: var(--risk-4); }

/* GDevelop: the numbers are the image */
.numbers { display: grid; gap: 1.5rem var(--gap); margin: 0; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); }
.numbers > div { display: flex; flex-direction: column; border-top: 1px solid var(--ink); padding-top: 0.75rem; }
.numbers dd { order: -1; margin: 0; font-size: var(--t-num); font-stretch: 125%; font-weight: 800; line-height: 0.9; letter-spacing: -0.04em; }
.numbers dd small { font-size: 0.42em; font-weight: 700; letter-spacing: 0; vertical-align: 0.9em; margin-right: 0.1em; }
.numbers dt { font-size: var(--t-s); color: var(--ink-2); margin-top: 0.6rem; max-width: 18rem; }

/* Photographs: a contact sheet, not a carousel */
.photos { display: grid; gap: clamp(0.5rem, 1.2vw, 1rem); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.photos img { width: 100%; height: 100%; object-fit: cover; }
.photos figure { margin: 0; }
.photos .tall { grid-row: span 2; }
@media (min-width: 52rem) {
  .photos { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: clamp(9rem, 16vw, 15rem); }
}

/* Outro / contact */
.outro { padding-block: var(--block) clamp(3rem, 6vw, 6rem); border-top: 1px solid var(--ink); }
.outro__mail { font-size: clamp(1.7rem, 0.2rem + 6.2vw, 6.5rem); font-stretch: 112%; font-weight: 800; letter-spacing: -0.04em; line-height: 0.95; text-decoration: none; white-space: nowrap; display: inline-block; }
.outro__mail:hover { color: var(--red-ink); }
.outro__links { display: flex; flex-wrap: wrap; gap: 0.75rem 2rem; margin-top: 2rem; font-size: var(--t-base); }

.site-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem; padding-block: 1.5rem 2.5rem; font-size: var(--t-xs); color: var(--ink-3); border-top: 1px solid var(--rule); }

/* ---------- MosquitOFF map (lives inside .piece--night) ------------------ */
.mq-map { margin: 0; }
.mq-map svg { width: 100%; }
.mq-cells path { stroke: none; }
.mq-cells .r0 { fill: var(--risk-0); }
.mq-cells .r1 { fill: var(--risk-1); }
.mq-cells .r2 { fill: var(--risk-2); }
.mq-cells .r3 { fill: var(--risk-3); }
.mq-cells .r4 { fill: var(--risk-4); }
.mq-outline { fill: none; stroke: var(--night-ink); stroke-width: 1.4; stroke-linejoin: round; }
.mq-river { fill: none; stroke: var(--night-ink-2); stroke-width: 1; stroke-dasharray: 3 3; }
.mq-pin__dot { fill: var(--night-ink); }
.mq-pin__ring { fill: none; stroke: var(--night-ink); stroke-width: 1.5; }
.mq-pin--key .mq-pin__dot { fill: var(--risk-4); }
.mq-pin--key .mq-pin__ring { stroke: var(--risk-4); stroke-width: 2; }
.mq-lead { stroke: var(--night-ink-2); stroke-width: 1; fill: none; }
.mq-txt { fill: var(--night-ink-2); font-family: var(--sans); font-size: 13px; }
.mq-txt--key { fill: var(--night-ink); font-weight: 700; font-size: 15px; }
.mq-txt--region { font-style: italic; font-size: 15px; }
.mq-txt--small, .mq-txt--stamp { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }
.mq-scale path, .mq-scale line { stroke: var(--night-ink-2); fill: none; }
.mq-scrub { margin-top: 1rem; font-size: var(--t-xs); color: var(--night-ink-2); }
.mq-scrub[hidden] { display: none; }
.mq-scrub input[type="range"] { width: 100%; accent-color: var(--risk-3); margin: 0.4rem 0; }
.mq-scrub__ticks { display: flex; justify-content: space-between; }
.mq-legend { list-style: none; display: flex; align-items: center; gap: 0.3rem; padding: 0; margin: 0.75rem 0 0; font-size: var(--t-xs); color: var(--night-ink-2); }
.mq-legend li { margin: 0; }
.mq-sw { width: 1.4rem; height: 0.75rem; }
.mq-sw--0 { background: var(--risk-0); } .mq-sw--1 { background: var(--risk-1); } .mq-sw--2 { background: var(--risk-2); }
.mq-sw--3 { background: var(--risk-3); } .mq-sw--4 { background: var(--risk-4); }
.mq-legend__end { padding-inline: 0.3rem; }
.mq-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.mq-scrub__label { display: flex; justify-content: space-between; }
.mq-map figcaption { font-size: var(--t-xs); color: var(--night-ink-2); margin-top: 0.75rem; }

/* ---------- CV page ------------------------------------------------------ */
.cv-head { padding-block: clamp(2rem, 5vw, 5rem) 2rem; }
.cv-head h1 { font-size: clamp(2.6rem, 1rem + 6vw, 6rem); font-stretch: 125%; font-weight: 800; letter-spacing: -0.03em; text-transform: uppercase; line-height: 0.9; }
.cv-head p { max-width: 40rem; }
.section { padding-block: 2.5rem; border-top: 1px solid var(--ink); display: grid; gap: 0.5rem 2rem; }
.section__label { font-size: var(--t-xs); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.section__label .n { margin-right: 0.5em; color: var(--ink); }
.section__body { min-width: 0; max-width: 62rem; }
.section__notes { min-width: 0; max-width: 62rem; }
@media (min-width: 60rem) {
  .section { grid-template-columns: 12rem minmax(0, 1fr); }
  .section__notes { grid-column: 2; }
}
.note { font-size: var(--t-xs); color: var(--ink-2); margin: 0 0 0.5rem; padding-left: 1.5em; position: relative; }
.note__n { position: absolute; left: 0; color: var(--ink-3); }
.note:target { background: var(--paper-2); }
sup.ref { font-size: 0.65em; line-height: 0; }
sup.ref a { text-decoration: none; color: var(--ink-3); }

dl.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 0 1.5rem; margin: 1.25rem 0; }
dl.figures > div { display: flex; flex-direction: column; border-top: 1px solid var(--ink); padding: 0.6rem 0 1rem; }
dl.figures dd { order: -1; margin: 0; font-size: 1.9rem; font-stretch: 118%; font-weight: 800; line-height: 1; letter-spacing: -0.02em; }
dl.figures dt { font-size: var(--t-xs); color: var(--ink-3); margin-top: 0.35rem; }

ol.timeline { list-style: none; padding: 0; margin: 1rem 0; }
ol.timeline > li { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; padding: 0.6rem 0; border-top: 1px solid var(--rule); margin: 0; }
ol.timeline time { font-weight: 600; font-size: var(--t-s); }

table.record { width: 100%; border-collapse: collapse; font-size: var(--t-s); margin: 0.5rem 0 2rem; }
table.record caption { text-align: left; font-size: var(--t-xs); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); padding-bottom: 0.5rem; }
table.record th, table.record td { text-align: left; vertical-align: top; padding: 0.6rem 1rem 0.6rem 0; border-top: 1px solid var(--rule); }
table.record thead th { font-size: var(--t-xs); font-weight: 600; color: var(--ink-3); border-top: 1px solid var(--ink); }
table.record td:first-child { white-space: nowrap; font-weight: 600; }
@media (max-width: 40rem) {
  table.record, table.record tbody, table.record tr, table.record td, table.record th { display: block; }
  table.record thead { display: none; }
  table.record tr { border-top: 1px solid var(--rule); padding: 0.6rem 0; }
  table.record td, table.record th { border: 0; padding: 0.1rem 0; }
  table.record td[data-label]::before { content: attr(data-label); display: block; font-size: var(--t-xs); color: var(--ink-3); margin-top: 0.3rem; }
  table.record td:first-child::before { display: none; }
}
details { margin: 1rem 0; }
details summary { cursor: pointer; font-weight: 600; }
blockquote.quote { margin: 1.5rem 0; padding-left: 1.25rem; border-left: 2px solid var(--ink); }
blockquote.quote footer { font-size: var(--t-xs); color: var(--ink-3); }
img.full { width: 100%; }
.section__body > h2 { font-size: clamp(1.35rem, 1rem + 1.2vw, 2rem); font-stretch: 112%; }
.numbers dd small:not(:first-child) { vertical-align: baseline; margin: 0 0.05em 0 0; }
