:root {
  color-scheme: dark;
  --bg: #0f172a;
  --panel: #111827;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --link: #60a5fa;
  --accent: #22d3ee;
  --accent-text: #0b1120;
  --border: #1f2937;
  --shadow: rgba(0, 0, 0, 0.25);
  --hero-title: #fff;
  --hero-subtitle: #e5e7eb;
  --fab-bg: #0b1220;
  --fab-text: #fff;
  --fab-border: #1f2937;
  --fab-hover: rgba(255, 255, 255, 0.12);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f8fafc;
  --panel: #fff;
  --text: #111827;
  --muted: #4b5563;
  --link: #1d4ed8;
  --accent: #0891b2;
  --accent-text: #fff;
  --border: #cbd5e1;
  --shadow: rgba(15, 23, 42, 0.12);
  --fab-bg: #fff;
  --fab-text: #111827;
  --fab-border: #cbd5e1;
  --fab-hover: rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  width: min(1100px, 92vw);
  margin-inline: auto;
}

.hero {
  position: relative;
  min-height: clamp(120px, 18vw, 220px);
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  background: center / cover no-repeat url('/assets/img/hero-biblioteca.webp');
  filter: saturate(1.05) contrast(1.02);
}

.hero__content {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  padding: clamp(12px, 3vw, 28px) clamp(16px, 4vw, 48px);
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.35), transparent 60%);
}

.hero__title {
  margin: 0 0 6px;
  color: var(--hero-title);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.hero__subtitle {
  margin: 0;
  color: var(--hero-subtitle);
  font-weight: 500;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.hero__brand {
  color: inherit;
}

.hero__brand:hover,
.hero__brand:focus-visible {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.theme-toggle {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

#btnTheme {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
}

#btnTheme:hover,
#btnTheme:focus-visible {
  border-color: var(--accent);
}

.site-main {
  flex: 1;
  margin-top: 24px;
}

.intro {
  display: grid;
  grid-template-columns: minmax(160px, 240px) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: start;
  margin-bottom: 24px;
}

.intro__media {
  margin: 0;
  width: min(100%, 220px);
}

.intro__media img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 6px 18px var(--shadow);
}

.intro__text h2 {
  margin-top: 0;
  font-size: clamp(24px, 3.6vw, 36px);
}

.intro__text p,
.muted {
  color: var(--muted);
}

.home-feature {
  margin-top: 24px;
}

.home-feature__title {
  margin: 0 0 8px;
  font-size: clamp(20px, 2.5vw, 28px);
}

.home-feature__title-link {
  color: inherit;
  text-decoration: none;
}

.home-feature__title-link:hover,
.home-feature__title-link:focus-visible {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.home-feature__description {
  display: block;
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.7;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  box-shadow: 0 4px 14px var(--shadow);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  filter: brightness(1.08);
  text-decoration: none;
}

.card,
.doc {
  margin-bottom: 16px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 6px 30px var(--shadow);
}

.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.testimonial-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 6px 22px var(--shadow);
  overflow-wrap: anywhere;
}

.testimonial-card__header {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin-bottom: 10px;
}

.testimonial-card__author {
  font-size: 1.05rem;
}

.testimonial-card__relation {
  font-size: 0.92rem;
}

.testimonial-text {
  margin: 0;
  line-height: 1.65;
  white-space: pre-line;
}

.site-footer {
  margin-top: 32px;
  padding: 16px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  text-align: center;
}

@media (max-width: 860px) {
  .intro {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .intro__media {
    width: min(100%, 220px);
  }

  .hero__content {
    padding: 12px 16px;
  }

  .hero__title {
    font-size: clamp(22px, 6vw, 32px);
  }
}

@media (max-width: 1024px) {
  .testimonials-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .testimonials-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
