* { box-sizing: border-box; }

:root {
  --bg: #fbfaf7;
  --surface: rgba(255,255,255,.88);
  --surface-solid: #fff;
  --text: #2b241f;
  --line: rgba(123,111,99,.22);
  --red: #7b0017;
  --red-dark: #5f0011;
  --green: #1d6b45;
  --shadow: 0 18px 45px rgba(35,28,22,.12);
  --radius-lg: 30px;
  --radius-md: 22px;
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(141,157,116,.28), transparent 34%),
    radial-gradient(circle at bottom right, rgba(123,0,23,.12), transparent 34%),
    linear-gradient(180deg, #fffdf9 0%, var(--bg) 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: -1;
  opacity: .16;
  background-repeat: no-repeat;
  background-size: contain;
  width: 340px;
  height: 340px;
  background-image: url("data:image/svg+xml,%3Csvg width='300' height='300' viewBox='0 0 300 300' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%238a9b70' stroke-width='8' stroke-linecap='round'%3E%3Cpath d='M35 260C95 185 145 120 260 45'/%3E%3Cpath d='M78 205C45 190 35 165 42 138C74 150 88 176 78 205Z' fill='%238a9b70' opacity='.55'/%3E%3Cpath d='M115 165C80 148 72 120 82 94C116 110 128 139 115 165Z' fill='%238a9b70' opacity='.55'/%3E%3Cpath d='M155 125C120 108 112 80 124 54C158 72 169 100 155 125Z' fill='%238a9b70' opacity='.55'/%3E%3Cpath d='M195 88C164 66 162 39 178 18C207 40 214 67 195 88Z' fill='%238a9b70' opacity='.55'/%3E%3C/g%3E%3C/svg%3E");
}

body::before { top: -90px; left: -90px; transform: rotate(12deg); }
body::after { right: -110px; bottom: -130px; transform: rotate(190deg); }

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 42px;
}

.brand-card {
  display: grid;
  place-items: center;
  text-align: center;
  gap: 12px;
  padding: 22px 14px 18px;
}

.logo {
  color: var(--red);
  font-size: clamp(46px, 8vw, 78px);
  font-weight: 900;
  letter-spacing: -3px;
  line-height: .95;
}

.logo span { color: var(--green); }

h1 {
  margin: 0;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(54px, 10vw, 104px);
  line-height: .9;
  font-style: italic;
  font-weight: 700;
}

.language-btn {
  margin-top: 12px;
  border: 1px solid rgba(123,0,23,.18);
  background: var(--surface-solid);
  color: var(--red);
  padding: 13px 22px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(35,28,22,.08);
  transition: .2s ease;
}

.language-btn:hover { background: var(--red); color: #fff; transform: translateY(-1px); }

.menu-section {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 12px 0 18px;
  background: linear-gradient(180deg, rgba(251,250,247,.95), rgba(251,250,247,.78));
  backdrop-filter: blur(14px);
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.menu-card {
  min-height: 96px;
  border: 1px solid rgba(123,111,99,.18);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-md);
  padding: 18px 14px;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  box-shadow: 0 8px 22px rgba(35,28,22,.06);
  transition: .2s ease;
}

.menu-card:hover { transform: translateY(-3px); background: #fff; box-shadow: var(--shadow); }
.menu-card.active { background: var(--red); color: #fff; border-color: var(--red); }

.menu-card .icon {
  display: block;
  font-size: 25px;
  margin-bottom: 7px;
}

.menu-card h3 {
  margin: 0;
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.2;
  font-weight: 900;
}

.viewer-card {
  background: var(--surface-solid);
  border: 1px solid rgba(123,111,99,.18);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
}

.viewer-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 22px;
  padding: 4px 4px 18px;
}

.current-label {
  margin: 0 0 5px;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: 1.8px;
  font-size: 11px;
  font-weight: 900;
}

h2 {
  margin: 0;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(30px, 5vw, 50px);
  line-height: 1;
  font-style: italic;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 12px 18px;
  text-decoration: none;
  color: var(--text);
  font-weight: 900;
  background: #fff;
  transition: .2s ease;
}

.btn.primary { background: var(--red); color: #fff; border-color: var(--red); }
.btn.primary:hover { background: var(--red-dark); }

.mobile-pdf-actions { display: none; }

.pdf-wrap {
  width: 100%;
  height: min(76vh, 850px);
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #f0eee9;
}

iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

@media (max-width: 820px) {
  .app-shell { width: min(100% - 22px, 1180px); padding-top: 16px; }
  .brand-card { padding-top: 14px; padding-bottom: 12px; }
  .menu-section { padding-top: 8px; padding-bottom: 12px; }
  .menu-grid {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    scroll-snap-type: x mandatory;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
  }
  .menu-card {
    flex: 0 0 74%;
    min-height: 88px;
    scroll-snap-align: start;
  }
  .viewer-card { border-radius: 24px; padding: 14px; }
  .viewer-top { align-items: flex-start; flex-direction: column; gap: 12px; padding-bottom: 14px; }
  .actions { width: 100%; }
  .actions .btn { width: 100%; }
  .pdf-wrap { height: 72vh; border-radius: 18px; }
}

@media (max-width: 520px) {
  body::before, body::after { opacity: .1; }
  .app-shell { width: min(100% - 16px, 1180px); }
  .logo { letter-spacing: -2px; }
  .language-btn { width: 100%; }
  .menu-card { flex-basis: 82%; padding: 16px 12px; }
  .viewer-top { padding-left: 2px; padding-right: 2px; }
  .actions { display: none; }
  .mobile-pdf-actions { display: block; margin-bottom: 12px; }
  .btn.wide { width: 100%; }
  .pdf-wrap { height: 68vh; }
}

@media (min-width: 1100px) {
  .viewer-card { padding: 24px; }
  .pdf-wrap { height: 82vh; }
}
