/* Sky — calm, low-arousal visual language. Soft dusk-sky palette, generous
   spacing, large touch targets, gentle motion. Designed to lower arousal,
   not raise it. */

:root {
  --sky-1: #1a2740;   /* deep dusk */
  --sky-2: #2b3d5c;
  --sky-3: #3d5680;
  --haze: #9fb3d1;
  --mist: #dbe6f5;
  --cloud: #f4f8ff;
  --warm: #f6c98a;    /* horizon glow — used sparingly for "you did it" */
  --accent: #7fb0e6;  /* calm blue */
  --accent-deep: #5a8fce;
  --ink: #eaf1fb;
  --ink-soft: #b9c7de;
  --ok: #8fd6a8;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  --maxw: 560px;
}

* { box-sizing: border-box; }

@media (prefers-reduced-motion: no-preference) {
  .screen { animation: fade 0.4s ease both; }
  .log-line { animation: rise 0.45s ease both; }
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

html, body { margin: 0; height: 100%; }
body {
  font-family: ui-rounded, "SF Pro Rounded", -apple-system, "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(120% 80% at 50% -10%, var(--sky-3) 0%, var(--sky-2) 45%, var(--sky-1) 100%) fixed;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

#app {
  max-width: var(--maxw);
  margin: 0 auto;
  min-height: 100%;
  padding: 22px 20px calc(28px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

.screen { flex: 1; display: flex; flex-direction: column; gap: 20px; }

/* ---------- brand ---------- */
.brand { text-align: center; padding: 26px 0 6px; }
.brand-mark {
  font-size: 44px; line-height: 1;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.3));
}
.brand-name { margin: 8px 0 2px; font-size: 38px; letter-spacing: 1px; font-weight: 700; }
.tagline { margin: 0; color: var(--ink-soft); font-size: 17px; }

/* ---------- card ---------- */
.card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
}
.card-title { margin: 0 0 14px; font-size: 18px; font-weight: 600; }

/* ---------- scenario chooser ---------- */
.scenarios { display: flex; flex-direction: column; gap: 10px; }
.scn-btn {
  display: flex; align-items: center; gap: 14px; text-align: left;
  padding: 14px 16px;
  background: rgba(255,255,255,0.05);
  border: 1.5px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-sm);
  color: var(--ink); cursor: pointer;
  transition: transform .15s ease, border-color .2s ease, background .2s ease;
}
.scn-btn:hover { transform: translateY(-1px); }
.scn-btn.is-active { border-color: var(--accent); background: rgba(127, 176, 230, 0.18); }
.scn-icon { font-size: 28px; line-height: 1; flex: 0 0 auto; }
.scn-text { display: flex; flex-direction: column; gap: 2px; }
.scn-name { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.scn-blurb { font-size: 13px; color: var(--ink-soft); }
.scn-tag {
  font-size: 10.5px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
  color: var(--warm); border: 1px solid rgba(246,201,138,0.5);
  border-radius: 999px; padding: 1px 7px;
}

/* ---------- frequency control ---------- */
.freq { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.freq-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 14px 8px;
  background: rgba(255,255,255,0.05);
  border: 1.5px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  cursor: pointer;
  transition: transform .15s ease, border-color .2s ease, background .2s ease, color .2s ease;
  min-height: 64px;
}
.freq-btn:hover { transform: translateY(-1px); }
.freq-btn.is-active {
  border-color: var(--accent);
  background: rgba(127, 176, 230, 0.18);
  color: var(--ink);
}
.freq-num { font-size: 22px; font-weight: 700; }
.freq-name { font-size: 13px; }
.freq-blurb { margin: 12px 2px 0; color: var(--ink-soft); font-size: 14px; min-height: 2.6em; }

/* ---------- toggle ---------- */
.toggle { display: flex; align-items: center; gap: 12px; margin-top: 18px; font-size: 15px; color: var(--ink-soft); cursor: pointer; }
.toggle input { width: 20px; height: 20px; accent-color: var(--accent); }

/* ---------- buttons ---------- */
.actions { display: flex; flex-direction: column; gap: 12px; margin-top: auto; }
.actions.sticky { position: sticky; bottom: 0; padding-top: 8px; }
.btn {
  font: inherit; font-size: 17px; font-weight: 600;
  padding: 16px 20px; border-radius: 999px; border: none; cursor: pointer;
  transition: transform .12s ease, filter .2s ease, opacity .2s ease;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-primary { background: linear-gradient(180deg, var(--accent) 0%, var(--accent-deep) 100%); color: #0e1626; box-shadow: var(--shadow); }
.btn-ghost { background: rgba(255,255,255,0.07); color: var(--ink); border: 1px solid rgba(255,255,255,0.14); }

.disclaimer { color: var(--haze); font-size: 12.5px; text-align: center; margin: 4px 0 0; }

/* ---------- topbar ---------- */
.topbar { display: flex; align-items: center; gap: 10px; }
.topbar h2 { margin: 0; font-size: 19px; font-weight: 600; }
.back {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.14); background: rgba(255,255,255,0.06);
  color: var(--ink); font-size: 24px; line-height: 1; cursor: pointer;
}
.lede, .now-feel { color: var(--ink-soft); }
.lede { margin: 0; font-size: 15.5px; }

/* ---------- preview timeline ---------- */
.timeline { list-style: none; margin: 4px 0 0; padding: 0; }
.tl-item { position: relative; display: flex; gap: 14px; padding: 0 0 22px 0; }
.tl-item::before {
  content: ""; position: absolute; left: 6px; top: 16px; bottom: -4px;
  width: 2px; background: rgba(255,255,255,0.14);
}
.tl-item:last-child::before { display: none; }
.tl-dot { flex: 0 0 14px; width: 14px; height: 14px; margin-top: 5px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 4px rgba(127,176,230,0.18); z-index: 1; }
.tl-label { margin: 0 0 6px; font-size: 17px; font-weight: 600; }
.tl-feel, .tl-why { margin: 0 0 6px; font-size: 14.5px; }
.tl-feel { color: var(--ink); }
.tl-why { color: var(--ink-soft); }
.tl-feel strong, .tl-why strong { color: var(--accent); font-weight: 600; }

/* ---------- companion ---------- */
.now { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--radius); padding: 20px; }
.now-label { margin: 0 0 8px; font-size: 24px; font-weight: 700; }
.now-feel { margin: 0 0 16px; font-size: 15px; }
.bar { height: 8px; background: rgba(255,255,255,0.10); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent), var(--warm));
  border-radius: 999px; transition: width .25s linear; }

.companion-freq { display: flex; flex-direction: column; gap: 8px; }
.mini-label { font-size: 13px; color: var(--ink-soft); }
.companion-freq .freq-btn { min-height: 52px; padding: 8px; }

.log-wrap { flex: 1; }
.log { display: flex; flex-direction: column; gap: 10px; }
.log-line {
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm); padding: 12px 14px; font-size: 15.5px; margin: 0;
}
.log-line.is-major { border-left-color: var(--warm); background: rgba(246,201,138,0.08); }
.mini-blurb { font-size: 13px; color: var(--ink-soft); }
