/* uhgia.org — "losas serigrafiadas": Havana cement tiles printed like ICAIC silkscreen posters. */

@font-face { font-family: 'Archivo'; font-style: normal; font-weight: 400 700; font-stretch: 62% 125%; font-display: swap; src: url('/assets/fonts/Archivo.woff2') format('woff2'); }
@font-face { font-family: 'Big Shoulders Display'; font-style: normal; font-weight: 700 900; font-display: swap; src: url('/assets/fonts/BigShouldersDisplay.woff2') format('woff2'); }

:root {
  --paper: #D6D2C8;
  --paper-2: #CBC6BB;
  --red: #B8322A;
  --indigo: #22356E;
  --ochre: #E0AE2E;
  --bone: #F1ECE2;
  --ink: #1B1A18;
  --display: 'Big Shoulders Display', 'Arial Narrow', sans-serif;
  --text: 'Archivo', system-ui, sans-serif;
  --gutter: clamp(18px, 4vw, 44px);
  --measure: 68ch;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--paper); color: var(--ink); -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 17px/1.55 var(--text); }
img, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--red); }
:focus-visible { outline: 3px solid var(--indigo); outline-offset: 3px; }
mark { background: none; color: inherit; font-weight: 700; box-shadow: inset 0 -0.42em 0 color-mix(in srgb, var(--ochre) 70%, transparent); }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1; margin: 0; letter-spacing: 0.005em; }
p { margin: 0; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: var(--gutter); top: 8px; background: var(--bone); padding: 6px 10px; z-index: 10; }

/* ---------- header ---------- */
#site-header { max-width: 1200px; margin: 0 auto; padding: 18px var(--gutter); display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 600; font-size: 15px; }
.brand-mark { font: 900 30px/1 var(--display); color: var(--red); text-shadow: 2px 1.5px 0 color-mix(in srgb, var(--indigo) 85%, transparent); }
#site-header nav { display: flex; gap: 22px; margin-left: auto; font-size: 15px; font-weight: 500; }
#site-header nav a { text-decoration: none; padding: 4px 0; border-bottom: 3px solid transparent; }
#site-header nav a[aria-current="page"] { border-bottom-color: var(--red); }
.lang { font: 600 14px var(--text); background: none; border: 2px solid var(--ink); color: var(--ink); padding: 4px 10px; cursor: pointer; }
.lang:hover { background: var(--ink); color: var(--bone); }

/* ---------- home hero ---------- */
.hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(24px, 4vw, 48px); align-items: start; padding-block: 12px 48px; }
.poster { position: relative; height: clamp(190px, 24vw, 290px); }
.poster .letters { position: absolute; left: -0.04em; top: 0; font: 900 clamp(200px, 26vw, 312px)/0.8 var(--display); letter-spacing: -0.02em; color: var(--red); mix-blend-mode: multiply; user-select: none; }
.poster .letters + .letters { color: var(--indigo); transform: translate(0.035em, 0.025em); }
.poster .sun { position: absolute; left: clamp(160px, 21vw, 290px); top: 16%; width: clamp(130px, 16vw, 210px); aspect-ratio: 1; border-radius: 50%; background: var(--ochre); mix-blend-mode: multiply; }
.hero h1 { font-size: clamp(34px, 4vw, 48px); margin: 18px 0 14px; }
.lede { font-size: 18px; max-width: 46ch; }
.credits { margin-top: 18px; font-stretch: 75%; font-size: 16px; line-height: 1.45; max-width: 52ch; }
.credits b { font-stretch: 100%; }

.stage { margin: 0; }
.stage canvas { width: 100%; aspect-ratio: 1; background: var(--paper); transition: opacity 350ms ease; }
.stage canvas.fading { opacity: 0; }
.stage-caption { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; margin-top: 12px; }
.motif-name { font: 700 26px/1 var(--display); }
.motif-how { grid-column: 1 / -1; font-size: 15px; max-width: 60ch; }
.motif-stat { grid-column: 1 / -1; display: flex; gap: 18px; flex-wrap: wrap; font-stretch: 72%; font-size: 15px; }
.motif-picker { display: flex; gap: 8px; }
.motif-picker button { padding: 0; border: 3px solid transparent; background: none; cursor: pointer; width: 34px; height: 34px; }
.motif-picker button canvas { width: 28px; height: 28px; }
.motif-picker button[aria-pressed="true"] { border-color: var(--ink); }

/* ---------- sections ---------- */
.section { padding-block: 40px; }
.section > .section-head { border-top: 3px solid var(--ink); padding-top: 14px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.section h2 { font-size: clamp(30px, 3.4vw, 42px); }
.more { font-weight: 600; font-size: 15px; }

.lines { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.line { border-left: 6px solid var(--paper-2); padding: 2px 0 2px 14px; transition: border-color 300ms; }
.line.active { border-left-color: var(--red); }
.line h3 { font-size: 24px; margin-bottom: 8px; }
.line p { font-size: 15px; }

.featured { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.project { position: relative; padding: 22px 22px 20px; background: var(--bone); overflow: hidden; }
.project canvas.badge { position: absolute; right: 14px; top: 14px; width: 64px; height: 64px; }
.project h3 { font-size: 40px; padding-right: 76px; }
.project .tagline { font-weight: 600; margin: 6px 0 10px; padding-right: 76px; }
.project .desc { font-size: 15px; max-width: 60ch; }
.project .links { display: flex; gap: 18px; margin-top: 14px; font-weight: 600; font-size: 15px; }

.papers { list-style: none; margin: 0; padding: 0; }
.paper { padding: 14px 0; border-bottom: 1.5px solid var(--paper-2); max-width: 90ch; }
.paper-title { font-weight: 600; font-size: 17px; line-height: 1.35; }
.paper-title a { text-decoration: none; }
.paper-title a:hover { text-decoration: underline; }
.paper-authors { font-stretch: 80%; font-size: 15px; margin-top: 3px; }
.paper-meta { font-size: 14px; margin-top: 3px; display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.paper-meta .kind { font-weight: 700; }
.paper-meta .venue { font-style: italic; }
.sup { display: block; font-size: 14px; margin-top: 3px; font-stretch: 80%; }
.tag { font: 700 13px var(--text); background: var(--indigo); color: var(--bone); padding: 1px 6px; }

/* ---------- inner pages ---------- */
.page-head { padding-block: 22px 30px; }
.page-head h1 { font-size: clamp(56px, 9vw, 120px); line-height: 0.85; color: var(--red); mix-blend-mode: multiply; text-shadow: 0.03em 0.02em 0 color-mix(in srgb, var(--indigo) 80%, transparent); }
.page-head .lede { margin-top: 16px; max-width: 60ch; }
.kicker { font-weight: 600; margin-bottom: 8px; }

/* people */
.graph-wrap { position: relative; margin-bottom: 8px; overflow-x: auto; }
.graph-wrap canvas { width: 100%; min-width: 760px; background: var(--paper); cursor: default; }
.graph-tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--bone); font-size: 14px; padding: 4px 8px; white-space: nowrap; transform: translate(-50%, -140%); }
.graph-tip[hidden] { display: none; }
.hint { font-size: 14px; }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px 22px; list-style: none; margin: 0; padding: 0; }
.person { display: grid; grid-template-columns: 72px 1fr; gap: 14px; align-items: start; padding: 10px 0; }
.person canvas { width: 72px; height: 72px; }
.person h3 { font: 700 22px/1.05 var(--display); }
.person .role { font-size: 14px; margin-top: 3px; }
.person .inst { font-size: 13px; font-stretch: 80%; }
.person .links { display: flex; gap: 12px; flex-wrap: wrap; font-size: 14px; font-weight: 600; margin-top: 5px; }

/* publications */
.tabs { display: flex; gap: 0; margin-bottom: 18px; }
.tabs button { font: 700 22px var(--display); background: none; border: 3px solid var(--ink); padding: 6px 16px; cursor: pointer; color: var(--ink); }
.tabs button + button { border-left: 0; }
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--bone); }
.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; margin-bottom: 10px; }
.filters label { display: grid; gap: 3px; font-size: 13px; font-weight: 600; }
.filters input, .filters select { font: 400 15px var(--text); padding: 7px 9px; border: 2px solid var(--ink); background: var(--bone); color: var(--ink); border-radius: 0; }
.filters input { width: min(420px, 100%); }
.filters .clear { font: 600 14px var(--text); background: none; border: 0; text-decoration: underline; cursor: pointer; padding: 8px 0; color: var(--ink); }
.count { font-size: 14px; margin: 8px 0 12px; }
.year-group { display: grid; grid-template-columns: 110px 1fr; gap: 20px; border-top: 3px solid var(--ink); }
.year-group > h2 { font: 900 44px/1 var(--display); color: var(--indigo); padding-top: 12px; position: sticky; top: 0; align-self: start; }
.empty { padding: 24px 0; font-size: 17px; }

/* projects */
.others { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0 28px; }
.others li { padding: 14px 0; border-bottom: 1.5px solid var(--paper-2); }
.others h3 { font-size: 26px; }
.others .tagline { font-weight: 600; font-size: 15px; margin-top: 3px; }
.others .desc { font-size: 15px; margin-top: 4px; }
.others .links { display: flex; gap: 16px; font-size: 14px; font-weight: 600; margin-top: 6px; }

/* gensie */
.numbers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin: 8px 0 28px; }
.numbers div { border-left: 6px solid var(--ochre); padding-left: 12px; }
.numbers b { display: block; font: 900 56px/1 var(--display); color: var(--indigo); }
.numbers span { font-size: 15px; }
.result { font-size: 18px; max-width: 66ch; }
.linkrow { display: flex; gap: 22px; flex-wrap: wrap; font-weight: 600; margin-top: 18px; }

/* 404 */
.lost { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; padding-bottom: 60px; }
.lost canvas { width: 100%; aspect-ratio: 1; }
.lost h1 { font-size: clamp(48px, 7vw, 96px); color: var(--red); }
.lost .lede { margin: 18px 0; }

/* ---------- footer ---------- */
#site-footer { max-width: 1200px; margin: 30px auto 0; padding: 22px var(--gutter) 40px; }
.footer-grid { border-top: 3px solid var(--ink); padding-top: 16px; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; font-size: 14px; }
noscript p { padding: 20px var(--gutter); font-weight: 600; }

/* ---------- small screens ---------- */
@media (max-width: 900px) {
  .hero, .lost { grid-template-columns: 1fr; }
  .lines { grid-template-columns: repeat(2, 1fr); }
  .numbers { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  #site-header nav { margin-left: 0; width: 100%; order: 3; gap: 18px; }
  .lang { margin-left: auto; }
  .lines, .featured { grid-template-columns: 1fr; }
  .year-group { grid-template-columns: 1fr; gap: 0; }
  .year-group > h2 { position: static; }
  .project h3 { font-size: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  .stage canvas, .line { transition: none; }
}
