/* =========================================================
   VILE HOUSE — Stylesheet
   ========================================================= */

:root {
  --bg: #efefef;
  --text: #111111;
  --muted: #6f6f6f;
  --border: #1a1a1a;
  --white: #ffffff;
  --shadow: rgba(0, 0, 0, 0.12);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  --max-w: 1200px;
  --pad-x: 32px;

  --transition: 300ms cubic-bezier(.2,.7,.2,1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'General Sans', system-ui, -apple-system, Segoe UI, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

/* ---------------------------------------------------------
   HEADER
--------------------------------------------------------- */
.site-header {
  width: 100%;
  border-bottom: 1px solid var(--border);
  background-color: var(--bg);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 18px var(--pad-x);
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.18em;
}

/* ---------------------------------------------------------
   HERO
--------------------------------------------------------- */
.hero {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 80px var(--pad-x) 60px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 60px;
  align-items: center;
}

.hero-title {
  font-size: clamp(48px, 7vw, 88px);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: var(--text);
}

.hero-desc {
  margin-top: 28px;
  font-size: 16px;
  color: var(--text);
  max-width: 460px;
}

.hero-actions {
  margin-top: 36px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  padding: 0 28px;
  font-size: 15px;
  font-weight: 500;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  transition: transform var(--transition), background-color var(--transition), color var(--transition), box-shadow var(--transition);
  cursor: pointer;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--text);
  color: var(--white);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px var(--shadow);
}

.btn-secondary {
  background-color: var(--white);
  color: var(--text);
}

.btn-secondary:hover {
  background-color: var(--text);
  color: var(--white);
  transform: translateY(-1px);
}

/* Polaroid */
.hero-photo {
  display: flex;
  justify-content: center;
}

.polaroid {
  background-color: var(--white);
  padding: 22px 22px 70px;
  border-radius: 4px;
  box-shadow: 0 18px 50px var(--shadow);
  transform: rotate(-1deg);
  max-width: 380px;
  width: 100%;
  transition: transform var(--transition);
}

.polaroid:hover {
  transform: rotate(0deg) translateY(-4px);
}

.polaroid img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  border-radius: 2px;
}

/* ---------------------------------------------------------
   NOTICE
--------------------------------------------------------- */
.notice-wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad-x);
}

.notice {
  background-color: #ffe9ea;
  border: 1px solid #e63946;
  border-radius: var(--radius-md);
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 20px;
  color: #8a1d27;
}

.notice-text {
  flex: 1;
  font-size: 14px;
  line-height: 1.55;
}

.notice-text strong {
  color: #e63946;
  font-weight: 600;
}

.notice-btn {
  background-color: #e63946;
  color: var(--white);
  border-color: #e63946;
  height: 44px;
  padding: 0 22px;
  font-size: 14px;
  flex-shrink: 0;
}

.notice-btn:hover {
  background-color: #c92c39;
  border-color: #c92c39;
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(230, 57, 70, 0.25);
}

/* ---------------------------------------------------------
   PRODUCTS
--------------------------------------------------------- */
.products {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 40px var(--pad-x) 100px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 32px;
}

.filter-btn {
  height: 38px;
  padding: 0 18px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  background-color: var(--white);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color var(--transition), color var(--transition);
}

.filter-btn:hover {
  background-color: var(--text);
  color: var(--white);
}

.filter-btn.active {
  background-color: var(--text);
  color: var(--white);
}

/* Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.card {
  background-color: transparent;
  cursor: pointer;
  transition: transform var(--transition);
}

.card-donation {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0;
  border: none;
  font: inherit;
  color: inherit;
  background: transparent;
}

.card-image-donation {
  background-color: #ffe9ea;
  color: #e63946;
}

.card-image-donation svg {
  width: 56%;
  height: 56%;
}

.card:hover {
  transform: translateY(-3px);
}

.card-image {
  width: 100%;
  aspect-ratio: 1/1;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background-color: #f4f4f4;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 600ms cubic-bezier(.2,.7,.2,1);
}

.card:hover .card-image img {
  transform: scale(1.04);
}

.card-name {
  margin-top: 14px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}

.card-category {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}

.card-price {
  margin-top: 8px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}

/* ---------------------------------------------------------
   FOOTER
--------------------------------------------------------- */
.site-footer {
  border-top: 1px solid rgba(26, 26, 26, 0.15);
  padding: 30px var(--pad-x);
  text-align: center;
  font-size: 13px;
  color: var(--text);
}

.site-footer p {
  margin: 2px 0;
}

.site-footer .muted {
  color: var(--muted);
}

/* ---------------------------------------------------------
   REVEAL ANIMATION
--------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 800ms ease, transform 800ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------------------------------------------------------
   DONATION MODAL
--------------------------------------------------------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

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

.modal-backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.55);
  animation: modal-fade 200ms ease;
}

.modal-dialog {
  position: relative;
  background-color: var(--white);
  border-radius: var(--radius-lg);
  padding: 40px 32px 32px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
  animation: modal-pop 240ms cubic-bezier(.2,.7,.2,1);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: transparent;
  border: none;
  font-size: 28px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  transition: background-color var(--transition), color var(--transition);
}

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

.modal-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.modal-desc {
  margin-top: 8px;
  font-size: 14px;
  color: var(--muted);
}

.modal-qr {
  margin: 24px auto 20px;
  width: 240px;
  height: 240px;
  background-color: #f4f4f4;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.modal-qr img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.modal-code-wrap {
  background-color: #f4f4f4;
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 16px;
  max-height: 96px;
  overflow-y: auto;
}

.modal-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  word-break: break-all;
  color: var(--text);
  line-height: 1.5;
}

.modal-copy {
  width: 100%;
}

@keyframes modal-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes modal-pop {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------------------------------------------------------
   RESPONSIVE
--------------------------------------------------------- */
@media (max-width: 900px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }

  .hero {
    padding: 56px var(--pad-x) 40px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .hero-text {
    order: 1;
  }

  .hero-photo {
    order: 2;
  }

  .polaroid {
    max-width: 320px;
  }
}

@media (max-width: 600px) {
  :root {
    --pad-x: 20px;
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .hero-title {
    font-size: 56px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
  }

  .filter-btn {
    flex: 1 1 auto;
  }

  .notice {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .notice-btn {
    width: 100%;
  }
}
