:root {
  color-scheme: dark;
  --bg: #0d0c0a;
  --panel: #171510;
  --panel-strong: #211d14;
  --gold: #c9a24b;
  --gold-soft: #f1d88a;
  --text: #f5efe2;
  --muted: #b7aa92;
  --line: rgba(201, 162, 75, 0.22);
  --danger: #d78b63;
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.38);
  --serif: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Aptos Display", "Segoe UI Variable Display", "Gill Sans", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(201, 162, 75, 0.18), transparent 28rem),
    radial-gradient(circle at 100% 12%, rgba(241, 216, 138, 0.1), transparent 22rem),
    linear-gradient(145deg, #080705 0%, var(--bg) 42%, #14110b 100%);
  color: var(--text);
  font-family: var(--sans);
}

button,
input {
  font: inherit;
}

.app-root {
  width: min(100%, 980px);
  margin: 0 auto;
}

.boot-message {
  min-height: 100vh;
  display: grid;
  place-items: center;
  color: var(--gold-soft);
}

.kratos-shell {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  padding: 28px clamp(18px, 4vw, 42px) 48px;
  overflow: hidden;
}

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(8px);
  pointer-events: none;
}

.ambient-one {
  width: 360px;
  height: 360px;
  top: -120px;
  left: -120px;
  background: radial-gradient(circle, rgba(201, 162, 75, 0.24), transparent 68%);
}

.ambient-two {
  width: 260px;
  height: 260px;
  right: -80px;
  bottom: 10%;
  background: radial-gradient(circle, rgba(241, 216, 138, 0.12), transparent 70%);
}

.topbar,
.control-panel,
.day-hero,
.sequence-card,
.moon-card,
.quote-card,
.calendar-card,
.editorial-note {
  backdrop-filter: blur(18px);
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.6rem, 9vw, 5.4rem);
  line-height: 0.85;
  letter-spacing: 0.08em;
}

.eyebrow,
.section-kicker {
  margin: 0;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.preview-badge,
.content-status {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--gold-soft);
  background: rgba(23, 21, 16, 0.72);
  font-size: 0.78rem;
}

.control-panel {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto;
  gap: 10px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 12px;
  background: rgba(23, 21, 16, 0.64);
  box-shadow: var(--shadow);
}

.date-control {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
}

.date-control input,
.ghost-button,
.screen-awake-button,
.segmented,
.language-toggle {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(13, 12, 10, 0.8);
  color: var(--text);
}

.date-control input {
  width: 100%;
  min-height: 42px;
  padding: 0 14px;
}

.ghost-button {
  min-height: 42px;
  padding: 0 16px;
  color: var(--gold-soft);
  cursor: pointer;
}

.screen-awake-control {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  border: 1px solid rgba(201, 162, 75, 0.18);
  border-radius: 20px;
  padding: 10px;
  background: rgba(13, 12, 10, 0.48);
}

.screen-awake-button {
  min-height: 40px;
  padding: 0 16px;
  color: var(--gold-soft);
  cursor: pointer;
}

.screen-awake-control.is-enabled .screen-awake-button {
  background: linear-gradient(135deg, rgba(201, 162, 75, 0.28), rgba(241, 216, 138, 0.18));
  color: var(--text);
}

.screen-awake-control p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.segmented,
.language-toggle {
  grid-column: 1 / -1;
  display: flex;
  gap: 6px;
  padding: 5px;
}

.segmented button,
.language-toggle button {
  flex: 1;
  min-height: 36px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.segmented button.active,
.language-toggle button.active {
  background: linear-gradient(135deg, rgba(201, 162, 75, 0.24), rgba(241, 216, 138, 0.16));
  color: var(--gold-soft);
}

.day-hero {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(18px, 6vw, 44px);
  align-items: center;
  min-height: 260px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 34px;
  padding: clamp(24px, 6vw, 52px);
  background:
    linear-gradient(145deg, rgba(33, 29, 20, 0.84), rgba(13, 12, 10, 0.72)),
    radial-gradient(circle at 18% 50%, rgba(201, 162, 75, 0.16), transparent 18rem);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.day-orbit {
  position: absolute;
  inset: 24px;
  border: 1px solid rgba(201, 162, 75, 0.11);
  border-radius: 50%;
  transform: translateX(-42%);
}

.day-number {
  position: relative;
  font-family: var(--serif);
  font-size: clamp(6.8rem, 31vw, 14rem);
  line-height: 0.78;
  color: var(--gold-soft);
  text-shadow: 0 20px 42px rgba(0, 0, 0, 0.42);
}

.day-copy {
  position: relative;
  min-width: 0;
}

.month-line {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: clamp(1.05rem, 4vw, 1.8rem);
  font-weight: 800;
  letter-spacing: 0.18em;
}

.year-line {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2rem, 8vw, 4rem);
}

.secondary-date,
.month-meaning {
  margin: 10px 0 0;
  color: var(--muted);
}

.moon-card {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 28px;
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 18px;
  background: rgba(23, 21, 16, 0.72);
}

.sequence-card {
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 20px;
  background:
    linear-gradient(135deg, rgba(201, 162, 75, 0.13), rgba(13, 12, 10, 0.7)),
    rgba(23, 21, 16, 0.72);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.2);
}

.sequence-card h2 {
  margin: 8px 0 0;
  font-family: var(--serif);
  font-size: clamp(1.55rem, 5vw, 2.8rem);
  line-height: 1.05;
}

.sequence-card p:not(.section-kicker) {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.sequence-card span {
  display: inline-flex;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 11px;
  color: var(--gold-soft);
  background: rgba(13, 12, 10, 0.55);
  font-size: 0.78rem;
}

.moon-icon {
  display: grid;
  width: 74px;
  height: 74px;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(241, 216, 138, 0.18), rgba(201, 162, 75, 0.08));
  color: var(--gold-soft);
  font-size: 2.6rem;
}

.moon-card p:last-child {
  margin: 6px 0 0;
  color: var(--muted);
}

.section-block {
  margin-top: 28px;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.status-draft {
  color: var(--danger);
}

.status-reviewed {
  color: var(--gold-soft);
}

.status-ready {
  color: #9ed08e;
}

.quote-grid,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.quote-card,
.calendar-card {
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 20px;
  background: linear-gradient(160deg, rgba(23, 21, 16, 0.92), rgba(13, 12, 10, 0.88));
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.22);
  animation: rise 520ms ease both;
  animation-delay: var(--delay, 0ms);
}

.quote-text {
  margin: 12px 0 0;
  font-family: var(--serif);
  font-size: clamp(1.08rem, 2.4vw, 1.38rem);
  line-height: 1.42;
}

.section-order {
  color: var(--gold-soft);
}

.calendar-value {
  margin: 10px 0 0;
  font-family: var(--serif);
  font-size: 1.22rem;
}

.calendar-explanation {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.editorial-note {
  margin-top: 26px;
  border-left: 2px solid var(--gold);
  padding: 10px 0 10px 16px;
  color: var(--muted);
  font-size: 0.92rem;
}

.editorial-note p {
  margin: 0 0 6px;
}

.editorial-note a,
.legal-back {
  color: var(--gold-soft);
}

.widget-preview-shell {
  width: min(100%, 540px);
  min-height: 100vh;
  display: grid;
  align-content: center;
  gap: 18px;
  margin: 0 auto;
  padding: 28px 18px;
}

.daily-widget-card {
  position: relative;
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 18px;
  min-height: 260px;
  border: 1px solid var(--line);
  border-radius: 36px;
  padding: 22px;
  background:
    radial-gradient(circle at 8% 10%, rgba(241, 216, 138, 0.22), transparent 12rem),
    linear-gradient(145deg, rgba(33, 29, 20, 0.94), rgba(13, 12, 10, 0.94));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.daily-widget-card::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  right: -74px;
  bottom: -82px;
  border: 1px solid rgba(201, 162, 75, 0.18);
  border-radius: 50%;
}

.daily-widget-mark {
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  border: 1px solid rgba(201, 162, 75, 0.28);
  border-radius: 24px;
  background: rgba(13, 12, 10, 0.56);
}

.daily-widget-mark span {
  color: var(--gold-soft);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  writing-mode: vertical-rl;
}

.daily-widget-body {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.daily-widget-kicker,
.daily-widget-subtitle,
.daily-widget-chapter,
.widget-preview-note {
  margin: 0;
  color: var(--muted);
}

.daily-widget-kicker {
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.daily-widget-card h1 {
  margin: 10px 0 6px;
  font-family: var(--serif);
  font-size: clamp(2.1rem, 10vw, 3.8rem);
  line-height: 0.95;
  letter-spacing: 0.01em;
}

.daily-widget-subtitle {
  font-size: 0.92rem;
}

.daily-widget-chapter {
  margin-top: 16px;
  color: var(--gold-soft);
  font-size: 0.92rem;
}

.daily-widget-text {
  margin: 14px 0 0;
  font-family: var(--serif);
  font-size: clamp(1.04rem, 4vw, 1.28rem);
  line-height: 1.36;
}

.widget-preview-note {
  border-left: 2px solid var(--gold);
  padding-left: 12px;
  font-size: 0.92rem;
  line-height: 1.5;
}

.legal-page {
  width: min(100%, 780px);
  margin: 0 auto;
  padding: 42px 18px 72px;
  line-height: 1.65;
}

.legal-page h1 {
  margin: 18px 0 24px;
  letter-spacing: 0.03em;
  line-height: 1;
}

.legal-page h2 {
  margin: 28px 0 8px;
  color: var(--gold);
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.legal-page p {
  color: var(--muted);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 720px) {
  .kratos-shell {
    padding: 22px 14px 34px;
  }

  .control-panel,
  .day-hero,
  .quote-grid,
  .calendar-grid {
    grid-template-columns: 1fr;
  }

  .day-hero {
    min-height: auto;
  }

  .day-orbit {
    transform: translate(-28%, -28%);
  }

  .day-number {
    font-size: clamp(7rem, 42vw, 10rem);
  }

  .daily-widget-card {
    grid-template-columns: 1fr;
  }

  .daily-widget-mark span {
    writing-mode: horizontal-tb;
  }
}
