:root {
  --ink: #202124;
  --muted: #62666d;
  --surface: #ffffff;
  --canvas: #f6f7f7;
  --line: #e4e6e8;
  --accent: #7c1f2a;
  --accent-hover: #621621;
  --shadow: 0 12px 30px rgba(31, 37, 43, 0.07);
  --radius: 14px;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--canvas); }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: "Inter", Arial, sans-serif;
  line-height: 1.55;
}

a { color: inherit; }
button, input { font: inherit; }
button { cursor: pointer; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100% - 48px, 1280px);
  min-height: 96px;
  margin: 0 auto;
}

.brand { display: inline-flex; flex-direction: column; text-decoration: none; line-height: 1.2; }
.brand-name { font-size: 1.02rem; font-weight: 700; letter-spacing: -0.025em; }
.brand-subtitle { margin-top: 5px; color: var(--muted); font-size: 0.69rem; font-weight: 500; letter-spacing: 0.07em; text-transform: uppercase; }

.eyebrow { margin: 0 0 16px; color: var(--accent); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(2rem, 4.5vw, 4.5rem); letter-spacing: -0.055em; line-height: 1.04; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.button-primary { background: var(--accent); color: #fff; }
.button-primary:hover { background: var(--accent-hover); box-shadow: 0 6px 16px rgba(94, 20, 31, 0.17); transform: translateY(-1px); }
.button-secondary { min-height: 38px; padding: 0 13px; border-color: #d9dcdf; background: var(--surface); color: #45484d; font-size: 0.82rem; }
.button-secondary:hover { border-color: #b9bdc2; background: #fafafa; }
.button-block { width: 100%; }
.button:focus-visible, .text-button:focus-visible, .back-link:focus-visible, .brand:focus-visible { outline: 3px solid rgba(124, 31, 42, 0.3); outline-offset: 3px; }

/* Portada */
.page-home { background: var(--surface); }
.hero-layout { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(460px, 1.1fr); min-height: calc(100vh - 96px); }
.hero-copy { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; max-width: 610px; padding: 64px clamp(24px, 7vw, 120px) 100px; }
.hero-copy h1 { max-width: 560px; }
.hero-lead { max-width: 545px; margin: 28px 0 0; color: #34373b; font-size: clamp(1.08rem, 1.55vw, 1.36rem); line-height: 1.55; }
.hero-description { max-width: 535px; margin: 18px 0 32px; color: var(--muted); font-size: 0.96rem; }
.hero-image-panel { position: relative; min-height: 500px; overflow: hidden; background: linear-gradient(135deg, #eaebeb, #f8f8f7 50%, #e3e5e5); }
.hero-image-panel img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.hero-image-panel img.is-unavailable { display: none; }
.hero-image-fallback { position: absolute; inset: 0; overflow: hidden; opacity: 0.7; }
.hero-image-fallback::before, .hero-image-fallback::after { position: absolute; content: ""; border: 1px solid rgba(70, 75, 79, 0.28); transform: rotate(-27deg); }
.hero-image-fallback::before { width: 78%; height: 55%; top: 14%; left: 10%; }
.hero-image-fallback::after { width: 57%; height: 70%; top: 27%; left: 32%; }
.hero-image-fallback span { position: absolute; display: block; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 6px rgba(124, 31, 42, 0.08); }
.hero-image-fallback span:nth-child(1) { top: 24%; left: 23%; }.hero-image-fallback span:nth-child(2) { top: 58%; left: 35%; }.hero-image-fallback span:nth-child(3) { top: 38%; right: 20%; }.hero-image-fallback span:nth-child(4) { bottom: 18%; right: 35%; }.hero-image-fallback span:nth-child(5) { top: 12%; right: 35%; }

/* Acceso */
.page-access { display: flex; flex-direction: column; }
.access-main { display: grid; flex: 1; place-items: center; padding: 36px 24px 54px; }
.access-card { width: min(100%, 460px); padding: clamp(30px, 5vw, 48px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.access-card h1 { font-size: clamp(1.8rem, 3.5vw, 2.45rem); }
.access-intro { margin: 18px 0 30px; color: var(--muted); font-size: 0.94rem; }
label { display: block; margin-bottom: 8px; color: #3d4045; font-size: 0.84rem; font-weight: 600; }
.password-control { position: relative; }
input[type="password"], input[type="text"] { width: 100%; min-height: 50px; padding: 0 86px 0 13px; border: 1px solid #ccd0d4; border-radius: 8px; background: #fff; color: var(--ink); outline: none; transition: border-color 160ms ease, box-shadow 160ms ease; }
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124, 31, 42, 0.12); }
.text-button { position: absolute; top: 50%; right: 8px; padding: 6px 8px; border: 0; background: transparent; color: var(--accent); font-size: 0.78rem; font-weight: 700; transform: translateY(-50%); }
.form-feedback { min-height: 22px; margin: 9px 0 13px; color: #aa222d; font-size: 0.79rem; }
.back-link { display: inline-block; margin-top: 25px; color: var(--muted); font-size: 0.83rem; text-underline-offset: 3px; }
.back-link:hover { color: var(--accent); }
.simple-footer { padding: 20px 24px 28px; color: #7a7e84; font-size: 0.74rem; text-align: center; }

/* Biblioteca */
.library-main { width: min(100% - 48px, 1280px); margin: 0 auto; padding: 68px 0 76px; }
.library-heading { max-width: 690px; margin-bottom: 42px; }
.library-heading h1 { font-size: clamp(2rem, 3.7vw, 3.35rem); }
.library-heading > p:last-child { margin: 18px 0 0; color: var(--muted); font-size: 1rem; }
.tools-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.tool-card { display: flex; flex-direction: column; min-height: 435px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 3px 10px rgba(31, 37, 43, 0.025); transition: transform 180ms ease, box-shadow 180ms ease; }
.tool-card:hover { box-shadow: var(--shadow); transform: translateY(-4px); }
.tool-card-image { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; background: #eaebeb; }
.tool-card-content { display: flex; flex: 1; flex-direction: column; padding: 23px; }
.tool-card h2 { margin: 0; font-size: 1.1rem; letter-spacing: -0.025em; line-height: 1.35; }
.tool-card p { margin: 13px 0 24px; color: var(--muted); font-size: 0.88rem; }
.tool-card .button { width: 100%; margin-top: auto; }

@media (max-width: 940px) {
  .hero-layout { grid-template-columns: 1fr 0.9fr; }
  .hero-copy { padding-left: 48px; }
  .tools-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .site-header { width: min(100% - 36px, 1280px); min-height: 82px; }
  .hero-layout { display: flex; flex-direction: column; }
  .hero-copy { min-height: 490px; padding: 68px 24px 56px; }
  .hero-image-panel { min-height: 300px; }
  .library-main { width: min(100% - 36px, 1280px); padding-top: 48px; }
  .tools-grid { grid-template-columns: 1fr; }
  .tool-card { min-height: 0; }
}

@media (max-width: 390px) { .brand-subtitle { font-size: 0.61rem; } .button-secondary { padding: 0 10px; } }
