:root {
  color-scheme: light;
  --bg: #fffaf5;
  --bg-accent: radial-gradient(circle at top, rgba(255, 214, 186, 0.55), transparent 38%), linear-gradient(180deg, #fffaf5 0%, #fff1e6 100%);
  --surface: rgba(255, 255, 255, 0.72);
  --surface-strong: #ffffff;
  --surface-muted: rgba(255, 244, 234, 0.88);
  --text: #2d1f1a;
  --text-soft: #6c5a52;
  --primary: #e6855e;
  --primary-strong: #d66c42;
  --border: rgba(219, 164, 135, 0.3);
  --shadow: 0 24px 60px rgba(180, 118, 88, 0.18);
}

body.dark-theme {
  color-scheme: dark;
  --bg: #181311;
  --bg-accent: radial-gradient(circle at top, rgba(255, 153, 102, 0.16), transparent 34%), linear-gradient(180deg, #181311 0%, #241c18 100%);
  --surface: rgba(40, 31, 27, 0.82);
  --surface-strong: #2d231f;
  --surface-muted: rgba(51, 39, 33, 0.92);
  --text: #fff6f0;
  --text-soft: #d6c0b3;
  --primary: #ff9e72;
  --primary-strong: #ffb48d;
  --border: rgba(255, 176, 131, 0.18);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Noto Sans KR", sans-serif;
  background: var(--bg-accent);
  color: var(--text);
  transition: background 0.3s ease, color 0.3s ease;
}

button {
  font: inherit;
}

.page-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 28px;
}

.eyebrow,
.modal__eyebrow,
.preview-card__label {
  margin: 0 0 8px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(1.5rem, 2vw, 2.1rem);
}

.hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
  gap: 24px;
  padding: clamp(24px, 4vw, 44px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 32px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.hero-copy h2 {
  margin-bottom: 16px;
  font-size: clamp(2rem, 4vw, 3.7rem);
  line-height: 1.16;
}

.hero-copy p {
  max-width: 620px;
  margin-bottom: 28px;
  font-size: 1.05rem;
  line-height: 1.72;
  color: var(--text-soft);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  margin-bottom: 18px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--primary);
  font-size: 0.92rem;
  font-weight: 700;
}

.preview-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 100%;
  padding: 24px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.9));
  border: 1px solid var(--border);
}

body.dark-theme .preview-card {
  background: linear-gradient(180deg, rgba(255, 180, 141, 0.08), rgba(59, 44, 37, 0.9));
}

.preview-card__text {
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--text);
}

.theme-toggle,
.primary-button,
.secondary-button,
.modal__close {
  border: 0;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.theme-toggle:hover,
.primary-button:hover,
.secondary-button:hover,
.modal__close:hover {
  transform: translateY(-1px);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 0 22px;
  border-radius: 18px;
  font-weight: 700;
}

.primary-button {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #fff;
  box-shadow: 0 14px 30px rgba(230, 133, 94, 0.28);
}

.secondary-button {
  background: var(--surface-muted);
  color: var(--text);
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(33, 22, 18, 0.52);
  backdrop-filter: blur(6px);
}

.modal__panel {
  position: relative;
  width: min(680px, 100%);
  padding: 28px;
  border-radius: 28px;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--surface-muted);
  color: var(--text);
  font-size: 1.5rem;
}

.modal__panel h3 {
  margin-bottom: 18px;
  font-size: clamp(1.45rem, 3vw, 2rem);
}

.verse-card {
  margin: 0;
  padding: 24px;
  border-radius: 22px;
  background: var(--surface-muted);
}

.verse-card__text {
  font-size: clamp(1.12rem, 2.4vw, 1.5rem);
  line-height: 1.9;
  white-space: pre-line;
}

.verse-card__reference {
  margin-top: 18px;
  color: var(--primary);
  font-weight: 700;
}

.modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

@media (max-width: 840px) {
  .topbar,
  .hero-card {
    grid-template-columns: 1fr;
    display: grid;
  }

  .topbar {
    align-items: stretch;
  }

  .theme-toggle {
    justify-self: start;
  }
}

@media (max-width: 560px) {
  .page-shell {
    width: min(100% - 20px, 1120px);
    padding-top: 20px;
  }

  .hero-card,
  .modal__panel {
    padding: 20px;
    border-radius: 24px;
  }

  .primary-button,
  .secondary-button,
  .theme-toggle {
    width: 100%;
  }

  .modal__actions {
    flex-direction: column;
  }
}
