/* Scripture Studio — the Infinite Canvas hero.
   Living-landscape board where composed verse cards land as draggable objects.
   Styled with the MyBibleLens brand palette (parchment #fdf8f3, gold #b6741d,
   Hammersmith One / Inter / Lora). All art is original CSS — nothing copied
   from the shipped app. */
@import url('https://fonts.googleapis.com/css2?family=Hammersmith+One&family=Inter:ital,wght@0,400;0,600;0,700;1,400&family=Lora:ital@0;1&display=swap');

:root {
  --gold: #b6741d;
  --gold-deep: #8f5916;
  --gold-light: #c98a35;
  --ink: #1a1a1a;
  --cream: #fdf8f3;
  --parchment: #f7ede2;
  --line: #e8d9c4;
}

* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }

/* The [hidden] attribute must win over the display rules below, or the sheet
   never closes and shows on load. Attribute selectors outrank the class rules. */
.sheet[hidden], .scrim[hidden] { display: none; }

body {
  font-family: "Inter", "Avenir Next", sans-serif;
  color: var(--ink);
  overflow: hidden;
  position: relative;
}

/* ---------- top bar ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 22px;
  background: rgba(255, 250, 244, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: baseline; gap: 8px; }
.brand-mark { color: var(--gold); font-size: 20px; }
.brand-name { font-family: "Hammersmith One", sans-serif; font-size: 18px; letter-spacing: -0.2px; }
.brand-sub { font-size: 11px; color: #9a8a70; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.lang {
  font: inherit; font-size: 12px; padding: 6px 8px; color: var(--gold-deep);
  border: 1.5px solid var(--line); border-radius: 10px; background: #fff8f3; cursor: pointer;
}
.powered { font-size: 11px; color: #6b5a44; }
.powered b { color: var(--gold-deep); }

/* ---------- the living landscape ---------- */
.canvas {
  position: absolute; inset: 0;
  /* warm horizon: golden sky fading to parchment ground, soft sun glow */
  background:
    radial-gradient(120% 80% at 78% 8%, rgba(212, 175, 55, 0.28) 0%, rgba(212, 175, 55, 0) 42%),
    radial-gradient(90% 55% at 20% 100%, rgba(182, 116, 29, 0.14) 0%, rgba(182, 116, 29, 0) 60%),
    linear-gradient(180deg, #fdf3df 0%, #fdf8f3 48%, #f7ede2 100%);
  overflow: hidden;
}
/* faint dotted "canvas" texture so it reads as an infinite board */
.canvas::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(182, 116, 29, 0.10) 1px, transparent 1px);
  background-size: 30px 30px;
  mask-image: radial-gradient(120% 100% at 50% 40%, #000 40%, transparent 85%);
}
/* a soft distant horizon line */
.canvas::after {
  content: ""; position: absolute; left: 0; right: 0; top: 58%; height: 180px; pointer-events: none;
  background: radial-gradient(80% 100% at 50% 0%, rgba(201, 138, 53, 0.16), transparent 70%);
}

.canvas-hint {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -60%);
  text-align: center; color: #a8987e; max-width: 420px; padding: 0 20px;
  transition: opacity 0.4s;
}
.canvas-hint .hint-mark { font-size: 40px; color: var(--gold); display: block; margin-bottom: 8px; }
.canvas-hint p { font-size: 15px; margin: 4px 0; }
.canvas-hint .hint-sub { font-size: 12.5px; color: #b6a888; }
.canvas-hint b { color: var(--gold-deep); }

/* ---------- canvas objects (draggable) ---------- */
.obj {
  position: absolute; touch-action: none; cursor: grab; user-select: none;
  transition: box-shadow 0.2s;
}
.obj:active { cursor: grabbing; }
.obj.dragging { z-index: 30 !important; }

/* pre-placed sticky note — sells the "living landscape" */
.note {
  width: 168px; padding: 16px 16px 22px; border-radius: 4px;
  background: linear-gradient(180deg, #fff6cf, #ffedb0);
  box-shadow: 0 8px 22px rgba(122, 82, 6, 0.18);
  font-family: "Lora", Georgia, serif; font-size: 13.5px; color: #5b4a2a; line-height: 1.5;
}
.note .note-pin {
  position: absolute; top: -8px; left: 50%; transform: translateX(-50%);
  width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #d98a2b, #a4611a);
  box-shadow: 0 2px 4px rgba(0,0,0,0.25);
}

/* pre-placed sticker */
.sticker {
  width: 96px; height: 96px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 46px;
  background: radial-gradient(circle at 35% 30%, #fffaf0, #f2e2c4);
  box-shadow: 0 10px 26px rgba(122, 82, 6, 0.20);
}

/* the star: a composed verse card landing on the canvas */
.verse-card {
  width: 320px; background: #fffdf7;
  border: 1px solid var(--line); border-radius: 16px;
  padding: 24px 22px 12px; text-align: center;
  box-shadow: 0 16px 44px rgba(122, 82, 6, 0.20);
  animation: land 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.25);
}
@keyframes land {
  from { transform: translateY(-26px) scale(0.9) rotate(-2deg); opacity: 0; }
  to { opacity: 1; }
}
.verse-text { font-family: "Lora", Georgia, serif; font-size: 16px; line-height: 1.55; margin-bottom: 10px; }
.verse-ref { font-weight: 700; color: var(--gold-deep); font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 10px; }
.card-caption { font-size: 12px; color: #6b5a44; font-style: italic; margin-bottom: 12px; }
.card-credit { font-size: 8.5px; color: #b6a888; margin-bottom: 10px; }
.card-actions { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.ghost {
  font: inherit; font-size: 11px; padding: 6px 11px;
  background: none; border: 1.5px solid var(--line); border-radius: 9px; cursor: pointer; color: var(--ink);
}
.ghost:hover { border-color: var(--gold); background: rgba(182,116,29,0.05); }
.ghost.primary { border-color: var(--gold); color: var(--gold-deep); font-weight: 700; }

/* ---------- compose FAB ---------- */
.compose-fab {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 45;
  display: flex; align-items: center; gap: 8px;
  font: inherit; font-weight: 700; font-size: 16px; color: #fff;
  padding: 14px 26px; border: none; border-radius: 999px; cursor: pointer;
  background: linear-gradient(135deg, var(--gold-light), var(--gold), var(--gold-deep));
  box-shadow: 0 10px 30px rgba(182, 116, 29, 0.45);
  transition: transform 0.15s, box-shadow 0.2s;
}
.compose-fab:hover { transform: translateX(-50%) translateY(-2px); box-shadow: 0 14px 36px rgba(182,116,29,0.55); }
.compose-fab .fab-mark { font-size: 18px; }

/* ---------- compose sheet ---------- */
.scrim {
  position: fixed; inset: 0; z-index: 48; background: rgba(40, 28, 12, 0.28); backdrop-filter: blur(2px);
}
.sheet {
  position: fixed; z-index: 50; right: 20px; bottom: 20px;
  width: 400px; max-width: calc(100vw - 40px); max-height: 78vh;
  display: flex; flex-direction: column;
  background: #fff8f3; border: 1px solid var(--line); border-radius: 20px;
  box-shadow: 0 24px 70px rgba(60, 40, 12, 0.35);
  animation: sheetUp 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.1);
  overflow: hidden;
}
@keyframes sheetUp { from { transform: translateY(20px); opacity: 0; } to { opacity: 1; } }
.sheet-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
  padding: 16px 18px 12px; border-bottom: 1px solid var(--line);
}
.sheet-head h2 { font-family: "Hammersmith One", sans-serif; font-size: 16px; font-weight: 400; }
.sheet-head p { font-size: 11.5px; color: #6b5a44; margin-top: 3px; line-height: 1.4; }
.sheet-close {
  font: inherit; font-size: 14px; width: 30px; height: 30px; flex: 0 0 auto;
  border: 1px solid var(--line); border-radius: 50%; background: #fff; cursor: pointer; color: var(--gold-deep);
}

.thread { flex: 1; min-height: 0; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 9px; }
.msg { max-width: 88%; padding: 9px 13px; border-radius: 15px; font-size: 13px; line-height: 1.5; }
.msg.assistant { background: var(--parchment); border: 1px solid var(--line); border-bottom-left-radius: 4px; align-self: flex-start; }
.msg.user { background: var(--gold); color: #fff; border-bottom-right-radius: 4px; align-self: flex-end; }
.msg.thinking { color: #9a8a70; font-style: italic; }
.msg .ref-pill {
  display: inline-block; margin-top: 6px; font-size: 10.5px; font-weight: 700;
  color: var(--gold-deep); background: #fff8f3; border: 1px solid var(--line);
  border-radius: 999px; padding: 2px 9px; letter-spacing: 0.05em;
}
.starters { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 11px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); background: #fff8f3; cursor: pointer; }
.chip:hover { border-color: var(--gold); }

.composer { flex: 0 0 auto; display: flex; gap: 8px; align-items: flex-end; padding: 10px; border-top: 1px solid var(--line); }
.composer textarea {
  flex: 1; padding: 10px 12px; font: inherit; font-size: 13px;
  border: 1.5px solid var(--line); border-radius: 12px; background: #fff; resize: none; max-height: 100px;
}
.composer textarea:focus { outline: none; border-color: var(--gold); }
.send { width: 40px; height: 40px; border-radius: 50%; border: none; background: var(--gold); color: #fff; font-size: 17px; cursor: pointer; }
.send:hover { background: var(--gold-deep); }
.send:disabled { opacity: 0.5; cursor: wait; }

/* ---------- footer ---------- */
.foot {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 35;
  text-align: center; font-size: 10px; color: #a8987e;
  padding: 7px 16px; background: rgba(255,250,244,0.7); backdrop-filter: blur(6px);
  border-top: 1px solid var(--line);
}
.foot b { color: var(--gold-deep); }

@media (max-width: 640px) {
  .brand-sub, .powered { display: none; }
  .sheet { right: 12px; left: 12px; width: auto; }
}

/* ============ view nav ============ */
.nav { display: flex; gap: 4px; }
.nav-btn {
  font: inherit; font-size: 13px; font-weight: 600; color: #8a7355;
  padding: 7px 14px; border: none; border-radius: 999px; background: none; cursor: pointer;
  display: flex; align-items: center; gap: 6px; transition: background 0.15s, color 0.15s;
}
.nav-btn:hover { color: var(--gold-deep); background: rgba(182,116,29,0.06); }
.nav-btn.active { color: #fff; background: var(--gold); }
.nav-count {
  font-size: 10px; font-weight: 700; min-width: 16px; height: 16px; padding: 0 4px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; background: rgba(255,255,255,0.28);
}
.nav-btn:not(.active) .nav-count { background: var(--gold); color: #fff; }

/* views share the area under the top bar */
.view { position: absolute; inset: 56px 0 0 0; }
.view[hidden] { display: none; }

/* ============ Sermon Deck view ============ */
.deck-view { background: linear-gradient(180deg, #fdf8f3, #f7ede2); overflow-y: auto; }
.deck-empty, .reflect-empty {
  position: absolute; top: 46%; left: 50%; transform: translate(-50%, -50%);
  text-align: center; color: #a8987e; max-width: 420px; padding: 0 20px;
}
.deck-empty .hint-mark, .reflect-empty .hint-mark { font-size: 38px; color: var(--gold); display: block; margin-bottom: 8px; }
.deck-empty p, .reflect-empty p { font-size: 14px; margin: 4px 0; }
.deck-empty .hint-sub, .reflect-empty .hint-sub { font-size: 12.5px; color: #b6a888; }
.deck-empty b, .reflect-empty b { color: var(--gold-deep); }

.deck-stage { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 30px 20px 90px; }
.slide {
  width: min(760px, 92vw); aspect-ratio: 16 / 9; border-radius: 20px;
  background: radial-gradient(120% 90% at 75% 12%, #fff6df 0%, #fffdf7 45%, #f4e7cf 100%);
  border: 1px solid var(--line); box-shadow: 0 20px 60px rgba(122, 82, 6, 0.22);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 6% 8%; position: relative;
}
.slide .slide-verse { font-family: "Lora", Georgia, serif; font-size: clamp(18px, 3.4vw, 34px); line-height: 1.4; color: #2b2118; margin-bottom: 18px; }
.slide .slide-ref { font-family: "Hammersmith One", sans-serif; font-size: clamp(13px, 1.8vw, 18px); letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold-deep); }
.slide .slide-caption { font-family: "Lora", serif; font-style: italic; font-size: clamp(12px, 1.6vw, 16px); color: #6b5a44; margin-top: 14px; }
.slide .slide-mark { position: absolute; top: 20px; left: 24px; color: var(--gold); font-size: 20px; }
.deck-controls { display: flex; align-items: center; gap: 16px; }
.slide-counter { font-size: 13px; font-weight: 700; color: var(--gold-deep); letter-spacing: 0.06em; }
.deck-rail { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; max-width: 760px; }
.deck-thumb {
  width: 92px; aspect-ratio: 16/9; border-radius: 8px; cursor: pointer;
  background: #fffdf7; border: 2px solid var(--line); overflow: hidden;
  font-family: "Lora", serif; font-size: 7px; color: #6b5a44; padding: 6px; line-height: 1.2;
  display: flex; flex-direction: column; justify-content: center; text-align: center;
}
.deck-thumb.active { border-color: var(--gold); box-shadow: 0 4px 12px rgba(182,116,29,0.25); }
.deck-thumb .thumb-ref { font-family: "Hammersmith One", sans-serif; font-size: 7px; color: var(--gold-deep); margin-top: 3px; text-transform: uppercase; }

/* ============ Reflections view ============ */
.reflect-view { background: linear-gradient(180deg, #fdf8f3, #f7ede2); overflow-y: auto; padding-bottom: 90px; }
.reflect-head { padding: 24px 24px 8px; max-width: 720px; margin: 0 auto; }
.reflect-head h2 { font-family: "Hammersmith One", sans-serif; font-size: 22px; color: var(--ink); }
.reflect-head p { font-size: 12.5px; color: #6b5a44; margin-top: 4px; }
.reflect-list { max-width: 720px; margin: 0 auto; padding: 8px 20px; display: flex; flex-direction: column; gap: 12px; }
.reflection {
  background: #fff8f3; border: 1px solid var(--line); border-left: 4px solid var(--gold);
  border-radius: 12px; padding: 14px 16px; box-shadow: 0 6px 18px rgba(122,82,6,0.08);
}
.reflection .r-intent { font-size: 13px; color: #6b5a44; }
.reflection .r-intent b { color: var(--ink); }
.reflection .r-verse { font-family: "Lora", Georgia, serif; font-size: 15px; color: #2b2118; margin: 8px 0 4px; line-height: 1.5; }
.reflection .r-ref { font-weight: 700; color: var(--gold-deep); font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; }
.reflection .r-reply { font-size: 12.5px; color: #6b5a44; font-style: italic; margin-top: 8px; }
.reflection .r-time { font-size: 10px; color: #b6a888; margin-top: 8px; }

/* ============ top-bar links + info button ============ */
.link-btn {
  font-size: 15px; line-height: 1; text-decoration: none;
  width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--line); border-radius: 9px; background: #fff8f3; cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
}
.link-btn:hover { border-color: var(--gold); transform: translateY(-1px); }
.soon {
  font-size: 10px; font-weight: 700; color: #a8987e; letter-spacing: 0.04em;
  border: 1px dashed var(--line); border-radius: 999px; padding: 4px 8px; white-space: nowrap;
}
.info-btn {
  width: 30px; height: 30px; border-radius: 50%; border: none; cursor: pointer;
  font: inherit; font-weight: 700; font-size: 15px; color: #fff;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  box-shadow: 0 3px 10px rgba(182,116,29,0.35);
}
.info-btn:hover { background: var(--gold-deep); }

/* ============ info modal ============ */
.info-scrim { position: fixed; inset: 0; z-index: 60; background: rgba(40,28,12,0.42); backdrop-filter: blur(3px); }
.info-scrim[hidden], .info-modal[hidden] { display: none; }
.info-modal {
  position: fixed; z-index: 62; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(560px, calc(100vw - 40px)); max-height: 86vh; overflow-y: auto;
  background: #fff8f3; border: 1px solid var(--line); border-radius: 20px;
  padding: 30px 30px 26px; box-shadow: 0 30px 80px rgba(60,40,12,0.4);
  animation: sheetUp 0.3s cubic-bezier(0.2,0.9,0.3,1.1);
}
.info-close {
  position: absolute; top: 16px; right: 16px; width: 30px; height: 30px;
  border: 1px solid var(--line); border-radius: 50%; background: #fff; cursor: pointer;
  font: inherit; font-size: 14px; color: var(--gold-deep);
}
.info-modal h2 { font-family: "Hammersmith One", sans-serif; font-size: 20px; font-weight: 400; color: var(--ink); line-height: 1.3; margin-bottom: 14px; padding-right: 30px; }
.info-modal p { font-size: 14px; line-height: 1.6; color: #4a3f30; margin-bottom: 12px; }
.info-modal ul { margin: 0 0 12px; padding-left: 20px; }
.info-modal li { font-size: 13.5px; line-height: 1.55; color: #4a3f30; margin-bottom: 5px; }
.info-modal b { color: var(--gold-deep); }
.info-status { font-weight: 700; color: var(--gold-deep) !important; font-size: 13px !important; padding: 10px 0; border-top: 1px solid var(--line); margin-top: 6px; }
.info-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.info-cta {
  flex: 1; min-width: 180px; text-align: center; text-decoration: none;
  font-weight: 700; font-size: 14px; color: #fff; padding: 12px 18px; border-radius: 12px;
  background: linear-gradient(135deg, var(--gold-light), var(--gold), var(--gold-deep));
}
.info-cta:hover { filter: brightness(1.05); }
.info-cta.ghost-cta { background: #1a1a1a; }

@media (max-width: 720px) { .soon, .powered { display: none; } }
