:root {
  --bg: #f3f7fc;
  --paper: #ffffff;
  --panel: #e8f0fa;
  --card: #ffffff;
  --line: #c9d9ea;
  --deep: #102847;
  --deep-2: #31587f;
  --accent: #0f52a8;
  --accent-hover: #0b3f83;
  --gold: #4b9bd5;
  --gold-soft: #e8f0fa;
  --ink: #102847;
  --muted: #526a84;
  --shadow: rgba(16, 40, 71, 0.12);
  --header-surface: linear-gradient(135deg, #f4f8ff 0%, #dbe9f7 28%, #f8fbff 100%);
  --header-border: rgba(15, 82, 168, 0.2);
  --button-text: #ffffff;
  --toggle-bg: rgba(15, 82, 168, 0.08);
  --toggle-text: #102847;
}

body[data-theme="dark"] {
  --bg: #101a28;
  --paper: #162438;
  --panel: #20354b;
  --card: #1a2c42;
  --line: #344e6b;
  --deep: #f1f6fc;
  --deep-2: #c3d5e8;
  --accent: #78b7ee;
  --accent-hover: #a9d6ff;
  --gold: #a9d6ff;
  --gold-soft: #20354b;
  --ink: #f1f6fc;
  --muted: #c0cfdf;
  --shadow: rgba(0, 0, 0, 0.38);
  --header-surface: linear-gradient(135deg, #14243a 0%, #203750 35%, #101a28 100%);
  --header-border: rgba(169, 214, 255, 0.18);
  --button-text: #101a28;
  --toggle-bg: rgba(255, 255, 255, 0.04);
  --toggle-text: #f1f6fc;
}

html, body {
  background: var(--bg) !important;
  color: var(--ink) !important;
}

body[data-theme="dark"] .topbar,
body[data-theme="dark"] .feature-wrapper,
body[data-theme="dark"] .newsletter-box,
body[data-theme="dark"] .social-box,
body[data-theme="dark"] .feature-lower-card,
body[data-theme="dark"] .editor-card,
body[data-theme="dark"] .editor-spotlight,
body[data-theme="dark"] .advisory-panel,
body[data-theme="dark"] .developer-card {
  box-shadow: 0 14px 26px rgba(2, 8, 18, 0.24) !important;
}

.topbar,
.topbar.is-compact,
.status-box,
.status-date-box,
.status-submit-box,
.status-theme-box,
.site-datetime-pill,
.newsletter-box,
.social-box,
.feature-lower-card,
.editor-card,
.editor-spotlight,
.advisory-panel,
.developer-card {
  background: var(--card) !important;
  border-color: var(--line) !important;
}

.topbar.is-compact {
  padding-top: 6px !important;
  padding-bottom: 6px !important;
  border-radius: 0 0 14px 14px !important;
  box-shadow: 0 8px 22px var(--shadow) !important;
  grid-template-columns: 1fr;
  grid-template-areas: "brand";
}

.topbar.is-compact .brand { min-height: 34px; }
.topbar.is-compact .brand img { max-height: 110px; }
.topbar.is-compact .brand { justify-content: center; }
.topbar.is-compact .menu-btn,
.topbar.is-compact .header-controls { visibility: hidden; pointer-events: none; }

.back-to-top {
  position: fixed;
  right: 22px;
  bottom: calc(94px + env(safe-area-inset-bottom, 0px));
  z-index: 999;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--card);
  color: var(--deep);
  box-shadow: 0 8px 20px var(--shadow);
  font: 700 20px/1 sans-serif;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .2s ease, visibility .2s ease, transform .2s ease;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

@media (max-width: 720px) {
  .status-row .status-box .submit-writing-link {
    min-height: 44px;
  }

  .saved-reading-link {
    min-width: 44px;
    min-height: 44px;
  }

  .footer-social a {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }

  .back-to-top {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }
}

.social-links a[hidden],
.footer-social a[hidden] {
  display: none !important;
}

.feature-wrapper {
  background:
    radial-gradient(circle at 88% 16%, rgba(255,255,255,.72), transparent 28%),
    linear-gradient(135deg, #dfefff 0%, #cfe0ff 26%, #f5faff 100%) !important;
  border-color: rgba(22, 104, 209, 0.28) !important;
  box-shadow: 0 18px 32px rgba(18, 60, 107, 0.12) !important;
}

body[data-theme="dark"] .feature-wrapper {
  background:
    radial-gradient(circle at 88% 18%, rgba(146, 195, 255, 0.2), transparent 26%),
    linear-gradient(135deg, #122846 0%, #183562 40%, #0d1d34 100%) !important;
  border-color: rgba(126, 184, 255, 0.4) !important;
}

.feature-wrapper::after {
  background: rgba(255,255,255,.7) !important;
  color: var(--accent) !important;
}

body[data-theme="dark"] .feature-copy .sub,
body[data-theme="dark"] .feature-issue-tag,
body[data-theme="dark"] .editor-spotlight .eyebrow,
body[data-theme="dark"] .editor-card p,
body[data-theme="dark"] .editorial .intro,
body[data-theme="dark"] .advisory-panel .people,
body[data-theme="dark"] .feature-lower-card p,
body[data-theme="dark"] .status-box .small,
body[data-theme="dark"] .developer-brand p,
body[data-theme="dark"] .footer-column p,
body[data-theme="dark"] .footer-column a,
body[data-theme="dark"] .footer-brand p {
  color: #d5e5ff !important;
}

.mini-tag,
.status-submit-box .submit-writing-link,
.subscribe-form button,
.menu-btn:hover,
.search button,
.nav-menu a:hover,
.submit-writing-link,
.site-footer .status-submit-box,
.feature-issue-tag,
.editor-tribute {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%) !important;
}

.editor-tribute {
  border-color: rgba(142, 197, 255, 0.3) !important;
}

.site-footer {
  background: linear-gradient(180deg, #0d1d36 0%, #071627 100%) !important;
  border-color: rgba(135, 186, 255, 0.22) !important;
}

.site-footer .footer-brand h4,
.site-footer .footer-column h5,
.site-footer .footer-bottom,
.site-footer .footer-column a,
.site-footer .footer-brand p,
.site-footer .footer-column p {
  color: #edf6ff !important;
}

.theme-toggle,
.menu-btn,
.search,
.search input,
.nav-menu a,
.submit-writing-link,
.saved-reading-link,
.status-actions .theme-toggle {
  border-color: var(--line) !important;
  color: var(--deep) !important;
}

.status-date-box .site-date,
.status-date-box .site-clock,
.status-box .meta,
.feature-lower-card h3,
.editor-card h3,
.editor-spotlight h3,
.newsletter-box h3,
.social-box h3,
.footer-brand h4,
.footer-column h5 {
  color: var(--deep) !important;
}

.site-clock,
.site-datetime-pill .site-clock,
.status-date-box .site-clock,
.role-tag,
.section-kicker,
.feature-lower-card .eyebrow,
.feature-issue-tag,
.feature-copy .sub,
.editor-spotlight .eyebrow,
.author-profile-link,
.item .author,
.category,
.cta,
.home-link,
.saved-reading-link {
  color: var(--accent) !important;
}

.newsletter-box p,
.social-box p,
.feature-lower-card p,
.editor-card p,
.editor-spotlight p,
.developer-brand p,
.footer-column p,
.footer-brand p {
  color: var(--muted) !important;
}

.feature-copy h1,
.feature-copy h2,
.feature-copy h3,
.feature-copy h4,
.feature-copy h5,
.feature-copy h6,
.editorial .title,
.editorial h2,
.editorial h3,
.issue-heading,
.headline,
.marketing-card h3 {
  color: var(--deep) !important;
}

.feature-lower-card:hover,
.editor-card:hover,
.newsletter-box:hover,
.social-box:hover {
  border-color: rgba(22, 104, 209, 0.38) !important;
  box-shadow: 0 16px 30px rgba(18, 60, 107, 0.12) !important;
}

html {
  scroll-behavior: smooth;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

body,
button,
input,
textarea,
select {
  font-family: "Noto Serif Bengali", "Hind Siliguri", "Segoe UI", sans-serif;
}

body {
  line-height: 1.7;
}

a,
button,
input,
textarea {
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease, color .2s ease, opacity .2s ease;
}

.sticky-whatsapp {
  position: fixed;
  right: 24px;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  z-index: 1000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: auto;
  height: auto;
  min-height: 60px;
  padding: 0 18px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #137a42;
  box-shadow: 0 8px 24px rgba(10, 48, 30, .28);
  color: #fff !important;
  font-family: "Segoe UI", sans-serif;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}

.sticky-whatsapp:hover {
  background: #116d3b;
  box-shadow: 0 12px 28px rgba(10, 48, 30, .34);
  color: #fff !important;
  transform: translateY(-2px);
}

.sticky-whatsapp svg {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

@media (max-width: 520px) {
  .sticky-whatsapp {
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    width: 60px;
    height: 60px;
    min-height: 60px;
    padding: 0;
    border-radius: 50%;
  }

  .sticky-whatsapp span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }
}

a:hover,
button:hover {
  text-decoration: none;
}

.feature-copy .sub {
  max-width: 38rem;
}

.feature-wrapper .cta-row a {
  box-shadow: 0 14px 26px rgba(24, 66, 128, 0.22);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(22, 104, 209, 0.35);
  outline-offset: 2px;
}

@media (max-width: 700px) {
  .feature-wrapper {
    padding: 1.1rem 1rem 1.2rem !important;
  }

  .feature-copy h1,
  .feature-copy h2 {
    font-size: clamp(1.8rem, 6vw, 2.8rem) !important;
    line-height: 1.15 !important;
  }

  .newsletter-box,
  .social-box,
  .feature-lower-card,
  .editor-card,
  .editor-spotlight,
  .advisory-panel,
  .developer-card {
    padding: 1rem !important;
  }
}
