:root {
  --ink: #ffffff;
  --ink-soft: rgba(255, 255, 255, 0.82);
  --ink-faint: rgba(255, 255, 255, 0.6);
  --accent: #f4d58d;
  --card-max: 620px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: #1a1712;
}
body {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* Background image layer with a slow ken-burns drift */
.bg {
  position: fixed;
  inset: -2%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  /* Warm fallback gradient shown before the image loads */
  background-image: linear-gradient(140deg, #6b4f2a 0%, #3a2c17 45%, #1a1712 100%);
  transform: scale(1.06);
  transition: opacity 1.1s ease;
  opacity: 0;
  animation: drift 60s ease-in-out infinite alternate;
  will-change: transform;
}
.bg.ready { opacity: 1; }

@keyframes drift {
  from { transform: scale(1.06) translate(0, 0); }
  to   { transform: scale(1.12) translate(-1.5%, -1%); }
}

/* Darkening scrim for text legibility */
.scrim {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 56% 72% at 24% 50%, rgba(0,0,0,0.52) 0%, rgba(0,0,0,0.30) 38%, rgba(0,0,0,0) 68%),
    linear-gradient(90deg, rgba(0,0,0,0.12) 0%, rgba(0,0,0,0) 55%),
    linear-gradient(0deg, rgba(0,0,0,0.12) 0%, rgba(0,0,0,0) 24%);
  pointer-events: none;
}

.topbar {
  flex: 0 0 auto;
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 34px;
  z-index: 3;
  /* keep header text legible over bright images */
  text-shadow:
    -1px -1px 1px rgba(0,0,0,0.5),
     1px -1px 1px rgba(0,0,0,0.5),
    -1px  1px 1px rgba(0,0,0,0.5),
     1px  1px 1px rgba(0,0,0,0.5),
     0 1px 6px rgba(0,0,0,0.55);
}
.brand {
  font-size: 14px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 700;
}
.clock {
  font-size: 15px;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

/* Adaptive header: when the top of the image is light, use dark text + a light halo */
body.bg-top-light .topbar {
  text-shadow:
    -1px -1px 1px rgba(255,255,255,0.75),
     1px -1px 1px rgba(255,255,255,0.75),
    -1px  1px 1px rgba(255,255,255,0.75),
     1px  1px 1px rgba(255,255,255,0.75),
     0 1px 4px rgba(255,255,255,0.6);
}
body.bg-top-light .brand,
body.bg-top-light .clock { color: #1a1712; }

.stage {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  overflow: hidden;
  /* generous clearance so content never crowds the header/footer */
  padding: clamp(48px, 7vh, 104px) clamp(28px, 7vw, 110px);
}

.card {
  max-width: var(--card-max);
  animation: rise 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
  /* subtle dark outline around glyphs for contrast on any image */
  text-shadow:
    -1px -1px 1px rgba(0,0,0,0.55),
     1px -1px 1px rgba(0,0,0,0.55),
    -1px  1px 1px rgba(0,0,0,0.55),
     1px  1px 1px rgba(0,0,0,0.55),
     0 2px 8px rgba(0,0,0,0.5);
}
@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.kicker { margin-bottom: 20px; }
.badge {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 700;
  color: #1a1712;
  background: var(--accent);
  padding: 5px 12px;
  border-radius: 999px;
  text-shadow: none; /* keep badge text crisp (don't inherit the card's outline) */
}

.verse {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(18px, 1.6vw, 23px);
  line-height: 1.42;
  font-style: italic;
  text-shadow:
    -1px -1px 1px rgba(0,0,0,0.62),
     1px -1px 1px rgba(0,0,0,0.62),
    -1px  1px 1px rgba(0,0,0,0.62),
     1px  1px 1px rgba(0,0,0,0.62),
     0 2px 16px rgba(0,0,0,0.55);
}
#verse-text::before { content: "\201C"; }
#verse-text::after  { content: "\201D"; }
/* auto-shrink for longer verses so the card always fits comfortably */
.verse.verse--long  { font-size: clamp(16px, 1.4vw, 20px); line-height: 1.4; }
.verse.verse--xlong { font-size: clamp(15px, 1.2vw, 18px); line-height: 1.38; }

.ref {
  display: inline;
  margin-left: 0.5em;
  font-style: normal;
  font-size: 0.7em;
  letter-spacing: 0.02em;
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
}

.divider {
  width: 64px;
  height: 2px;
  background: rgba(255,255,255,0.35);
  margin: 18px 0;
}

.block + .block { margin-top: 14px; }

.label {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 700;
  margin-bottom: 6px;
}
.label--do { color: var(--accent); }

.meaning, .today {
  font-size: clamp(14px, 1.2vw, 17px);
  line-height: 1.5;
  color: var(--ink-soft);
  text-shadow:
    -1px -1px 1px rgba(0,0,0,0.55),
     1px -1px 1px rgba(0,0,0,0.55),
    -1px  1px 1px rgba(0,0,0,0.55),
     1px  1px 1px rgba(0,0,0,0.55),
     0 1px 10px rgba(0,0,0,0.5);
  max-width: 56ch;
}
/* emphasize the actionable line — sized to match the verse */
.today { font-size: clamp(18px, 1.6vw, 23px); }

.footer {
  flex: 0 0 auto;
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  padding: 18px 34px;
  text-shadow:
    -1px -1px 1px rgba(0,0,0,0.5),
     1px -1px 1px rgba(0,0,0,0.5),
    -1px  1px 1px rgba(0,0,0,0.5),
     1px  1px 1px rgba(0,0,0,0.5),
     0 1px 6px rgba(0,0,0,0.55);
}
.another {
  font: inherit;
  font-size: 13px;
  color: #fff;
  background: rgba(0,0,0,0.34);
  border: 1px solid rgba(255,255,255,0.3);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  padding: 9px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}
.another:hover { background: rgba(0,0,0,0.5); }
.another:active { transform: scale(0.96); }
.counter { font-size: 12px; color: var(--ink-faint); letter-spacing: 0.05em; }

/* "Set as home page" prompt (web only) */
.hp-prompt {
  position: fixed; left: 22px; bottom: 20px; z-index: 6;
  display: flex; align-items: center; gap: 6px;
  animation: rise 0.6s ease both;
}
.hp-open {
  font: inherit; font-size: 13px; font-weight: 600; color: #1a1712;
  background: var(--accent); border: none; border-radius: 999px;
  padding: 10px 16px; cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,0.35);
}
.hp-open:hover { filter: brightness(1.05); }
.hp-x {
  font: inherit; font-size: 13px; color: #fff; background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.3); border-radius: 999px;
  width: 30px; height: 30px; cursor: pointer;
}
.hp-x:hover { background: rgba(0,0,0,0.6); }

.hp-modal {
  position: fixed; inset: 0; z-index: 10;
  background: rgba(0,0,0,0.55); display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.hp-card {
  background: #fdf7ec; color: #2b2318; border-radius: 18px; padding: 28px 30px;
  max-width: 460px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,0.4); text-align: left;
}
.hp-card h2 { font-size: 20px; margin: 0 0 10px; color: #3a2c17; }
.hp-card p { font-size: 15px; line-height: 1.55; margin: 0 0 14px; }
.hp-url {
  display: flex; align-items: center; gap: 8px; background: #fff;
  border: 1px solid #e7dcc6; border-radius: 10px; padding: 8px 8px 8px 14px; margin-bottom: 14px;
}
#hp-url-text { flex: 1; font-family: Menlo, Consolas, monospace; font-size: 14px; color: #3a2c17; }
#hp-copy { font: inherit; font-size: 13px; font-weight: 600; color: #1a1712; background: var(--accent);
  border: none; border-radius: 8px; padding: 8px 14px; cursor: pointer; }
.hp-steps { font-size: 14px; color: #5c4d33; }
.hp-actions { display: flex; gap: 10px; margin-top: 8px; }
.hp-primary { font: inherit; font-size: 14px; font-weight: 600; color: #fff; background: #6b4f2a;
  border: none; border-radius: 10px; padding: 11px 16px; cursor: pointer; }
.hp-secondary { font: inherit; font-size: 14px; color: #6b4f2a; background: transparent;
  border: 1px solid #d8c7a4; border-radius: 10px; padding: 11px 16px; cursor: pointer; }

@media (max-width: 620px) {
  .hp-prompt { left: 12px; right: 12px; bottom: 66px; justify-content: center; }
  .topbar { padding: 16px 20px; }
  .stage { padding: 40px 20px; }
  .footer { padding: 14px 20px; gap: 12px; justify-content: space-between; }
  .another { font-size: 15px; padding: 12px 20px; }   /* bigger tap target */
  .brand { font-size: 12px; letter-spacing: 0.14em; }
  .clock { font-size: 13px; }
}
