/* ===========================
   Reset & Base
=========================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --gold:       #c9a84c;
  --gold-light: #f0d98c;
  --cream:      #fdf8f0;
  --warm-white: #fffef9;
  --deep:       #1a1209;
  --brown:      #4a3520;
  --brown-mid:  #7a5c38;
  --text:       #2d2010;
  --text-muted: #7a6a55;
  --border:     #e8dcc8;
  --shadow:     0 4px 24px rgba(74,53,32,.10);
  --radius:     14px;
  --radius-sm:  8px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Noto Sans KR', sans-serif;
  background: var(--cream);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===========================
   Header / Nav
=========================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(253, 248, 240, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--brown);
  font-family: 'Noto Serif KR', serif;
  font-weight: 700;
  font-size: 1.15rem;
}
.logo-icon { color: var(--gold); font-size: 1.2rem; }

.nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
}
.nav-link {
  text-decoration: none;
  color: var(--text-muted);
  font-size: .9rem;
  padding: 6px 14px;
  border-radius: 20px;
  transition: background .2s, color .2s;
}
.nav-link:hover,
.nav-link.active {
  background: var(--gold-light);
  color: var(--brown);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--brown);
  margin-left: auto;
}

/* ===========================
   Hero
=========================== */
.hero {
  position: relative;
  padding: 80px 0 72px;
  text-align: center;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, #f5e8cc 0%, #fdf8f0 55%, #e8f0f5 100%);
  z-index: 0;
}
.hero-content {
  position: relative;
  z-index: 1;
}
.hero-subtitle {
  font-size: .9rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
  font-weight: 500;
}
.hero-title {
  font-family: 'Noto Serif KR', serif;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  color: var(--brown);
  margin-bottom: 18px;
  line-height: 1.3;
}
.hero-desc {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.9;
}

/* ===========================
   Generator Section
=========================== */
.generator-section { padding: 60px 0 80px; }

/* Category Grid */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}
.category-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 8px 14px;
  background: var(--warm-white);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all .22s ease;
  font-family: inherit;
}
.category-btn:hover {
  border-color: var(--gold);
  background: #fffbf0;
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.category-btn.active {
  border-color: var(--gold);
  background: linear-gradient(135deg, #fff8e6 0%, #fdf4d8 100%);
  box-shadow: 0 2px 12px rgba(201,168,76,.2);
}
.cat-icon { font-size: 1.6rem; }
.cat-label { font-size: .78rem; font-weight: 500; color: var(--brown); }

/* Options Card */
.options-card {
  background: var(--warm-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 28px;
  box-shadow: var(--shadow);
}
.options-row {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.option-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 180px;
}
.option-group label {
  font-size: .8rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: .04em;
  display: flex;
  align-items: center;
  gap: 6px;
}
.opt-tag {
  font-size: .7rem;
  font-weight: 500;
  color: var(--brown-mid);
  background: var(--gold-light);
  border-radius: 20px;
  padding: 1px 8px;
  letter-spacing: .02em;
}
.option-group select,
.option-group input {
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: .9rem;
  color: var(--text);
  background: var(--cream);
  outline: none;
  transition: border-color .2s;
}
.option-group select:focus,
.option-group input:focus { border-color: var(--gold); }

.intent-row {
  margin-top: 14px;
}
.intent-group { max-width: 100%; }
.intent-group input {
  width: 100%;
  box-sizing: border-box;
}
.btn-row {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.generate-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 28px;
  background: linear-gradient(135deg, var(--gold) 0%, #b8922d 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .2s, transform .2s;
  white-space: nowrap;
  box-shadow: 0 3px 12px rgba(201,168,76,.4);
}
.generate-btn:hover { opacity: .9; transform: translateY(-1px); }
.generate-btn:active { transform: translateY(0); }
.generate-btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.ai-btn {
  background: linear-gradient(135deg, #6c47cc 0%, #4a2fa0 100%);
  box-shadow: 0 3px 12px rgba(108,71,204,.35);
}
.btn-icon { font-size: .85rem; }
.ai-source-badge {
  background: #ede9fc;
  color: #5b3dbc;
  font-size: .72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: .04em;
}
.prayer-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 36px 0;
  color: var(--text-muted);
  font-size: .9rem;
}
.prayer-loading .spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: #6c47cc;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Prayer Output */
.prayer-output-card {
  background: var(--warm-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--cream);
  flex-wrap: wrap;
  gap: 10px;
}
.output-badge {
  background: var(--gold-light);
  color: var(--brown);
  font-size: .78rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  letter-spacing: .06em;
}
.output-actions { display: flex; gap: 8px; }
.action-btn {
  padding: 6px 14px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: #fff;
  font-family: inherit;
  font-size: .8rem;
  cursor: pointer;
  color: var(--brown-mid);
  transition: all .18s;
}
.action-btn:hover {
  border-color: var(--gold);
  background: var(--gold-light);
  color: var(--brown);
}

.prayer-text {
  padding: 40px 40px 32px;
  min-height: 220px;
  font-family: 'Noto Serif KR', serif;
  font-size: 1.05rem;
  line-height: 2.1;
  color: var(--text);
  white-space: pre-wrap;
}
.prayer-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  color: var(--text-muted);
  text-align: center;
  font-family: 'Noto Sans KR', sans-serif;
  font-size: .95rem;
}
.prayer-placeholder strong { color: var(--gold); }

.output-footer {
  padding: 16px 40px 24px;
  border-top: 1px solid var(--border);
}
.scripture-text {
  font-family: 'Noto Serif KR', serif;
  font-size: .88rem;
  color: var(--text-muted);
  font-style: italic;
  text-align: right;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--brown);
  color: #fff;
  padding: 12px 28px;
  border-radius: 40px;
  font-size: .9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s, transform .3s;
  z-index: 999;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===========================
   Features
=========================== */
.features-section {
  padding: 72px 0;
  background: linear-gradient(180deg, #f0e8d8 0%, var(--cream) 100%);
}
.section-title {
  font-family: 'Noto Serif KR', serif;
  font-size: 1.6rem;
  color: var(--brown);
  text-align: center;
  margin-bottom: 8px;
}
.section-desc {
  text-align: center;
  color: var(--text-muted);
  font-size: .95rem;
  margin-bottom: 40px;
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin-top: 40px;
}
.feature-card {
  background: var(--warm-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform .2s;
}
.feature-card:hover { transform: translateY(-4px); }
.feature-icon { font-size: 2.4rem; margin-bottom: 14px; }
.feature-card h3 {
  font-family: 'Noto Serif KR', serif;
  font-size: 1.05rem;
  color: var(--brown);
  margin-bottom: 10px;
}
.feature-card p { font-size: .88rem; color: var(--text-muted); line-height: 1.8; }

/* ===========================
   Comments (Disqus)
=========================== */
.comments-section {
  padding: 72px 0;
  background: var(--warm-white);
  border-top: 1px solid var(--border);
}
#disqus_thread { margin-top: 24px; }

/* ===========================
   Footer
=========================== */
.site-footer {
  background: var(--deep);
  color: rgba(255,255,255,.7);
  padding: 40px 0;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}
.footer-brand {
  font-family: 'Noto Serif KR', serif;
  font-size: 1.1rem;
  color: var(--gold-light);
  font-weight: 600;
}
.footer-nav { display: flex; gap: 20px; }
.footer-nav a {
  text-decoration: none;
  color: rgba(255,255,255,.55);
  font-size: .85rem;
  transition: color .2s;
}
.footer-nav a:hover { color: var(--gold-light); }
.footer-copy { font-size: .8rem; font-style: italic; opacity: .5; }

/* ===========================
   Responsive
=========================== */
@media (max-width: 640px) {
  .nav { display: none; }
  .nav-toggle { display: block; }
  .nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--cream);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    gap: 4px;
    z-index: 99;
  }
  .options-row { flex-direction: column; }
  .prayer-text { padding: 28px 22px; }
  .output-header { flex-direction: column; align-items: flex-start; }
}
