:root {
  color-scheme: light;
  --ink: #24241a;
  --muted: #56574a;
  --paper: #f9f7ef;
  --border: #d6d2c1;
  --yellow: #ffdc52;
  --olive: #e9eddb;
  --blush: #f7e2d8;
  --red: #802c1d;
  font: 16px/1.55 "DM Sans", system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box }
[hidden] { display: none !important }
body { margin: 0; color: var(--ink); background: var(--paper) }
::selection { color: var(--ink); background: var(--yellow) }
a { color: inherit; text-underline-offset: .2em; text-decoration-thickness: .08em }
a:hover { text-decoration-thickness: .14em }
:focus-visible { outline: 3px solid #4542a4; outline-offset: 4px }
.hero :focus-visible, .footer :focus-visible { outline-color: var(--yellow) }
.skip { position: absolute; z-index: 2; top: 12px; left: 12px; padding: 8px 15px; background: var(--paper); transform: translateY(-160%); }
.skip:focus { transform: translateY(0) }
.hero { background: var(--ink); color: #fffdf4; border-bottom: 8px solid var(--yellow) }
.hero-inner, .layout, .footer > div { max-width: 1200px; margin: auto; padding-inline: clamp(20px, 5vw, 72px) }
.hero-inner { padding-block: 34px clamp(38px, 7vw, 92px) }
.project { display: flex; flex-wrap: wrap; gap: 2px 20px; align-items: baseline; border-bottom: 1px solid #555649; padding-bottom: 16px; margin: 0 0 clamp(35px, 6vw, 74px); font-size: .9rem; font-weight: 750; color: var(--yellow) }
.project span { color: #e6e1cd; font-weight: 500 }
h1,h2,h3,h4 { line-height: 1.15; letter-spacing: -.027em; text-wrap: balance }
h1 { font-size: clamp(2.7rem, 8.5vw, 7.4rem); margin: 0; letter-spacing: -.048em; font-weight: 800; line-height: .98 }
.lead { max-width: 42ch; margin: 25px 0 0; color: #ece8d9; font-size: clamp(1.05rem, 2.2vw, 1.5rem); line-height: 1.45 }
.layout { display: grid; grid-template-columns: minmax(160px, 208px) minmax(0, 1fr); gap: clamp(32px, 7vw, 96px); align-items: start }
.toc { position: sticky; top: 24px; margin-block: 56px 30px; font-size: .9rem }
.toc p { font-weight: 800; margin: 0 0 8px }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border) }
.toc a { display: block; padding: .36em .8em; text-decoration: none }
.toc a:hover { background: #f1ecd9 }
.toc a[aria-current="location"] { background: var(--yellow); color: var(--ink) }
main { min-width: 0; padding-block: 53px 55px }
section { scroll-margin-top: 24px; margin-bottom: 57px }
section + section { border-top: 1px solid var(--border); padding-top: 34px }
section:last-child { margin-bottom: 0 }
h2 { font-size: clamp(1.85rem, 4vw, 3.05rem); margin: 0 0 18px }
h3 { font-size: 1.16rem; margin: 0 0 7px }
h4 { font-size: 1.06rem; margin: 0 0 5px }
p { margin: 0 0 .9em }
main > section > p { max-width: 70ch }
.muted, .context, .outcome { color: var(--muted) }
.sources { padding: 0; margin: .7rem 0 0; list-style: none; display: flex; flex-wrap: wrap; gap: 7px 17px; font-size: .86rem; font-weight: 700 }
.steps, .hypotheses, .reference-list, .heuristic-list, .row-list { list-style: none; margin: 0; padding: 0 }
.steps { display: grid; grid-template-columns: 1fr 1fr; gap: 15px 25px; counter-reset: step }
.steps li { counter-increment: step; padding: 17px 0 3px; border-top: 1px solid var(--border) }
.steps h3::before { content: "0" counter(step); color: var(--muted); font-size: .76em; margin-right: .55em }
.outcome { font-size: .91rem }
.outcome strong, .opportunity strong, .reference-list strong { display: block; color: var(--ink); margin-bottom: 1px }
.hypotheses li { border-top: 1px solid var(--border); padding: 16px 0 13px }
.case-links { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 0; font-size: .85rem }
.case-links span { color: var(--muted); margin-right: 4px }
.case-links a { display: grid; place-items: center; min-width: 34px; min-height: 30px; padding: 1px 4px; background: var(--olive); font-weight: 750; border-radius: 4px }
.case-links a:hover { background: var(--yellow) }
.context { font-size: .91rem; margin: 10px 0 0 }
.profile-tools { margin: 18px 0 15px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 14px; align-items: center }
.profile-tools label { grid-column: 1 / -1; font-size: .9rem; font-weight: 700 }
.profile-tools input { font: inherit; color: inherit; background: #fffdf7; border: 1px solid #8a887b; padding: 9px 12px; border-radius: 7px; width: 100% }
.profile-tools p { margin: 0; color: var(--muted); font-size: .85rem }
.profile-group, .spec { border-block-start: 1px solid var(--border) }
.profile-group:last-of-type, .spec { border-block-end: 1px solid var(--border) }
summary { padding: 12px 1px; cursor: pointer; font-weight: 800 }
summary:hover { text-decoration: underline; text-underline-offset: 4px }
.group-count { margin-left: .5em; font-weight: 500; font-size: .82rem; color: var(--muted) }
.profile-group ol { margin: 0; padding: 0; list-style: none }
.profile { display: grid; grid-template-columns: 36px minmax(0,1fr); gap: 10px; padding: 13px 10px 13px 2px; border-top: 1px solid var(--border); scroll-margin-top: 18px }
.profile h3 { font-size: 1.06rem; margin-bottom: 5px; }
.profile p { margin-bottom: 6px }
.profile-id { color: var(--muted); font-size: .85rem; font-weight: 750; padding-top: 1px }
.profile:target { background: #fff1b4 }
.opportunity { color: var(--muted) }
.opportunity strong { display: inline; margin-right: .3em }
.reference-list li, .heuristic-list li, .label-row { display: grid; grid-template-columns: minmax(0, .75fr) minmax(0, 1.45fr); gap: 8px 24px; padding: 16px 0; border-top: 1px solid var(--border) }
.reference-list li li, .heuristic-list li li { display: block; padding: 0; border: 0 }
.reference-list p, .heuristic-list p, .label-row p { margin-bottom: 5px }
.reference-pattern { color: var(--muted) }
.formula, .metrics { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin: 20px 0; padding: 16px; background: var(--olive) }
.formula div:last-child { background: var(--yellow); padding: 9px; margin: -9px }
.formula span, .metrics dt { display: block; font-size: .83rem; line-height: 1.2; color: #474838 }
.formula strong, .metrics dd { display: block; margin: 4px 0 0; font-size: clamp(.98rem, 3vw, 1.6rem); font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.03em }
.severity { display: inline-block; font-size: .78rem; font-weight: 800; background: var(--olive); border-radius: 4px; padding: 2px 6px; margin-bottom: 7px }
.severity-2 { background: #f8eabc }
.severity-3 { background: var(--blush); color: var(--red) }
#artefactos .sources { flex-direction: column; font-size: 1rem }
.footer { background: var(--ink); color: #fffdf4; padding-block: 22px }
.footer > div { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 13px; font-size: .88rem }
.footer a { color: var(--yellow); font-weight: 750 }
@media (max-width: 760px) {
  .layout { display: block }
  .toc { position: static; max-height: none; margin: 24px 0 0 }
  .toc ol { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; border: 0 }
  .toc a { border-bottom: 1px solid var(--border); padding: 8px 0 }
  main { padding-block: 30px }
  section { margin-bottom: 36px }
  section + section { padding-top: 27px }
}
@media (max-width: 460px) {
  .steps, .reference-list li, .heuristic-list li, .label-row { grid-template-columns: 1fr }
  .reference-list .sources li { display: block }
  .profile-tools { grid-template-columns: 1fr }
}
@media print {
  :root { font-size: 11pt }
  body, .hero, .footer { background: white; color: black }
  .hero-inner, .layout, .footer > div { max-width: none; padding-inline: 0 }
  .hero-inner { padding-block: 0 12pt }
  h1 { font-size: 38pt }
  .project, .project span, .lead { color: black }
  .project { margin-bottom: 12pt }
  .lead { margin-top: 8pt }
  .layout { display: block }
  .toc, .profile-tools, .skip, .footer a { display: none !important }
  main { padding-block: 12pt }
  section { margin-bottom: 20pt }
  section + section { padding-top: 12pt }
  h2, h3, h4, summary { break-after: avoid }
  .profile, .steps li, .heuristic-list > li, .reference-list > li { break-inside: avoid }
  details:not([open]) > :not(summary) { display: block !important }
}

/* Portada y navegación del entregable */
@font-face {
  font-family: "DM Sans";
  src: url(dm-sans.woff2) format("woff2");
  font-weight: 400 800;
  font-display: swap;
}
h1 { font-size: clamp(2.65rem, 7.4vw, 6.7rem); }
.hero-name { color: var(--yellow); font-size: clamp(1.55rem, 3vw, 2.2rem); font-weight: 800; letter-spacing: -.025em; margin: 34px 0 9px; }
.hero .lead { margin-top: 0; }
.hero-actions { display:flex; flex-wrap:wrap; gap:10px 20px; margin-top:25px; }
.hero-actions a { display: inline-flex; align-items: center; padding: 9px 0; min-height: 44px; font-weight: 800; }
.hero-actions a:first-child { background: var(--yellow); color: var(--ink); padding-inline:15px; text-decoration:none; border-radius: 6px; }
.toc { max-height: calc(100svh - 48px); overflow: auto; }
main > section > h3 { margin: 26px 0 8px; }
main li { margin-bottom: 4px; }

/* Evidencia, recorridos y pantallas */
.board, .flows, .evidence-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 18px;
  margin: 22px 0;
}
.evidence-list { list-style:none; padding:0; }
.evidence-list li, .flows article { border-top: 1px solid var(--border); padding-top: 14px; }
.evidence-list p > strong { display: block; }
.board figure { margin: 0; min-width: 0; border-top: 1px solid var(--border); padding-top: 10px; }
.board figcaption { padding: 14px 0 5px; font-size: .92rem; }
.board img { height:auto; max-width:100%; max-height:252px; object-fit:contain; }
.board-image { min-height: 248px; padding: 11px; display: flex; justify-content: center; align-items: center; gap: 8px; background: #eeebdf; }
.board-duo img { min-width: 0; width: auto; max-width: 48%; }
.pattern { display: grid; gap: 6px; padding: 12px; background: #fffdf7; border-radius: 9px; max-width: 210px; font-size: .83rem; }
.pattern > span { background: var(--olive); padding: 6px; border-radius: 7px; }
.pattern .pattern-user { background: #fff0b7; }
.pattern .pattern-link { font-weight: 800; }
.pattern small { color: var(--muted); }
.flows ol { margin: 5px 0 10px; padding-left: 1.5rem; }
.feature-list, .screen-group { border-top: 1px solid var(--border); }
.feature-list details, .screen-group:last-of-type { border-bottom: 1px solid var(--border); }
.feature-list summary, .screen-group summary, .flow-visual summary { padding-block: 14px; }
.feature-list details p { max-width: 67ch; padding-left: 20px; }
.flow-visual { font-size: .875rem; }
.flow-visual img { display: block; width: 100%; height: auto; border-radius: 8px; }
.screen-gallery, .component-gallery { display: grid; gap: 14px; }
.screen-gallery { grid-template-columns: repeat(4,minmax(0,1fr)); padding-bottom: 15px; }
.screen-gallery figure, .component-gallery figure { margin: 0; min-width: 0; }
.screen-gallery a, .component-gallery a { display: block; }
.screen-gallery img, .component-gallery img { display: block; width: 100%; height: auto; }
.screen-gallery img { aspect-ratio: 402 / 874; object-fit: contain; }
.screen-gallery figcaption { font-size: .86rem; margin: 6px 0; color: var(--muted); }
.screen-group + p { margin-top: 14px; }
.component-gallery { grid-template-columns: repeat(2,minmax(0,1fr)); margin-block: 20px; }
.component-gallery a { height: 210px; padding: 9px; background: #eeeae0; border-radius: 8px; }
.component-gallery img { width: 100%; height: 100%; object-fit: contain; }
.component-gallery figcaption { margin-top: 11px; font-size: .92rem; }
a[aria-haspopup="dialog"] img { cursor: zoom-in; }
.image-viewer {
  width: fit-content; max-width: none; max-height: none;
  padding: 0; overflow: visible; border: 0;
  background: transparent; color: #fffdf7;
}
.image-viewer::backdrop { background: #24241ad9; }
.image-viewer-dismiss {
  position: absolute; inset-block-end: calc(100% + 8px); inset-inline-end: 0;
}
.image-viewer-close {
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 1px solid transparent; border-radius: 50%;
  background: white; color: var(--ink); cursor: pointer;
}
.image-viewer-close:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.image-viewer-stage { overflow: hidden; }
.image-viewer-stage img {
  display: block; max-width: min(1098px, calc(100dvw - 34px)); max-height: calc(100dvh - 134px);
}
.demo-layout { display: grid; grid-template-columns: minmax(0,1fr) minmax(0, 422px); gap: 24px; align-items: start; }
.demo-guide h3 { margin-top: 6px; }
.demo-guide li { margin: 0 0 .7rem; }
.demo-guide ol { padding-left: 20px; }
.demo-guide .demo-scenarios { padding-left: 20px; margin-block: 18px; }
.demo-layout iframe { display: block; border: 0; width: 100%; max-width: 422px; height: auto; aspect-ratio: 422 / 894; }
.artifact-links { padding-left: 20px; }
@media (max-width: 1010px) {
  .demo-layout { display: block; }
  .demo-layout iframe { margin-block-start: 20px; }
}
@media (max-width: 570px) {
  .board, .flows, .evidence-list { grid-template-columns: 1fr; }
  .screen-gallery { grid-template-columns: 1fr 1fr; }
  .component-gallery a { height: 150px; }
}
@media print {
  .hero-name { color: var(--ink); }
  .hero-actions, .demo-layout iframe, .image-viewer[open] { display: none; }
  .board figure, .flows article, .screen-gallery figure, .evidence-list li { break-inside: avoid; }
}
