:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --ink: #07142d;
  --muted: #566174;
  --accent: #5967d8;
  --accent-deep: #4654c7;
  --accent-soft: #eef2ff;
  --line: rgba(7, 20, 45, 0.1);
  --shadow: 0 22px 60px rgba(7, 20, 45, 0.1);
  --max: 1120px;
  --font-heading: Georgia, "Times New Roman", serif;
  --font-body: Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 0;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(89, 103, 216, 0.08), transparent 38%),
    linear-gradient(315deg, rgba(123, 97, 217, 0.06), transparent 34%),
    var(--bg);
  font-family: var(--font-body);
  line-height: 1.7;
  overflow-x: hidden;
}

body.nav-open,
body.prayer-session-open {
  overflow: hidden;
}

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

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

button,
input {
  font: inherit;
}

button,
label {
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid rgba(89, 103, 216, 0.4);
  outline-offset: 4px;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 34px rgba(7, 20, 45, 0.06);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.nav-shell {
  position: relative;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand img {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(7, 20, 45, 0.13);
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 0.98rem;
  letter-spacing: 0.1em;
}

.brand span span {
  color: var(--muted);
  font-size: 0.78rem;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--accent-deep);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  padding: 0;
  border: 1px solid rgba(7, 20, 45, 0.12);
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 10px 24px rgba(7, 20, 45, 0.08);
  cursor: pointer;
}

.nav-toggle span {
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.prayer-landing {
  min-height: calc(100svh - 76px);
  padding: clamp(56px, 8vw, 104px) 0 78px;
}

.landing-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.84fr) minmax(560px, 1.16fr);
  gap: clamp(52px, 8vw, 104px);
  align-items: start;
}

.landing-copy {
  position: sticky;
  top: 132px;
  padding-top: 10px;
}

.kicker {
  color: var(--accent-deep);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.landing-copy h1 {
  max-width: 610px;
  margin: 18px 0 24px;
  font-family: var(--font-heading);
  font-size: clamp(3rem, 5.2vw, 5.4rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.045em;
}

.landing-copy > p {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.5vw, 1.24rem);
}

.landing-note {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 36px;
}

.landing-note span {
  padding: 7px 11px;
  border: 1px solid rgba(89, 103, 216, 0.15);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.7);
  font-size: 0.78rem;
}

.prayer-choices {
  padding: clamp(26px, 4vw, 42px);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

fieldset + fieldset {
  margin-top: 36px;
}

legend {
  width: 100%;
  margin-bottom: 18px;
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 700;
}

legend span {
  margin-right: 10px;
  color: var(--accent-deep);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.theme-option {
  min-width: 0;
  cursor: pointer;
}

.theme-option input,
.duration-options input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
}

.theme-card {
  min-height: 210px;
  display: flex;
  flex-direction: column;
  padding: 22px 18px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.theme-option:hover .theme-card {
  transform: translateY(-3px);
  border-color: rgba(89, 103, 216, 0.28);
  box-shadow: 0 16px 34px rgba(7, 20, 45, 0.08);
}

.theme-option input:checked + .theme-card {
  border-color: var(--accent);
  background: linear-gradient(180deg, #f8f9ff, var(--accent-soft));
  box-shadow: 0 0 0 2px rgba(89, 103, 216, 0.12);
}

.theme-option input:focus-visible + .theme-card,
.duration-options input:focus-visible + span {
  outline: 3px solid rgba(89, 103, 216, 0.4);
  outline-offset: 3px;
}

.theme-mark {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  margin-bottom: 24px;
  border-radius: 50%;
  color: var(--accent-deep);
  background: var(--accent-soft);
  font-weight: 700;
}

.theme-card strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-family: var(--font-heading);
  font-size: 1.45rem;
}

.theme-card > span:last-child {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.duration-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 6px;
  border-radius: 10px;
  background: #eef0f6;
}

.duration-options label {
  cursor: pointer;
}

.duration-options span {
  min-height: 48px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: var(--muted);
  font-weight: 700;
}

.duration-options input:checked + span {
  color: var(--accent-deep);
  background: #fff;
  box-shadow: 0 8px 20px rgba(7, 20, 45, 0.1);
}

.primary-button,
.secondary-button,
.quiet-button,
.text-button {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}

.primary-button {
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, #5260d3 0%, #635bd6 54%, #7b61d9 100%);
  box-shadow: 0 18px 42px rgba(82, 96, 211, 0.22);
}

.primary-button:hover {
  box-shadow: 0 22px 54px rgba(82, 96, 211, 0.28);
}

.secondary-button {
  border: 1px solid rgba(7, 20, 45, 0.13);
  color: var(--ink);
  background: #fff;
  box-shadow: 0 10px 24px rgba(7, 20, 45, 0.07);
}

.secondary-button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.start-button {
  width: 100%;
  margin-top: 34px;
  min-height: 58px;
  font-size: 1rem;
}

.play-mark {
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 10px solid currentColor;
}

.music-credit {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
}

.prayer-session {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  grid-template-rows: auto 3px minmax(0, 1fr) auto;
  color: #fff;
  background:
    linear-gradient(145deg, rgba(8, 24, 51, 0.98), rgba(24, 43, 93, 0.98) 70%, rgba(46, 54, 118, 0.98));
  overflow: hidden;
}

.session-topbar {
  min-height: 72px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  padding: 14px clamp(18px, 4vw, 54px);
  color: rgba(255, 255, 255, 0.68);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.session-brand {
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.15em;
}

.session-progress-copy {
  display: flex;
  gap: 18px;
  font-size: 0.78rem;
  font-weight: 700;
}

.quiet-button {
  justify-self: end;
  min-height: 40px;
  padding: 9px 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.8);
  background: transparent;
}

.progress-track {
  background: rgba(255, 255, 255, 0.08);
}

.progress-track span {
  width: 0;
  height: 100%;
  display: block;
  background: linear-gradient(90deg, #8290ff, #c084fc);
  transition: width 250ms linear;
}

.session-body {
  width: min(calc(100% - 40px), 1180px);
  min-height: 0;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: clamp(44px, 7vw, 100px);
  align-items: center;
  padding: 38px 0;
  overflow-y: auto;
}

.stage-panel {
  max-width: 760px;
}

.stage-panel .kicker {
  color: #aeb7ff;
}

.stage-panel h2 {
  margin: 15px 0 24px;
  color: #fff;
  font-family: var(--font-heading);
  font-size: clamp(3.2rem, 7vw, 6.7rem);
  line-height: 1;
  letter-spacing: -0.045em;
}

.stage-content {
  max-width: 720px;
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(1.3rem, 2.25vw, 2rem);
  line-height: 1.65;
}

.stage-content.scripture-text {
  font-family: var(--font-heading);
  font-size: clamp(1.35rem, 2.5vw, 2.2rem);
}

.scripture-reference {
  margin: 22px 0 4px;
  color: #fff;
  font-weight: 700;
}

.scripture-source {
  color: #aeb7ff;
  font-size: 0.8rem;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.breath-line {
  width: min(320px, 62vw);
  height: 1px;
  margin-top: 54px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.14);
}

.breath-line span {
  width: 46%;
  height: 100%;
  display: block;
  background: linear-gradient(90deg, transparent, #aeb7ff, transparent);
  animation: breathe 5s ease-in-out infinite alternate;
}

.session-aside {
  display: grid;
  gap: 14px;
}

.time-card,
.music-card {
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
}

.time-card > span,
.music-label {
  display: block;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.time-card strong {
  display: block;
  margin-top: 4px;
  color: #fff;
  font-family: var(--font-heading);
  font-size: 2.35rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

.time-card p,
.music-card p {
  min-height: 1.5em;
  margin: 5px 0 0;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.76rem;
}

.music-card strong {
  display: block;
  margin-top: 5px;
  color: #fff;
}

.player-frame {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.text-button {
  min-height: 34px;
  margin-top: 14px;
  padding: 7px 13px;
  border: 1px solid rgba(199, 206, 255, 0.35);
  color: #eef0ff;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.78rem;
}

.music-fallback {
  min-height: 0;
  margin-top: 14px;
  padding: 0;
  border: 0;
  color: #c7ceff;
  background: none;
  font-size: 0.78rem;
}

.music-fallback {
  display: inline-block;
  margin-left: 12px;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.session-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 18px max(20px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(4, 15, 34, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.session-controls .secondary-button {
  min-width: 118px;
  color: rgba(255, 255, 255, 0.8);
  border-color: rgba(255, 255, 255, 0.17);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: none;
}

.session-controls .compact {
  min-width: 130px;
}

.prayer-complete {
  min-height: calc(100svh - 76px);
  display: grid;
  place-items: center;
  padding: 70px 16px;
}

.complete-card {
  width: min(100%, 860px);
  padding: clamp(34px, 7vw, 78px);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  text-align: center;
}

.complete-card h2 {
  margin: 18px auto 22px;
  font-family: var(--font-heading);
  font-size: clamp(2.4rem, 5vw, 4.6rem);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.complete-card > p {
  max-width: 640px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 1.05rem;
}

.complete-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 34px;
}

.play-link .play-mark {
  color: var(--accent-deep);
}

.site-footer {
  padding: 28px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.footer-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-links a {
  color: var(--accent-deep);
}

@keyframes breathe {
  from { transform: translateX(-18%); opacity: 0.45; }
  to { transform: translateX(138%); opacity: 1; }
}

@media (max-width: 900px) {
  .nav-shell {
    min-height: 68px;
    gap: 12px;
    padding: 10px 0;
  }

  .brand {
    flex: 1 1 auto;
    gap: 10px;
  }

  .brand img {
    width: 44px;
    height: 44px;
  }

  .brand > span {
    min-width: 0;
  }

  .brand strong,
  .brand > span > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .brand strong {
    font-size: 0.86rem;
    letter-spacing: 0.08em;
  }

  .brand > span > span {
    max-width: min(52vw, 240px);
    font-size: 0.7rem;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--muted);
    background: #fff;
    box-shadow: 0 22px 54px rgba(7, 20, 45, 0.14);
  }

  .site-nav.open {
    display: flex;
  }

  .site-nav a {
    padding: 11px 12px;
    border-radius: 8px;
  }

  .site-nav a:hover,
  .site-nav a[aria-current="page"] {
    background: var(--accent-soft);
  }

  .landing-layout {
    grid-template-columns: 1fr;
    gap: 42px;
  }

  .landing-copy {
    position: static;
  }

  .landing-copy h1 {
    max-width: 720px;
  }

  .session-body {
    grid-template-columns: 1fr;
    gap: 30px;
    align-content: center;
  }

  .session-aside {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 680px) {
  .prayer-landing {
    padding: 46px 0 58px;
  }

  .landing-copy h1 {
    font-size: clamp(2.55rem, 13vw, 3.7rem);
  }

  .prayer-choices {
    padding: 22px;
  }

  .theme-grid {
    grid-template-columns: 1fr;
  }

  .theme-card {
    min-height: 0;
    display: grid;
    grid-template-columns: 42px 1fr;
    column-gap: 14px;
    padding: 18px;
  }

  .theme-mark {
    grid-row: 1 / 3;
    margin: 0;
  }

  .theme-card strong {
    margin: 0;
    font-size: 1.24rem;
  }

  .theme-card > span:last-child {
    margin-top: 2px;
  }

  .duration-options span {
    min-height: 46px;
    font-size: 0.88rem;
  }

  .session-topbar {
    min-height: 64px;
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 11px 16px;
  }

  .session-brand {
    font-size: 0.72rem;
  }

  .session-progress-copy {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.7rem;
  }

  .quiet-button {
    min-height: 36px;
    padding: 7px 12px;
    font-size: 0.76rem;
  }

  .session-body {
    width: min(calc(100% - 32px), 1180px);
    display: block;
    padding: 28px 0 24px;
  }

  .stage-panel h2 {
    margin-bottom: 18px;
    font-size: clamp(2.7rem, 16vw, 4.25rem);
  }

  .stage-content,
  .stage-content.scripture-text {
    font-size: clamp(1.12rem, 5.7vw, 1.42rem);
    line-height: 1.58;
  }

  .breath-line {
    margin-top: 34px;
  }

  .session-aside {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 28px;
  }

  .time-card,
  .music-card {
    min-width: 0;
    padding: 15px;
  }

  .time-card strong {
    font-size: 1.85rem;
  }

  .music-card strong {
    overflow: hidden;
    font-size: 0.86rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .music-card p,
  .time-card p {
    font-size: 0.68rem;
    line-height: 1.4;
  }

  .text-button,
  .music-fallback {
    margin-top: 8px;
    font-size: 0.72rem;
  }

  .text-button {
    min-height: 32px;
    padding: 6px 10px;
  }

  .music-fallback {
    margin-left: 0;
  }

  .session-controls {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    padding-top: 12px;
  }

  .session-controls .secondary-button,
  .session-controls .compact {
    min-width: 0;
    min-height: 46px;
    padding: 10px 8px;
    font-size: 0.8rem;
  }

  .complete-card h2 {
    font-size: clamp(2rem, 10vw, 3rem);
  }

  .complete-actions {
    display: grid;
  }

  .footer-shell {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-height: 670px) and (max-width: 680px) {
  .session-topbar {
    min-height: 54px;
  }

  .session-body {
    padding-top: 18px;
    padding-bottom: 16px;
  }

  .stage-panel h2 {
    margin: 9px 0 13px;
    font-size: 2.65rem;
  }

  .stage-content,
  .stage-content.scripture-text {
    font-size: 1.05rem;
  }

  .breath-line {
    margin-top: 20px;
  }

  .session-aside {
    margin-top: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  .theme-option:hover .theme-card {
    transform: none;
  }
}
