:root {
  color-scheme: light;
  --navy: #102E52;
  --navy2: #173F6D;
  --orange: #FFA72B;
  --orangeSoft: #FFF0D7;
  --paper: #FFFDF8;
  --warm: #FBF7EF;
  --ink: #1C2A36;
  --muted: #687583;
  --line: #E6DED2;
  --shadow: 0 16px 48px rgba(16, 46, 82, .12);
  --shadowHover: 0 20px 54px rgba(16, 46, 82, .16);
  --safe: max(16px, env(safe-area-inset-bottom));
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--warm);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: radial-gradient(circle at 15% 0%, rgba(255, 167, 43, .07), transparent 32rem), var(--warm);
  font-family: Nunito, system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.55;
}

a {
  color: var(--navy2);
  text-decoration-color: rgba(23, 63, 109, .35);
  text-decoration-thickness: 1.5px;
  text-underline-offset: .18em;
  transition: color .18s ease, text-decoration-color .18s ease;
}

a:hover {
  color: var(--navy);
  text-decoration-color: var(--orange);
}

.shell {
  width: min(100% - 32px, 1040px);
  margin: auto;
}

.site-header {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand img {
  display: block;
  width: 206px;
  max-width: 54vw;
  height: auto;
}

.icon-button {
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  color: var(--navy);
  font-weight: 900;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.icon-button:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 167, 43, .65);
  background: #fff;
  box-shadow: 0 8px 24px rgba(16, 46, 82, .10);
}

.main {
  padding: 24px 0 20px;
}

.content-col {
  width: min(100%, 760px);
  margin: auto;
}

.hero {
  text-align: center;
  padding: 36px 0 26px;
}

.eyebrow {
  display: inline-block;
  color: #F39A1F;
  font-size: .78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .12em;
  margin-bottom: 12px;
}

h1,
h2,
h3 {
  color: #0B223D;
  line-height: 1.1;
}

h1 {
  font-size: clamp(2.05rem, 6vw, 3.35rem);
  letter-spacing: -.02em;
  margin: .1em 0 .35em;
}

.hero-lead,
.lead-copy {
  font-size: clamp(1.05rem, 3vw, 1.25rem);
  color: var(--muted);
}

.how {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 253, 248, .78);
  margin: 16px 0 30px;
}

.how p {
  margin: .45em 0 0;
}

.muted {
  color: var(--muted);
}

.category-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 18px 0 22px;
}

.category-option input {
  position: absolute;
  opacity: 0;
}

.category-card {
  min-height: 78px;
  padding: 16px 18px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  display: flex;
  gap: 14px;
  align-items: center;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.category-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 167, 43, .55);
  box-shadow: 0 10px 28px rgba(16, 46, 82, .08);
}

.category-card small {
  display: block;
  color: var(--muted);
  margin-top: 2px;
}

.check {
  width: 30px;
  height: 30px;
  border: 2px solid #B9C2CB;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: transparent;
  background: #fff;
  font-weight: 900;
}

.category-option input:checked + .category-card {
  border-color: var(--orange);
  background: linear-gradient(#fffdfc, #fff7e9);
}

.category-option input:checked + .category-card .check {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
}

.category-option input:focus-visible + .category-card {
  outline: 3px solid rgba(23, 63, 109, .22);
  outline-offset: 3px;
}

.primary-button {
  width: 100%;
  min-height: 58px;
  border: 0;
  border-radius: 17px;
  background: var(--navy);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
  padding: 0 20px;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.primary-button:hover:not(:disabled) {
  color: #fff;
  transform: translateY(-1px);
  background: #0B2748;
  box-shadow: 0 12px 30px rgba(16, 46, 82, .18);
}

.primary-button:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: none;
}

.primary-button:disabled {
  opacity: .42;
  cursor: not-allowed;
}

.secondary-link {
  display: block;
  text-align: center;
  font-weight: 800;
  margin-top: 15px;
  color: var(--navy2);
}

.page-head {
  margin-bottom: 26px;
}

.list-grid {
  display: grid;
  gap: 12px;
}

.list-card {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  text-decoration: none;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  color: var(--navy);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.list-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 167, 43, .62);
  background: #fff;
  box-shadow: 0 12px 32px rgba(16, 46, 82, .09);
}

.breadcrumbs {
  font-size: .9rem;
  color: var(--muted);
  margin-bottom: 18px;
}

.breadcrumbs a {
  color: var(--navy2);
  font-weight: 800;
}

.fact-list {
  display: grid;
  gap: 14px;
}

.fact-list article {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  animation: contentIn .34s ease both;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.fact-list article:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 167, 43, .55);
  background: #fff;
  box-shadow: 0 12px 32px rgba(16, 46, 82, .09);
}

.fact-list article h2 {
  font-size: 1.25rem;
  margin-top: 0;
}

.fact-list article a {
  color: var(--navy);
  text-decoration-color: rgba(255, 167, 43, .45);
}

.fact-list article a:hover {
  color: #0B2748;
  text-decoration-color: var(--orange);
}

.fact-card {
  padding: clamp(24px, 5vw, 52px);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 30px;
  box-shadow: var(--shadow);
  animation: contentIn .34s ease both;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.fact-card:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 167, 43, .42);
  box-shadow: var(--shadowHover);
}

.pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pills span,
.tags span {
  background: var(--orangeSoft);
  color: #87500D;
  border-radius: 99px;
  padding: 6px 10px;
  font-weight: 800;
  font-size: .82rem;
}

.fact-lead {
  padding-left: 18px;
  border-left: 4px solid var(--orange);
  font-family: Georgia, serif;
  font-size: clamp(1.16rem, 3.5vw, 1.42rem);
  line-height: 1.6;
  color: #344352;
}

.fact-image {
  margin: 24px 0 28px;
}

.fact-image img {
  display: block;
  width: 100%;
  max-height: 460px;
  object-fit: contain;
  background: #F4EFE7;
  border: 1px solid var(--line);
  border-radius: 18px;
}

.fact-image figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.45;
}

.fact-image figcaption span,
.fact-image figcaption small {
  display: block;
}

.reading {
  font-family: Georgia, serif;
  font-size: clamp(1.05rem, 2.5vw, 1.17rem);
  line-height: 1.78;
}

.reading h2 {
  font-family: Nunito, system-ui, sans-serif;
  margin-top: 34px;
}

.takeaway {
  margin-top: 34px;
  padding: 22px;
  border-radius: 14px;
  background: var(--navy);
  color: #fff;
}

.takeaway small {
  display: block;
  color: #FFD89A;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.takeaway p {
  font-family: Georgia, serif;
  margin: .5em 0 0;
}

.metadata {
  margin-top: 24px;
  color: var(--muted);
}

.fact-feedback {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.fact-feedback button {
  width: 58px;
  min-width: 58px;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #fff;
  color: var(--navy);
  font-size: 1.35rem;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.fact-feedback button:hover,
.fact-feedback button.is-selected {
  border-color: var(--orange);
  background: var(--orangeSoft);
  box-shadow: 0 8px 22px rgba(16, 46, 82, .08);
}

.fact-feedback button:hover {
  transform: translateY(-1px);
}

.tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.sources {
  margin-top: 24px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.button-link {
  display: grid;
  place-items: center;
  text-decoration: none;
  margin-top: 18px;
  color: #fff;
}

.button-link:hover {
  color: #fff;
  text-decoration: none;
}

.history-rating {
  display: inline-flex;
  width: fit-content;
  margin: 0 12px 12px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 900;
}

.history-rating.is-up {
  border-color: rgba(53, 130, 91, .28);
  background: rgba(53, 130, 91, .1);
  color: #256241;
}

.history-rating.is-down {
  border-color: rgba(169, 62, 62, .25);
  background: rgba(169, 62, 62, .09);
  color: #883333;
}

.pagination {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

.pagination a,
.pagination strong {
  min-height: 42px;
  display: grid;
  place-items: center;
}

.pagination a {
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--navy);
  font-weight: 900;
  text-decoration: none;
}

.pagination a:last-child {
  justify-self: end;
}

.fixed-action {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px 16px var(--safe);
  background: linear-gradient(to top, var(--warm) 74%, rgba(251, 247, 239, 0));
  z-index: 15;
}

.fixed-action > div {
  width: min(100%, 720px);
  margin: auto;
}

.action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.install-invite {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(var(--safe) + 76px);
  z-index: 35;
  width: min(100% - 32px, 720px);
  margin: auto;
  padding: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  background: var(--paper);
  border: 1px solid rgba(255, 167, 43, .62);
  border-radius: 18px;
  box-shadow: var(--shadow);
  animation: contentIn .22s ease both;
}

.install-invite strong {
  display: block;
  color: var(--navy);
  font-size: 1.05rem;
}

.install-invite p {
  margin: 4px 36px 0 0;
  color: var(--muted);
}

.install-invite .primary-button {
  min-height: 48px;
  border-radius: 14px;
}

.install-close {
  position: absolute;
  right: 10px;
  top: 8px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
  transition: color .18s ease, background .18s ease, transform .18s ease;
}

.install-close:hover {
  background: var(--orangeSoft);
  color: var(--navy);
  transform: rotate(8deg);
}

.footer {
  padding: 30px 0 38px;
  text-align: center;
  color: var(--muted);
  font-size: .88rem;
}

.menu-drawer {
  position: fixed;
  right: 16px;
  top: 70px;
  z-index: 30;
  width: min(330px, calc(100vw - 32px));
  padding: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.menu-drawer a,
.menu-drawer button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px;
  border: 0;
  background: none;
  color: var(--navy);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
  border-radius: 10px;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}

.menu-drawer a:hover,
.menu-drawer button:hover {
  background: var(--orangeSoft);
  color: var(--navy);
  transform: translateX(2px);
}

.menu-drawer .theme-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-toggle-icon {
  width: 24px;
  color: var(--orange);
  font-size: 1.2rem;
  line-height: 1;
  text-align: center;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --navy: #9DCCFF;
  --navy2: #82B9F0;
  --orange: #FFB44A;
  --orangeSoft: #3A2D1D;
  --paper: #172331;
  --warm: #0E1722;
  --ink: #E7EEF6;
  --muted: #AAB8C6;
  --line: #344657;
  --shadow: 0 16px 48px rgba(0, 0, 0, .3);
  --shadowHover: 0 20px 54px rgba(0, 0, 0, .38);
}

:root[data-theme="dark"] body {
  background: radial-gradient(circle at 15% 0%, rgba(255, 180, 74, .08), transparent 32rem), var(--warm);
}

:root[data-theme="dark"] h1,
:root[data-theme="dark"] h2,
:root[data-theme="dark"] h3 {
  color: #F2F6FA;
}

:root[data-theme="dark"] .brand img {
  filter: invert(1) drop-shadow(0 1px 1px rgba(255, 255, 255, .2));
}

:root[data-theme="dark"] .icon-button:hover,
:root[data-theme="dark"] .list-card:hover,
:root[data-theme="dark"] .fact-list article:hover {
  background: #1D2C3C;
}

:root[data-theme="dark"] .how {
  background: rgba(23, 35, 49, .82);
}

:root[data-theme="dark"] .check,
:root[data-theme="dark"] .fact-feedback button {
  background: #101B27;
}

:root[data-theme="dark"] .category-option input:checked + .category-card {
  background: linear-gradient(#202E3C, #30291F);
}

:root[data-theme="dark"] .primary-button,
:root[data-theme="dark"] .takeaway {
  background: #194E80;
}

:root[data-theme="dark"] .primary-button:hover:not(:disabled) {
  background: #216098;
}

:root[data-theme="dark"] .pills span,
:root[data-theme="dark"] .tags span {
  color: #FFD399;
}

:root[data-theme="dark"] .fact-lead {
  color: #C7D3DF;
}

:root[data-theme="dark"] .fact-image img {
  background: #101B27;
}

:root[data-theme="dark"] .history-rating.is-up {
  color: #8DD5AE;
}

:root[data-theme="dark"] .history-rating.is-down {
  color: #F1A2A2;
}

:root[data-theme="dark"] .fixed-action {
  background: linear-gradient(to top, var(--warm) 74%, rgba(14, 23, 34, 0));
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 34, 61, .42);
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal {
  position: relative;
  width: min(560px, 100%);
  max-height: 85vh;
  overflow: auto;
  background: var(--paper);
  border-radius: 22px;
  padding: 24px;
  animation: contentIn .22s ease both;
}

.modal-close {
  position: absolute;
  right: 14px;
  top: 12px;
  border: 0;
  background: none;
  font-size: 2rem;
  cursor: pointer;
  transition: color .18s ease, transform .18s ease;
}

.modal-close:hover {
  color: var(--orange);
  transform: rotate(8deg);
}

.prose {
  font-family: Georgia, serif;
  font-size: 1.08rem;
}

.prose h1,
.prose h2 {
  font-family: Nunito, system-ui, sans-serif;
}

@keyframes contentIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 620px) {
  .shell {
    width: min(100% - 48px, 1040px);
  }

  .category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .install-invite {
    grid-template-columns: minmax(0, 1fr) 168px;
    align-items: center;
    padding: 18px 52px 18px 20px;
  }

  .install-invite p {
    margin-right: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
