/*
 * DogPayCard editorial system
 * Adapted from licensed beUI Pro composition patterns for this static/Worker site.
 */

:root {
  --be-bg: #ffffff;
  --be-surface: #ffffff;
  --be-surface-2: #e9edf3;
  --be-ink: #0b1020;
  --be-muted: #667085;
  --be-line: rgba(11, 16, 32, 0.11);
  --be-primary: #3157ff;
  --be-primary-strong: #1739d0;
  --be-signal: #78f478;
  --be-night: #071126;
  --be-night-2: #0d1b38;
  --be-radius-sm: 12px;
  --be-radius-md: 20px;
  --be-radius-lg: 30px;
  --be-shadow: 0 24px 70px rgba(11, 16, 32, 0.11);
  --be-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --be-display: "Plus Jakarta Sans", "Avenir Next", sans-serif;
  --be-body: "Work Sans", "Avenir Next", sans-serif;
}

body.theme-dark {
  --be-bg: #071020;
  --be-surface: #0d1830;
  --be-surface-2: #13213d;
  --be-ink: #f7f9ff;
  --be-muted: #9ba8bd;
  --be-line: rgba(216, 226, 255, 0.13);
  --be-shadow: 0 30px 90px rgba(0, 0, 0, 0.26);
}

html {
  background: var(--be-bg);
  scroll-padding-top: 110px;
}

body,
body.theme-light,
body.theme-dark {
  background:
    radial-gradient(circle at 8% -4%, rgba(49, 87, 255, 0.16), transparent 27rem),
    radial-gradient(circle at 92% 18%, rgba(120, 244, 120, 0.08), transparent 24rem),
    var(--be-bg);
  color: var(--be-ink);
  font-family: var(--be-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  opacity: 0.22;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.95' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.14'/%3E%3C/svg%3E");
}

/* Shared bright template: keep the full reading surface white. */
body.theme-light {
  color-scheme: light;
  background: #ffffff;
}
body.theme-light::before { opacity: 0; }
body.theme-light .site-footer,
body.theme-light .category-footer,
body.theme-light .post-footer,
body.theme-light .footer-top {
  background: #f7f9fc;
  border-color: var(--be-line);
  color: var(--be-ink);
}
body.theme-light .footer-top::before { display: none; }
body.theme-light .footer-about p,
body.theme-light .footer-links a,
body.theme-light .footer-legal a,
body.theme-light .newsletter-card p,
body.theme-light .footer-bottom,
body.theme-light .footer-brand small {
  color: var(--be-muted) !important;
}
body.theme-light .footer-top h3,
body.theme-light .footer-brand strong,
body.theme-light .newsletter-card h3 { color: var(--be-ink); }
body.theme-light .newsletter-card {
  background: #ffffff !important;
  border-color: var(--be-line);
}

::selection {
  background: var(--be-signal);
  color: #071020;
}

a,
button,
input {
  -webkit-tap-highlight-color: transparent;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(49, 87, 255, 0.5);
  outline-offset: 3px;
}

/* Shared frame */
.site-shell,
.category-shell,
.post-shell,
.search-shell {
  min-height: 100vh;
  background: transparent;
}

.site-header,
.category-header,
.post-header,
.search-header {
  position: sticky;
  top: 14px;
  z-index: 100;
  width: min(1240px, calc(100% - 40px));
  min-height: 72px;
  margin: 14px auto 0;
  padding: 10px 12px 10px 16px;
  border: 1px solid var(--be-line);
  border-radius: 22px;
  background: color-mix(in srgb, var(--be-surface) 82%, transparent);
  box-shadow: 0 12px 40px rgba(5, 10, 24, 0.08);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
}

.brand {
  min-width: max-content;
  gap: 11px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  padding: 5px;
  border-radius: 13px;
  background: var(--be-signal);
  object-fit: contain;
}

.brand-text,
.brand-copy {
  display: grid;
  gap: 1px;
}

.brand-text strong,
.brand-copy strong,
.footer-brand strong {
  color: var(--be-ink);
  font-family: var(--be-display);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.035em;
}

.brand-text small,
.brand-copy small,
.footer-brand small {
  color: var(--be-muted);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.nav-links,
.top-nav {
  gap: 4px;
  padding: 5px;
  border: 1px solid var(--be-line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--be-surface-2) 70%, transparent);
}

.nav-links a,
.top-nav a {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--be-muted) !important;
  font-size: 13px;
  font-weight: 600;
  transition: color 180ms ease, background 180ms ease, transform 180ms ease;
}

.nav-links a:hover,
.top-nav a:hover,
.nav-links a[aria-current="page"],
.top-nav a[aria-current="page"] {
  background: var(--be-surface);
  color: var(--be-ink) !important;
  box-shadow: 0 3px 12px rgba(11, 16, 32, 0.08);
}

.header-actions,
.top-actions {
  gap: 8px;
}

.header-search,
.search-box {
  min-width: 170px;
  height: 42px;
  border: 1px solid var(--be-line);
  border-radius: 999px;
  background: var(--be-surface-2) !important;
  transition: min-width 300ms var(--be-ease), border-color 180ms ease, box-shadow 180ms ease;
}

.header-search:focus-within,
.search-box:focus-within {
  min-width: 230px;
  border-color: rgba(49, 87, 255, 0.5);
  box-shadow: 0 0 0 4px rgba(49, 87, 255, 0.1);
}

.header-search input,
.search-box input {
  color: var(--be-ink) !important;
  font-family: var(--be-body);
}

.header-search svg,
.search-box svg {
  stroke: var(--be-muted) !important;
}

.theme-toggle-track,
.mode-track {
  width: 44px;
  height: 28px;
  border: 1px solid var(--be-line);
  border-radius: 999px;
  background: var(--be-surface-2) !important;
}

.theme-toggle-thumb,
.mode-thumb {
  width: 22px;
  height: 22px;
  margin: 2px;
  border-radius: 50%;
  background: var(--be-surface) !important;
  color: var(--be-primary) !important;
  box-shadow: 0 2px 7px rgba(11, 16, 32, 0.18);
}

.auth-link {
  min-height: 42px;
  padding: 0 15px;
  border-radius: 999px;
  color: var(--be-ink) !important;
  font-size: 13px;
  font-weight: 700;
}

.auth-link-primary {
  border: 0 !important;
  background: var(--be-primary) !important;
  color: #fff !important;
  box-shadow: 0 8px 22px rgba(49, 87, 255, 0.25);
}

.auth-link-primary:hover {
  background: var(--be-primary-strong) !important;
  transform: translateY(-1px);
}

/* Homepage / beUI Blog index composition */
.page-content {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  padding: 0 0 100px;
}

.publication-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.55fr);
  gap: 64px;
  align-items: end;
  padding: 108px 10px 58px;
}

.publication-kicker,
.section-index,
.search-kicker,
.breadcrumb,
.category-topic,
.post-topic,
.article-badge,
.related-topic,
.banner-badge {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 11px;
  font-weight: 750;
}

.publication-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 22px;
  color: var(--be-muted);
}

.publication-kicker span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--be-signal);
  box-shadow: 0 0 0 6px rgba(120, 244, 120, 0.12);
}

.publication-intro h1 {
  max-width: 900px;
  margin: 0;
  color: var(--be-ink);
  font-family: var(--be-display);
  font-size: clamp(48px, 6.2vw, 94px);
  font-weight: 650;
  line-height: 0.96;
  letter-spacing: -0.065em;
}

.publication-intro h1 em {
  color: var(--be-primary);
  font-style: normal;
}

.publication-intro-aside {
  padding-bottom: 8px;
}

.publication-intro-aside p {
  margin: 0 0 28px;
  color: var(--be-muted);
  font-size: 16px;
  line-height: 1.7;
}

.publication-intro-aside a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--be-ink);
  font-weight: 700;
}

.publication-intro-aside a span {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--be-line);
  border-radius: 50%;
  transition: transform 260ms var(--be-ease), background 180ms ease;
}

.publication-intro-aside a:hover span {
  background: var(--be-signal);
  color: #071020;
  transform: rotate(-45deg);
}

.topic-rail {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 0 22px;
  scrollbar-width: none;
}

.topic-rail::-webkit-scrollbar {
  display: none;
}

.topic-rail a {
  flex: 0 0 auto;
  padding: 10px 16px;
  border: 1px solid var(--be-line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--be-surface) 78%, transparent);
  color: var(--be-muted);
  font-size: 13px;
  font-weight: 600;
  transition: transform 220ms var(--be-ease), background 180ms ease, color 180ms ease;
}

.topic-rail a:hover {
  background: var(--be-signal);
  color: #071020;
  transform: translateY(-2px);
}

.hero {
  padding: 0 0 88px;
}

.hero-media {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.75fr);
  min-height: 530px;
  overflow: hidden;
  padding: 8px;
  border: 1px solid var(--be-line);
  border-radius: var(--be-radius-lg);
  background: var(--be-surface);
  box-shadow: var(--be-shadow);
}

.hero-media > img {
  position: static;
  width: 100%;
  height: 100%;
  min-height: 514px;
  border-radius: 23px;
  object-fit: cover;
  transition: transform 700ms var(--be-ease), filter 400ms ease;
}

.hero-media:hover > img {
  transform: scale(1.018);
}

.hero-card {
  position: relative;
  inset: auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: auto;
  max-width: none;
  min-height: 100%;
  padding: clamp(34px, 5vw, 72px);
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--be-ink);
  backdrop-filter: none;
}

.hero-card::before {
  width: 46px;
  height: 46px;
  margin-bottom: auto;
  border: 1px solid var(--be-line);
  border-radius: 50%;
  content: "";
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233157ff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17 17 7M8 7h9v9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px;
  display: grid;
  place-items: center;
  color: var(--be-primary);
  font-size: 20px;
}

.hero-badge,
.post-topic,
.category-topic,
.article-badge,
.related-topic,
.banner-badge {
  display: inline-flex;
  width: fit-content;
  min-height: 28px;
  align-items: center;
  padding: 7px 11px;
  border: 0;
  border-radius: 999px;
  background: rgba(49, 87, 255, 0.11) !important;
  color: var(--be-primary) !important;
}

.hero-card h1,
.hero-card h2 {
  margin: 24px 0 36px;
  color: var(--be-ink);
  font-family: var(--be-display);
  font-size: clamp(36px, 4vw, 62px);
  font-weight: 620;
  line-height: 1.02;
  letter-spacing: -0.055em;
}

.hero-meta,
.post-meta,
.card-meta,
.related-meta,
.result-meta,
.article-meta {
  color: var(--be-muted);
}

.author-chip img,
.post-meta img,
.card-meta img,
.related-meta img,
.author-meta img {
  border: 2px solid var(--be-surface);
  box-shadow: 0 0 0 1px var(--be-line);
}

.latest-section {
  padding: 0;
}

.section-heading,
.results-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--be-line);
}

.section-index {
  display: block;
  margin-bottom: 10px;
  color: var(--be-primary);
}

.section-heading h2,
.results-head h2 {
  margin: 0;
  color: var(--be-ink);
  font-family: var(--be-display);
  font-size: clamp(34px, 4vw, 52px);
  font-weight: 620;
  letter-spacing: -0.05em;
}

.section-heading > p,
.results-head > p {
  color: var(--be-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.11em;
}

.post-grid,
.category-grid,
.results-grid,
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.post-card,
.category-card,
.result-card,
.related-card {
  position: relative;
  overflow: hidden;
  min-height: 0;
  padding: 8px;
  border: 1px solid var(--be-line);
  border-radius: var(--be-radius-md);
  background: color-mix(in srgb, var(--be-surface) 92%, transparent) !important;
  box-shadow: none;
  transition: transform 350ms var(--be-ease), box-shadow 350ms var(--be-ease), border-color 180ms ease;
}

.post-card::after,
.category-card::after,
.result-card::after,
.related-card::after {
  position: absolute;
  inset: auto 16px 12px auto;
  width: 34px;
  height: 34px;
  content: "";
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233157ff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17 17 7M8 7h9v9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 17px;
  display: grid;
  place-items: center;
  border: 1px solid var(--be-line);
  border-radius: 50%;
  color: var(--be-primary);
  opacity: 0;
  transform: translate(-6px, 6px);
  transition: opacity 220ms ease, transform 300ms var(--be-ease);
}

.post-card:hover,
.category-card:hover,
.result-card:hover,
.related-card:hover {
  border-color: rgba(49, 87, 255, 0.32);
  box-shadow: 0 24px 60px rgba(11, 16, 32, 0.13);
  transform: translateY(-6px);
}

.post-card:hover::after,
.category-card:hover::after,
.result-card:hover::after,
.related-card:hover::after {
  opacity: 1;
  transform: translate(0, 0);
}

.post-card-link,
.category-card-link,
.related-card-link {
  display: flex;
  height: 100%;
  flex-direction: column;
}

.post-image,
.category-card img.card-image,
.related-image {
  width: 100%;
  height: 238px;
  margin: 0;
  border-radius: 14px;
  object-fit: cover;
  filter: saturate(0.92) contrast(1.02);
  transition: transform 600ms var(--be-ease), filter 300ms ease;
}

.post-card:hover .post-image,
.category-card:hover .card-image,
.related-card:hover .related-image {
  filter: saturate(1.05) contrast(1.04);
  transform: scale(1.025);
}

.post-copy,
.category-card-copy,
.related-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 18px;
  min-height: 0;
  padding: 22px 14px 16px;
}

.post-copy > div:first-child,
.category-card-copy > div:first-child,
.related-copy > div:first-child {
  min-height: 0;
}

.post-card h3,
.category-card h3,
.result-card h3,
.related-card h3 {
  margin: 14px 0 0;
  color: var(--be-ink);
  font-family: var(--be-display);
  font-size: 21px;
  font-weight: 650;
  line-height: 1.18;
  letter-spacing: -0.035em;
}

.post-copy > p,
.category-card-copy > p,
.result-card > p,
.related-copy > p {
  color: var(--be-muted);
  font-size: 14px;
  line-height: 1.65;
}

.post-meta,
.card-meta,
.related-meta,
.result-meta {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--be-line);
  font-size: 12px;
}

.view-all-wrap,
.load-more-wrap {
  margin-top: 42px;
}

.view-all-button,
.load-more {
  min-height: 50px;
  padding: 0 24px;
  border: 1px solid var(--be-line);
  border-radius: 999px;
  background: var(--be-surface);
  color: var(--be-ink);
  font-weight: 700;
  box-shadow: 0 10px 28px rgba(11, 16, 32, 0.08);
  transition: transform 220ms var(--be-ease), background 180ms ease;
}

.view-all-button:hover,
.load-more:hover {
  background: var(--be-signal);
  color: #071020;
  transform: translateY(-2px);
}

/* Category and localized index */
.category-main,
.search-main {
  width: min(1240px, calc(100% - 40px));
  padding: 90px 0 110px;
}

.page-intro,
.search-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(260px, 0.5fr);
  gap: 40px;
  align-items: end;
  padding: 48px 8px 62px;
}

.search-hero {
  grid-template-areas:
    "kicker kicker"
    "title summary";
}

.search-hero .search-kicker {
  grid-area: kicker;
}

.search-hero h1 {
  grid-area: title;
}

.search-hero p {
  grid-area: summary;
  align-self: end;
}

.page-intro h1,
.search-hero h1 {
  max-width: 900px;
  margin: 18px 0 0;
  color: var(--be-ink);
  font-family: var(--be-display);
  font-size: clamp(48px, 7vw, 92px);
  font-weight: 620;
  line-height: 0.98;
  letter-spacing: -0.065em;
}

.search-hero p {
  max-width: 420px;
  margin: 0;
  color: var(--be-muted);
  font-size: 16px;
  line-height: 1.7;
}

.feature-banner {
  position: relative;
  min-height: 420px;
  overflow: hidden;
  padding: 8px;
  border: 1px solid var(--be-line);
  border-radius: var(--be-radius-lg);
  background: var(--be-surface);
  box-shadow: var(--be-shadow);
}

.feature-banner > img {
  border-radius: 23px;
}

.banner-overlay {
  background: linear-gradient(90deg, rgba(5, 12, 28, 0.92), rgba(5, 12, 28, 0.42) 58%, transparent) !important;
}

.banner-copy {
  max-width: 620px;
  padding: clamp(34px, 6vw, 78px);
}

.banner-copy h2 {
  color: #fff;
  font-family: var(--be-display);
  font-size: clamp(36px, 4vw, 60px);
  line-height: 1.03;
  letter-spacing: -0.055em;
}

.category-grid-section,
.results-section {
  padding-top: 56px;
}

.result-card {
  display: flex;
  min-height: 280px;
  flex-direction: column;
  padding: 28px;
}

.result-topic {
  color: var(--be-primary);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.result-card h3 a {
  color: inherit;
}

.result-empty,
.empty-state {
  grid-column: 1 / -1;
  padding: 72px 24px;
  border: 1px dashed var(--be-line);
  border-radius: var(--be-radius-md);
  color: var(--be-muted);
  text-align: center;
}

/* Article / beUI long-form reading composition */
.post-main {
  gap: 0;
  padding: 86px 0 120px;
}

.post-content-layout {
  grid-template-columns: minmax(0, 780px) 290px !important;
  gap: 72px !important;
  width: min(1160px, calc(100% - 40px));
}

.post-article {
  width: 100%;
}

.article-heading {
  gap: 22px;
  padding: 12px 0 36px;
}

.article-heading h1 {
  max-width: 850px;
  margin: 0;
  color: var(--be-ink);
  font-family: var(--be-display);
  font-size: clamp(46px, 6vw, 78px);
  font-weight: 620;
  line-height: 1;
  letter-spacing: -0.062em;
}

.article-meta {
  display: flex;
  justify-content: space-between;
  padding-top: 20px;
  border-top: 1px solid var(--be-line);
}

.article-hero {
  height: min(60vw, 520px);
  margin-top: 12px;
  border-radius: var(--be-radius-lg);
  box-shadow: var(--be-shadow);
}

.article-body {
  gap: 26px;
  padding-top: 54px;
}

.article-body > p,
.article-section p,
.article-list {
  color: color-mix(in srgb, var(--be-ink) 78%, var(--be-muted));
  font-family: "Source Serif 4", Georgia, serif;
  font-size: clamp(18px, 1.65vw, 21px);
  line-height: 1.72;
}

.article-body > p:first-child {
  padding-left: 24px;
  border-left: 3px solid var(--be-primary);
  color: var(--be-ink);
  font-size: clamp(21px, 2vw, 26px);
  line-height: 1.55;
}

.article-section {
  gap: 16px;
  padding-top: 18px;
}

.article-section h2,
.related-heading h2 {
  color: var(--be-ink);
  font-family: var(--be-display);
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 650;
  line-height: 1.12;
  letter-spacing: -0.045em;
}

.article-section h3 {
  color: var(--be-ink);
  font-family: var(--be-display);
  font-size: 23px;
  letter-spacing: -0.025em;
}

.article-quote {
  padding: 34px;
  border: 0;
  border-radius: var(--be-radius-md);
  background: var(--be-night);
  color: #fff;
  box-shadow: var(--be-shadow);
}

.floating-download-ad {
  top: 112px;
  width: 290px !important;
  height: auto !important;
}

.floating-download-card {
  position: relative;
  width: 290px;
  min-height: 0;
  padding: 30px 24px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--be-radius-md);
  background:
    linear-gradient(145deg, rgba(120, 244, 120, 0.95), rgba(70, 218, 119, 0.9)),
    var(--be-signal);
  box-shadow: var(--be-shadow);
  transform: none;
}

.floating-download-card::before {
  position: absolute;
  inset: -20% -45% auto auto;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  content: "";
  filter: blur(1px);
}

.floating-download-logo {
  position: relative;
  width: 150px;
  margin-bottom: 18px;
}

.floating-download-headline {
  position: relative;
  margin-bottom: 14px;
  color: #071020;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.04em;
}

.floating-download-copy {
  position: relative;
  gap: 5px;
  margin-bottom: 22px;
  color: rgba(7, 16, 32, 0.74);
  font-size: 14px;
  line-height: 1.45;
}

.floating-download-brands {
  position: relative;
  gap: 8px;
  margin-bottom: 22px;
}

.floating-download-actions {
  position: relative;
  width: 100%;
  gap: 10px;
}

.floating-download-button {
  grid-template-columns: 1fr 28px;
  height: 58px;
  padding: 9px 14px;
  border-radius: 13px;
  background: rgba(7, 16, 32, 0.88);
}

.floating-download-button strong {
  font-size: 16px;
}

.floating-download-button span {
  font-size: 10px;
}

.related-section {
  gap: 28px;
  margin-top: 64px;
  padding-top: 46px;
  border-top-color: var(--be-line);
}

.related-heading p {
  color: var(--be-muted);
}

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

.related-image {
  height: 170px;
}

/* Footer / beUI shade panel CTA */
.site-footer,
.category-footer,
.post-footer {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto 28px;
  padding: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--be-radius-lg);
  background: var(--be-night);
  color: #fff;
}

.footer-top {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1.25fr 1.05fr;
  gap: 44px;
  padding: 58px;
  overflow: hidden;
  border-radius: 23px;
  background:
    radial-gradient(circle at 8% 20%, rgba(49, 87, 255, 0.38), transparent 30%),
    linear-gradient(90deg, rgba(18, 31, 67, 0.98), rgba(7, 17, 38, 0.95));
}

.footer-top::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  opacity: 0.42;
  background: repeating-linear-gradient(90deg, transparent 0 16.5%, rgba(80, 111, 205, 0.16) 16.5% 33%);
}

.footer-top > * {
  position: relative;
}

.footer-top h3 {
  color: var(--be-ink);
  font-family: var(--be-display);
  font-size: 18px;
}

.footer-about p,
.footer-links a,
.footer-legal a,
.newsletter-card p {
  color: rgba(229, 235, 255, 0.66) !important;
}

.footer-links a:hover,
.footer-legal a:hover {
  color: var(--be-signal) !important;
}

.newsletter-card {
  align-self: stretch;
  padding: 34px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--be-radius-md);
  background: rgba(255, 255, 255, 0.07) !important;
  backdrop-filter: blur(14px);
}

.newsletter-card h3 {
  color: var(--be-ink);
  font-family: var(--be-display);
  font-size: 32px;
  letter-spacing: -0.04em;
}

.newsletter-button {
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  background: var(--be-signal) !important;
  color: #071020 !important;
  font-weight: 800;
}

.footer-bottom {
  padding: 24px 44px 18px;
  border-top: 0;
}

.footer-bottom .footer-brand strong,
.footer-bottom .footer-brand small {
  color: #fff;
}

/* Motion */
@keyframes be-rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.publication-intro > *,
.hero-media,
.page-intro > *,
.search-hero > *,
.article-heading > * {
  animation: be-rise 650ms var(--be-ease) both;
}

.publication-intro > *:nth-child(2),
.page-intro > *:nth-child(2),
.search-hero > *:nth-child(2) {
  animation-delay: 90ms;
}

.post-card,
.category-card,
.result-card {
  animation: be-rise 520ms var(--be-ease) both;
}

.post-card:nth-child(2),
.category-card:nth-child(2),
.result-card:nth-child(2) { animation-delay: 50ms; }
.post-card:nth-child(3),
.category-card:nth-child(3),
.result-card:nth-child(3) { animation-delay: 100ms; }

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

@media (max-width: 1040px) {
  .nav-links,
  .top-nav {
    display: none;
  }

  .hero-media {
    grid-template-columns: 1fr 0.82fr;
  }

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

  .post-content-layout {
    grid-template-columns: minmax(0, 1fr) 250px !important;
    gap: 36px !important;
  }

  .floating-download-ad,
  .floating-download-card {
    width: 250px !important;
  }

  .footer-top {
    grid-template-columns: 1fr 1fr;
  }

  .newsletter-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .site-header,
  .category-header,
  .post-header,
  .search-header {
    grid-template-columns: auto auto;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    top: 8px;
    width: calc(100% - 20px);
    min-height: 62px;
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 18px;
  }

  .header-actions,
  .top-actions {
    width: auto;
    justify-self: end;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .brand-text small,
  .brand-copy small,
  .header-search,
  .search-box,
  .theme-toggle,
  .mode-toggle,
  .auth-link:not(.auth-link-primary) {
    display: none !important;
  }

  .auth-link-primary {
    min-height: 38px;
    padding: 0 14px;
  }

  .page-content,
  .category-main,
  .search-main {
    width: calc(100% - 24px);
  }

  .publication-intro,
  .page-intro,
  .search-hero {
    grid-template-columns: 1fr;
    gap: 26px;
    padding: 66px 2px 38px;
  }

  .search-hero {
    grid-template-areas:
      "kicker"
      "title"
      "summary";
  }

  .publication-intro h1,
  .page-intro h1,
  .search-hero h1 {
    font-size: clamp(42px, 13vw, 60px);
    line-height: 0.98;
  }

  .publication-intro-aside {
    max-width: 95%;
  }

  .topic-rail {
    margin-right: -12px;
  }

  .hero {
    padding-bottom: 66px;
  }

  .hero-media {
    grid-template-columns: 1fr;
    min-height: 0;
    border-radius: 23px;
  }

  .hero-media > img {
    min-height: 0;
    height: 62vw;
    border-radius: 16px;
  }

  .hero-card {
    min-height: 360px;
    padding: 32px 22px;
  }

  .hero-card::before {
    width: 40px;
    height: 40px;
  }

  .hero-card h1,
  .hero-card h2 {
    font-size: 38px;
  }

  .section-heading,
  .results-head {
    align-items: start;
    flex-direction: column;
  }

  .post-grid,
  .category-grid,
  .results-grid,
  .related-grid {
    grid-template-columns: 1fr;
  }

  .post-card,
  .category-card,
  .result-card,
  .related-card {
    border-radius: 18px;
  }

  .post-image,
  .category-card img.card-image,
  .related-image {
    height: 58vw;
    max-height: 310px;
  }

  .feature-banner {
    min-height: 480px;
    border-radius: 23px;
  }

  .banner-copy {
    padding: 34px 24px;
  }

  .post-main {
    padding-top: 64px;
  }

  .post-content-layout {
    display: block;
    width: calc(100% - 24px);
  }

  .article-heading h1 {
    font-size: clamp(40px, 12vw, 58px);
  }

  .article-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .article-hero {
    height: 62vw;
    min-height: 260px;
    border-radius: 22px;
  }

  .article-body {
    padding-top: 38px;
  }

  .article-body > p:first-child {
    padding-left: 18px;
  }

  .floating-download-ad {
    display: none !important;
  }

  .site-footer,
  .category-footer,
  .post-footer {
    width: calc(100% - 20px);
    margin-bottom: 88px;
    border-radius: 23px;
  }

  .footer-top {
    grid-template-columns: 1fr;
    gap: 34px;
    padding: 34px 24px;
    border-radius: 16px;
  }

  .newsletter-card {
    grid-column: auto;
  }

  .footer-bottom {
    align-items: flex-start;
    flex-direction: column;
    gap: 20px;
    padding: 24px 20px 18px;
  }

  .mobile-app-banner {
    border-color: rgba(7, 16, 32, 0.1) !important;
    background: rgba(255, 255, 255, 0.92) !important;
    box-shadow: 0 18px 50px rgba(7, 16, 32, 0.24) !important;
    backdrop-filter: blur(18px);
  }

  .mobile-app-banner-signup {
    background: var(--be-signal) !important;
  }
}
