/* Estilo: Minimalism & Swiss Style (UI/UX Pro Max) adaptado a la marca ARQUIPOR. Tipografía: Lexend + Source Sans 3. */
:root {
  color-scheme: light;
  --brand-navy: #08264b;
  --brand-red: #e5091b;
  --background: #ffffff;
  --surface: #f8fafc;
  --tile: #f3f6f9;
  --ink: var(--brand-navy);
  --muted: #475569;
  --primary: var(--brand-red);
  --pressed: #b80918;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --control-border: #7c8aa0;
  --grid-line: #d9e1ea;
  --selected: var(--brand-navy);
  --selected-hover: #0e3263;
  --onbrand: #ffffff;
  --onbrand-muted: #c7d2e0;
  --hover: #edf1f6;
  --focus: #285fa8;
  --online: #15803d;
  --online-dot: #16a34a;
  --online-on-navy: #86efac;
  --onlinebg: #dcfce7;
  --scrollbar-thumb: #a4b1c1;
  --scrollbar-track: #f1f5f8;
  --scrollbar-thumb-hover: #73859a;
  --scrollbar-thumb-active: #526781;
  --font-display: Lexend, 'Segoe UI', Arial, sans-serif;
  --font-body: 'Source Sans 3', 'Segoe UI', Arial, sans-serif;
  --radius-control: 2px;
  --ease-out: cubic-bezier(.2, .7, .2, 1);
  --duration: 180ms;
  --sidebar-width: clamp(310px, 27.9vw, 442px);
  --page-padding: clamp(32px, 4.9vw, 78px);
  --header-height: 78px;
}
* { box-sizing: border-box; scrollbar-width: thin; scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track); }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: var(--scrollbar-track); }
*::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border: 2px solid var(--scrollbar-track); border-radius: 4px; }
*::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); }
*::-webkit-scrollbar-thumb:active { background: var(--scrollbar-thumb-active); }
html { scrollbar-gutter: stable; scroll-padding-top: calc(var(--header-height) + 24px); }
body { margin: 0; background: var(--background); color: var(--ink); font-family: var(--font-body); font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button, a[href] { cursor: pointer; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
button:disabled { cursor: not-allowed; opacity: .55; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { font-family: var(--font-display); text-wrap: balance; }
ul { list-style: none; margin: 0; padding: 0; }
/* Native hidden must win over shared flex/grid component declarations. */
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -100px; left: 20px; padding: 12px 20px; background: var(--ink); color: var(--onbrand); font-weight: 600; z-index: 10; }
.skip-link:focus { top: 12px; }
.icon { width: 24px; height: 24px; flex: 0 0 auto; fill: currentColor; }
.library-icon { display: block; flex: 0 0 auto; filter: invert(12%) sepia(34%) saturate(2202%) hue-rotate(183deg) brightness(93%) contrast(103%); }
.site-header { height: var(--header-height); position: sticky; top: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; padding: 0 36px; border-bottom: 1px solid var(--line); background: var(--background); }
.brand { display: flex; align-items: center; border-radius: 2px; }
.brand-logo { width: 216px; height: auto; display: block; }
.suite-brand { padding-left: 24px; border-left: 1px solid var(--line); line-height: 1.1; }
.suite-brand > span { font-family: var(--font-display); font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.suite-brand p { margin-top: 5px; font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.app-shell { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); align-items: start; }
.sidebar { position: sticky; top: var(--header-height); height: calc(100dvh - var(--header-height)); overflow-y: auto; padding: 24px 20px; background: var(--surface); border-right: 1px solid var(--line); }
.sidebar-heading { display: flex; align-items: center; justify-content: space-between; margin: 0 12px 14px; }
.sidebar h1 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.3; }
.search { display: flex; align-items: center; height: 44px; padding: 0 6px 0 12px; margin: 0 0 22px; border: 1px solid var(--control-border); border-radius: var(--radius-control); background: var(--background); color: var(--muted); transition: border-color var(--duration) var(--ease-out), box-shadow var(--duration) var(--ease-out); }
.search:hover { border-color: var(--muted); }
.search:focus-within { border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus); }
.search > .icon { width: 20px; height: 20px; }
/* 16px evita el zoom automático de iOS al enfocar el campo. */
.search input { min-width: 0; width: 100%; height: 100%; padding: 0 10px; border: 0; outline: none; color: var(--ink); background: transparent; font-size: 16px; }
.search input::placeholder { color: var(--muted); opacity: 1; }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.icon-button { display: grid; place-items: center; min-width: 32px; height: 32px; padding: 5px; border: 0; background: transparent; border-radius: var(--radius-control); color: var(--muted); }
.icon-button:hover { background: var(--hover); }
.icon-button:active { background: var(--line); }
.icon-button .icon { width: 18px; height: 18px; }
.directory section > h2 { margin: 0 12px 6px; color: var(--muted); font-family: var(--font-body); font-size: 14px; font-weight: 600; }
.module-choice { position: relative; display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 8px 12px; transition: background-color var(--duration) var(--ease-out), color var(--duration) var(--ease-out); }
.module-icon { width: 26px; height: 26px; }
.module-copy { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.module-title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.online-pill { display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto; width: max-content; color: var(--online); font-size: 14px; font-weight: 600; line-height: 1.3; white-space: nowrap; }
.online-pill::before { content: ''; flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: var(--online-dot); box-shadow: 0 0 0 3px var(--onlinebg); }
/* En el índice basta el punto: el texto «En línea» sigue en el DOM para lectores de pantalla y el title lo muestra al pasar el cursor. */
.module-title-row .online-pill { width: 8px; height: 8px; gap: 0; overflow: hidden; }
.module-title-row .online-pill::before { box-shadow: none; }
.module-name { font-size: 15px; font-weight: 600; line-height: 1.35; }
.module-summary { color: var(--muted); font-size: 13px; line-height: 1.4; }
.module-choice:hover { background: var(--hover); }
.module-choice:active { background: var(--line); }
.module-choice.is-selected { color: var(--onbrand); background: var(--selected); box-shadow: inset 4px 0 0 var(--primary); }
.module-choice.is-selected .module-summary { color: var(--onbrand-muted); }
.module-choice.is-selected .online-pill::before { background: var(--online-on-navy); }
.module-choice.is-selected:hover { background: var(--selected-hover); }
.module-choice:focus-visible { outline-offset: -3px; }
.module-choice.is-selected:focus-visible { outline-color: var(--onbrand); }
.upcoming-section { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.upcoming-section .module-choice:not(.is-selected) { color: var(--muted); }
.upcoming-section .module-choice { min-height: 52px; padding-block: 6px; }
.picker-toggle { display: none; }
main { min-width: 0; }
main:focus { outline: none; }
/* Pestañas alineadas con el borde del contenido; el subrayado mide lo mismo que el texto. */
.family-nav { min-height: 78px; display: flex; flex-wrap: wrap; align-items: stretch; column-gap: clamp(20px, 2.4vw, 40px); margin: 0 44px 0 var(--page-padding); border-bottom: 1px solid var(--line); }
.family-tab { position: relative; border: 0; background: transparent; padding: 30px 0 14px; font-family: var(--font-display); font-size: 16px; font-weight: 500; color: var(--muted); transition: color var(--duration) var(--ease-out); }
.family-tab::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: var(--primary); transform: scaleX(0); transform-origin: left; transition: transform 240ms var(--ease-out); }
.family-tab:hover { color: var(--ink); }
.family-tab.is-selected { color: var(--ink); }
.family-tab.is-selected::after { transform: scaleX(1); }
.module-details { position: relative; isolation: isolate; min-height: calc(100dvh - 164px); padding: 56px 44px 56px var(--page-padding); display: flex; flex-direction: column; }
.architecture-art { position: absolute; pointer-events: none; z-index: -1; right: 0; top: 22px; width: 350px; height: 680px; object-fit: cover; opacity: .6; }
.module-detail { flex: 1; min-width: 0; scroll-margin-top: 100px; }
.module-detail + .module-detail { margin-top: 64px; }
/* Al cambiar de módulo, el detalle entra con un fundido breve (se desactiva con movimiento reducido). */
.is-enhanced .module-detail { margin-top: 0; animation: detail-in 260ms var(--ease-out); }
@keyframes detail-in { from { opacity: 0; transform: translateY(6px); } }
.module-hero { display: grid; grid-template-columns: 184px minmax(0, 1fr); gap: 40px; align-items: start; padding-bottom: 52px; }
/* Retícula de plano arquitectónico que se desvanece hacia el centro para no competir con el ícono. */
.hero-art { position: relative; isolation: isolate; width: 184px; height: 184px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); background: var(--tile); }
.hero-art::before { content: ''; position: absolute; inset: 0; z-index: -1; background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px); background-size: 26px 26px; background-position: 12px 12px; -webkit-mask-image: radial-gradient(closest-side, transparent 58%, #000); mask-image: radial-gradient(closest-side, transparent 58%, #000); }
.treasury-art { width: 100%; height: 100%; object-fit: cover; }
.hero-icon { width: 100px; height: 100px; }
.hero-copy { padding-top: 6px; min-width: 0; }
.module-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; margin-bottom: 10px; }
.eyebrow { font-size: 15px; font-weight: 600; color: var(--muted); }
.hero-copy h2 { max-width: 820px; font-size: clamp(40px, 3.8vw, 60px); line-height: 1.06; font-weight: 700; letter-spacing: -.03em; overflow-wrap: anywhere; }
.hero-copy h2:focus { outline: none; }
.hero-description { margin-top: 14px; max-width: 56ch; font-size: clamp(18px, 1.35vw, 21px); color: var(--muted); line-height: 1.5; }
.open-module { display: inline-flex; align-items: center; justify-content: center; gap: 12px; max-width: 100%; margin-top: 30px; min-height: 54px; padding: 12px 26px; border-radius: var(--radius-control); color: var(--onbrand); background: var(--primary); font-family: var(--font-display); font-size: 18px; font-weight: 600; line-height: 1.3; transition: background-color var(--duration) var(--ease-out), transform 120ms var(--ease-out); }
.open-module .library-icon { width: 22px; height: 22px; filter: invert(1); }
.open-module:hover { background: var(--pressed); }
.open-module:active { transform: scale(.98); }
.features > h3 { font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.feature-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 48px; margin-top: 16px; }
.feature-grid li { display: flex; align-items: flex-start; gap: 18px; min-width: 0; padding: 22px 0; border-top: 1px solid var(--line); }
.feature-icon { width: 32px; height: 32px; margin-top: 1px; }
.feature-grid h4 { font-size: 17px; font-weight: 600; line-height: 1.35; }
.feature-grid p { margin-top: 3px; color: var(--muted); font-size: 16px; line-height: 1.5; }
.availability-label { display: inline-flex; align-items: center; margin-top: 26px; padding: 8px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-control); font-family: var(--font-display); font-size: 15px; font-weight: 500; background: var(--surface); color: var(--muted); }
.availability-note { margin-top: 12px; font-size: 16px; color: var(--muted); }
.site-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 20px; margin-top: 88px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.site-footer p { display: flex; align-items: center; gap: 10px; }
.site-footer .library-icon { opacity: .7; width: 20px; height: 20px; }
.empty-state { padding: 24px 12px; }
.empty-state h2 { font-size: 18px; }
.empty-state p { margin: 8px 0 16px; font-size: 15px; color: var(--muted); }
.text-button { border: 0; padding: 10px 0; color: var(--ink); background: transparent; font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }
.text-button:hover { color: var(--primary); }
.text-button:active { color: var(--pressed); }
@media (max-width: 1190px) {
  .family-nav { column-gap: 22px; margin-right: 30px; }
  .family-tab { font-size: 15px; }
  .module-details { padding-right: 30px; padding-top: 44px; }
  .module-hero { grid-template-columns: 140px minmax(0, 1fr); gap: 28px; }
  .hero-art { width: 140px; height: 140px; }
  .hero-art::before { background-size: 22px 22px; background-position: 4px 4px; }
  .hero-icon { width: 80px; height: 80px; }
  .hero-copy h2 { font-size: 42px; }
  .hero-description { font-size: 18px; }
  .open-module { font-size: 17px; padding-inline: 22px; min-height: 50px; }
  .feature-grid { column-gap: 28px; }
  .feature-grid li { gap: 16px; }
  .feature-icon { width: 28px; height: 28px; }
  .site-footer { align-items: flex-start; flex-direction: column; margin-top: 64px; }
  .architecture-art { width: 240px; opacity: .45; }
}
@media (max-width: 960px) and (min-width: 761px) {
  .family-nav { min-height: 0; display: grid; grid-template-columns: 1fr 1fr; column-gap: 16px; }
  .family-tab { justify-self: start; padding: 14px 0 10px; font-size: 14px; text-align: left; }
  .module-hero { grid-template-columns: 1fr; gap: 20px; }
  .hero-art { width: 112px; height: 112px; }
  .hero-icon { width: 64px; height: 64px; }
  .feature-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  :root { --header-height: 66px; --page-padding: 20px; }
  html { scrollbar-gutter: auto; }
  .site-header { padding-inline: 20px; }
  .brand-logo { width: 150px; }
  .suite-brand { padding-left: 14px; }
  .suite-brand > span { font-size: 20px; }
  .suite-brand p { font-size: 11px; letter-spacing: .06em; }
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; overflow: visible; padding: 16px 20px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar-heading { margin: 0 0 12px; }
  .sidebar h1 { font-size: 22px; }
  .picker-toggle { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--control-border); background: var(--background); border-radius: var(--radius-control); font-size: 14px; font-weight: 600; }
  .picker-toggle .icon { width: 16px; height: 16px; transition: transform var(--duration) var(--ease-out); }
  .picker-toggle[aria-expanded="true"] .icon { transform: rotate(180deg); }
  .picker-toggle:hover { background: var(--hover); }
  .picker-toggle:active { background: var(--line); }
  .search { margin: 0; height: 46px; }
  .is-enhanced .directory { display: none; }
  .is-enhanced .is-picker-open .directory { display: block; max-height: 340px; overflow-y: auto; margin-top: 14px; padding: 4px 0; scrollbar-gutter: stable; }
  .module-choice { min-height: 58px; gap: 14px; }
  .family-nav { display: grid; grid-template-columns: auto auto; justify-content: start; gap: 0 28px; margin: 0 20px; min-height: 0; }
  .family-tab { justify-self: start; min-height: 48px; padding: 12px 0 10px; font-size: 14px; text-align: left; }
  .module-details { padding: 28px 20px; min-height: 0; }
  .module-hero { grid-template-columns: 1fr; gap: 18px; padding-bottom: 32px; }
  .hero-art { width: 96px; height: 96px; }
  .hero-art::before { background-size: 16px 16px; background-position: 7px 7px; }
  .hero-icon { width: 58px; height: 58px; }
  .hero-copy { padding-top: 0; }
  .eyebrow { font-size: 14px; }
  .module-meta { margin-bottom: 8px; }
  .hero-copy h2 { font-size: 36px; letter-spacing: -.025em; }
  .hero-description { margin-top: 10px; font-size: 17px; }
  .open-module { min-height: 52px; font-size: 17px; margin-top: 22px; padding: 12px 22px; }
  .features > h3 { font-size: 19px; }
  .feature-grid { grid-template-columns: 1fr; margin-top: 12px; }
  .feature-grid li { gap: 16px; padding: 18px 0; }
  .feature-grid h4 { font-size: 16px; }
  .feature-grid p { font-size: 15px; }
  .architecture-art { width: 200px; height: 400px; opacity: .45; top: 0; }
  .site-footer { margin-top: 44px; font-size: 13px; gap: 14px; }
}
@media (max-width: 380px) {
  .suite-brand p { display: none; }
  .hero-copy h2 { font-size: 31px; letter-spacing: -.02em; }
}
@media (prefers-reduced-motion: reduce) {
  /* Accessibility preference overrides all component motion. */
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  * { scrollbar-color: auto; }
  .module-choice.is-selected, .family-tab.is-selected { border-color: Highlight; outline: 1px solid Highlight; }
  .open-module { border: 1px solid ButtonText; }
  .architecture-art, .hero-art::before { display: none; }
  .library-icon { filter: none; }
  .online-pill::before { forced-color-adjust: none; background: CanvasText; box-shadow: none; }
}
