/* Healing: calm, warm palette. Light by default; dark follows the phone's setting. */
:root {
  color-scheme: light;
  --bg: #f7efdc;
  --surface: #fdf8ec;
  --card: #fdf8ec;
  --ink: #34423a;
  --muted: #6f7f74;
  --line: #e6d9bd;
  --accent: #4f9a80;
  --accent-ink: #ffffff;
  --accent-soft: #e4efd9;
  --gold: #e9b64a;
  --sky: #7fb2d9;
  --danger: #c0564a;
  --shadow: 0 1px 2px rgba(60, 70, 50, 0.06), 0 8px 22px rgba(60, 70, 50, 0.08);
  --radius: 16px;
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
  overflow-x: hidden;
}
a { color: var(--accent); text-underline-offset: 3px; }
h1 { font-size: 1.75rem; line-height: 1.2; letter-spacing: -0.01em; margin: 0.25rem 0 0.75rem; }
h2 { font-size: 1.2rem; margin: 0 0 0.25rem; }
h3 { font-size: 1.05rem; margin: 1.4rem 0 0.4rem; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
.center { text-align: center; }
.error { color: var(--danger); font-weight: 600; }
.eyebrow {
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent); margin: 0.5rem 0 0;
}

/* Top bar */
.topbar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  padding: calc(env(safe-area-inset-top) + 12px) var(--gutter, 18px) 12px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.brand {
  font-family: var(--serif); font-weight: 700; font-size: 1.25rem;
  color: var(--ink); text-decoration: none; letter-spacing: 0.01em;
}
.brand::before { content: "✦ "; color: var(--gold); }
nav { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
nav a {
  text-decoration: none; color: var(--muted); padding: 6px 10px; border-radius: 999px; font-size: 0.95rem;
}
nav a:hover { background: var(--accent-soft); color: var(--ink); }
.inline { display: inline; margin: 0; }
button.link {
  background: none; border: 0; color: var(--muted); font: inherit; font-size: 0.95rem; padding: 6px 10px;
  border-radius: 999px; cursor: pointer;
}
button.link:hover { background: var(--accent-soft); color: var(--ink); }

/* Layout */
.wrap { max-width: 680px; margin: 0 auto; padding: 20px var(--gutter, 18px) 48px; }
section { width: 100%; }
.narrow { max-width: 440px; margin: 28px auto 0; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow);
}
.stack { display: flex; flex-direction: column; gap: 14px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.grid { display: grid; gap: 12px; }
.grid.topics { margin-top: 14px; }
.section-title { font-size: 1.05rem; margin: 30px 0 10px; }

/* Forms */
label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; }
input[type="text"], input[type="password"], input[type="url"], input[type="search"], select, textarea {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; width: 100%;
  min-height: 48px;
}
textarea { min-height: 96px; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 3px solid var(--accent-soft); outline-offset: 2px;
}
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin: 0; }
legend { font-weight: 700; padding: 0 4px; }
.radio, .check { flex-direction: row; align-items: center; font-weight: 400; gap: 10px; min-height: 40px; }
.radio input, .check input { width: 20px; height: 20px; accent-color: var(--accent); }

/* Buttons and tiles */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 20px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: inherit; font-weight: 600;
  text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: transform 0.08s ease, background 0.2s ease;
}
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.big { min-height: 64px; font-size: 1.1rem; }
.btn.danger { color: var(--danger); }
.btn.small-btn { min-height: 36px; padding: 6px 14px; font-size: 0.9rem; }
.danger-zone { margin-top: 28px; }

.tile {
  display: flex; flex-direction: column; gap: 4px; padding: 20px 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); text-decoration: none; color: var(--ink);
  transition: transform 0.12s ease;
}
.tile:hover, .tile:focus-visible { transform: translateY(-1px); }
.tile-title { font-family: var(--serif); font-size: 1.25rem; font-weight: 700; }
.tile-sub { color: var(--muted); font-size: 0.95rem; }
.tile.wide { flex-direction: row; justify-content: space-between; align-items: center; }
.tile.wide .tile-sub { text-align: right; }

.plan-card { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.chapter-link {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; text-decoration: none; color: var(--ink);
}
.chapter-name { font-family: var(--serif); font-size: 1.15rem; font-weight: 700; }

/* Day grid for reading plans */
.day-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 8px; }
.day {
  display: flex; align-items: center; justify-content: center; min-height: 44px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 600;
}
.day.done { background: var(--accent-soft); border-color: var(--accent); }
.day.current { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Chips and cards */
.search { display: flex; flex-direction: column; gap: 8px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.chip {
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line);
  text-decoration: none; color: var(--ink); background: var(--surface); font-size: 0.92rem;
}
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.list { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 10px; }
.item {
  display: flex; justify-content: space-between; gap: 12px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px;
  box-shadow: var(--shadow);
}
.item-main { min-width: 0; flex: 1; }
.item-title { font-weight: 600; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
a.item-title:hover { text-decoration: underline; }

.meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 8px 0 0; }
.badge, .tag {
  font-size: 0.78rem; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--ink);
}
.badge { font-weight: 700; }
.tag { border: 1px solid var(--line); background: transparent; }

/* Video */
.embed { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #000; box-shadow: var(--shadow); }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.embed.vertical { aspect-ratio: 9 / 16; width: min(100%, calc(72vh * 9 / 16)); margin: 0 auto; }
.video-title { font-size: 1.3rem; margin-top: 16px; overflow-wrap: anywhere; }
.watch .actions .btn { flex: 1 1 auto; }

/* Verse, prayer, and reader */
.verse {
  margin: 0 0 16px; padding: 16px 18px; border-left: 4px solid var(--gold);
  background: var(--surface); border-radius: 12px; box-shadow: var(--shadow);
  font-family: var(--serif); font-size: 1.08rem; line-height: 1.6;
}
.verse p { margin: 0 0 8px; }
.verse footer { font-family: -apple-system, system-ui, sans-serif; font-weight: 700; font-size: 0.88rem; color: var(--muted); }
.big-verse { font-size: 1.25rem; padding: 22px 22px; }
.verse-preview { margin: 4px 0 0; }
.danger-text { color: var(--danger); }
.pray {
  margin: 18px 0 0; padding: 14px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
}
.pray summary { font-weight: 700; cursor: pointer; min-height: 40px; display: flex; align-items: center; }
.pray-steps { padding-left: 1.2em; margin: 8px 0 0; }
.pray-steps li { margin-bottom: 10px; }
.pray.own { margin-top: 12px; }
.fill p { margin: 0 0 12px; }
.blank { display: inline-block; min-width: 4em; border-bottom: 1px dashed var(--muted); }

.reader .scripture {
  font-family: var(--serif); font-size: 1.12rem; line-height: 1.75;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: var(--shadow);
}
.scripture p { margin: 0 0 12px; }
.scripture sup { font-family: -apple-system, system-ui, sans-serif; font-size: 0.7rem; color: var(--muted); margin-right: 2px; }
.scripture h3 { font-family: var(--serif); color: var(--ink); text-align: center; font-style: italic; }
.audio-card { margin-bottom: 14px; display: flex; flex-direction: column; gap: 12px; }
.audio-card audio { width: 100%; }
.reader-picker { display: flex; align-items: center; gap: 10px; }
.reader-picker label { flex: 0 1 240px; }
.chapter-nav { justify-content: space-between; }

textarea, .check input { accent-color: var(--accent); }

@media (min-width: 560px) {
  .grid { grid-template-columns: 1fr 1fr; }
  .grid.topics { grid-template-columns: repeat(3, 1fr); }
  .grid .tile.wide { grid-column: span 1; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Design pass 2 */
.hero { margin-bottom: 6px; }
.hero h1 { font-size: 2rem; }
.tile { position: relative; overflow: hidden; }
.tile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--accent); }
.tile.topic-anxiety::before { background: #7cc0a2; }
.tile.topic-overthinking::before { background: #86b6e0; }
.tile.topic-fear::before { background: #f0b84e; }
.tile .tile-title { padding-left: 4px; }
.tile .tile-sub { padding-left: 4px; }
.progress { height: 8px; border-radius: 999px; background: var(--accent-soft); overflow: hidden; margin-top: 10px; min-width: 160px; }
.progress span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.example {
  margin: 10px 0 14px; padding: 14px 16px; border-left: 3px solid var(--gold);
  background: var(--bg); border-radius: 10px; font-family: var(--serif); line-height: 1.7;
}
.example p { margin: 0 0 8px; }
.example footer { font-family: -apple-system, system-ui, sans-serif; font-size: 0.85rem; color: var(--muted); }
.login { text-align: left; }
.login .mark { font-size: 1.8rem; color: var(--gold); text-align: center; margin: 0; }
.center { text-align: center; }
.plan-card .btn { min-width: 120px; }
article.card + article.card { margin-top: 0; }

/* Home: Daily Bible Study fills the rest of the screen */
.home { display: flex; flex-direction: column; }
.home .study { display: grid; gap: 12px; }
.daily-tile { flex: 0 0 auto; min-height: 0; justify-content: center; gap: 4px; padding: 16px 18px; }
.daily-tile .tile-title { font-size: 1.15rem; }
.daily-tile .tile-sub { font-size: 0.88rem; }

.home .grid.topics { margin-top: 10px; gap: 10px; }
.home .grid.topics .tile { padding: 14px 18px; }
.home .hero h1 { margin-bottom: 4px; }
.home .section-title { margin: 18px 0 8px; }
.tile.topic-daily::before { background: #f2a48f; }

/* Design pass 3: softer, more finished */
body {
  background:
    radial-gradient(1200px 500px at 50% -200px, color-mix(in srgb, var(--accent-soft) 70%, transparent), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}
h1 { font-family: var(--serif); font-weight: 700; letter-spacing: -0.005em; }
.topbar { border-bottom: none; background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
nav a { font-weight: 600; }

/* Topic tiles: a soft tinted icon dot, title, and subtitle */
.tile { padding: 18px 18px 18px 22px; gap: 2px; }
.tile::before { display: none; }
.tile::after {
  content: ""; position: absolute; left: 8px; top: 50%; width: 9px; height: 9px; margin-top: -4px;
  border-radius: 50%; background: var(--accent);
}
.tile.topic-anxiety::after { background: #7cc0a2; }
.tile.topic-overthinking::after { background: #86b6e0; }
.tile.topic-fear::after { background: #f0b84e; }
.tile.topic-daily::after { background: #f2a48f; }
.tile .tile-title { padding-left: 0; font-size: 1.2rem; }
.tile .tile-sub { padding-left: 0; font-size: 0.92rem; }
.tile.wide .tile-title { padding-left: 0; }
.tile { padding-left: 26px; }

.eyebrow { letter-spacing: 0.12em; }

/* Watch page */
.watch .embed { border-radius: 20px; box-shadow: 0 18px 40px -18px rgba(38, 48, 43, 0.35); }
.video-title { font-family: var(--serif); font-size: 1.35rem; line-height: 1.3; margin-top: 18px; }
.verse {
  position: relative; border-left: none; padding: 20px 22px 18px 22px;
  background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--accent-soft) 45%, var(--surface)));
  border: 1px solid var(--line); font-size: 1.1rem;
}
.verse::before {
  content: "\201C"; position: absolute; left: 12px; top: -8px; font-size: 3.2rem; line-height: 1;
  color: var(--gold); font-family: var(--serif);
}
.verse p { padding-left: 14px; }
.verse footer { padding-left: 14px; color: var(--accent); }
.watch .meta { margin-top: 12px; }
.watch .actions { margin-top: 20px; }
.watch .btn.primary { box-shadow: 0 8px 18px -10px var(--accent); }

/* Library list */
.item {
  border-radius: 16px; padding: 14px 16px; border-color: transparent;
  box-shadow: 0 1px 2px rgba(38,48,43,0.05), 0 4px 14px rgba(38,48,43,0.05);
  transition: transform 0.12s ease, box-shadow 0.2s ease;
}
.item:hover { transform: translateY(-1px); box-shadow: 0 1px 2px rgba(38,48,43,0.06), 0 10px 22px rgba(38,48,43,0.08); }
.item-title { font-family: var(--serif); font-size: 1.05rem; font-weight: 700; }
.item .small { color: var(--accent); font-weight: 600; text-decoration: none; }
.chip { font-weight: 600; }
.search input[type="search"] { border-radius: 999px; padding-left: 18px; background: var(--surface); }

/* Chapter cards */
.chapter-name { font-size: 1.2rem; }
.reader .scripture { padding: 26px 26px; }
.reader .scripture p { text-indent: 0; }

/* Buttons */
.btn { border-radius: 999px; letter-spacing: 0.01em; }
.btn:hover { filter: brightness(1.03); }
.btn.primary:hover { filter: brightness(1.08); }

/* Sizing for phones and computers */
.daily-tile .eyebrow { margin: 0; }
@media (min-width: 900px) {
  .wrap { max-width: 960px; padding-top: 28px; }
  h1 { font-size: 2.1rem; }
  .hero h1 { font-size: 2.4rem; }
  .home .grid.topics { grid-template-columns: repeat(2, 1fr); }
  .home .study { grid-template-columns: 1fr 1fr; }
  .tile { padding: 22px 22px 22px 26px; }
  .reader .scripture { padding: 30px 34px; font-size: 1.12rem; }
  .narrow { max-width: 480px; }
}
@media (min-width: 1200px) {
  .wrap { max-width: 1080px; }
  .home .grid.topics { grid-template-columns: repeat(4, 1fr); }
  .day-grid { grid-template-columns: repeat(10, 1fr); }
}
