:root {
  --cream: #f8f3ea;
  --paper: #fffdfa;
  --rose-deep: #9e4058;
  --rose-mid: #c97f93;
  --rose-soft: #dfb8c2;
  --rose-pale: #f2e1e4;
  --olive-deep: #596052;
  --olive-mid: #96998a;
  --olive-soft: #c7c9b9;
  --olive-pale: #e9eadf;
  --ink: #30342f;
  --muted: #6b6f67;
  --border: #c9cbbb;
  --shadow: 0 12px 28px rgb(55 58 50 / 10%);
  --radius: 5px;
  --container: 1200px;
}

* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  font-family: "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}
button, input { font: inherit; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { color: inherit; }
.container { width: min(var(--container), calc(100% - 40px)); margin-inline: auto; }

.site-header { background: var(--cream); }
.brand-banner { display: block; width: min(var(--container), 100%); margin-inline: auto; overflow: hidden; }
.brand-banner img { width: 100%; height: auto; }

.main-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--olive-soft);
  border-bottom: 1px solid rgb(89 96 82 / 20%);
  box-shadow: 0 3px 10px rgb(55 58 50 / 5%);
}
.nav-desktop { min-height: 56px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 24px; }
.nav-center { display: flex; align-items: center; justify-content: center; gap: 40px; font-size: 18px; font-weight: 500; }
.nav-link { padding: 16px 0; border: 0; background: transparent; color: inherit; font: inherit; white-space: nowrap; cursor: pointer; }
.nav-link span { margin-left: 3px; font-size: .7em; vertical-align: .08em; }
.nav-link:hover { color: var(--rose-deep); }
.nav-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 13px;
  border: 1px solid var(--rose-deep);
  border-radius: var(--radius);
  background: var(--rose-deep);
  color: white;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.nav-action:hover { background: #8d354d; }
.nav-menu { position: relative; }
.nav-dropdown {
  position: absolute;
  top: calc(100% - 2px);
  left: 50%;
  transform: translateX(-50%);
  width: 230px;
  padding: 8px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.nav-menu--home .nav-dropdown { width: 245px; }
.nav-menu--wheel .nav-dropdown { width: 270px; }
.nav-menu--all .nav-dropdown { width: 190px; }
.nav-dropdown a,
.dropdown-action {
  display: block;
  width: 100%;
  padding: 10px 11px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}
.nav-dropdown a:hover,
.dropdown-action:hover { background: var(--rose-pale); color: var(--rose-deep); }
.nav-mobile { display: none; }

.search-panel { position: sticky; top: 52px; z-index: 35; background: var(--paper); border-bottom: 1px solid var(--olive-soft); box-shadow: 0 8px 18px rgb(55 58 50 / 7%); }
.search-panel__inner { padding: 22px 0 20px; }
.search-form label { display: block; margin-bottom: 8px; font-weight: 700; color: var(--olive-deep); }
.search-row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; }
.search-row input { min-height: 44px; padding: 10px 12px; border: 1px solid var(--olive-mid); border-radius: var(--radius); background: white; outline: none; }
.search-row input:focus { border-color: var(--rose-deep); box-shadow: 0 0 0 2px rgb(158 64 88 / 10%); }
.button { min-height: 42px; padding: 9px 14px; border-radius: var(--radius); cursor: pointer; font-weight: 700; }
.button--primary { border: 1px solid var(--rose-deep); background: var(--rose-deep); color: white; }
.button--secondary { border: 1px solid var(--olive-mid); background: white; color: var(--olive-deep); }
.search-results { margin-top: 14px; display: grid; gap: 7px; }
.search-result { display: block; padding: 9px 10px; border-left: 3px solid var(--rose-soft); background: var(--cream); font-size: 14px; }
.search-empty { color: var(--muted); font-size: 14px; }

.home-section { padding: 54px 0 58px; }
.home-section--day { background: var(--rose-pale); }
.home-section--popular { background: var(--paper); }
.home-section--rubrics { background: var(--olive-pale); }

.story-day { display: grid; grid-template-columns: 56fr 41fr; grid-template-areas: "art copy" "lead lead"; gap: 26px 3%; align-items: start; }
.story-day__art { grid-area: art; }
.story-day__copy { grid-area: copy; padding-top: 4px; }
.story-day__lead { grid-area: lead; margin: 0; padding-top: 2px; font-size: 19px; line-height: 1.65; }
.eyebrow { margin: 0 0 11px; color: var(--rose-deep); font-size: 13px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.rubric-link { display: inline-block; margin-bottom: 10px; color: var(--olive-deep); font-size: 13px; font-weight: 700; }
.story-day h1 { margin: 0 0 12px; font-size: clamp(29px, 3.2vw, 44px); line-height: 1.12; letter-spacing: -.025em; }
.story-day h1 a:hover { color: var(--rose-deep); }
.comments-count { color: var(--muted); font-size: 13px; }

.section-heading { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 22px; }
.section-heading h2 { margin: 0; color: var(--rose-deep); font-size: 30px; line-height: 1.2; }
.popular-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.popular-card { display: grid; align-content: start; gap: 10px; min-width: 0; }
.popular-card:hover { filter: drop-shadow(0 8px 12px rgb(55 58 50 / 10%)); }
.popular-card__title { font-size: 20px; line-height: 1.35; font-weight: 700; }

.art { display: block; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; position: relative; background: linear-gradient(140deg, var(--rose-soft), var(--cream)); }
.art::before, .art::after { content: ""; position: absolute; border-radius: 999px; opacity: .62; filter: blur(.1px); }
.art::before { width: 46%; aspect-ratio: 1; left: 9%; top: 13%; background: rgb(255 253 250 / 55%); border: 1px solid rgb(89 96 82 / 20%); }
.art::after { width: 37%; aspect-ratio: 1; right: 7%; bottom: -9%; background: rgb(89 96 82 / 30%); }
.art--family { background: linear-gradient(135deg, #e6bdc6 0%, #f4e8df 50%, #a6a594 100%); }
.art--rose { background: linear-gradient(135deg, #b85d76, #edd1d7 58%, #ddd6c3); }
.art--pet { background: linear-gradient(135deg, #8f9585, #d9cab7 55%, #bd7c8f); }
.art--office { background: linear-gradient(135deg, #b9bcae, #eee8df 48%, #9f455e); }
.art--family-two { background: linear-gradient(135deg, #d59aad, #f1dfdf 48%, #9a9d8f); }
.art--pet-two { background: linear-gradient(135deg, #8f9484, #f0e7da 50%, #d0a1ae); }
.art--home { background: linear-gradient(135deg, #b8b9aa, #e8ddd0 52%, #b4667c); }
.art--office-two { background: linear-gradient(135deg, #c08a99, #efe5d8 52%, #777d70); }
.art--teen { background: linear-gradient(135deg, #d8aab6, #f4eadf 50%, #9d9f91); }
.art--miracle { background: linear-gradient(135deg, #9ea293, #eadacb 47%, #c77f92); }

.rubrics-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 52px 34px; }
.rubric-block { display: flex; flex-direction: column; min-width: 0; }
.rubric-block h2 { margin: 0 0 15px; color: var(--olive-deep); font-size: 25px; line-height: 1.2; }
.rubric-lead { display: grid; gap: 9px; margin-bottom: 17px; }
.rubric-lead:hover .rubric-lead__title { color: var(--rose-deep); }
.rubric-lead__title { font-size: 19px; line-height: 1.35; font-weight: 700; }
.rubric-lead__text { color: #50554d; font-size: 14px; line-height: 1.5; }
.rubric-list { display: grid; gap: 0; margin-bottom: 15px; }
.rubric-list a { display: grid; gap: 4px; padding: 12px 0; border-top: 1px solid rgb(89 96 82 / 18%); }
.rubric-list strong { font-size: 15px; line-height: 1.35; }
.rubric-list span { color: #5d625a; font-size: 13px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rubric-list a:hover strong { color: var(--rose-deep); }
.rubric-more { margin-top: auto; color: var(--rose-deep); font-size: 14px; font-weight: 700; }

.site-footer { background: var(--rose-soft); border-top: 1px solid rgb(158 64 88 / 15%); }
.site-footer__inner { padding: 30px 0 32px; text-align: center; }
.site-footer__brand { margin: 0 0 11px; color: var(--olive-deep); font-size: 18px; font-weight: 700; }
.footer-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; font-size: 13px; color: var(--olive-deep); }
.footer-nav a:hover { color: var(--rose-deep); }
.site-footer__copy { margin: 12px 0 0; color: #666b62; font-size: 12px; }

.wheel-overlay[hidden] { display: none; }
.wheel-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(circle at 50% 42%, rgb(177 62 94 / 22%), transparent 34%),
    rgb(45 49 44 / 62%);
  backdrop-filter: blur(5px);
}
.wheel-dialog {
  width: min(420px, 100%);
  padding: 34px 30px 30px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 14%, rgb(255 255 255 / 92%), transparent 34%),
    linear-gradient(145deg, #fff7f2 0%, #f6e1e4 48%, #e8eadc 100%);
  border: 3px solid var(--rose-deep);
  border-radius: 18px;
  box-shadow:
    0 0 0 8px rgb(176 65 93 / 14%),
    0 24px 70px rgb(34 36 31 / 38%);
  animation: wheelDialogPulse 1.05s ease-in-out infinite alternate;
}
.wheel-dialog.is-result { animation: none; }
.wheel-icon {
  width: 126px;
  height: 126px;
  margin: 0 auto 22px;
  position: relative;
  border: 8px solid var(--rose-deep);
  border-radius: 50%;
  background: rgb(255 250 244 / 78%);
  box-shadow:
    0 0 0 7px rgb(176 65 93 / 12%),
    0 0 34px rgb(176 65 93 / 28%);
  animation: wheelSpin .52s linear infinite;
}
.wheel-icon::after {
  content: "";
  position: absolute;
  inset: 40px;
  border-radius: 50%;
  background: var(--olive-deep);
  box-shadow: 0 0 0 5px rgb(255 255 255 / 32%);
}
.wheel-icon span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 5px;
  height: 48px;
  transform-origin: 50% 0;
  background: var(--rose-deep);
  border-radius: 3px;
}
.wheel-icon span:nth-child(1){ transform: rotate(0deg); }
.wheel-icon span:nth-child(2){ transform: rotate(60deg); }
.wheel-icon span:nth-child(3){ transform: rotate(120deg); }
.wheel-icon span:nth-child(4){ transform: rotate(180deg); }
.wheel-icon span:nth-child(5){ transform: rotate(240deg); }
.wheel-icon span:nth-child(6){ transform: rotate(300deg); }
.wheel-dialog p { margin: 0; line-height: 1.5; }
.wheel-status {
  min-height: 30px;
  color: var(--rose-deep);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: .01em;
}
.wheel-wisdom {
  margin: 18px 0 0;
  padding: 19px 18px;
  border: 1px solid rgb(89 96 82 / 24%);
  border-radius: 10px;
  background: rgb(255 255 255 / 62%);
  color: var(--olive-deep);
  font-family: "Literata", serif;
  font-size: 19px;
  line-height: 1.55;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 42%);
}
.wheel-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}
.wheel-icon.is-still { animation: none; }

@keyframes wheelSpin {
  to { transform: rotate(360deg); }
}
@keyframes wheelDialogPulse {
  from {
    transform: translateY(0) scale(1);
    box-shadow:
      0 0 0 8px rgb(176 65 93 / 12%),
      0 24px 70px rgb(34 36 31 / 34%);
  }
  to {
    transform: translateY(-2px) scale(1.012);
    box-shadow:
      0 0 0 12px rgb(176 65 93 / 20%),
      0 28px 78px rgb(34 36 31 / 42%);
  }
}

@media (max-width: 900px) {
  .container { width: min(100% - 28px, var(--container)); }
  .nav-desktop { display: none; }
  .nav-mobile { min-height: 54px; display: grid; grid-template-columns: auto 1fr 1fr; align-items: center; gap: 8px; position: relative; }
  .mobile-menu-trigger { width: 38px; min-height: 34px; border: 1px solid var(--olive-deep); border-radius: var(--radius); background: transparent; cursor: pointer; font-size: 18px; }
  .nav-mobile .nav-action { padding-inline: 8px; font-size: 12px; white-space: nowrap; }
  .mobile-menu { position: absolute; top: calc(100% + 1px); left: 0; right: 0; padding: 8px; background: var(--paper); border: 1px solid var(--olive-soft); border-top: 0; box-shadow: var(--shadow); }
  .mobile-menu details + details { border-top: 1px solid rgb(89 96 82 / 14%); }
  .mobile-menu summary { padding: 12px; color: var(--olive-deep); font-weight: 700; cursor: pointer; list-style: none; }
  .mobile-menu summary::-webkit-details-marker { display: none; }
  .mobile-menu summary::after { content: "▾"; float: right; font-size: 12px; }
  .mobile-menu details[open] summary::after { transform: rotate(180deg); }
  .mobile-menu a, .mobile-menu button { display: block; width: 100%; padding: 9px 18px 10px 24px; text-align: left; border: 0; background: transparent; color: inherit; font: inherit; font-size: 13px; cursor: pointer; }
  .mobile-menu a:hover, .mobile-menu button:hover { color: var(--rose-deep); background: var(--rose-pale); }
  .search-panel { top: 54px; }
  .search-row { grid-template-columns: 1fr auto; }
  .search-close { grid-column: 1 / -1; justify-self: start; }
  .home-section { padding: 42px 0 46px; }
  .story-day { grid-template-columns: 1fr; grid-template-areas: "art" "copy" "lead"; gap: 18px; }
  .story-day__copy { padding-top: 0; }
  .story-day h1 { font-size: clamp(29px, 7vw, 38px); }
  .story-day__lead { font-size: 18px; }
  .popular-grid { grid-template-columns: 1fr; gap: 16px; }
  .popular-card:first-child { gap: 9px; }
  .popular-card:not(:first-child) { grid-template-columns: 132px 1fr; grid-template-areas: "art title" "art comments"; align-items: start; gap: 4px 13px; }
  .popular-card:not(:first-child) .art { grid-area: art; }
  .popular-card:not(:first-child) .popular-card__title { grid-area: title; font-size: 16px; }
  .popular-card:not(:first-child) .comments-count { grid-area: comments; }
  .rubrics-grid { grid-template-columns: 1fr; gap: 44px; }
}

@media (max-width: 520px) {
  .container { width: calc(100% - 24px); }
  .nav-mobile { grid-template-columns: 36px 1fr 1fr; gap: 6px; }
  .nav-mobile .nav-action { font-size: 11px; padding: 7px 6px; }
  .home-section { padding: 34px 0 38px; }
  .section-heading h2 { font-size: 26px; }
  .popular-card:not(:first-child) { grid-template-columns: 106px 1fr; }
  .rubric-block h2 { font-size: 23px; }
  .rubric-lead__title { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .wheel-icon { animation-duration: 1.5s; }
}
