:root {
  color-scheme: light;
  --ink: #102e45;
  --muted: #496174;
  --blue: #076b94;
  --blue-dark: #075b80;
  --line: #dce7ee;
  --back: #f7fafc;
  --white: #fff;
  font-family: "Open Sans", system-ui, sans-serif;
  color: var(--ink);
  background: var(--back);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
button, input, select { font: inherit; }
button { cursor: pointer; }
a { color: var(--blue-dark); }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { letter-spacing: -.035em; }
:focus-visible { outline: 3px solid #077ca8; outline-offset: 4px; }
.wrap { width: min(1160px, calc(100% - 80px)); margin-inline: auto; }
.skip { position: fixed; z-index: 5; left: 1rem; top: 1rem; padding: .75rem; background: white; transform: translateY(-160%); }
.skip:focus { transform: none; }
.visually-hidden { position: absolute; height: 1px; width: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.site-header { background: var(--white); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 78px; }
.brand { display: inline-flex; align-items: center; gap: 13px; text-decoration: none; color: var(--ink); }
.brand img { object-fit: contain; flex: none; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 1.07rem; letter-spacing: -.025em; }
.brand small { font-size: .74rem; color: var(--muted); margin-top: 2px; }
.site-nav { display: flex; align-items: center; gap: 6px; }
.site-nav a { text-decoration: none; color: var(--muted); font-size: .87rem; font-weight: 650; padding: .58rem .92rem; border-radius: 8px; }
.site-nav a:hover, .site-nav a[aria-current] { color: var(--blue-dark); background: #e9f4fa; }
main { min-height: 65vh; }
.hero { display: grid; grid-template-columns: 1.04fr 1fr; align-items: center; isolation: isolate; min-height: 366px; margin-top: 34px; overflow: hidden; position: relative; border: 1px solid #d4e8f2; border-radius: 22px; background: #e9f5fb; }
.hero-copy { padding: 44px 0 44px 46px; z-index: 1; }
.kicker { color: var(--blue-dark); font-size: .71rem; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; }
.hero h1 { font-size: clamp(3.15rem, 5.6vw, 5.25rem); line-height: .99; margin: 15px 0 19px; letter-spacing: -.068em; }
.hero h1 span { display: block; }
.hero p:not(.kicker) { font-size: 1rem; color: var(--muted); line-height: 1.6; max-width: 390px; }
.hero-art { position: absolute; inset: 0 0 0 43%; z-index: -1; background: url("assets/molecula.webp") center 53% / cover no-repeat; }
.hero-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #e9f5fb 0%, #e9f5fb00 27%); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; color: white; background: var(--blue); border: 1px solid var(--blue); border-radius: 9px; padding: 11px 16px; text-decoration: none; font-size: .86rem; font-weight: 700; line-height: 1.35; }
.button:hover { background: var(--blue-dark); border-color: var(--blue-dark); color: white; }
.button.secondary { background: white; color: var(--ink); border-color: #cadee9; }
.button.secondary:hover { background: #edf7fb; color: var(--blue-dark); border-color: #9bc8dc; }
.button:disabled { opacity: .42; cursor: default; }
.icon { width: 20px; height: 20px; display: inline-block; flex: none; vertical-align: middle; }
.button .icon, .card-link .icon, .topic .icon { width: 16px; height: 16px; }
.home-section { margin: 36px auto 0; }
.home-section:last-child { margin-bottom: 52px; }
.section-heading { margin-bottom: 16px; }
.section-heading h2 { font-size: 1.55rem; }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.module { background: white; border: 1px solid var(--line); border-radius: 15px; padding: 21px; color: var(--ink); text-decoration: none; min-height: 176px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; box-shadow: 0 3px 8px #103c5b06; }
.module:hover, .topic:hover { border-color: #8abed3; box-shadow: 0 5px 15px #103c5b12; }
.badge-icon { display: grid; place-items: center; height: 39px; width: 39px; border-radius: 10px; background: #e5f3fa; color: #096a96; margin-bottom: 4px; }
.badge-icon.teal { background: #e4f4f0; color: #116c61; }
.badge-icon.gold { background: #fff2df; color: #8f4e0e; }
.module h3 { font-size: 1.11rem; }
.module p { color: var(--muted); font-size: .85rem; line-height: 1.52; }
.card-link { display: flex; align-items: center; gap: 6px; margin-top: auto; padding-top: 6px; color: var(--blue-dark); font-size: .82rem; font-weight: 700; }
.topic-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.topic { display: flex; align-items: center; min-height: 64px; gap: 9px; justify-content: space-between; background: white; border: 1px solid var(--line); border-radius: 11px; padding: 12px; color: var(--ink); text-decoration: none; font-weight: 650; font-size: .85rem; }
.formula-chip { background: #eaf4f8; color: var(--blue-dark); padding: 4px 7px; border-radius: 6px; font-size: .83rem; flex: none; font-weight: 700; }
.site-footer { background: white; border-top: 1px solid var(--line); }
.footer-main { display: flex; align-items: center; justify-content: space-between; min-height: 102px; gap: 24px; }
.institution { display: flex; align-items: center; gap: 26px; }
.xunta, .galicia { object-fit: contain; height: auto; }
.site-footer address { display: flex; flex-wrap: wrap; gap: 10px 22px; padding: 15px 0 20px; border-top: 1px solid var(--line); color: var(--muted); font-style: normal; font-size: .8rem; }
.interior { padding-block: 34px 56px; }
.page-intro { margin-bottom: 24px; }
.page-intro h1 { font-size: clamp(2.12rem, 5vw, 3.55rem); line-height: 1.06; margin: 8px 0 10px; }
.page-intro p:last-child { color: var(--muted); max-width: 68ch; line-height: 1.6; }
.reader { display: grid; grid-template-columns: 260px minmax(0,1fr); align-items: start; gap: 18px; }
.panel { background: white; border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.panel h2 { font-size: 1.23rem; }
.chapters { display: grid; gap: 4px; margin: 11px 0 0; padding: 0; list-style: none; }
.chapters a { display: block; color: var(--ink); padding: 8px 10px; text-decoration: none; border-radius: 7px; font-size: .84rem; }
.chapters a:hover, .chapters a[aria-current] { color: var(--blue-dark); background: #e9f4fa; }
.reader-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.reader-nav select { flex: 1; min-width: 0; }
.page-image { width: auto; max-height: 1100px; height: auto; margin: auto; }
.figure { margin: 15px 0; background: white; border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.figure a { display: block; }
.reader-text { margin-top: 16px; }
summary { cursor: pointer; font-weight: 700; color: var(--blue-dark); }
.transcript { white-space: pre-line; line-height: 1.6; overflow-wrap: anywhere; color: var(--muted); font-size: .86rem; padding: 12px 0 0; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: .82rem; font-weight: 700; }
input[type=search], select { color: var(--ink); background: white; border: 1px solid #b6cbd8; border-radius: 8px; padding: 9px 11px; min-height: 41px; }
.chapters + .field { margin-top: 18px; }
.results { font-size: .84rem; color: var(--muted); margin-block: 10px; }
.matches { display: grid; gap: 4px; padding-left: 17px; font-size: .8rem; }
.toolbar { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.toolbar .field { flex: 1; min-width: 160px; max-width: 330px; }
.toolbar .check { display: flex; align-items: center; gap: 6px; min-height: 41px; font-size: .86rem; }
.table-scroll { overflow-x: auto; border-radius: 12px; border: 1px solid var(--line); }
table { border-collapse: collapse; width: 100%; min-width: 710px; font-size: .88rem; }
th, td { text-align: left; padding: 12px 13px; border-bottom: 1px solid var(--line); vertical-align: middle; }
thead { background: #0d4863; color: white; }
tbody { background: white; }
tbody tr:nth-child(even) { background: #f0f7fa; }
tbody tr:last-child > * { border-bottom: 0; }
td:first-child { color: var(--blue-dark); font-weight: 750; }
td small { display: block; color: var(--muted); line-height: 1.45; }
.chemical { font-family: system-ui, sans-serif; font-weight: 600; letter-spacing: .005em; }
.ex-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.solution { display: flex; flex-direction: column; gap: 9px; min-height: 102px; padding: 13px 15px; }
.solution h2 { font-size: .84rem; letter-spacing: 0; }
.solution-head { display: flex; align-items: center; gap: 8px; }
.number { display: inline-grid; place-items: center; background: #e6f3fa; color: var(--blue-dark); border-radius: 7px; min-width: 30px; height: 28px; padding-inline: 5px; }
.solution p, .solution summary { font-size: .88rem; }
.solution p { line-height: 1.5; overflow-wrap: anywhere; }
.solution details[open] summary { margin-bottom: 8px; }
.solution img { max-height: 75px; width: auto; }
.empty { background: white; padding: 20px; border: 1px solid var(--line); border-radius: 10px; }
@media (max-width: 900px) {
  .wrap { width: calc(100% - 44px); }
  .hero-copy { padding-left: 30px; }
  .topic-grid, .ex-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .reader { grid-template-columns: 205px minmax(0,1fr); }
  .institution { gap: 14px; }
  .xunta { width: 255px; }
}
@media (max-width: 640px) {
  .wrap { width: calc(100% - 28px); }
  .header-inner { min-height: auto; align-items: flex-start; flex-direction: column; gap: 10px; padding: 12px 0; }
  .header-inner .brand img { width: 38px; height: 38px; }
  .site-nav { width: 100%; justify-content: space-between; gap: 0; }
  .site-nav a { padding: .55rem .46rem; font-size: .8rem; }
  .hero { display: block; min-height: 0; margin-top: 17px; border-radius: 16px; }
  .hero-copy { padding: 23px 18px 0; }
  .hero h1 { font-size: clamp(2.65rem, 10vw, 4rem); }
  .hero p:not(.kicker) { font-size: .91rem; }
  .hero-art { position: relative; inset: auto; height: 186px; background-position: center 54%; }
  .hero-art::after { background: linear-gradient(#e9f5fb 0%, #e9f5fb00 35%); }
  .home-section { margin-top: 25px; }
  .card-grid, .reader, .ex-grid { grid-template-columns: minmax(0,1fr); }
  .card-grid { gap: 10px; }
  .module { padding: 16px; min-height: auto; }
  .topic { justify-content: flex-start; }
  .topic .icon { display: none; }
  .footer-main { flex-wrap: wrap; padding: 16px 0; }
  .institution { width: 100%; justify-content: space-between; }
  .xunta { width: min(73%,255px); }
  .galicia { width: 52px; }
  .interior { padding-top: 23px; }
  .figure, .panel { padding: 12px; }
}
@media (max-width: 360px) {
  .topic-grid { grid-template-columns: minmax(0,1fr); }
}
