:root {
  --purple-dark: #281a39;
  --purple: #4720b7;
  --purple-mid: #907acf;
  --purple-light: #b8a7e7;
  --blue: #1452a6;
  --grey-bg: #f6f6f6;
  --sage: #a7b6a3;
  --sage-dark: #8d9d89;
  --yellow: #ffef98;
  --beige: #ede3d9;
  --grey-line: #c5c5c5;
  --text: #281a39;
  --muted: #626262;
  --white: #ffffff;
  --radius: 10px;
  --maxw: 1100px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Lato", Arial, Helvetica, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--grey-bg);
}

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

a { color: var(--purple); }
a:hover { color: var(--purple-dark); }

h1, h2, h3 {
  font-family: "Fahkwang", Georgia, serif;
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 .6em;
}
h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.3rem; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Header ---------- */
.site-header {
  background: var(--sage);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 20px;
}
.logo img { width: 220px; }

.social {
  display: flex;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.social a {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--purple-dark);
  color: var(--white);
  transition: background .2s;
}
.social a:hover { background: var(--purple); color: var(--white); }
.social svg { width: 16px; height: 16px; fill: currentColor; }

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  padding: 8px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 26px;
  height: 3px;
  margin: 5px 0;
  background: var(--purple-dark);
  border-radius: 2px;
}

.main-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}
.main-nav li { position: relative; }
.main-nav a {
  display: block;
  padding: 12px 16px;
  text-decoration: none;
  color: #26301f;
  font-size: 15px;
  letter-spacing: .02em;
}
.main-nav a:hover { color: var(--white); }
.main-nav a.active { color: #000; font-weight: 700; box-shadow: inset 0 -3px 0 #000; }

.main-nav .submenu {
  display: none;
  position: absolute;
  left: 0;
  top: 100%;
  min-width: 160px;
  background: var(--sage);
  border: 1px solid var(--sage-dark);
  flex-direction: column;
}
.main-nav li:hover > .submenu,
.main-nav li:focus-within > .submenu { display: flex; }

/* ---------- Page banner ---------- */
.page-banner {
  background: var(--beige);
  color: var(--purple-dark);
  text-align: center;
  padding: 60px 20px;
}
.page-banner h1 { margin: 0; }

main section { padding: 56px 0; }
.section-alt { background: var(--grey-bg); }
.section-home { background: var(--sage); }

/* ---------- Home ---------- */
.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}
.home-heading {
  display: inline-block;
  background: var(--yellow);
  border-radius: 60px;
  padding: 22px 40px;
  text-align: center;
}
.home-heading .sub {
  display: block;
  font-size: .6em;
}
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 4px 18px rgba(40, 26, 57, .1);
  padding: 28px;
}
.apps {
  display: flex;
  gap: 18px;
  margin-top: 16px;
}
.apps img {
  width: 100px;
  border-radius: 18px;
  transition: transform .2s, box-shadow .2s;
}
.app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.app-link:hover img {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(40, 26, 57, .25);
}
.stores { font-size: 13px; white-space: nowrap; }
.poster {
  border-radius: var(--radius);
  box-shadow: 0 4px 18px rgba(40, 26, 57, .15);
}

/* ---------- About ---------- */
.prose { max-width: 820px; margin: 0 auto; }
.prose h3 {
  color: var(--purple);
  margin-top: 1.8em;
}
.about-photo {
  width: 300px;
  border-radius: 50%;
  margin: 30px auto 0;
}

/* ---------- Gallery ---------- */
.gallery {
  columns: 3 260px;
  column-gap: 16px;
}
.gallery a {
  display: block;
  margin-bottom: 16px;
  break-inside: avoid;
}
.gallery img {
  width: 100%;
  border-radius: var(--radius);
  transition: transform .25s, box-shadow .25s;
}
.gallery a:hover img {
  transform: translateY(-3px);
  box-shadow: 0 8px 22px rgba(40, 26, 57, .25);
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(20, 12, 30, .92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-height: 90vh;
  max-width: 90vw;
  border-radius: 6px;
}
.lightbox button {
  position: absolute;
  background: none;
  border: 0;
  color: var(--white);
  font-size: 42px;
  cursor: pointer;
  padding: 10px 18px;
}
.lightbox .lb-close { top: 10px; right: 10px; }
.lightbox .lb-prev { left: 10px; }
.lightbox .lb-next { right: 10px; }

/* ---------- Books ---------- */
.books-grid {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr) 240px;
  gap: 40px;
  align-items: start;
}
.btn {
  display: inline-block;
  background: var(--purple);
  color: var(--white);
  padding: 12px 26px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 700;
  border: 0;
  cursor: pointer;
  font-size: 16px;
  transition: background .2s;
}
.btn:hover { background: var(--purple-dark); color: var(--white); }
.break-all { word-break: break-all; }

/* ---------- Payments ---------- */
.pay-list { list-style: none; padding: 0; margin: 0; }
.pay-list > li {
  padding: 16px 0;
  border-bottom: 1px solid var(--grey-line);
}
.pay-list > li:last-child { border-bottom: 0; }
.banks { margin: 10px 0 0; padding-left: 22px; }
.banks li { margin: 6px 0; }
.iban {
  font-family: Consolas, "Courier New", monospace;
  background: var(--grey-bg);
  padding: 2px 6px;
  border-radius: 4px;
  word-break: break-all;
}
.tbi {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.tbi .tbi-logo { width: 120px; }
.tbi .tbi-banner { width: 200px; }

/* ---------- Schedule ---------- */
.schedule {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(40, 26, 57, .1);
}
.schedule th,
.schedule td {
  text-align: left;
  padding: 14px 18px;
  border-bottom: 1px solid #e6e1f3;
}
.schedule th {
  background: var(--purple-dark);
  color: var(--white);
  font-weight: 700;
}
.schedule tr:last-child td { border-bottom: 0; }
.schedule td:first-child { font-weight: 700; white-space: nowrap; }
.schedule tbody tr:nth-child(even) { background: #faf8ff; }

/* ---------- Rules ---------- */
.rules h3 {
  margin-top: 1.6em;
  padding-bottom: .3em;
  border-bottom: 2px solid var(--purple-light);
}
.rules ul { padding-left: 22px; }
.rules li { margin: 6px 0; }
.downloads {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 26px;
}
.download {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border: 1px solid var(--grey-line);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  background: var(--white);
  max-width: 420px;
}
.download:hover { border-color: var(--purple); }
.download svg { width: 34px; height: 34px; flex: none; }

/* ---------- Contact page ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 40px;
}
.contact-info dt {
  font-weight: 700;
  color: var(--purple);
  margin-top: 18px;
}
.contact-info dd { margin: 4px 0 0; }
.map {
  width: 100%;
  min-height: 360px;
  border: 0;
  border-radius: var(--radius);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--sage);
  color: var(--purple-dark);
  padding: 56px 0 24px;
}
.site-footer a { color: var(--purple-dark); }
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 40px;
  align-items: center;
}
.site-footer .social a { background: #000; color: var(--white); }
.site-footer .social a:hover { background: var(--purple-dark); }

.contact-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 20px;
}
.contact-form .full { grid-column: 1 / -1; }
.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--sage-dark);
  border-radius: 4px;
  background: var(--white);
  color: var(--text);
  font: inherit;
}
.contact-form input::placeholder,
.contact-form textarea::placeholder { color: #777; }
.contact-form textarea { min-height: 120px; resize: vertical; }
.contact-form .btn { background: #000; color: var(--white); border-radius: 0; padding: 12px 40px; justify-self: start; }
.contact-form .btn:hover { background: var(--purple-dark); }
.form-msg { grid-column: 1 / -1; margin: 0; color: var(--purple-dark); min-height: 1.2em; }

.footer-alf { max-width: 320px; margin-left: auto; }
.copyright {
  text-align: center;
  font-size: 14px;
  color: rgba(40, 26, 57, .75);
  margin-top: 40px;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .header-top .social { display: none; }
  .main-nav { display: none; }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; }
  .main-nav a { padding: 12px 20px; border-top: 1px solid var(--sage-dark); }
  .main-nav .submenu { display: flex; position: static; border: 0; }
  .main-nav .submenu a { padding-left: 40px; }
  .main-nav a.active { box-shadow: inset 4px 0 0 #000; }

  .home-grid,
  .books-grid,
  .contact-grid,
  .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .books-grid .books-banner-1 { display: none; }
  .footer-alf { margin: 0 auto; }
  .logo img { width: 170px; }
}

@media (max-width: 520px) {
  body { font-size: 16px; }
  .contact-form { grid-template-columns: 1fr; }
  .schedule th, .schedule td { padding: 10px 10px; font-size: 15px; }
}
