:root {
  color-scheme: light;
  --ink: #17201c;
  --muted: #5f6f66;
  --line: #d9e1dc;
  --paper: #fbfaf7;
  --panel: #ffffff;
  --sage: #4e7564;
  --sage-dark: #294b3e;
  --clay: #9d6046;
  --gold: #c29b48;
  --mist: #edf3f0;
  --shadow: 0 18px 50px rgba(23, 32, 28, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body,
body * {
  line-break: strict;
  overflow-wrap: normal;
  word-break: keep-all;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Noto Sans KR", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  word-break: keep-all;
}

.site-header {
  align-items: center;
  backdrop-filter: blur(18px);
  background: rgba(251, 250, 247, 0.88);
  border-bottom: 1px solid rgba(217, 225, 220, 0.8);
  display: flex;
  justify-content: space-between;
  left: 0;
  min-height: 72px;
  padding: 0 5vw;
  position: sticky;
  right: 0;
  top: 0;
  z-index: 20;
}

.brand {
  align-items: center;
  display: inline-flex;
  font-weight: 800;
  gap: 10px;
}

.brand-mark {
  align-items: center;
  background: var(--sage-dark);
  border-radius: 8px;
  color: #fff;
  display: inline-flex;
  height: 38px;
  justify-content: center;
  letter-spacing: 0;
  width: 42px;
}

.nav-links {
  display: flex;
  gap: 24px;
  font-size: 0.96rem;
  font-weight: 700;
}

.nav-links a {
  color: var(--muted);
}

.nav-links a:hover {
  color: var(--sage-dark);
}

.hero {
  display: grid;
  min-height: calc(100vh - 112px);
  overflow: hidden;
  position: relative;
}

.hero-image,
.hero-overlay,
.hero-content {
  grid-area: 1 / 1;
}

.hero-image {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.hero-overlay {
  background: linear-gradient(90deg, rgba(17, 27, 23, 0.78) 0%, rgba(17, 27, 23, 0.54) 38%, rgba(17, 27, 23, 0.1) 74%);
}

.hero-content {
  align-self: center;
  color: #fff;
  max-width: 760px;
  padding: 8vh 5vw 14vh;
  position: relative;
  z-index: 2;
}

.eyebrow {
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin: 0 0 10px;
  text-transform: uppercase;
}

.hero h1 {
  font-size: clamp(2.6rem, 6vw, 5.7rem);
  letter-spacing: 0;
  line-height: 1.05;
  margin: 0;
  max-width: 720px;
}

.hero-copy {
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.12rem;
  margin: 24px 0 0;
  max-width: 650px;
}

.hero-actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button.primary {
  background: var(--sage);
  color: #fff;
}

.button.secondary {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.42);
  color: #fff;
}

.button.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--sage-dark);
}

.section {
  padding: 88px 5vw;
}

.section-heading {
  margin: 0 auto 28px;
  max-width: 1180px;
}

.section-heading h2 {
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  letter-spacing: 0;
  line-height: 1.18;
  margin: 0;
}

.flow-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 auto;
  max-width: 1180px;
}

.flow-item,
.passage-panel,
.journal-form,
.saved-entry {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(23, 32, 28, 0.06);
}

.flow-item {
  min-height: 198px;
  padding: 24px;
}

.step {
  color: var(--clay);
  display: block;
  font-weight: 800;
  margin-bottom: 28px;
}

.flow-item h3 {
  display: block;
  font-size: 1.22rem;
  margin: 0 0 8px;
}

.flow-item p,
.passage-summary p,
.saved-entry p,
.site-footer {
  color: var(--muted);
  margin: 0;
}

.today {
  background: var(--mist);
}

.workspace {
  display: grid;
  align-items: start;
  gap: 24px;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  margin: 0 auto;
  max-width: 1240px;
}

.passage-panel,
.journal-form,
.devotion-card,
.scripture-reader,
.hymn-card {
  padding: 24px;
}

.passage-panel {
  position: sticky;
  top: 96px;
}

.study-stack {
  display: grid;
  gap: 22px;
  min-width: 0;
}

.date-card {
  align-items: center;
  background: var(--sage-dark);
  border-radius: 8px;
  color: #fff;
  display: grid;
  gap: 12px;
  grid-template-columns: 38px minmax(0, 1fr) 38px;
  margin-bottom: 24px;
  padding: 16px;
}

.date-current {
  min-width: 0;
  text-align: center;
}

.date-card span {
  color: rgba(255, 255, 255, 0.72);
  display: block;
  font-size: 0.92rem;
  font-weight: 700;
}

.date-card strong {
  display: block;
  font-size: 1.4rem;
  margin-top: 6px;
}

.date-arrow {
  align-items: center;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font-size: 1.2rem;
  font-weight: 800;
  height: 38px;
  justify-content: center;
  transition: background 160ms ease, transform 160ms ease;
  width: 38px;
}

.date-arrow:hover:not(:disabled),
.date-arrow:focus-visible:not(:disabled) {
  background: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}

.date-arrow:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

label,
.label,
.note-field span {
  color: var(--sage-dark);
  display: block;
  font-weight: 800;
}

select,
input,
textarea {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  outline: none;
  width: 100%;
}

select,
input {
  min-height: 48px;
  padding: 0 14px;
}

.daily-note {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
  margin: 10px 0 0;
}

.api-message {
  color: var(--clay);
  font-size: 0.9rem;
  font-weight: 700;
  margin: 8px 0 0;
}

textarea {
  min-height: 150px;
  padding: 14px;
  resize: vertical;
}

select:focus,
input:focus,
textarea:focus {
  border-color: var(--sage);
  box-shadow: 0 0 0 4px rgba(78, 117, 100, 0.14);
}

.passage-summary {
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
  margin: 22px 0;
  padding: 22px 0;
}

blockquote {
  border-left: 4px solid var(--gold);
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 700;
  margin: 10px 0 12px;
  padding-left: 14px;
}

.devotion-card,
.scripture-reader,
.hymn-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(23, 32, 28, 0.06);
}

.reader-heading {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 16px;
}

.reader-heading h3 {
  font-size: clamp(1.35rem, 2vw, 1.8rem);
  line-height: 1.2;
  margin: 0;
}

.reader-heading span {
  color: var(--clay);
  font-size: 0.86rem;
  font-weight: 800;
  white-space: nowrap;
}

.passage-explanation {
  background: var(--mist);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 16px;
  padding: 16px;
}

.passage-explanation .label {
  color: var(--clay);
  font-size: 0.86rem;
  margin: 0 0 6px;
}

.passage-explanation p:last-child {
  color: var(--muted);
  margin: 0;
}

.daily-devotion-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 16px;
}

.daily-devotion-grid section {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.daily-devotion-grid p:last-child {
  color: var(--muted);
  margin: 6px 0 0;
}

.reader-tools {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(180px, 1fr) minmax(260px, auto);
  margin-bottom: 18px;
}

.tts-controls {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(84px, 1fr));
}

.mini-button {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--sage-dark);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 800;
  min-height: 40px;
  padding: 0 10px;
}

.mini-button:hover,
.mini-button.is-active {
  background: var(--sage);
  border-color: var(--sage);
  color: #fff;
}

.scripture-text {
  color: var(--ink);
  display: grid;
  font-size: 1.03rem;
  gap: 12px;
  line-height: 1.78;
  max-height: 430px;
  overflow: auto;
  padding-right: 6px;
}

.scripture-text p {
  border-radius: 8px;
  margin: 0;
  padding: 6px 8px;
  transition: background 160ms ease, box-shadow 160ms ease;
}

.scripture-text p.is-reading {
  background: #fff7df;
  box-shadow: inset 4px 0 0 var(--gold);
}

.breath-mark {
  align-items: center;
  background: #eef4f1;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--sage-dark);
  display: inline-flex;
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1;
  margin-left: 10px;
  padding: 5px 8px;
  vertical-align: middle;
}

.hymn-card p {
  color: var(--muted);
  margin: 0 0 16px;
}

.hymn-card .hymn-meta {
  color: var(--clay);
  font-weight: 800;
  margin-top: -6px;
}

.hymn-card .hymn-fallback-note {
  color: var(--clay);
  font-size: 0.9rem;
  font-weight: 700;
  margin: 12px 0 0;
}

.hymn-link {
  align-items: center;
  background: var(--sage);
  border-color: var(--sage);
  color: #fff;
  display: flex;
  font-size: 1rem;
  justify-content: center;
  margin: 12px 0 0;
  min-height: 52px;
  text-align: center;
  width: 100%;
}

.hymn-card iframe {
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 8px;
  display: block;
  width: 100%;
}

.verse-number {
  color: var(--clay);
  font-weight: 800;
  margin-right: 6px;
}

.field-row {
  margin-bottom: 18px;
}

.field-row label,
.note-field span {
  margin-bottom: 8px;
}

.note-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.journal {
  background: #fff;
}

.saved-list {
  display: grid;
  gap: 14px;
  margin: 0 auto;
  max-width: 1180px;
}

.saved-entry {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 20px;
}

.app-install-section,
.support-section {
  background: var(--mist);
}

.app-install-section {
  padding: 0 5vw 18px;
}

.support-section {
  padding: 0 5vw 76px;
}

.app-install-card,
.support-card {
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(23, 32, 28, 0.06);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 1180px;
  padding: 24px;
}

.app-install-actions,
.support-actions {
  display: grid;
  gap: 10px;
  min-width: min(100%, 260px);
}

.app-install-card h2,
.support-card h2 {
  font-size: clamp(1.35rem, 2vw, 1.8rem);
  line-height: 1.2;
  margin: 0;
}

.app-install-card p,
.support-card p {
  color: var(--muted);
  margin: 8px 0 0;
}

.referral-status {
  color: var(--clay);
  font-size: 0.9rem;
  font-weight: 800;
  min-height: 1.4em;
}

.support-button {
  justify-content: center;
  white-space: nowrap;
}

.hymn-link,
.mini-button,
.button,
.date-arrow {
  overflow-wrap: normal;
  word-break: keep-all;
}

.saved-entry h3 {
  margin: 0 0 4px;
}

.saved-entry time {
  color: var(--clay);
  display: block;
  font-size: 0.9rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.delete-note {
  align-self: start;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--clay);
  cursor: pointer;
  font-weight: 800;
  min-height: 40px;
  padding: 0 14px;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 5vw;
  text-align: center;
}

.policy-page {
  margin: 0 auto;
  max-width: 980px;
  padding: 72px 5vw 96px;
}

.policy-hero {
  border-bottom: 1px solid var(--line);
  margin-bottom: 34px;
  padding-bottom: 28px;
}

.policy-hero h1 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.12;
  margin: 0;
}

.policy-hero p {
  color: var(--muted);
  font-size: 1.05rem;
  margin: 18px 0 12px;
}

.policy-hero time {
  color: var(--clay);
  display: block;
  font-weight: 800;
}

.policy-content {
  display: grid;
  gap: 18px;
}

.policy-content article {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(23, 32, 28, 0.06);
  padding: 24px;
}

.policy-content h2 {
  color: var(--sage-dark);
  font-size: 1.18rem;
  line-height: 1.35;
  margin: 0 0 10px;
}

.policy-content p {
  color: var(--muted);
  margin: 0;
}

@media (max-width: 920px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 14px;
    padding-top: 14px;
    position: static;
  }

  .hero {
    min-height: 760px;
  }

  .hero-overlay {
    background: linear-gradient(180deg, rgba(17, 27, 23, 0.78) 0%, rgba(17, 27, 23, 0.45) 62%, rgba(17, 27, 23, 0.12) 100%);
  }

  .flow-grid,
  .workspace,
  .note-grid,
  .reader-tools,
  .daily-devotion-grid {
    grid-template-columns: 1fr;
  }

  .passage-panel {
    position: static;
  }
}

@media (max-width: 560px) {
  .nav-links {
    gap: 14px;
    overflow-x: auto;
    width: 100%;
  }

  .hero {
    min-height: 680px;
  }

  .hero-content {
    padding-bottom: 90px;
  }

  .section {
    padding: 64px 18px;
  }

  .policy-page {
    padding: 56px 18px 72px;
  }

  .saved-entry {
    grid-template-columns: 1fr;
  }

  .reader-heading,
  .hero-actions,
  .form-actions,
  .app-install-card,
  .support-card {
    align-items: stretch;
    flex-direction: column;
  }

  .tts-controls {
    grid-template-columns: 1fr;
  }
}

@media print {
  .site-header,
  .hero,
  .site-footer,
  .button,
  .delete-note {
    display: none;
  }

  body,
  .today,
  .journal {
    background: #fff;
  }

  .section {
    padding: 20px 0;
  }

  .workspace,
  .note-grid {
    display: block;
  }

  .scripture-text {
    max-height: none;
    overflow: visible;
  }

  .passage-panel,
  .journal-form,
  .saved-entry {
    border: 1px solid #999;
    box-shadow: none;
    margin-bottom: 16px;
  }
}
