:root {
  --font-serif: "Fraunces", Georgia, Cambria, "Times New Roman", serif;
  --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --color-orthe-green: #42a62a;
  --color-orthe-green-dark: #2c7a1d;
  --color-arrigans-blue: #009ee0;
  --color-arrigans-blue-dark: #0070a3;
}

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

html,
body,
#root {
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

html {
  font-family: var(--font-sans);
  background-color: #f7fafa;
  color: #152026;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

.app-shell {
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  background-color: #f7fafa;
  color: #152026;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  user-select: none;
}

/* Top signature stripe */
.top-stripe {
  height: 4px;
  width: 100%;
  flex-shrink: 0;
  background: linear-gradient(90deg, #42a62a 0%, #009ee0 50%, #0070a3 100%);
}

/* Masthead */
.masthead {
  flex-shrink: 0;
  padding: 2.8vh 4.5vw 2.2vh;
  border-bottom: 1px solid #dce6e9;
  background-color: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1.2vw;
  flex-shrink: 0;
}

.brand-logo {
  height: clamp(2.4rem, 4.6vh, 3.6rem);
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.brand-name {
  font-family: var(--font-sans);
  font-size: clamp(1.1rem, 1.5vw, 1.7rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  color: #152026;
  white-space: nowrap;
}

.date-cluster {
  display: flex;
  align-items: baseline;
  gap: 1.4vw;
  white-space: nowrap;
}

.header-date {
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 2.1vw, 2.35rem);
  font-weight: 500;
  color: #0070a3;
  white-space: nowrap;
}

.date-sep {
  color: #bdd0d6;
  font-size: clamp(1.2rem, 1.8vw, 2rem);
}

.header-week {
  font-family: var(--font-sans);
  font-size: clamp(1.15rem, 1.6vw, 1.85rem);
  font-weight: 500;
  color: #2c7a1d;
  white-space: nowrap;
}

.header-clock {
  font-family: var(--font-mono);
  font-size: clamp(1.35rem, 2vw, 2.25rem);
  font-weight: 500;
  color: #2c7a1d;
  white-space: nowrap;
}

/* Main stage */
.stage {
  flex: 1;
  min-height: 0;
  padding: 4vh 4.5vw;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.stage-inner {
  width: 100%;
  height: 100%;
  max-width: 1760px;
  margin: 0 auto;
}

.slide-container {
  width: 100%;
  height: 100%;
}

.slide-container.is-entering {
  animation: slide-fade-in 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.slide-container.is-exiting {
  animation: slide-fade-out 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slide-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slide-fade-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-14px);
  }
}

@keyframes block-reveal {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes rule-reveal {
  from {
    opacity: 0;
    transform: scaleX(0);
  }
  to {
    opacity: 1;
    transform: scaleX(1);
  }
}

.anim-block {
  opacity: 0;
  animation: block-reveal 0.62s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.anim-rule {
  opacity: 0;
  transform-origin: left center;
  animation: rule-reveal 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.delay-1 { animation-delay: 0.09s; }
.delay-2 { animation-delay: 0.18s; }
.delay-3 { animation-delay: 0.27s; }
.delay-4 { animation-delay: 0.36s; }
.delay-5 { animation-delay: 0.45s; }

/* History slide */
.history-grid {
  height: 100%;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 4vw;
  align-items: center;
}

.history-left {
  grid-column: span 4 / span 4;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.history-day-label {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 3.1vw, 3.5rem);
  font-weight: 500;
  line-height: 1.25;
  color: #2c7a1d;
}

.history-year {
  margin-top: 1.8vh;
  font-family: var(--font-serif);
  font-size: clamp(5.5rem, 10.5vw, 12rem);
  font-weight: 500;
  line-height: 0.88;
  letter-spacing: -0.025em;
  color: #0070a3;
}

.history-left-rule {
  margin-top: 3.8vh;
  height: 2px;
  width: 100%;
  background: linear-gradient(90deg, #42a62a 0%, #009ee0 50%, #dce6e9 100%);
}

.history-card {
  grid-column: span 8 / span 8;
  background-color: #ffffff;
  border: 1px solid #dce6e9;
  padding: 5vh 3.6vw;
}

.history-title {
  font-family: var(--font-serif);
  font-size: clamp(2.3rem, 3.9vw, 4.5rem);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.025em;
  color: #152026;
}

.history-card-rule {
  margin: 3.2vh 0;
  height: 2px;
  width: 7rem;
  background: linear-gradient(90deg, #42a62a 0%, #009ee0 100%);
}

.history-summary {
  font-size: clamp(1.45rem, 2.25vw, 2.55rem);
  line-height: 1.45;
  color: #2b3d45;
  font-weight: 400;
}

/* Astronomy slide */
.astro-shell {
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.astro-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
}

.astro-kicker {
  font-size: clamp(1.15rem, 1.6vw, 1.85rem);
  font-weight: 500;
  color: #2c7a1d;
}

.astro-title {
  margin-top: 0.8vh;
  font-family: var(--font-serif);
  font-size: clamp(2.4rem, 4vw, 4.6rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  color: #152026;
  line-height: 1.08;
}

.astro-daylight {
  font-family: var(--font-mono);
  font-size: clamp(1.5rem, 2.35vw, 2.65rem);
  font-weight: 500;
  color: #0070a3;
  white-space: nowrap;
}

.astro-grid {
  margin-top: 4vh;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 3.2vw;
  align-items: stretch;
}

.astro-solar-card {
  grid-column: span 7 / span 7;
  background-color: #ffffff;
  border: 1px solid #dce6e9;
  padding: 3.8vh 3vw;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.astro-svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.zenith-label {
  fill: #4b616b;
  font-size: 16px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.solar-metrics-row {
  margin-top: 2vh;
  padding-top: 2.4vh;
  border-top: 1px solid #e4ecee;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.solar-metric-center {
  text-align: center;
}

.solar-metric-right {
  text-align: right;
}

.solar-metric-label {
  font-size: clamp(1.05rem, 1.4vw, 1.55rem);
  color: #4b616b;
}

.solar-metric-value {
  margin-top: 0.25rem;
  font-family: var(--font-mono);
  font-size: clamp(1.65rem, 2.6vw, 3rem);
  font-weight: 500;
  color: #152026;
}

.solar-metric-delta {
  margin-top: 0.25rem;
  font-family: var(--font-mono);
  font-size: clamp(1.4rem, 2.1vw, 2.4rem);
  font-weight: 500;
  color: #2c7a1d;
}

.astro-lunar-card {
  grid-column: span 5 / span 5;
  background-color: #ffffff;
  border: 1px solid #dce6e9;
  padding: 4vh 3vw;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.lunar-row {
  display: flex;
  align-items: center;
  gap: 2vw;
}

.lunar-svg {
  flex-shrink: 0;
  width: clamp(3.75rem, 5.5vw, 5.5rem);
  height: clamp(3.75rem, 5.5vw, 5.5rem);
}

.lunar-kicker {
  font-size: clamp(1.05rem, 1.45vw, 1.65rem);
  color: #4b616b;
}

.lunar-name {
  margin-top: 0.25rem;
  font-family: var(--font-serif);
  font-size: clamp(1.65rem, 2.5vw, 2.85rem);
  font-weight: 500;
  line-height: 1.25;
  color: #152026;
}

.lunar-illum {
  margin-top: 0.25rem;
  font-family: var(--font-mono);
  font-size: clamp(1.15rem, 1.6vw, 1.8rem);
  color: #0070a3;
}

.saints-block {
  margin-top: 3vh;
  padding-top: 3vh;
  border-top: 1px solid #e4ecee;
}

.saints-kicker {
  font-size: clamp(1.05rem, 1.45vw, 1.65rem);
  color: #4b616b;
}

.saints-names {
  margin-top: 1vh;
  font-family: var(--font-serif);
  font-size: clamp(1.9rem, 3vw, 3.3rem);
  font-weight: 500;
  line-height: 1.15;
  color: #2c7a1d;
}

/* Footer */
.footer {
  flex-shrink: 0;
  padding: 1.5vh 4.5vw 3vh;
}

.footer-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.4vh;
}

.slide-indicators {
  display: flex;
  align-items: center;
  gap: 1.8vw;
}

.slide-indicator {
  font-size: clamp(0.95rem, 1.25vw, 1.4rem);
  font-weight: 500;
  color: #879ba3;
  transition: color 0.3s ease;
  white-space: nowrap;
}

.slide-indicator.is-active {
  color: #0070a3;
}

.slide-counter {
  font-family: var(--font-mono);
  font-size: clamp(0.95rem, 1.2vw, 1.35rem);
  color: #6c828c;
  white-space: nowrap;
}

.progress-track {
  height: 4px;
  width: 100%;
  background-color: #dce6e9;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 100%;
  transform-origin: left center;
  transform: scaleX(0);
  background: linear-gradient(90deg, #42a62a 0%, #009ee0 100%);
}

@keyframes progress-fill {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
