:root {
  --bg: #f6f2ea;
  --paper: #fffdf9;
  --surface: #ffffff;
  --line: #e5ddd0;
  --text: #1f1b17;
  --muted: #6f665d;
  --accent: #8a6a2f;
  --accent-soft: #b6924b;
  --danger: #7d1f28;
  --shadow: 0 10px 30px rgba(35, 24, 14, 0.08);
  --radius: 18px;
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  background: linear-gradient(180deg, var(--paper), var(--bg));
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

body.heaven-mode {
  animation: holyGlow 1.8s ease-in-out infinite;
}

body.doom-mode {
  animation: doomShake 0.18s linear infinite;
  filter: contrast(1.04);
}

@keyframes holyGlow {
  0%,
  100% {
    background: linear-gradient(180deg, var(--paper), var(--bg));
  }
  50% {
    background: linear-gradient(180deg, #fffdf9, #f2ebde);
  }
}

@keyframes doomShake {
  0% {
    transform: translate(0, 0);
  }
  25% {
    transform: translate(1px, -1px);
  }
  50% {
    transform: translate(-1px, 1px);
  }
  75% {
    transform: translate(1px, 0);
  }
  100% {
    transform: translate(0, 0);
  }
}

.container {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 253, 249, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(138, 106, 47, 0.12);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
}

.brand {
  font-size: 14px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.nav a {
  color: var(--text);
  text-decoration: none;
  font-size: 15px;
}

.nav a:hover {
  color: var(--accent);
}

.hero {
  padding: 88px 0 54px;
  flex: 1;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 32px;
  align-items: start;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 13px;
  font-weight: 700;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
  line-height: 1.06;
}

h1 {
  font-size: clamp(42px, 6vw, 78px);
  margin-bottom: 18px;
}

h2 {
  font-size: clamp(30px, 4vw, 48px);
  margin-bottom: 14px;
}

h3 {
  font-size: 22px;
  margin-bottom: 10px;
}

.lead {
  font-size: 19px;
  line-height: 1.8;
  color: var(--muted);
  max-width: 62ch;
  margin: 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 14px 22px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease,
    color 0.18s ease, border-color 0.18s ease;
  font-size: 15px;
  border: 1px solid transparent;
  font: inherit;
}

.button:hover {
  transform: translateY(-1px);
}

.button.primary {
  background: var(--text);
  color: white;
  border: 1px solid var(--text);
  box-shadow: var(--shadow);
}

.button.primary:hover {
  background: #2a241f;
  border-color: #2a241f;
}

.button.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

.button.secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-panel {
  padding: 28px;
}

.hero-panel p {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.75;
  font-size: 17px;
}

section {
  padding: 28px 0;
}

.section-intro {
  max-width: 72ch;
  color: var(--muted);
  line-height: 1.8;
  font-size: 18px;
  margin-bottom: 26px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.info-box {
  padding: 24px;
}

.info-box p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
  font-size: 16px;
}

.timeline {
  display: grid;
  gap: 14px;
}

.timeline-item {
  padding: 22px;
}

.timeline-item strong {
  display: block;
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.timeline-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.donation {
  padding: 30px;
  position: relative;
  overflow: hidden;
}

.donation-top {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  margin-bottom: 16px;
}

.amount {
  font-size: clamp(34px, 5vw, 56px);
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-top: 6px;
}

.donation-row {
  display: grid;
  grid-template-columns: 1fr 160px;
  gap: 16px;
  align-items: center;
  margin-top: 18px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent-soft);
  cursor: pointer;
}

.amount-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  font: inherit;
  font-size: 18px;
  color: var(--text);
}

.amount-input:focus {
  outline: none;
  border-color: var(--accent-soft);
  box-shadow: 0 0 0 3px rgba(182, 146, 75, 0.12);
}

.range-scale {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  margin-top: 8px;
}

.satisfaction {
  margin-top: 22px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fdfaf4;
}

.satisfaction-title {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 8px;
}

.satisfaction-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.face {
  font-size: 52px;
  line-height: 1;
  transition: transform 0.25s ease, filter 0.25s ease;
}

.satisfaction.happy .face {
  transform: scale(1.08);
}

.satisfaction.demonic .face {
  filter: drop-shadow(0 0 8px rgba(125, 31, 40, 0.35));
  transform: scale(1.04) rotate(-2deg);
}

.satisfaction-text {
  flex: 1;
  min-width: 220px;
}

.satisfaction-text strong {
  display: block;
  margin-bottom: 4px;
  font-size: 17px;
}

.satisfaction-text span {
  color: var(--muted);
  line-height: 1.7;
}

.message {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 16px;
  background: #f8f4ec;
  color: var(--text);
  line-height: 1.7;
  min-height: 60px;
}

.note {
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.footer {
  padding: 44px 0 64px;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
  margin-top: auto;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.footer-copy {
  line-height: 1.8;
  max-width: 760px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  line-height: 1;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease,
    color 0.18s ease, background 0.18s ease;
}

.footer-links a:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  color: var(--accent);
  background: #fffaf1;
  box-shadow: 0 8px 24px rgba(35, 24, 14, 0.08);
}

.footer-links a:focus {
  outline: none;
}

.footer-links a:focus-visible {
  outline: 2px solid rgba(138, 106, 47, 0.28);
  outline-offset: 4px;
}

.footer-link-item {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  color: var(--muted);
  font-size: 14px;
}

.footer-link-item span {
  color: var(--muted);
}

/* Quotes page */

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.quote-card {
  padding: 28px;
  max-width: 760px;
}

.quotes-list {
  display: grid;
  gap: 18px;
}

.quote-status {
  color: var(--muted);
}

.quote-text {
  font-size: 18px;
  line-height: 1.8;
  margin: 0;
}

.quote-meta {
  margin-top: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 14px;
}

.quote-like {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: 18px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font: inherit;
  transition: transform 0.15s ease, color 0.15s ease;
}

.quote-like:hover {
  transform: translateY(-1px);
  color: var(--danger);
}

.quote-like:disabled {
  cursor: default;
  transform: none;
}

.quote-like.is-voted {
  color: var(--danger);
}

.quote-like:focus {
  outline: none;
}

.quote-like:focus-visible {
  outline: 2px solid rgba(138, 106, 47, 0.35);
  outline-offset: 4px;
  border-radius: 8px;
}

.quote-like .heart {
  font-size: 22px;
  line-height: 1;
}

.quote-like .like-count {
  font-size: 14px;
  min-width: 1.5em;
  text-align: left;
}

/* Modal */

.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.is-open {
  display: flex;
}

.modal-panel {
  max-width: 520px;
  width: 100%;
  padding: 28px;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  padding: 0;
}

.modal-close:hover {
  color: var(--text);
}

.modal-close:focus {
  outline: none;
}

.modal-close:focus-visible {
  outline: 2px solid rgba(138, 106, 47, 0.35);
  outline-offset: 4px;
  border-radius: 8px;
}

/* Effects */

.floating-blessing,
.floating-doom {
  position: fixed;
  top: -30px;
  pointer-events: none;
  font-size: 24px;
  z-index: 999;
  animation: fall linear forwards;
}

@keyframes fall {
  to {
    transform: translateY(110vh) rotate(540deg);
    opacity: 0;
  }
}

.flash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: rgba(125, 31, 40, 0.1);
  opacity: 0;
  z-index: 998;
  animation: flashPulse 0.6s ease;
}

@keyframes flashPulse {
  0% {
    opacity: 0;
  }
  30% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@media (max-width: 900px) {
  .hero-grid,
  .grid-3,
  .donation-row {
    grid-template-columns: 1fr;
  }

  .nav-inner,
  .donation-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-header {
    align-items: flex-start;
  }

  .footer-links {
  flex-direction: column;
  width: 100%;
}

.footer-links a {
  width: min(100%, 320px);
}
}
