/* Inner Weather — calm, cinematic, dark. */
:root {
  --ink: #eef2f8;
  --ink-soft: rgba(238, 242, 248, 0.72);
  --ink-faint: rgba(238, 242, 248, 0.46);
  --bg: #070912;
  --panel: rgba(14, 18, 30, 0.55);
  --line: rgba(255, 255, 255, 0.12);
  --serif: Georgia, 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  background: radial-gradient(120% 100% at 50% -10%, #11162a 0%, #070912 60%, #04050b 100%);
  color: var(--ink);
  font-family: var(--sans);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }

/* ---------- INTRO ---------- */
.intro {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(24px, 6vw, 64px);
  position: relative;
  z-index: 2;
}
.brand {
  letter-spacing: 0.42em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--ink-faint);
  margin-bottom: 30px;
  font-weight: 600;
}
.intro h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(34px, 7vw, 64px);
  line-height: 1.12;
  margin: 0 0 14px;
  letter-spacing: -0.01em;
  background: linear-gradient(180deg, #ffffff 0%, #b9c6e0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.intro .sub {
  color: var(--ink-soft);
  font-size: clamp(15px, 2.4vw, 19px);
  max-width: 30ch;
  margin: 0 auto 38px;
  line-height: 1.5;
}

/* ---------- FORM ---------- */
.mood-form {
  width: min(560px, 100%);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.field {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 6px 6px 6px 20px;
  backdrop-filter: blur(8px);
  transition: border-color 0.25s, background 0.25s, box-shadow 0.25s;
}
.field:focus-within {
  border-color: rgba(160, 185, 230, 0.6);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 4px rgba(120, 150, 220, 0.12);
}
.field input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--ink);
  font-size: 17px;
  font-family: var(--serif);
  padding: 14px 0;
  min-width: 0;
}
.field input::placeholder { color: var(--ink-faint); font-style: italic; }
.go {
  flex: none;
  border: none;
  border-radius: 14px;
  padding: 14px 22px;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--sans);
  color: #0a0d18;
  background: linear-gradient(180deg, #eaf0ff, #b9c8ec);
  cursor: pointer;
  transition: transform 0.15s, filter 0.2s;
  white-space: nowrap;
}
.go:hover { filter: brightness(1.06); transform: translateY(-1px); }
.go:active { transform: translateY(0); }

.tries {
  font-size: 13.5px;
  color: var(--ink-faint);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
}
.tries .lead { margin-right: 2px; }
.chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 5px 13px;
  font-size: 13px;
  font-family: var(--serif);
  font-style: italic;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.15s;
}
.chip:hover { background: rgba(255, 255, 255, 0.12); color: var(--ink); transform: translateY(-1px); }

.reduced-note {
  margin-top: 26px;
  font-size: 12.5px;
  color: var(--ink-faint);
  max-width: 34ch;
}

/* ---------- STAGE (the sky) ---------- */
.stage {
  position: fixed;
  inset: 0;
  z-index: 1;
}
#sky {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: block;
}

/* ---------- READING PANEL ---------- */
.panel {
  position: relative;
  z-index: 3;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(20px, 4vw, 48px);
  pointer-events: none;
}
.panel > * { pointer-events: auto; }

.readout-card {
  width: min(680px, 100%);
  margin: 0 auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  padding: clamp(20px, 3.5vw, 30px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  animation: rise 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: translateY(0); } }

.echo {
  font-family: var(--serif);
  font-size: clamp(20px, 3.6vw, 27px);
  line-height: 1.3;
  margin: 0 0 14px;
  color: #fff;
  letter-spacing: -0.005em;
}

.fc-row {
  display: flex;
  gap: clamp(16px, 3vw, 28px);
  align-items: center;
  flex-wrap: wrap;
}
.forecast {
  flex: 1 1 280px;
  font-size: clamp(14.5px, 2.2vw, 16.5px);
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0;
}
.dial-wrap { flex: none; width: 150px; }
.dial-svg { width: 150px; height: auto; display: block; }
.dial-num { font-family: var(--sans); font-size: 22px; font-weight: 700; fill: #fff; }
.dial-lbl { font-family: var(--sans); font-size: 9px; font-weight: 600; letter-spacing: 0.12em; fill: rgba(255,255,255,0.6); }

.readout {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 13.5px;
  color: var(--ink-faint);
}
.readout b { color: var(--ink); font-weight: 700; font-size: 15px; }

/* ---------- ACTIONS ---------- */
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  border-radius: 13px;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, border-color 0.2s;
  font-family: var(--sans);
}
.btn:hover { background: rgba(255, 255, 255, 0.13); transform: translateY(-1px); }
.btn.primary {
  background: linear-gradient(180deg, #eaf0ff, #b9c8ec);
  color: #0a0d18;
  border-color: transparent;
}
.btn.ghost { background: transparent; }

/* shared-arrival CTA */
.share-cta {
  display: none;
  margin-top: 16px;
  font-size: 13.5px;
  color: var(--ink-soft);
  text-align: center;
}
body.from-share .share-cta { display: block; }
.share-cta b { color: #fff; }

/* ---------- DIARY STRIP ---------- */
.diary {
  width: min(680px, 100%);
  margin: 18px auto 0;
}
.diary h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 15px;
  color: var(--ink-soft);
  margin: 0 0 10px;
  letter-spacing: 0.01em;
}
.strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.strip::-webkit-scrollbar { height: 6px; }
.strip::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.18); border-radius: 99px; }
.tile {
  flex: none;
  position: relative;
  width: 80px;
  height: 100px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  padding: 0;
  cursor: pointer;
  background: #0a0d18;
  transition: transform 0.18s, border-color 0.2s;
}
.tile:hover { transform: translateY(-2px) scale(1.03); border-color: rgba(180,200,240,0.5); }
.tile canvas { width: 100%; height: 100%; display: block; }
.tile-date {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #fff;
  text-align: center;
  padding: 3px 0;
  background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,0.7));
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}

/* ---------- ALMANAC TEASER ---------- */
.almanac {
  width: min(680px, 100%);
  margin: 18px auto 6px;
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-faint);
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 14px;
}
.almanac b { color: var(--ink-soft); }

/* footer */
.foot {
  position: relative;
  z-index: 3;
  text-align: center;
  font-size: 12px;
  color: var(--ink-faint);
  padding: 20px;
}

/* reveal state hides intro scroll */
body.revealed { overflow: auto; }
[hidden] { display: none !important; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 560px) {
  .field { padding: 6px 6px 6px 16px; flex-wrap: wrap; }
  .field input { flex: 1 1 100%; padding: 12px 4px; }
  .go { flex: 1 1 100%; padding: 13px; }
  .fc-row { flex-direction: column-reverse; align-items: stretch; }
  .dial-wrap { width: 130px; margin: 0 auto; }
  .dial-svg { width: 130px; }
  .actions .btn { flex: 1 1 auto; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
