:root {
  --max-width: 1060px;
  --article-width: 720px;
  --page-pad: 40px;
  --section-gap: 96px;
  --navy: #1a2332;
  --navy-light: #243044;
  --navy-mid: #1e2d3f;
  --amber: #e8a838;
  --teal: #2bb5a0;
  --teal-hover: #25a08d;
  --text-primary: #e0e5eb;
  --text-secondary: #a3afc4;
  --text-muted: #73889e;
  --card-border: rgba(255, 255, 255, 0.07);
  --card-bg: #243044;
  --radius: 12px;
  --motion-ui: 0.45s;
  --motion-reveal: 1s;
  --motion-hero: 1.15s;
  --ease-soft: cubic-bezier(0.22, 1, 0.36, 1);
  --rise-subtle: 12px;
  --nav-height: 72px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--navy);
  color: var(--text-primary);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

.reveal {
  opacity: 0;
  transform: translateY(var(--rise-subtle));
  transition:
    opacity var(--motion-reveal) var(--ease-soft),
    transform var(--motion-reveal) var(--ease-soft);
  transition-delay: var(--reveal-delay, 0s);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .nav {
    animation: gentle-fade 0.9s var(--ease-soft) both;
  }

  .article-header .reveal.is-visible:nth-child(1) { transition-delay: 0.04s; }
  .article-header .reveal.is-visible:nth-child(2) { transition-delay: 0.1s; }
  .article-header .reveal.is-visible:nth-child(3) { transition-delay: 0.16s; }
}

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

@media (prefers-reduced-motion: reduce) {
  .nav { animation: none; }
}

img { max-width: 100%; height: auto; display: block; }

a {
  color: var(--amber);
  text-decoration: none;
  transition: opacity var(--motion-ui) var(--ease-soft);
}

a:hover { opacity: 0.85; }

.frame {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-left: var(--page-pad);
  padding-right: var(--page-pad);
}

.article-shell {
  max-width: var(--article-width);
  margin: 0 auto;
  padding-left: var(--page-pad);
  padding-right: var(--page-pad);
}

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(26, 35, 50, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--card-border);
}

.nav .frame {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--nav-height);
  padding-top: 14px;
  padding-bottom: 18px;
}

.nav-logo img { height: 40px; width: auto; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
}

.nav-links a:hover { color: var(--text-primary); opacity: 1; }

.nav-cta {
  background: var(--teal);
  color: #fff !important;
  padding: 8px 18px;
  border-radius: 6px;
  font-weight: 600;
}

.nav-cta:hover { background: var(--teal-hover); opacity: 1; }

.nav-hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 4px;
}

.nav-hamburger svg { width: 24px; height: 24px; }

.mobile-menu {
  display: none;
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--navy);
  z-index: 99;
  padding: 24px var(--page-pad);
  flex-direction: column;
  gap: 20px;
}

.mobile-menu.open { display: flex; }

.mobile-menu a {
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 500;
}

.article-page {
  padding-top: calc(var(--nav-height) + 48px);
  padding-bottom: var(--section-gap);
}

.article-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 28px;
}

.article-back:hover { color: var(--text-secondary); opacity: 1; }

.article-eyebrow {
  font-family: 'Lora', serif;
  font-style: italic;
  color: var(--amber);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 12px;
  letter-spacing: 0.02em;
}

.article-title {
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}

.article-hero {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 36px;
  border: 1px solid var(--card-border);
  background: var(--navy-mid);
}

.article-hero img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.article-content {
  font-size: 17px;
  color: var(--text-secondary);
  line-height: 1.8;
}

.article-content .reveal + .reveal { margin-top: 2em; }

.article-content p + p { margin-top: 1.25em; }

.article-content .reveal > p:first-child {
  font-size: 19px;
  color: var(--text-primary);
}

.article-content h2 {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
  margin-bottom: 0.85em;
}

.article-references h2 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1em;
}

.article-references ul {
  list-style: none;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.65;
}

.article-references li + li { margin-top: 0.85em; }

.article-end {
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--card-border);
}

.article-author {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.article-author-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--amber);
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
}

.article-author-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.article-author-meta {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 2px;
}

.article-engage {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: space-between;
  align-items: flex-start;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 24px;
}

.article-engage-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.article-rating-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.article-stars {
  display: flex;
  gap: 4px;
}

.article-star {
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-muted);
  transition: color var(--motion-ui) var(--ease-soft), transform var(--motion-ui) var(--ease-soft);
}

.article-star svg { width: 24px; height: 24px; }

.article-star:hover,
.article-star.is-active {
  color: var(--amber);
  transform: scale(1.05);
}

.article-rating-submit {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  background: rgba(232, 168, 56, 0.35);
  color: var(--text-primary);
  transition: background var(--motion-ui) var(--ease-soft), opacity var(--motion-ui) var(--ease-soft);
}

.article-rating-submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.article-rating-submit:not(:disabled):hover {
  background: rgba(232, 168, 56, 0.5);
}

.article-rating-thanks {
  font-size: 13px;
  color: var(--teal);
  font-weight: 600;
  display: none;
}

.article-rating.is-submitted .article-rating-row { display: none; }
.article-rating.is-submitted .article-rating-thanks { display: block; }

.article-share-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.article-share-btn {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  color: var(--text-secondary);
  background: rgba(26, 35, 50, 0.5);
  transition: border-color var(--motion-ui) var(--ease-soft), color var(--motion-ui) var(--ease-soft);
}

.article-share-btn:hover {
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--text-primary);
  opacity: 1;
}

.article-share-btn svg { width: 18px; height: 18px; }

.site-footer {
  border-top: 1px solid var(--card-border);
  padding: 40px 0;
  background: var(--navy-mid);
}

.site-footer p {
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
}

@media (max-width: 768px) {
  :root { --page-pad: 16px; --section-gap: 64px; }

  .nav-links { display: none; }
  .nav-hamburger { display: block; }

  .article-engage {
    flex-direction: column;
    gap: 28px;
  }

  .articles-grid { grid-template-columns: 1fr; }
}

/* ============================================
   ARTICLES LIST
   ============================================ */
.articles-list-hero {
  padding-top: calc(var(--nav-height) + 48px);
  padding-bottom: 40px;
  background: var(--navy-mid);
  border-bottom: 1px solid var(--card-border);
}

.articles-list-hero .label {
  font-family: 'Lora', serif;
  font-style: italic;
  color: var(--amber);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 10px;
  letter-spacing: 0.02em;
}

.articles-list-hero .heading {
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  max-width: 640px;
}

.articles-list-main {
  padding-top: 48px;
  padding-bottom: var(--section-gap);
}

.articles-list-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 280px);
  gap: 40px;
  align-items: start;
}

.articles-list-sidebar {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}

.articles-list-feed {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
}

.articles-filter-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 28px 24px;
}

.articles-filter-eyebrow {
  font-family: 'Lora', serif;
  font-style: italic;
  font-size: 13px;
  font-weight: 500;
  color: var(--amber);
  margin-bottom: 10px;
  letter-spacing: 0.02em;
}

.articles-filter-title {
  font-size: clamp(18px, 2.2vw, 22px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.articles-filter-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.articles-filter-label--pills {
  margin-top: 16px;
  margin-bottom: 10px;
}

.articles-filter-search {
  width: 100%;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  background: var(--navy);
  font-size: 14px;
  font-family: inherit;
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--motion-ui) var(--ease-soft);
}

.articles-filter-search:focus {
  border-color: rgba(43, 181, 160, 0.45);
}

.articles-filter-search::placeholder {
  color: var(--text-muted);
}

.articles-filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.articles-filter-pill {
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--card-border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition:
    background var(--motion-ui) var(--ease-soft),
    border-color var(--motion-ui) var(--ease-soft),
    color var(--motion-ui) var(--ease-soft);
  font-family: inherit;
}

.articles-filter-pill:hover {
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--text-primary);
}

.articles-filter-pill.active {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
}

.articles-filter-empty {
  margin-bottom: 24px;
  padding: 20px;
  border: 1px dashed var(--card-border);
  border-radius: var(--radius);
  font-size: 15px;
  color: var(--text-secondary);
  text-align: center;
}

.article-card[hidden] {
  display: none;
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.article-card {
  display: block;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--motion-ui) var(--ease-soft);
  color: inherit;
  text-decoration: none;
}

.article-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
  opacity: 1;
}

.article-thumb {
  height: 180px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
}

.article-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-body { padding: 20px; }

.article-eyebrow {
  font-size: 12px;
  font-weight: 600;
  color: var(--amber);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.article-card h3 {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color var(--motion-ui) var(--ease-soft);
}

.article-card:hover h3 { color: var(--amber); }

.article-excerpt {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-date {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 12px;
}

.article-card--placeholder {
  cursor: default;
}

.article-card--placeholder:hover {
  border-color: var(--card-border);
}

.article-card--placeholder:hover h3 {
  color: inherit;
}

.article-thumb--placeholder {
  position: relative;
  background:
    linear-gradient(135deg, rgba(26, 35, 50, 0.92), rgba(36, 48, 68, 0.88)),
    radial-gradient(circle at 30% 30%, rgba(232, 168, 56, 0.08), transparent 55%);
}

.article-thumb-label {
  font-family: 'Lora', serif;
  font-style: italic;
  font-size: 15px;
  color: rgba(163, 175, 196, 0.55);
  letter-spacing: 0.02em;
}

.article-coming-soon {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 12px;
}

.nav-links a[aria-current="page"] {
  color: var(--text-primary);
}

.content-page-main {
  padding-top: 48px;
  padding-bottom: var(--section-gap);
}

.content-page-body {
  max-width: 620px;
}

.content-page-body p {
  font-size: 17px;
  color: var(--text-secondary);
  line-height: 1.8;
}

.content-page-body p + p { margin-top: 1.25em; }

.legal-content section + section { margin-top: 2.25em; }

.legal-content h2 {
  font-family: inherit;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary, #f5f7fa);
  margin: 0 0 0.75em;
  line-height: 1.35;
}

.legal-content h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary, #f5f7fa);
  margin: 1.25em 0 0.5em;
  line-height: 1.4;
}

.legal-content ul {
  margin: 0.75em 0 0;
  padding-left: 1.25em;
  color: var(--text-secondary);
  font-size: 17px;
  line-height: 1.7;
}

.legal-content li + li { margin-top: 0.4em; }

.legal-content a {
  color: var(--teal, #2bb5a0);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.articles-list-hero .subtext {
  margin-top: 12px;
  font-size: 16px;
  color: var(--text-muted);
  max-width: 40ch;
}

.articles-load-error {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
  padding: 8px 0 24px;
}

.provider-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(43, 181, 160, 0.12);
  color: var(--teal);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 20px;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--teal);
  border: 1px solid var(--teal);
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 15px;
  margin-top: 28px;
  transition: background var(--motion-ui) var(--ease-soft);
}

.btn-outline:hover {
  background: rgba(43, 181, 160, 0.1);
  opacity: 1;
}

.placeholder-note {
  margin-top: 32px;
  padding: 20px;
  border: 1px dashed var(--card-border);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

.app-placeholder-page {
  min-height: calc(100vh - var(--nav-height));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px var(--page-pad);
  text-align: center;
}

.app-placeholder-page p {
  font-size: clamp(22px, 4vw, 32px);
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}

@media (max-width: 900px) {
  .articles-list-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .articles-list-sidebar {
    grid-column: 1;
    grid-row: 1;
  }

  .articles-list-feed {
    grid-column: 1;
    grid-row: 2;
  }
}

/* ─── Kastro engagement widget — Sunrise brand theme ─────────────────────── */
[data-kastro-widget] {
  --kastro-widget-primary-color: #1f314f;
  --kastro-widget-bg:            #1a1a1a;
  --kastro-widget-text:          #ffffff;
  --kastro-widget-radius:        12px;
}
