@font-face { font-family: "Cormorant Garamond"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/cormorant-garamond-latin-ext-400-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Cormorant Garamond"; font-weight: 400; font-style: italic; font-display: swap; src: url("fonts/cormorant-garamond-latin-ext-400-italic.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Cormorant Garamond"; font-weight: 500; font-style: normal; font-display: swap; src: url("fonts/cormorant-garamond-latin-ext-500-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Cormorant Garamond"; font-weight: 500; font-style: italic; font-display: swap; src: url("fonts/cormorant-garamond-latin-ext-500-italic.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Cormorant Garamond"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/cormorant-garamond-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-weight: 400; font-style: italic; font-display: swap; src: url("fonts/cormorant-garamond-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-weight: 500; font-style: normal; font-display: swap; src: url("fonts/cormorant-garamond-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-weight: 500; font-style: italic; font-display: swap; src: url("fonts/cormorant-garamond-latin-500-italic.woff2") format("woff2"); }

/* Base */

:root {
  box-sizing: border-box;
  background: #e9845a;
}

html { height: 100%; scroll-behavior: smooth; scroll-padding-top: calc(env(safe-area-inset-top, 0px) + 80px); }

*, *::before, *::after { box-sizing: inherit; }

body {
  margin: 0;
  min-height: 100%;
  background: transparent;
  color: #fff8ee;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

body.over-light { cursor: pointer; }

button { font: inherit; color: inherit; }

.serif, h1, h2, .tagline, .reading, .sky-verse, .loader-title, .sheet-status {
  font-family: "Cormorant Garamond", Georgia, "Times New Roman", serif;
}

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0;
  transition: opacity 1.6s ease;
}

#scene.ready { opacity: 1; }

.topbar, .hero, main, footer { position: relative; z-index: 1; }

/* Header */

.topbar {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  width: min(60rem, calc(100% - 24px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 8px 8px 20px;
  border-radius: 999px;
  background: rgba(24, 14, 12, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
}

.brand {
  color: inherit;
  text-decoration: none;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.controls { display: flex; gap: 8px; align-items: center; }

.segmented {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.segmented[hidden] { display: none; }

.segmented button {
  border: 0;
  background: transparent;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  cursor: pointer;
  opacity: 0.75;
  transition: background 0.3s ease, color 0.3s ease, opacity 0.3s ease, transform 0.15s ease;
}

.segmented button:hover { opacity: 1; }
.segmented button:active { transform: scale(0.94); }

.segmented button[aria-pressed="true"] {
  background: #fff8ee;
  color: #2a1712;
  opacity: 1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

/* Hero */

.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(env(safe-area-inset-top, 0px) + 18vh) 1.5rem calc(env(safe-area-inset-bottom, 0px) + 2.5rem);
  text-align: center;
  text-shadow: 0 2px 24px rgba(40, 15, 10, 0.5);
}

.eyebrow {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.85;
}

.hero h1 {
  margin: 0.4rem 0 0;
  font-weight: 500;
  font-size: clamp(3.4rem, 12vw, 7.5rem);
  letter-spacing: 0.02em;
  line-height: 0.95;
}

.tagline { margin: 0.7rem 0 0; font-style: italic; font-size: clamp(1.3rem, 3.6vw, 1.9rem); }

.sky-chip {
  margin-top: 1.6rem;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(24, 14, 12, 0.28);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  font-size: 0.92rem;
  cursor: pointer;
  text-shadow: none;
  transition: transform 0.2s ease, background 0.3s ease;
}

.sky-chip:hover { background: rgba(24, 14, 12, 0.4); }
.sky-chip:active { transform: scale(0.96); }
.sky-chip:empty, .sky-chip #sky-chip-text:empty { display: none; }

.sky-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ffc46b;
  box-shadow: 0 0 12px #ffb347;
}

.sky-chip.is-night .sky-dot { background: #e8ecf6; box-shadow: 0 0 12px #c9d4ff; }

.hint { margin: 0.9rem 0 0; font-size: 0.85rem; opacity: 0.75; }

.cta {
  margin-top: auto;
  color: inherit;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 12px 22px;
  border-radius: 999px;
  background: rgba(255, 248, 238, 0.14);
  border: 1px solid rgba(255, 248, 238, 0.35);
  transition: background 0.3s ease, transform 0.2s ease;
}

.cta:hover { background: rgba(255, 248, 238, 0.24); }
.cta:active { transform: scale(0.96); }

/* Cards */

.reading, .sky {
  max-width: 44rem;
  width: calc(100% - 2rem);
  margin: 0 auto 6rem;
  padding: 2.75rem 2rem;
  border-radius: 28px;
  background: rgba(30, 16, 13, 0.6);
  border: 1px solid rgba(255, 230, 200, 0.16);
  -webkit-backdrop-filter: saturate(160%) blur(22px);
  backdrop-filter: saturate(160%) blur(22px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25);
}

.reading .eyebrow, .sky .eyebrow { color: #ffc98f; opacity: 1; }
.reading h2, .sky h2 { margin: 0.4rem 0 1.4rem; font-weight: 500; font-size: clamp(2.1rem, 6vw, 3rem); line-height: 1.1; }
.reading p { margin: 0 0 1.2rem; font-size: 1.3rem; line-height: 1.65; }

.reading blockquote, .sky-verse blockquote {
  margin: 1.8rem 0;
  padding-left: 1.2rem;
  border-left: 2px solid #ffc98f;
  font-style: italic;
  font-size: 1.4rem;
  line-height: 1.55;
}

.reading cite, .sky-verse cite {
  display: block;
  margin-top: 0.5rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #ffc98f;
}

a.read-sl {
  display: inline-block;
  margin-top: 0.5rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.85rem;
  font-style: normal;
  color: #ffd9ae;
  text-underline-offset: 4px;
}

/* Sky section */

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

.tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 18px 16px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.07);
  text-align: left;
  cursor: pointer;
  transition: transform 0.25s ease, background 0.3s ease;
}

.tile:hover { background: rgba(255, 255, 255, 0.12); transform: translateY(-2px); }
.tile:active { transform: scale(0.97); }

.tile-icon { width: 26px; height: 26px; border-radius: 50%; }
.tile-icon.sun-up { background: radial-gradient(circle at 50% 70%, #ffd27a 0 45%, transparent 47%), linear-gradient(transparent 60%, rgba(255, 255, 255, 0.5) 60% 64%, transparent 64%); }
.tile-icon.sun-down { background: radial-gradient(circle at 50% 70%, #ff9a5c 0 45%, transparent 47%), linear-gradient(transparent 60%, rgba(255, 255, 255, 0.5) 60% 64%, transparent 64%); }
.tile-icon.moon svg { width: 100%; height: 100%; display: block; }

.tile-label { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.7; }
.tile-value { font-size: 1.35rem; font-weight: 600; font-variant-numeric: tabular-nums; }

.sky-verse blockquote { margin-top: 2.2rem; }
.place-note { margin: 1.4rem 0 0; font-size: 0.85rem; opacity: 0.7; }

/* Archive */

.archive-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 auto 1.6rem;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid rgba(255, 248, 238, 0.3);
  background: rgba(24, 14, 12, 0.35);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  text-shadow: none;
  transition: background 0.3s ease, transform 0.2s ease;
}

.archive-button:hover { background: rgba(24, 14, 12, 0.5); }
.archive-button:active { transform: scale(0.96); }

.archive-icon {
  width: 16px;
  height: 16px;
  border: 1.5px solid currentColor;
  border-radius: 4px;
  background: linear-gradient(currentColor, currentColor) 0 3px / 100% 1.5px no-repeat;
}

.back-today {
  margin: 0 0 1.4rem;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 201, 143, 0.5);
  background: rgba(255, 201, 143, 0.12);
  color: #ffd9ae;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
}

.back-today[hidden] { display: none; }
.back-today:hover { background: rgba(255, 201, 143, 0.22); }
.back-today:active { transform: scale(0.96); }

.archive-sheet { width: min(26rem, 100%); }
.archive-eyebrow { color: #ffc98f; opacity: 1; margin-bottom: 0.6rem; }

.archive-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.8rem; }
.archive-month { margin: 0; font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.7rem; font-weight: 500; }

.archive-arrow {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.1);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.archive-arrow:hover:not(:disabled) { background: rgba(255, 255, 255, 0.2); }
.archive-arrow:active:not(:disabled) { transform: scale(0.92); }
.archive-arrow:disabled { opacity: 0.25; cursor: default; }

.archive-weekdays, .archive-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.archive-weekdays span { text-align: center; font-size: 0.72rem; font-weight: 600; opacity: 0.55; padding-bottom: 4px; text-transform: uppercase; }

.archive-day {
  aspect-ratio: 1 / 1.05;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.08);
  padding: 0;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

button.archive-day:hover { background: rgba(255, 255, 255, 0.18); }
button.archive-day:active { transform: scale(0.93); }
.archive-day.is-locked { background: transparent; opacity: 0.3; cursor: default; }
.archive-day.is-today { border-color: rgba(255, 201, 143, 0.8); }
.archive-day.is-selected { background: #fff8ee; color: #2a1712; }

.archive-number { font-size: 0.95rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.archive-chapter { font-size: 0.58rem; font-weight: 600; opacity: 0.75; white-space: nowrap; }
.archive-hint { margin: 1rem 0; font-size: 0.82rem; opacity: 0.7; }

/* Footer */

footer {
  text-align: center;
  padding: 0 1.5rem calc(env(safe-area-inset-bottom, 0px) + 3rem);
  font-size: 0.82rem;
  opacity: 0.85;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.6);
}

footer p { margin: 0.3rem auto; max-width: 40rem; }

/* Sheet */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0);
  transition: background 0.35s ease;
}

.sheet-backdrop[hidden] { display: none; }
.sheet-backdrop.open { background: rgba(0, 0, 0, 0.35); }

.sheet {
  width: min(24rem, 100%);
  padding: 28px 24px 20px;
  border-radius: 28px;
  background: rgba(36, 20, 16, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: saturate(180%) blur(28px);
  backdrop-filter: saturate(180%) blur(28px);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45);
  transform: translateY(24px) scale(0.96);
  opacity: 0;
  transition: transform 0.45s cubic-bezier(0.2, 0.9, 0.25, 1.15), opacity 0.3s ease;
}

.sheet-backdrop.open .sheet { transform: none; opacity: 1; }

.sheet-status { margin: 0 0 1.2rem; font-size: 1.9rem; line-height: 1.15; font-weight: 500; }
.sheet-rows { margin: 0; }
.sheet-rows div { display: flex; justify-content: space-between; padding: 12px 0; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.sheet-rows dt { opacity: 0.7; }
.sheet-rows dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.sheet-place { margin: 0.8rem 0 1.2rem; font-size: 0.82rem; opacity: 0.7; }

.sheet-close {
  width: 100%;
  padding: 13px;
  border: 0;
  border-radius: 14px;
  background: #fff8ee;
  color: #2a1712;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.sheet-close:active { transform: scale(0.97); }

@media (max-width: 640px) {
  .sheet-backdrop { align-items: flex-end; padding: 0 8px calc(env(safe-area-inset-bottom, 0px) + 8px); }
  .tiles { grid-template-columns: 1fr; }
  .tile { flex-direction: row; align-items: center; gap: 12px; }
  .tile-value { margin-left: auto; font-size: 1.1rem; }
  .reading, .sky { padding: 2rem 1.35rem; border-radius: 24px; }
  .reading p { font-size: 1.2rem; }
  .topbar { padding-left: 16px; }
  .brand { font-size: 1.15rem; }
  .segmented button { padding: 6px 9px; font-size: 0.72rem; }
}

/* Scroll reveals */

.js .reveal { opacity: 0; transform: translateY(40px) scale(0.98); transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1); }
.js .reveal.in { opacity: 1; transform: none; }

/* Loading screen */

.loader { display: none; }

.js .loader {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  background: radial-gradient(ellipse at 50% 70%, #f6c79c 0%, #e9935f 55%, #7a3d2c 100%);
  transition: opacity 1s ease, visibility 1s ease;
}

.loader.done { opacity: 0; visibility: hidden; pointer-events: none; }

.loader p { margin: 0; text-shadow: 0 2px 18px rgba(60, 20, 10, 0.45); }
.loader-title { font-size: clamp(2.2rem, 8vw, 3.6rem); font-weight: 500; letter-spacing: 0.04em; }
.loader-percent { font-size: 1.4rem; font-weight: 300; font-variant-numeric: tabular-nums; }
.loader-track { width: min(16rem, 70vw); height: 2px; background: rgba(255, 244, 230, 0.3); border-radius: 2px; overflow: hidden; }
.loader-bar { height: 100%; background: #fff4e6; transform: scaleX(0); transform-origin: left; transition: transform 0.3s ease; }
.loader-label { font-style: italic; font-size: 1.1rem; opacity: 0.9; font-family: "Cormorant Garamond", Georgia, serif; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  #scene, .js .reveal, .sheet { transition: none; }
}
