:root {
  --brand: #e8392b;
  --brand-dark: #c22a1e;
  --brand-light: #ff6b5e;
  --brand-soft: rgba(232, 57, 43, 0.12);
  --accent: #ff9f1c;
  --accent-2: #ffd166;
  --bg: #f7f8fb;
  --bg-alt: #ffffff;
  --bg-elev: rgba(255, 255, 255, 0.72);
  --glass: rgba(255, 255, 255, 0.55);
  --glass-border: rgba(255, 255, 255, 0.6);
  --text: #1f2430;
  --text-soft: #4b5464;
  --text-muted: #7c8598;
  --border: rgba(31, 36, 48, 0.1);
  --shadow-sm: 0 2px 10px rgba(31, 36, 48, 0.06);
  --shadow-md: 0 10px 30px rgba(31, 36, 48, 0.1);
  --shadow-lg: 0 20px 50px rgba(31, 36, 48, 0.16);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --header-h: 72px;
  --maxw: 1200px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

[data-theme="dark"] {
  --brand: #ff5a4d;
  --brand-dark: #e8392b;
  --brand-light: #ff8577;
  --brand-soft: rgba(255, 90, 77, 0.18);
  --accent: #ffb03a;
  --accent-2: #ffd166;
  --bg: #0f1218;
  --bg-alt: #161b24;
  --bg-elev: rgba(22, 27, 36, 0.72);
  --glass: rgba(30, 36, 48, 0.55);
  --glass-border: rgba(255, 255, 255, 0.08);
  --text: #eef1f6;
  --text-soft: #c3cad6;
  --text-muted: #8b94a5;
  --border: rgba(255, 255, 255, 0.1);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 20px 50px 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);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  background-image: radial-gradient(
      circle at 12% -10%,
      var(--brand-soft),
      transparent 42%
    ),
    radial-gradient(circle at 92% 4%, rgba(255, 159, 28, 0.1), transparent 40%);
  background-attachment: fixed;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
  overflow-x: hidden;
}

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

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

a:hover,
a:focus-visible {
  color: var(--brand-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--brand-soft);
  outline-offset: 2px;
  border-radius: 6px;
}

h1,
h2,
h3,
h4 {
  line-height: 1.3;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(1.7rem, 3.6vw, 2.6rem);
  margin: 0 0 0.6em;
}

h2 {
  font-size: clamp(1.4rem, 2.6vw, 1.95rem);
  margin: 0 0 0.7em;
  position: relative;
  padding-left: 18px;
}

h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.18em;
  bottom: 0.18em;
  width: 6px;
  border-radius: 6px;
  background: linear-gradient(180deg, var(--brand), var(--accent));
}

h3 {
  font-size: clamp(1.1rem, 1.9vw, 1.3rem);
  margin: 1.6em 0 0.5em;
}

h4 {
  font-size: 1.05rem;
  margin: 1.4em 0 0.4em;
  color: var(--brand-dark);
}

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

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

li {
  margin-bottom: 0.4em;
}

blockquote {
  margin: 0;
}

time {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.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(--glass);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
  transition: background 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

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

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

.brand svg {
  width: 38px;
  height: 38px;
  filter: drop-shadow(0 4px 10px rgba(232, 57, 43, 0.35));
  transition: transform 0.5s var(--ease);
}

.brand:hover svg {
  transform: rotate(-8deg) scale(1.08);
}

.brand-name {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: linear-gradient(120deg, var(--brand), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
}

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

#main-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

#main-nav li {
  margin: 0;
}

#main-nav a {
  display: inline-block;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--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 {
  background: var(--brand-soft);
  color: var(--brand-dark);
  text-decoration: none;
  transform: translateY(-1px);
}

#menu-toggle,
#theme-toggle {
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.25s var(--ease), color 0.25s var(--ease),
    border-color 0.25s var(--ease), transform 0.25s var(--ease),
    box-shadow 0.25s var(--ease);
}

#menu-toggle:hover,
#theme-toggle:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(232, 57, 43, 0.3);
}

#menu-toggle {
  display: none;
}

#site-search {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 3px 3px 14px;
  transition: box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}

#site-search:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
}

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

#search-input::placeholder {
  color: var(--text-muted);
}

#site-search button {
  border: 0;
  background: linear-gradient(135deg, var(--brand), var(--brand-light));
  color: #fff;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: filter 0.25s var(--ease), transform 0.25s var(--ease);
}

#site-search button:hover {
  filter: brightness(1.08);
  transform: scale(1.03);
}

/* ============ Layout ============ */
main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px 60px;
}

main > section,
#breadcrumb {
  margin-top: 56px;
  animation: fadeUp 0.7s var(--ease) both;
}

main > section:nth-of-type(odd) {
  animation-delay: 0.04s;
}

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

/* ============ Hero ============ */
#hero {
  margin-top: 32px;
  padding: clamp(28px, 5vw, 56px);
  border-radius: var(--radius-xl);
  background: linear-gradient(
      135deg,
      rgba(232, 57, 43, 0.92),
      rgba(255, 107, 94, 0.86) 38%,
      rgba(255, 159, 28, 0.82) 72%,
      rgba(255, 209, 102, 0.8)
    ),
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.35), transparent 50%);
  background-size: 200% 200%;
  animation: gradientShift 14s ease infinite, fadeUp 0.7s var(--ease) both;
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

#hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
      circle at 15% 100%,
      rgba(255, 255, 255, 0.22),
      transparent 45%
    ),
    radial-gradient(circle at 100% 0%, rgba(255, 255, 255, 0.18), transparent 40%);
  pointer-events: none;
}

@keyframes gradientShift {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

#hero > * {
  position: relative;
  z-index: 1;
}

#hero h1 {
  color: #fff;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.18);
  max-width: 22ch;
}

.hero-lead {
  color: rgba(255, 255, 255, 0.94);
  font-size: clamp(0.95rem, 1.6vw, 1.06rem);
  max-width: 76ch;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.12);
}

/* Hero carousel */
#hero-carousel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 28px 0;
}

#hero-carousel .slide {
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  transition: transform 0.4s var(--ease), background 0.4s var(--ease),
    box-shadow 0.4s var(--ease);
}

#hero-carousel .slide:hover {
  transform: translateY(-6px);
  background: rgba(255, 255, 255, 0.24);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
}

#hero-carousel h2 {
  color: #fff;
  font-size: 1.12rem;
  margin: 0 0 0.5em;
  padding-left: 0;
}

#hero-carousel h2::before {
  display: none;
}

#hero-carousel p {
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.92rem;
  margin: 0;
}

/* Stats */
#stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 8px;
}

#stats .stat {
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-md);
  padding: 16px 14px;
  text-align: center;
  transition: transform 0.35s var(--ease), background 0.35s var(--ease);
}

#stats .stat:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.28);
}

#stats .num {
  display: block;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

#stats .stat span:last-child {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.9);
}

/* ============ Breadcrumb ============ */
#breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 10px 18px;
  font-size: 0.88rem;
  background: var(--bg-elev);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 999px;
  width: fit-content;
  color: var(--text-muted);
}

#breadcrumb li {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

#breadcrumb li + li::before {
  content: "›";
  color: var(--text-muted);
  font-weight: 700;
}

/* ============ Generic sections ============ */
main > section:not(#hero):not(#breadcrumb) {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(22px, 4vw, 40px);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.4s var(--ease), transform 0.4s var(--ease),
    border-color 0.4s var(--ease);
}

main > section:not(#hero):not(#breadcrumb):hover {
  box-shadow: var(--shadow-md);
  border-color: var(--brand-soft);
}

/* ============ Products & feature cards ============ */
#products h4 {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 0.92rem;
}

[data-theme="dark"] #products h4 {
  color: var(--brand-light);
}

/* ============ Testimonials ============ */
#testimonials {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

#testimonials h2 {
  grid-column: 1 / -1;
}

#testimonials blockquote {
  position: relative;
  background: var(--bg-elev);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius-md);
  padding: 22px 22px 18px;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

#testimonials blockquote::before {
  content: "\201C";
  position: absolute;
  top: -4px;
  right: 16px;
  font-size: 3.4rem;
  line-height: 1;
  color: var(--brand-soft);
  font-family: Georgia, serif;
}

#testimonials blockquote:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
}

#testimonials blockquote p {
  margin: 0 0 12px;
  color: var(--text-soft);
  font-size: 0.95rem;
}

#testimonials cite {
  display: block;
  font-style: normal;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--brand);
  text-align: right;
}

/* ============ News ============ */
#news {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

#news h2 {
  grid-column: 1 / -1;
}

#news article {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease),
    border-color 0.4s var(--ease);
}

#news article:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
  border-color: var(--brand-soft);
}

#news article h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

#news article p:last-child {
  margin-bottom: 0;
  font-size: 0.92rem;
}

/* ============ Articles ============ */
#articles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

#articles h2 {
  grid-column: 1 / -1;
}

#articles article {
  display: flex;
  flex-direction: column;
  background: linear-gradient(
    160deg,
    var(--bg-elev),
    rgba(255, 255, 255, 0.02)
  );
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  position: relative;
  overflow: hidden;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease),
    border-color 0.4s var(--ease);
}

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

#articles article:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
  border-color: var(--brand-soft);
}

#articles article:hover::before {
  transform: scaleX(1);
}

#articles article h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

#articles article p {
  font-size: 0.92rem;
  flex: 1;
}

#articles article a {
  align-self: flex-start;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  transition: background 0.3s var(--ease), color 0.3s var(--ease),
    transform 0.3s var(--ease);
}

[data-theme="dark"] #articles article a {
  color: var(--brand-light);
}

#articles article a:hover {
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  transform: translateX(4px);
}

/* ============ FAQ ============ */
#faq details {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  overflow: hidden;
  transition: box-shadow 0.35s var(--ease), border-color 0.35s var(--ease),
    background 0.35s var(--ease);
}

#faq details:hover {
  border-color: var(--brand-soft);
  box-shadow: var(--shadow-sm);
}

#faq details[open] {
  border-color: var(--brand-soft);
  box-shadow: var(--shadow-md);
  background: var(--bg-alt);
}

#faq summary {
  cursor: pointer;
  list-style: none;
  padding: 16px 48px 16px 20px;
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--text);
  position: relative;
  transition: 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: 24px;
  height: 24px;
  line-height: 22px;
  text-align: center;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 1.1rem;
  font-weight: 700;
  transition: transform 0.35s var(--ease), background 0.35s var(--ease),
    color 0.35s var(--ease);
}

[data-theme="dark"] #faq summary::after {
  color: var(--brand-light);
}

#faq details[open] summary::after {
  content: "−";
  transform: translateY(-50%) rotate(180deg);
  background: var(--brand);
  color: #fff;
}

#faq summary:hover {
  color: var(--brand-dark);
}

#faq details p {
  margin: 0;
  padding: 0 20px 18px;
  font-size: 0.94rem;
  animation: fadeUp 0.4s var(--ease) both;
}

/* ============ HowTo ============ */
#howto ol {
  counter-reset: step;
  list-style: none;
  padding-left: 0;
}

#howto ol li {
  position: relative;
  padding: 12px 16px 12px 52px;
  margin-bottom: 10px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  counter-increment: step;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease),
    box-shadow 0.3s var(--ease);
}

#howto ol li::before {
  content: counter(step);
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  line-height: 26px;
  text-align: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
}

#howto ol li:hover {
  transform: translateX(6px);
  border-color: var(--brand-soft);
  box-shadow: var(--shadow-sm);
}

/* ============ Contact ============ */
#contact p {
  padding-left: 0;
}

#contact p:nth-of-type(1),
#contact p:nth-of-type(2),
#contact p:nth-of-type(3),
#contact p:nth-of-type(4),
#contact p:nth-of-type(5),
#contact p:nth-of-type(6) {
  display: inline-block;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 16px;
  margin: 0 8px 10px 0;
  font-size: 0.9rem;
  transition: background 0.3s var(--ease), transform 0.3s var(--ease),
    border-color 0.3s var(--ease);
}

#contact p:nth-of-type(1):hover,
#contact p:nth-of-type(2):hover,
#contact p:nth-of-type(3):hover,
#contact p:nth-of-type(4):hover,
#contact p:nth-of-type(5):hover,
#contact p:nth-of-type(6):hover {
  background: var(--brand-soft);
  border-color: var(--brand-soft);
  transform: translateY(-2px);
}

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

#sitemap li,
#links li {
  margin: 0;
}

#sitemap a,
#links a {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  font-size: 0.88rem;
  color: var(--text-soft);
  transition: background 0.3s var(--ease), color 0.3s var(--ease),
    transform 0.3s var(--ease), border-color 0.3s var(--ease);
}

#sitemap a:hover,
#links a:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  text-decoration: none;
  transform: translateY(-2px);
}

/* ============ Footer ============ */
#site-footer {
  margin-top: 40px;
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: clamp(32px, 5vw, 56px) 20px 0;
  position: relative;
}

#site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--brand),
    var(--accent),
    var(--brand-light)
  );
}

#site-footer > section {
  max-width: var(--maxw);
  margin: 0 auto 28px;
  padding: 0 0 24px;
  border-bottom: 1px dashed var(--border);
}

#site-footer h2 {
  font-size: 1rem;
  padding-left: 14px;
  margin-bottom: 0.6em;
}

#site-footer h2::before {
  width: 4px;
}

#site-footer p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 0.5em;
}

#site-footer .copyright {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px 0 24px;
  text-align: center;
  font-size: 0.84rem;
  color: var(--text-muted);
  border: 0;
}

/* ============ Back to top ============ */
#back-to-top {
  position: fixed;
  right: 20px;
  bottom: 24px;
  z-index: 90;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--text);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.1;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: transform 0.35s var(--ease), background 0.35s var(--ease),
    color 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

#back-to-top:hover {
  background: var(--brand);
  color: #fff;
  transform: translateY(-4px) scale(1.06);
  box-shadow: 0 14px 30px rgba(232, 57, 43, 0.4);
}

/* ============ Scroll reveal ============ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  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: 1024px) {
  #main-nav ul {
    gap: 2px;
  }

  #main-nav a {
    padding: 6px 9px;
    font-size: 0.85rem;
  }

  #search-input {
    width: 120px;
  }
}

@media (max-width: 860px) {
  :root {
    --header-h: 64px;
  }

  .header-inner {
    gap: 10px;
    padding: 10px 16px;
  }

  #menu-toggle {
    display: inline-block;
    margin-left: auto;
  }

  #theme-toggle {
    display: inline-block;
  }

  #main-nav {
    flex: 1 1 100%;
    order: 10;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.45s var(--ease), opacity 0.35s var(--ease),
      margin 0.35s var(--ease);
  }

  #main-nav.is-open {
    max-height: 520px;
    opacity: 1;
    margin-top: 6px;
  }

  #main-nav ul {
    flex-direction: column;
    gap: 4px;
    padding: 8px 0;
  }

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

  #site-search {
    flex: 1 1 100%;
    order: 11;
    margin-top: 4px;
  }

  #search-input {
    width: 100%;
    flex: 1;
  }

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

  main {
    padding: 0 16px 48px;
  }

  main > section,
  #breadcrumb {
    margin-top: 40px;
  }

  #testimonials,
  #news,
  #articles {
    grid-template-columns: 1fr;
  }
}

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

  #hero {
    border-radius: var(--radius-lg);
    padding: 24px 20px;
  }

  #hero h1 {
    max-width: none;
  }

  #hero-carousel {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  #stats {
    gap: 10px;
  }

  #stats .stat {
    padding: 12px 10px;
  }

  #stats .stat span:last-child {
    font-size: 0.75rem;
  }

  #contact p:nth-of-type(1),
  #contact p:nth-of-type(2),
  #contact p:nth-of-type(3),
  #contact p:nth-of-type(4),
  #contact p:nth-of-type(5),
  #contact p:nth-of-type(6) {
    display: block;
    margin: 0 0 8px;
    border-radius: var(--radius-sm);
  }

  #back-to-top {
    width: 42px;
    height: 42px;
    right: 14px;
    bottom: 16px;
    font-size: 0.62rem;
  }

  #site-footer {
    padding-left: 16px;
    padding-right: 16px;
  }
}

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

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

@media print {
  #site-header,
  #back-to-top,
  #site-search,
  #menu-toggle,
  #theme-toggle {
    display: none !important;
  }

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

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