:root {
  --teal-dark: #044251;
  --teal: #0d6c83;
  --teal-mid: #096c82;
  --cyan: #47b9d3;
  --cyan-light: #eaf7fa;
  --ink: #0b3440;
  --paper: #ffffff;
  --grey-bg: #f4f8f9;
  --border: #dbe9ec;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(4, 66, 81, 0.12);
  --font: "Lato", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */
.site-header {
  display: flex;
  flex-direction: column;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
}
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.header-row-top { padding-bottom: 12px; }
.header-row-bottom {
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.header-row-bottom--no-filters { justify-content: flex-end; }

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand img.logo-liryc { height: 40px; width: auto; }
.brand-divider { width: 1px; height: 30px; background: var(--border); }
.brand-name {
  font-weight: 800;
  font-size: 18px;
  color: var(--teal-dark);
  line-height: 1.1;
}
.lang-switch {
  display: flex;
  gap: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.lang-switch a { color: var(--teal); padding: 1px 2px; }
.lang-switch a.active { color: var(--teal-dark); border-bottom: 2px solid var(--cyan); }
.main-nav { display: flex; gap: 28px; }
.main-nav a {
  font-weight: 700;
  font-size: 14px;
  color: var(--teal-dark);
}
.main-nav a:hover { color: var(--cyan); }

.header-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.header-filters-label {
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--teal);
  margin-right: 2px;
}
.header-filters .filter-chip {
  padding: 6px 14px;
  font-size: 11.5px;
  border-color: var(--teal);
  color: var(--teal-dark);
}
.header-filters .filter-chip:hover { border-color: var(--teal-dark); }
.header-filters .filter-chip.active {
  background: var(--teal-dark);
  color: #fff;
  border-color: var(--teal-dark);
}

@media (max-width: 780px) {
  .header-row-bottom {
    flex-wrap: wrap;
    row-gap: 10px;
  }
  .header-row-bottom--no-filters { justify-content: center; }
}

@media (max-width: 640px) {
  .site-header { padding: 12px 20px; }
  .brand img.logo-liryc { height: 34px; }
  .brand-divider { height: 26px; }
  .brand-name { font-size: 15px; }
  .header-row-top {
    flex-wrap: wrap;
    row-gap: 10px;
  }
  .main-nav {
    flex: 1 1 100%;
    gap: 20px;
    flex-wrap: wrap;
  }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(120deg, var(--teal-dark) 0%, var(--teal) 55%, var(--cyan) 130%);
  color: #fff;
  padding: 72px 24px 96px;
}
.hero::after {
  content: "";
  position: absolute;
  right: -10%;
  top: -20%;
  width: 60%;
  height: 160%;
  background: rgba(255,255,255,0.06);
  transform: rotate(12deg);
}
.hero-inner {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
}
.hero-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 12px;
  font-weight: 700;
  color: var(--cyan-light);
  margin-bottom: 14px;
}
.hero h1 {
  font-size: clamp(30px, 4.4vw, 48px);
  line-height: 1.15;
  font-weight: 800;
  margin: 0 0 18px;
  max-width: 720px;
}
.hero p {
  font-size: 17px;
  line-height: 1.6;
  max-width: 560px;
  color: rgba(255,255,255,0.9);
  margin: 0 0 26px;
}
.hero-actions { margin-bottom: 0; }

.filter-chip {
  padding: 9px 18px;
  border-radius: 999px;
  border: 1.5px solid rgba(255,255,255,0.55);
  background: transparent;
  color: #fff;
  font-family: var(--font);
  font-weight: 700;
  font-size: 12.5px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.filter-chip:hover { border-color: #fff; }
.filter-chip.active {
  background: #fff;
  color: var(--teal-dark);
  border-color: #fff;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-primary {
  background: #fff;
  color: var(--teal-dark);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(0,0,0,0.18); }
.btn-teal {
  background: var(--teal-dark);
  color: #fff;
}
.btn-teal:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(4,66,81,0.25); }
.btn-outline {
  background: transparent;
  color: var(--teal-dark);
  border: 2px solid var(--teal-dark);
}
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none !important; }

/* ---------- Sections ---------- */
section { padding: 72px 0; }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 46px; }
.section-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 12px;
  font-weight: 800;
  color: var(--cyan);
  margin-bottom: 10px;
}
.section-head h2 {
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 800;
  color: var(--teal-dark);
  margin: 0 0 12px;
}
.section-head p { color: #4c6a72; line-height: 1.6; }

.audience-group { margin-bottom: 58px; }
.audience-group h3 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 19px;
  font-weight: 800;
  color: var(--teal-dark);
  margin-bottom: 22px;
}
.audience-group h3::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  flex-shrink: 0;
}
.audience-group h3 sup { font-size: 0.65em; }

.book-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}
@media (max-width: 760px) {
  .book-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .book-card { flex-direction: column; }
  .book-cover-wrap {
    width: 100%;
    max-width: 260px;
    height: auto;
    aspect-ratio: 1 / 1.414;
    margin: 0 auto;
  }
}

.book-card {
  display: flex;
  gap: 20px;
  background: var(--grey-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: box-shadow .2s ease, transform .2s ease;
}
.book-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }

.book-cover-wrap {
  position: relative;
  flex: 0 0 230px;
  width: 230px;
  height: 325px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(4,66,81,0.22);
  cursor: pointer;
  background: #eee;
}
.book-cover-wrap img {
  width: 100%; height: 100%; object-fit: cover;
}
.preview-trigger {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 0 6px;
  background: linear-gradient(0deg, rgba(4,66,81,0.85) 10%, rgba(4,66,81,0));
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.preview-trigger .tri {
  width: 0; height: 0;
  border-left: 7px solid #fff;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}
.book-cover-wrap:hover .preview-trigger { background: linear-gradient(0deg, rgba(71,185,211,0.95) 10%, rgba(71,185,211,0)); }

.book-info { flex: 1; display: flex; flex-direction: column; }
.book-info h4 { margin: 0 0 6px; font-size: 17px; font-weight: 800; color: var(--teal-dark); }
.book-authors { margin: 0 0 10px; font-size: 12.5px; font-style: italic; color: #4c6a72; }
.book-info p { margin: 0 0 14px; font-size: 13.5px; line-height: 1.55; color: #4c6a72; flex: 1; }
.book-meta { font-size: 11px; color: var(--teal); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 10px; }

.book-actions { display: flex; flex-direction: column; gap: 10px; margin-top: auto; }
.book-actions .btn { padding: 12px 18px; font-size: 12px; width: 100%; justify-content: center; }

/* Coming soon (EN / missing books) */
.book-card.coming-soon { opacity: 0.75; }
.badge-soon {
  display: inline-block;
  font-size: 10px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--cyan-light); color: var(--teal);
  padding: 4px 10px; border-radius: 999px; margin-bottom: 8px;
}

/* ---------- Modals ---------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(4,20,25,0.72);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: #fff;
  border-radius: var(--radius);
  max-width: 460px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  padding: 32px;
  position: relative;
}
.modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--grey-bg);
  color: var(--teal-dark);
  font-size: 18px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.modal-box h3 { color: var(--teal-dark); font-size: 21px; margin: 0 0 6px; }
.modal-sub { color: #4c6a72; font-size: 13.5px; margin: 0 0 22px; line-height: 1.5; }

.form-row { margin-bottom: 16px; }
.form-row label {
  display: block;
  font-size: 12.5px; font-weight: 700;
  color: var(--teal-dark);
  margin-bottom: 6px;
}
.form-row input, .form-row select {
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: var(--font);
  font-size: 14px;
  color: var(--ink);
  background: #fff;
}
.form-row input:focus, .form-row select:focus {
  outline: none; border-color: var(--cyan);
}
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .two-col { grid-template-columns: 1fr; } }

.consent-row { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 20px; }
.consent-row input { margin-top: 3px; }
.consent-row label { font-size: 12px; color: #4c6a72; line-height: 1.5; font-weight: 400; }
.consent-row a { color: var(--teal); text-decoration: underline; }

.form-msg { font-size: 13px; margin-top: 12px; display: none; }
.form-msg.error { color: #b02a2a; }
.form-msg.success { color: #147a4a; }

.download-success { text-align: center; }
.download-success .check {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--cyan-light); color: var(--teal);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; margin: 0 auto 16px;
}
.download-list { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }

/* Preview flipbook modal */
.preview-overlay {
  position: fixed; inset: 0;
  background: rgba(2,10,13,0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 110;
  padding: 20px;
}
.preview-overlay.open { display: flex; }
.preview-shell {
  position: relative;
  max-width: 620px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.preview-frame {
  width: auto;
  height: min(66vh, 720px);
  max-width: 100%;
  aspect-ratio: 1 / 1.414;
  background: #0b3440;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  position: relative;
  margin: 0 auto;
}
.preview-frame img {
  width: 100%; height: 100%; object-fit: contain;
  background: #fff;
}
.preview-controls {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%;
  margin-top: 16px;
  color: #fff;
}
.preview-controls .pv-btn {
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,0.12);
  border: none; color: #fff; font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.preview-controls .pv-btn:hover { background: var(--cyan); }
.preview-controls .pv-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.preview-count { font-size: 13px; font-weight: 700; letter-spacing: 0.03em; }
.preview-note {
  color: rgba(255,255,255,0.65);
  font-size: 12px;
  margin-top: 14px;
  text-align: center;
  max-width: 480px;
}
.preview-close {
  position: absolute; top: -50px; right: 0;
  background: transparent; border: none; color: #fff;
  font-size: 26px; cursor: pointer;
}
@media (max-width: 640px) {
  .preview-close { top: -44px; }
}

/* ---------- About / trust strip ---------- */
.strip {
  background: var(--cyan-light);
  padding: 46px 0;
}
.strip-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  text-align: center;
}
@media (max-width: 760px) { .strip-grid { grid-template-columns: 1fr; } }
.strip-grid .num { font-size: 30px; font-weight: 800; color: var(--teal-dark); }
.strip-grid .lbl { font-size: 13px; color: var(--teal); font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }

/* ---------- Footer ---------- */
footer {
  background: var(--teal-dark);
  color: rgba(255,255,255,0.85);
  padding: 48px 0 26px;
}
.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
  padding-bottom: 30px;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  margin-bottom: 22px;
}
.footer-logos { display: flex; align-items: center; gap: 26px; }
.footer-logos img.f-liryc { height: 34px; filter: brightness(0) invert(1); opacity: 0.95; }
.footer-logos img.f-stimuprat { height: 30px; }
.footer-logos img.f-unibs { height: 44px; }
.footer-links { display: flex; gap: 22px; flex-wrap: wrap; font-size: 13px; }
.footer-links a:hover { color: #fff; }
.footer-bottom { font-size: 12px; color: rgba(255,255,255,0.55); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* EN page banner */
.lang-note {
  background: var(--cyan-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin: 0 auto 40px;
  max-width: 680px;
  text-align: center;
  color: var(--teal-dark);
  font-size: 14px;
  line-height: 1.6;
}
.lang-note a { font-weight: 800; color: var(--teal); text-decoration: underline; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap;
}
