/* Outdoor Crusade · 40 Day Reset Journey · oc-main.css */

:root {
  --ink: #242422;
  --charcoal: #4a4a48;
  --stone: #6d6e72;
  --stone-light: #a9aaae;
  --ember: #ea9640;
  --ember-deep: #a85f15;
  --ember-tint: #fcecda;
  --pine: #4b6049;
  --pine-deep: #2f3f2e;
  --pine-tint: #e7ede4;
  --paper: #faf7f1;
  --paper-raised: #ffffff;
  --line: rgba(36, 36, 34, 0.12);
  --line-strong: rgba(36, 36, 34, 0.22);
  --shadow: 0 1px 2px rgba(36, 36, 34, 0.06);
  --font-display: Impact, "Arial Narrow Bold", "Franklin Gothic Heavy", "Haettenschweiler", sans-serif;
  --font-serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

body {
  min-height: 100vh;
  padding-top: calc(56px + var(--safe-top));
  padding-bottom: calc(64px + var(--safe-bottom));
}

a { color: var(--ember-deep); }
button { font-family: var(--font-sans); cursor: pointer; }

.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ---- Header ---- */
.app-header {
  position: fixed; top: 0; left: 0; right: 0;
  height: calc(56px + var(--safe-top));
  padding-top: var(--safe-top);
  background: var(--ink); color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding-left: 16px; padding-right: 16px;
  z-index: 50;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.app-header__brand { display: flex; align-items: center; gap: 10px; }
.app-header__mark { width: 28px; height: 28px; display: block; }
.app-header__title { font-family: var(--font-display); letter-spacing: 0.04em; text-transform: uppercase; font-size: 16px; line-height: 1; }
.app-header__streak { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--ember); font-weight: 600; }
.app-header__streak svg { width: 14px; height: 14px; }

/* ---- Main / views ---- */
main { max-width: 640px; margin: 0 auto; padding: 20px 16px 32px; }
.view { display: none; }
.view.is-active { display: block; }

.eyebrow { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--stone); font-weight: 600; margin: 0 0 4px; }

h1, h2, h3 { font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.02em; font-weight: 400; color: var(--ink); margin: 0; }
h1 { font-size: 30px; line-height: 1.05; }
h2 { font-size: 22px; line-height: 1.1; }
h3 { font-size: 17px; line-height: 1.15; }
p { line-height: 1.65; margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

/* ---- Cards ---- */
.card { background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.card--pad { padding: 18px 20px; }

/* ---- Today ---- */
.hero-start { text-align: center; padding: 8px 0 4px; }
.hero-start__cover { width: 150px; border-radius: var(--radius-md); box-shadow: 0 6px 20px rgba(36,36,34,0.18); margin: 0 auto 18px; display: block; }
.hero-start h1 { font-size: 26px; margin-bottom: 6px; }
.hero-start p { color: var(--charcoal); max-width: 42ch; margin: 0 auto 20px; }
.today-card { margin-bottom: 18px; }
.today-card__phase { color: var(--ember-deep); }
.today-card__title { margin: 6px 0 8px; }
.today-card__ref { color: var(--stone); font-family: var(--font-serif); font-style: italic; font-size: 14px; margin-bottom: 16px; }

/* ---- Buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: none; border-radius: var(--radius-md); padding: 12px 18px; font-size: 14px; font-weight: 600; font-family: var(--font-sans); letter-spacing: 0.01em; transition: transform 0.1s ease; }
.btn:active { transform: scale(0.98); }
.btn--primary { background: var(--ember); color: #fff; width: 100%; }
.btn--primary:hover { background: var(--ember-deep); }
.btn--ghost { background: transparent; border: 1px solid var(--line-strong); color: var(--ink); }
.btn--success { background: var(--pine); color: #fff; width: 100%; }
.btn--success.is-done { background: var(--pine-tint); color: var(--pine-deep); }
.btn--icon { background: var(--paper); border: 1px solid var(--line); border-radius: 50%; width: 40px; height: 40px; padding: 0; flex: none; color: var(--ink); }
.btn--icon svg { width: 18px; height: 18px; }
.btn--icon:disabled { opacity: 0.3; cursor: default; }

/* ---- Week strip & stats ---- */
.week-strip { display: flex; gap: 8px; margin: 14px 0 18px; overflow-x: auto; padding-bottom: 2px; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat-box { background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 12px 8px; text-align: center; }
.stat-box__num { font-family: var(--font-display); font-size: 22px; color: var(--ink); }
.stat-box__label { font-size: 11px; color: var(--stone); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 2px; }

/* ---- Day chips ---- */
.day-chip { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; border: 1px solid var(--line); background: var(--paper-raised); color: var(--charcoal); flex: none; }
.day-chip.is-done { background: var(--pine); border-color: var(--pine); color: #fff; }
.day-chip.is-current { border: 2px solid var(--ember); color: var(--ember-deep); background: var(--ember-tint); }
.day-chip svg { width: 15px; height: 15px; }
button.day-chip { -webkit-appearance: none; appearance: none; }

/* ---- Days view ---- */
.group-block { margin-bottom: 22px; }
.group-block__label { font-size: 12px; font-weight: 700; color: var(--charcoal); margin-bottom: 4px; }
.group-block__range { font-size: 11px; color: var(--stone-light); margin-bottom: 10px; }
.chip-grid { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---- Progress ---- */
.bar-row { margin-bottom: 14px; }
.bar-row__top { display: flex; justify-content: space-between; font-size: 12px; color: var(--charcoal); margin-bottom: 4px; }
.bar-track { height: 7px; border-radius: 4px; background: var(--line); overflow: hidden; }
.bar-fill { height: 100%; background: var(--pine); border-radius: 4px; transition: width 0.3s ease; }
.reset-row { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); text-align: center; }
.reset-row p { font-size: 12px; color: var(--stone); margin-bottom: 10px; }

/* ---- Day detail ---- */
.detail-view { position: fixed; inset: 0; background: var(--paper); z-index: 60; display: none; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.detail-view.is-active { display: block; }
.detail-header { position: sticky; top: 0; background: var(--paper); padding: calc(12px + var(--safe-top)) 16px 10px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); z-index: 5; }
.detail-back { display: flex; align-items: center; gap: 4px; background: none; border: none; color: var(--charcoal); font-size: 13px; font-weight: 600; padding: 6px 4px; }
.detail-back svg { width: 16px; height: 16px; }
.detail-body { max-width: 640px; margin: 0 auto; padding: 20px 18px 110px; }
.detail-meta { color: var(--ember-deep); margin-bottom: 6px; }
.detail-title { margin-bottom: 14px; }

.section { margin-bottom: 20px; }
.section__label { display: flex; align-items: center; gap: 6px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--stone); font-weight: 700; margin-bottom: 8px; }
.section__label svg { width: 14px; height: 14px; color: var(--ember-deep); }

.section--scripture { background: var(--ember-tint); border-radius: var(--radius-md); padding: 14px 16px; }
.section--scripture p { font-family: var(--font-serif); font-style: italic; color: var(--ember-deep); font-size: 15px; margin: 0; }
.section--prose p { font-family: var(--font-serif); font-size: 16px; color: var(--ink); white-space: pre-line; }

.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.action-box { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 12px 14px; }
.action-box p { font-size: 13px; margin: 0; }

.section--prayer p { font-family: var(--font-serif); font-style: italic; color: var(--charcoal); white-space: pre-line; }

.reflection-list { margin: 0; padding-left: 20px; }
.reflection-list li { font-size: 14px; margin-bottom: 6px; color: var(--ink); }

.section--grace { background: var(--pine-tint); border-radius: var(--radius-md); padding: 14px 16px; display: flex; gap: 10px; align-items: flex-start; }
.section--grace svg { width: 18px; height: 18px; color: var(--pine-deep); flex: none; margin-top: 1px; }
.section--grace p { color: var(--pine-deep); font-size: 14px; margin: 0; }

.detail-footer { position: sticky; bottom: 0; background: var(--paper); border-top: 1px solid var(--line); padding: 12px 16px calc(12px + var(--safe-bottom)); display: flex; align-items: center; gap: 10px; }

/* ---- About ---- */
.about-cover { width: 100%; max-width: 280px; display: block; margin: 0 auto 20px; border-radius: var(--radius-md); box-shadow: 0 8px 24px rgba(36,36,34,0.18); }
.about-title { text-align: center; margin-bottom: 4px; }
.about-subtitle { text-align: center; color: var(--charcoal); font-style: italic; font-family: var(--font-serif); margin-bottom: 4px; }
.about-author { text-align: center; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ember-deep); font-weight: 700; margin-bottom: 26px; }
.rhythm-list { list-style: none; margin: 0; padding: 0; }
.rhythm-list li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.rhythm-list li:last-child { border-bottom: none; }
.rhythm-num { width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex: none; }
.about-note p { font-family: var(--font-serif); font-size: 15px; white-space: pre-line; }
.about-foot { text-align: center; font-size: 11px; color: var(--stone-light); margin-top: 24px; }

/* ---- Install banner ---- */
.install-banner { display: none; position: fixed; left: 12px; right: 12px; bottom: calc(72px + var(--safe-bottom)); background: var(--ink); color: #fff; border-radius: var(--radius-md); padding: 12px 14px; align-items: center; justify-content: space-between; gap: 10px; z-index: 70; box-shadow: 0 6px 18px rgba(0,0,0,0.25); }
.install-banner.is-visible { display: flex; }
.install-banner p { font-size: 13px; margin: 0; }
.install-banner__actions { display: flex; gap: 8px; flex: none; }
.install-banner button { border: none; border-radius: var(--radius-sm); font-size: 12px; font-weight: 600; padding: 8px 12px; }
.install-banner__install { background: var(--ember); color: #fff; }
.install-banner__dismiss { background: transparent; color: rgba(255,255,255,0.65); }

/* ---- Tab bar ---- */
.tab-bar { position: fixed; left: 0; right: 0; bottom: 0; height: calc(64px + var(--safe-bottom)); padding-bottom: var(--safe-bottom); background: var(--paper-raised); border-top: 1px solid var(--line); display: flex; z-index: 40; }
.tab-btn { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; background: none; border: none; color: var(--stone); font-size: 11px; font-family: var(--font-sans); }
.tab-btn svg { width: 21px; height: 21px; }
.tab-btn.is-active { color: var(--ember-deep); }

/* ---- Responsive ---- */
@media (min-width: 720px) {
  main { padding-top: 28px; }
  .tab-bar { max-width: 640px; left: 50%; transform: translateX(-50%); border-left: 1px solid var(--line); border-right: 1px solid var(--line); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---- Day 20 Dip ---- */
.dip-chip { background: var(--ember-tint); border: 2px solid var(--ember); color: var(--ember-deep); }
.dip-chip svg { width: 17px; height: 17px; }
.dip-badge { display: inline-flex; align-items: center; gap: 6px; background: var(--ember-tint); color: var(--ember-deep); border: 1px solid var(--ember); border-radius: 20px; padding: 5px 12px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 14px; }
.dip-badge svg { width: 14px; height: 14px; }
.dip-prose p { font-family: var(--font-serif); font-size: 16px; line-height: 1.75; color: var(--ink); white-space: pre-line; }

/* ---- Keep Walking Guide interstitial ---- */

.kwg-chip {
  background: var(--pine-tint);
  border: 2px solid var(--pine);
  color: var(--pine-deep);
}
.kwg-chip svg { width: 17px; height: 17px; }

.kwg-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--pine-tint);
  color: var(--pine-deep);
  border: 1px solid var(--pine);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}
.kwg-badge svg { width: 14px; height: 14px; }

.kwg-subtitle {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--pine-deep);
  font-size: 15px;
  margin-bottom: 20px;
}

.kwg-prose p {
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink);
  white-space: pre-line;
}

.btn--kwg {
  background: var(--pine);
  color: #fff;
  width: 100%;
}
.btn--kwg:hover { background: var(--pine-deep); }

/* ---- Final Word ---- */

.final-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--ink);
  color: var(--ember);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}
.final-badge svg { width: 13px; height: 13px; }

.final-prose p {
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.8;
  color: var(--ink);
  white-space: pre-line;
}

.final-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 28px 0 20px;
  color: var(--charcoal);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.final-divider::before,
.final-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line-strong);
}
.final-divider span {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.final-divider svg { width: 14px; height: 14px; color: var(--pine); }

.final-step {
  margin-bottom: 22px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.final-step:last-child { border-bottom: none; }

.final-step__heading {
  font-family: var(--font-display);
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--pine-deep);
  margin-bottom: 10px;
}

/* ---- Journal section (in day detail) ---- */

.journal-section {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 2px solid var(--ink);
}

.journal-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 18px;
}

.journal-header > span:first-child {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink);
}
.journal-header svg { width: 16px; height: 16px; color: var(--ember-deep); }

.journal-subtitle {
  font-size: 11px;
  color: var(--stone-light);
}

.journal-field {
  margin-bottom: 16px;
}

.journal-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--charcoal);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.journal-textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper-raised);
  resize: vertical;
  min-height: 70px;
  transition: border-color 0.15s ease;
}
.journal-textarea:focus {
  outline: none;
  border-color: var(--ember);
}
.journal-textarea::placeholder { color: var(--stone-light); }

/* ---- Journal browser tab ---- */

.journal-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--stone);
}
.journal-empty svg { width: 32px; height: 32px; margin-bottom: 12px; display: block; margin-left: auto; margin-right: auto; opacity: 0.4; }
.journal-empty p { margin: 0 0 8px; }

.journal-entry-card {
  display: block;
  width: 100%;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: 10px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s;
}
.journal-entry-card:hover { border-color: var(--ember); }

.journal-entry-card__top {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 3px;
}
.journal-entry-card__day {
  font-size: 11px;
  font-weight: 700;
  color: var(--ember-deep);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  flex: none;
}
.journal-entry-card__title {
  font-family: var(--font-display);
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.journal-entry-card__phase {
  font-size: 11px;
  color: var(--stone);
  margin-bottom: 6px;
}
.journal-entry-card__preview {
  font-family: var(--font-serif);
  font-size: 13px;
  color: var(--charcoal);
  font-style: italic;
  line-height: 1.5;
}

/* Workbook link button */
.workbook-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.workbook-link svg { width: 16px; height: 16px; }
