:root {
  --c-bg: #fbf8f3;
  --c-bg-alt: #f3ede3;
  --c-surface: #ffffff;
  --c-surface-glass: rgba(255, 255, 255, 0.62);
  --c-text: #24222b;
  --c-text-soft: #5c5766;
  --c-text-mute: #8a8493;
  --c-line: rgba(36, 34, 43, 0.1);
  --c-primary: #e76f51;
  --c-primary-soft: #f4a261;
  --c-accent: #2a9d8f;
  --c-gold: #e9c46a;
  --c-night: #1a1a2e;
  --c-night-2: #16213e;
  --c-night-3: #0f3460;
  --shadow-sm: 0 2px 8px rgba(26, 26, 46, 0.06);
  --shadow-md: 0 10px 30px rgba(26, 26, 46, 0.1);
  --shadow-lg: 0 24px 60px rgba(26, 26, 46, 0.16);
  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --radius-pill: 999px;
  --header-h: 72px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", Georgia, "Times New Roman", serif;
}

[data-theme="dark"] {
  --c-bg: #101018;
  --c-bg-alt: #15151f;
  --c-surface: #1b1b27;
  --c-surface-glass: rgba(27, 27, 39, 0.66);
  --c-text: #ece9f1;
  --c-text-soft: #b9b3c4;
  --c-text-mute: #8b8598;
  --c-line: rgba(236, 233, 241, 0.12);
  --c-primary: #f08a6c;
  --c-primary-soft: #f4a261;
  --c-accent: #4cc9b8;
  --c-gold: #f0d27e;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.6);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.8;
  color: var(--c-text);
  background: var(--c-bg);
  background-image:
    radial-gradient(circle at 12% -8%, rgba(233, 196, 106, 0.16), transparent 42%),
    radial-gradient(circle at 92% 4%, rgba(42, 157, 143, 0.12), transparent 40%);
  background-attachment: fixed;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  max-width: 100%;
  display: block;
}

a {
  color: var(--c-primary);
  text-decoration: none;
  transition: color 0.25s var(--ease), opacity 0.25s var(--ease);
}

a:hover,
a:focus-visible {
  color: var(--c-accent);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  line-height: 1.35;
  color: var(--c-text);
  margin: 0 0 0.6em;
  letter-spacing: 0.01em;
}

h1 { font-size: clamp(1.7rem, 3.4vw, 2.6rem); }
h2 { font-size: clamp(1.45rem, 2.6vw, 2rem); }
h3 { font-size: clamp(1.15rem, 1.9vw, 1.4rem); }
h4 { font-size: clamp(1.02rem, 1.5vw, 1.15rem); }

p {
  margin: 0 0 1em;
  color: var(--c-text-soft);
}

ul, ol {
  margin: 0 0 1em;
  padding-left: 1.25em;
  color: var(--c-text-soft);
}

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--c-gold);
  outline-offset: 3px;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ===== Header ===== */
#site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--c-surface-glass);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  backdrop-filter: saturate(160%) blur(18px);
  border-bottom: 1px solid var(--c-line);
  transition: background 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

#site-header.is-scrolled {
  box-shadow: var(--shadow-md);
}

.header-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 22px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--c-text);
  font-weight: 700;
  flex-shrink: 0;
}

.logo svg {
  border-radius: 10px;
  box-shadow: 0 0 0 1px var(--c-line), var(--shadow-sm);
  transition: transform 0.5s var(--ease);
}

.logo:hover svg {
  transform: rotate(-8deg) scale(1.05);
}

.logo-text {
  font-family: var(--font-serif);
  font-size: 1.22rem;
  letter-spacing: 0.06em;
  background: linear-gradient(120deg, var(--c-primary), var(--c-gold) 55%, var(--c-accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.main-nav {
  flex: 1 1 auto;
  min-width: 0;
}

.main-nav ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.main-nav a {
  display: inline-block;
  padding: 6px 11px;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  color: var(--c-text-soft);
  white-space: nowrap;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), transform 0.25s var(--ease);
}

.main-nav a:hover,
.main-nav a:focus-visible {
  color: var(--c-text);
  background: rgba(231, 111, 81, 0.12);
  transform: translateY(-1px);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.site-search {
  display: flex;
  align-items: center;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-pill);
  padding: 3px 3px 3px 14px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.site-search:focus-within {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 4px rgba(231, 111, 81, 0.16);
}

.site-search input {
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--c-text);
  width: 168px;
  padding: 6px 0;
  outline: none;
}

.site-search input::placeholder {
  color: var(--c-text-mute);
}

.site-search button {
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--c-primary), var(--c-primary-soft));
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  transition: transform 0.25s var(--ease), filter 0.25s var(--ease);
}

.site-search button:hover {
  transform: scale(1.04);
  filter: brightness(1.06);
}

#theme-toggle,
#menu-toggle {
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--c-line);
  background: var(--c-surface);
  color: var(--c-text-soft);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.25s var(--ease);
}

#theme-toggle:hover,
#menu-toggle:hover {
  color: var(--c-primary);
  border-color: var(--c-primary);
  transform: translateY(-1px);
}

#menu-toggle {
  display: none;
}

/* ===== Main layout ===== */
main {
  display: block;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px 40px;
}

main > section,
main > nav {
  margin: 0 0 34px;
  padding: clamp(22px, 3.4vw, 42px);
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.4s var(--ease), transform 0.4s var(--ease), background 0.4s var(--ease);
}

main > section:hover {
  box-shadow: var(--shadow-md);
}

main > section:nth-of-type(2n) {
  background: linear-gradient(180deg, var(--c-surface), var(--c-bg-alt));
}

/* ===== Breadcrumb ===== */
.breadcrumb {
  margin-top: 22px;
  padding: 12px 20px;
  background: var(--c-surface-glass);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-pill);
  font-size: 0.86rem;
  box-shadow: var(--shadow-sm);
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.breadcrumb li {
  color: var(--c-text-mute);
}

.breadcrumb li + li::before {
  content: "›";
  margin-right: 6px;
  color: var(--c-text-mute);
}

.breadcrumb a {
  color: var(--c-text-soft);
}

.breadcrumb a:hover {
  color: var(--c-primary);
}

/* ===== Hero Banner ===== */
#hero {
  position: relative;
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 45%, #0f3460 100%);
  border: none;
  box-shadow: var(--shadow-lg);
}

#hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 70%;
  background:
    radial-gradient(circle at 22% 30%, rgba(233, 196, 106, 0.34), transparent 55%),
    radial-gradient(circle at 78% 18%, rgba(231, 111, 81, 0.3), transparent 52%),
    radial-gradient(circle at 55% 88%, rgba(42, 157, 143, 0.28), transparent 55%);
  filter: blur(6px);
  pointer-events: none;
  animation: auroraShift 18s var(--ease) infinite alternate;
}

@keyframes auroraShift {
  0% { transform: translate3d(0, 0, 0) scale(1); opacity: 0.85; }
  100% { transform: translate3d(3%, -4%, 0) scale(1.08); opacity: 1; }
}

#hero:hover {
  box-shadow: var(--shadow-lg);
}

.banner-slides {
  position: relative;
  min-height: 420px;
}

.slide {
  display: none;
  position: relative;
  padding: clamp(20px, 3vw, 38px);
  animation: slideFade 0.7s var(--ease) both;
}

.slide.is-active {
  display: block;
}

@keyframes slideFade {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.slide-img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.38);
  transition: transform 0.7s var(--ease);
}

.slide:hover .slide-img {
  transform: scale(1.012);
}

.slide-caption {
  position: relative;
  margin-top: -34px;
  margin-left: clamp(0px, 3vw, 30px);
  margin-right: clamp(0px, 3vw, 30px);
  padding: clamp(18px, 2.6vw, 30px);
  background: rgba(20, 20, 34, 0.62);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-md);
  color: #f4f1ea;
  box-shadow: var(--shadow-md);
}

.slide-caption h1,
.slide-caption h2 {
  color: #fff;
  margin-bottom: 0.5em;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.35);
}

.slide-caption h1 {
  font-size: clamp(1.35rem, 2.8vw, 2.1rem);
}

.slide-caption p {
  color: rgba(244, 241, 234, 0.9);
  margin-bottom: 1.1em;
  font-size: clamp(0.9rem, 1.4vw, 1rem);
}

.cta {
  display: inline-block;
  padding: 11px 26px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--c-gold), var(--c-primary-soft) 60%, var(--c-primary));
  color: #241d10;
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  box-shadow: 0 10px 24px rgba(233, 196, 106, 0.3);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), filter 0.3s var(--ease);
}

.cta:hover,
.cta:focus-visible {
  color: #1a1408;
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 16px 34px rgba(233, 196, 106, 0.42);
  filter: brightness(1.05);
}

.banner-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 20px 24px;
  position: relative;
  z-index: 2;
}

.banner-controls .prev,
.banner-controls .next {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  line-height: 1;
  color: #f4f1ea;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: background 0.25s var(--ease), transform 0.25s var(--ease);
}

.banner-controls .prev:hover,
.banner-controls .next:hover {
  background: rgba(233, 196, 106, 0.28);
  transform: scale(1.08);
}

.banner-controls .dots {
  display: flex;
  gap: 8px;
}

.banner-controls .dots button {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(244, 241, 234, 0.72);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  transition: all 0.25s var(--ease);
}

.banner-controls .dots button[aria-selected="true"] {
  color: #241d10;
  background: var(--c-gold);
  border-color: var(--c-gold);
  transform: scale(1.1);
}

/* ===== Stats ===== */
#stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  padding: clamp(22px, 3vw, 34px);
  background: linear-gradient(135deg, rgba(231, 111, 81, 0.08), rgba(42, 157, 143, 0.08)) !important;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.stat-item {
  text-align: center;
  padding: 18px 12px;
  border-radius: var(--radius-md);
  background: var(--c-surface-glass);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--c-line);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.stat-item:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
}

.stat-num {
  display: block;
  font-family: var(--font-serif);
  font-size: clamp(1.7rem, 3.6vw, 2.6rem);
  font-weight: 700;
  line-height: 1.1;
  background: linear-gradient(120deg, var(--c-primary), var(--c-gold), var(--c-accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat-label {
  display: block;
  margin-top: 6px;
  font-size: 0.85rem;
  color: var(--c-text-mute);
  letter-spacing: 0.02em;
}

/* ===== Section headings ===== */
main > section > h2 {
  position: relative;
  padding-bottom: 14px;
  margin-bottom: 1em;
}

main > section > h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 62px;
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--c-primary), var(--c-gold), var(--c-accent));
}

main > section > h3 {
  margin-top: 1.6em;
  color: var(--c-text);
}

main > section > h3::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c-primary), var(--c-gold));
  vertical-align: middle;
  transform: translateY(-2px);
}

/* ===== News ===== */
.news-item {
  padding: 20px 22px;
  margin-bottom: 14px;
  border-radius: var(--radius-md);
  background: var(--c-surface-glass);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--c-line);
  border-left: 4px solid var(--c-primary);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-left-color 0.3s var(--ease);
}

.news-item:hover {
  transform: translateX(6px);
  box-shadow: var(--shadow-md);
  border-left-color: var(--c-accent);
}

.news-item h3 {
  margin-bottom: 0.35em;
}

.news-item p:first-of-type {
  font-size: 0.82rem;
  color: var(--c-text-mute);
  margin-bottom: 0.5em;
}

/* ===== Article cards ===== */
.article-card {
  padding: 22px 24px;
  margin-bottom: 16px;
  border-radius: var(--radius-md);
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease);
}

.article-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--c-primary), var(--c-gold), var(--c-accent));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s var(--ease);
}

.article-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: rgba(231, 111, 81, 0.35);
}

.article-card:hover::before {
  transform: scaleX(1);
}

.article-card h3 {
  margin-bottom: 0.4em;
  transition: color 0.25s var(--ease);
}

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

.article-card p:first-of-type {
  font-size: 0.82rem;
  color: var(--c-text-mute);
  margin-bottom: 0.5em;
}

.article-card a {
  display: inline-block;
  margin-top: 4px;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  background: rgba(231, 111, 81, 0.1);
  transition: background 0.25s var(--ease), color 0.25s var(--ease), transform 0.25s var(--ease);
}

.article-card a:hover {
  background: var(--c-primary);
  color: #fff;
  transform: translateX(3px);
}

/* ===== Article detail sections ===== */
#articles > section[id^="article-"] {
  margin: 0 0 18px;
  padding: 20px 24px;
  background: var(--c-bg-alt);
  border-radius: var(--radius-md);
  border: 1px solid var(--c-line);
  transition: box-shadow 0.3s var(--ease), transform 0.3s var(--ease);
}

#articles > section[id^="article-"]:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

#articles > section[id^="article-"] h4 {
  color: var(--c-accent);
  margin-bottom: 0.45em;
}

/* ===== FAQ ===== */
#faq details {
  margin-bottom: 12px;
  border-radius: var(--radius-md);
  background: var(--c-surface-glass);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--c-line);
  overflow: hidden;
  transition: box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}

#faq details:hover {
  border-color: rgba(42, 157, 143, 0.4);
  box-shadow: var(--shadow-sm);
}

#faq details[open] {
  box-shadow: var(--shadow-md);
  border-color: rgba(42, 157, 143, 0.5);
}

#faq summary {
  position: relative;
  padding: 16px 52px 16px 22px;
  font-weight: 600;
  color: var(--c-text);
  cursor: pointer;
  list-style: none;
  transition: background 0.25s var(--ease), color 0.25s var(--ease);
}

#faq summary::-webkit-details-marker {
  display: none;
}

#faq summary::after {
  content: "+";
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--c-primary);
  background: rgba(231, 111, 81, 0.12);
  transition: transform 0.3s var(--ease), background 0.3s var(--ease);
}

#faq details[open] summary::after {
  content: "−";
  transform: translateY(-50%) rotate(180deg);
  background: rgba(42, 157, 143, 0.18);
  color: var(--c-accent);
}

#faq summary:hover {
  background: rgba(231, 111, 81, 0.06);
  color: var(--c-primary);
}

#faq details p {
  padding: 0 22px 18px;
  margin: 0;
  animation: faqIn 0.35s var(--ease);
}

@keyframes faqIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== HowTo ===== */
#howto h3 {
  display: inline-block;
  margin-top: 1.4em;
}

#howto p {
  padding-left: 4px;
}

/* ===== Contact ===== */
#contact address {
  font-style: normal;
  padding: 22px 24px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(42, 157, 143, 0.08), rgba(233, 196, 106, 0.1));
  border: 1px solid var(--c-line);
}

#contact address p {
  margin: 0 0 0.55em;
  color: var(--c-text);
}

#contact address p:last-child {
  margin-bottom: 0;
}

/* ===== Sitemap / links ===== */
#sitemap ul,
#links ul {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  list-style: none;
  padding: 0;
  margin: 0;
}

#sitemap a,
#links a {
  display: inline-block;
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  color: var(--c-text-soft);
  background: var(--c-bg-alt);
  border: 1px solid var(--c-line);
  transition: all 0.25s var(--ease);
}

#sitemap a:hover,
#links a:hover {
  color: #fff;
  background: linear-gradient(135deg, var(--c-primary), var(--c-primary-soft));
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* ===== Footer ===== */
#site-footer {
  margin-top: 20px;
  padding: clamp(30px, 4vw, 50px) 20px;
  background: linear-gradient(160deg, #1a1a2e, #16213e 55%, #0f3460);
  color: rgba(244, 241, 234, 0.82);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-inner {
  max-width: 1240px;
  margin: 0 auto;
}

#site-footer p {
  color: rgba(244, 241, 234, 0.78);
  font-size: 0.88rem;
}

#site-footer h2 {
  color: var(--c-gold);
  font-size: 1.05rem;
  margin-top: 1.4em;
  margin-bottom: 0.5em;
}

#site-footer a {
  color: var(--c-gold);
}

#site-footer a:hover {
  color: var(--c-primary-soft);
}

#site-footer section {
  margin-bottom: 8px;
}

/* ===== Back to top ===== */
#back-to-top {
  position: fixed;
  right: 22px;
  bottom: 26px;
  z-index: 90;
  padding: 12px 18px;
  border-radius: var(--radius-pill);
  font-size: 0.84rem;
  font-weight: 700;
  color: #241d10;
  background: linear-gradient(135deg, var(--c-gold), var(--c-primary-soft));
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease), visibility 0.35s var(--ease);
}

#back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#back-to-top:hover {
  transform: translateY(-3px) scale(1.03);
  filter: brightness(1.05);
}

/* ===== Scroll reveal ===== */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  will-change: opacity, transform;
}

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

/* ===== Responsive ===== */
@media (max-width: 1080px) {
  .main-nav a {
    padding: 6px 8px;
    font-size: 0.84rem;
  }

  .site-search input {
    width: 130px;
  }
}

@media (max-width: 900px) {
  .header-inner {
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  #menu-toggle {
    display: inline-block;
    order: 3;
  }

  .header-tools {
    order: 2;
    margin-left: auto;
  }

  .main-nav {
    order: 4;
    flex-basis: 100%;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.45s var(--ease);
  }

  .main-nav.is-open {
    max-height: 520px;
  }

  .main-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 8px 0 12px;
  }

  .main-nav a {
    display: block;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.94rem;
  }

  .site-search {
    display: none;
  }

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

  .banner-slides {
    min-height: 0;
  }

  .slide-caption {
    margin-top: -22px;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 15px;
  }

  main {
    padding: 0 12px 30px;
  }

  main > section,
  main > nav {
    padding: 20px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 22px;
  }

  .breadcrumb {
    margin-top: 14px;
    padding: 10px 14px;
    font-size: 0.8rem;
  }

  .slide {
    padding: 14px;
  }

  .slide-caption {
    margin-left: 0;
    margin-right: 0;
    padding: 18px 16px;
  }

  .cta {
    width: 100%;
    text-align: center;
  }

  #stats {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 16px;
  }

  .stat-item {
    padding: 14px 8px;
  }

  .news-item,
  .article-card {
    padding: 16px 16px;
  }

  #faq summary {
    padding: 14px 46px 14px 16px;
    font-size: 0.94rem;
  }

  #faq details p {
    padding: 0 16px 16px;
  }

  #contact address {
    padding: 16px;
  }

  #back-to-top {
    right: 14px;
    bottom: 16px;
    padding: 10px 14px;
    font-size: 0.78rem;
  }
}

@media (max-width: 380px) {
  #stats {
    grid-template-columns: 1fr;
  }

  .logo-text {
    font-size: 1.05rem;
  }
}

/* ===== Motion preferences ===== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ===== Print ===== */
@media print {
  #site-header,
  #back-to-top,
  .banner-controls,
  #hero::before {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  main > section,
  main > nav {
    box-shadow: none;
    border: 1px solid #ccc;
    break-inside: avoid;
  }
}