:root{
  --brand:#c8a24a;
  --brand-deep:#8a6d1f;
  --brand-soft:#fff8e1;
  --brand-glow:rgba(200,162,74,.35);
  --bg:#fbf7ee;
  --bg-alt:#f4ecda;
  --surface:rgba(255,255,255,.72);
  --surface-solid:#ffffff;
  --surface-strong:rgba(255,255,255,.9);
  --text:#2b2416;
  --text-soft:#5c5238;
  --text-muted:#8a8064;
  --border:rgba(138,109,31,.16);
  --border-strong:rgba(138,109,31,.3);
  --shadow-sm:0 2px 8px rgba(58,45,15,.06);
  --shadow-md:0 10px 30px rgba(58,45,15,.1);
  --shadow-lg:0 22px 60px rgba(58,45,15,.16);
  --radius-sm:10px;
  --radius-md:16px;
  --radius-lg:24px;
  --radius-pill:999px;
  --header-h:72px;
  --ease:cubic-bezier(.22,.61,.36,1);
  --grad-banner:linear-gradient(135deg,#c8a24a 0%,#e3c878 38%,#f6e6b8 62%,#b98f36 100%);
  --grad-accent:linear-gradient(120deg,#8a6d1f,#c8a24a 55%,#e3c878);
  --font-sans:"PingFang SC","Hiragino Sans GB","Microsoft YaHei","Noto Sans SC",system-ui,-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
}

body.theme-dark{
  --bg:#14110a;
  --bg-alt:#1b1710;
  --surface:rgba(38,32,20,.62);
  --surface-solid:#221d13;
  --surface-strong:rgba(46,39,24,.86);
  --text:#f4ecd8;
  --text-soft:#d3c8ab;
  --text-muted:#9d9276;
  --border:rgba(200,162,74,.2);
  --border-strong:rgba(200,162,74,.4);
  --brand-soft:#2a2313;
  --shadow-sm:0 2px 8px rgba(0,0,0,.4);
  --shadow-md:0 10px 30px rgba(0,0,0,.5);
  --shadow-lg:0 22px 60px rgba(0,0,0,.6);
  --grad-banner:linear-gradient(135deg,#3a2f14 0%,#6b5522 40%,#8a6d1f 70%,#2e2611 100%);
}

*,
*::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.75;
  color:var(--text);
  background:
    radial-gradient(1200px 600px at 85% -10%,var(--brand-glow),transparent 60%),
    radial-gradient(900px 500px at -10% 20%,rgba(227,200,120,.22),transparent 55%),
    var(--bg);
  background-attachment:fixed;
  transition:background-color .4s var(--ease),color .4s var(--ease);
  overflow-x:hidden;
}

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

a{
  color:var(--brand-deep);
  text-decoration:none;
  transition:color .25s var(--ease);
}

body.theme-dark a{
  color:var(--brand);
}

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

h1,h2,h3,h4{
  line-height:1.3;
  margin:0 0 .6em;
  font-weight:800;
  letter-spacing:.01em;
  color:var(--text);
}

h1{font-size:clamp(1.7rem,3.4vw,2.6rem);}
h2{font-size:clamp(1.4rem,2.6vw,2rem);}
h3{font-size:clamp(1.1rem,1.9vw,1.35rem);}
h4{font-size:1.05rem;}

p{margin:0 0 1em;}

ul,ol{
  margin:0 0 1em;
  padding-left:1.4em;
}

li{margin-bottom:.45em;}

blockquote{
  margin:1.2em 0;
  padding:1em 1.3em;
  border-left:4px solid var(--brand);
  border-radius:0 var(--radius-md) var(--radius-md) 0;
  background:var(--surface);
  -webkit-backdrop-filter:blur(12px);
  backdrop-filter:blur(12px);
  color:var(--text-soft);
  font-style:normal;
}

blockquote p:last-child{margin-bottom:0;}

code{
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  font-size:.92em;
  padding:.15em .45em;
  border-radius:6px;
  background:var(--bg-alt);
  color:var(--brand-deep);
}

.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;
}

:focus-visible{
  outline:3px solid var(--brand);
  outline-offset:2px;
  border-radius:6px;
}

::selection{
  background:var(--brand);
  color:#fff;
}

/* ---------- Header ---------- */

#site-header{
  position:sticky;
  top:0;
  z-index:100;
  background:var(--surface-strong);
  -webkit-backdrop-filter:blur(18px) saturate(160%);
  backdrop-filter:blur(18px) saturate(160%);
  border-bottom:1px solid var(--border);
  transition:box-shadow .3s var(--ease),background-color .3s var(--ease);
}

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

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

.brand-logo{
  display:inline-flex;
  align-items:center;
  gap:10px;
  flex-shrink:0;
  text-decoration:none;
  color:var(--text);
}

.brand-logo:hover{
  text-decoration:none;
}

.brand-logo svg{
  border-radius:12px;
  box-shadow:0 6px 18px var(--brand-glow);
  transition:transform .4s var(--ease);
}

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

.brand-name{
  font-size:1.15rem;
  font-weight:900;
  letter-spacing:.02em;
  background:var(--grad-accent);
  -webkit-background-clip:text;
  background-clip:text;
  -webkit-text-fill-color:transparent;
  color:transparent;
  white-space:nowrap;
}

#main-nav{
  flex:1 1 auto;
}

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

#main-nav li{
  margin:0;
}

#main-nav a{
  display:inline-block;
  padding:7px 12px;
  border-radius:var(--radius-pill);
  font-size:.92rem;
  font-weight:600;
  color:var(--text-soft);
  transition:background-color .25s var(--ease),color .25s var(--ease),transform .25s var(--ease);
}

#main-nav a:hover,
#main-nav a:focus-visible{
  background:var(--brand-soft);
  color:var(--brand-deep);
  text-decoration:none;
  transform:translateY(-1px);
}

body.theme-dark #main-nav a:hover,
body.theme-dark #main-nav a:focus-visible{
  color:var(--brand);
}

#site-search{
  display:flex;
  align-items:center;
  gap:6px;
  flex-shrink:0;
}

#site-search input{
  width:200px;
  padding:8px 14px;
  font:inherit;
  font-size:.9rem;
  color:var(--text);
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius-pill);
  -webkit-backdrop-filter:blur(8px);
  backdrop-filter:blur(8px);
  transition:border-color .25s var(--ease),box-shadow .25s var(--ease),width .3s var(--ease);
}

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

#site-search input:focus{
  outline:none;
  border-color:var(--brand);
  box-shadow:0 0 0 4px var(--brand-glow);
  width:230px;
}

#site-search button,
#theme-toggle,
#menu-toggle{
  font:inherit;
  font-size:.88rem;
  font-weight:700;
  padding:8px 16px;
  border-radius:var(--radius-pill);
  border:1px solid var(--border-strong);
  background:var(--surface);
  color:var(--text-soft);
  cursor:pointer;
  white-space:nowrap;
  -webkit-backdrop-filter:blur(8px);
  backdrop-filter:blur(8px);
  transition:background-color .25s var(--ease),color .25s var(--ease),transform .25s var(--ease),box-shadow .25s var(--ease);
}

#site-search button{
  background:var(--grad-accent);
  color:#fff;
  border-color:transparent;
}

#site-search button:hover,
#theme-toggle:hover,
#menu-toggle:hover{
  transform:translateY(-2px);
  box-shadow:var(--shadow-sm);
}

#site-search button:hover{
  filter:brightness(1.06);
}

#theme-toggle:hover,
#menu-toggle:hover{
  background:var(--brand-soft);
  color:var(--brand-deep);
}

#menu-toggle{
  display:none;
}

/* ---------- Main layout ---------- */

main{
  max-width:1240px;
  margin:0 auto;
  padding:0 20px 60px;
}

main > section{
  margin-top:56px;
  opacity:0;
  transform:translateY(28px);
  transition:opacity .7s var(--ease),transform .7s var(--ease);
}

main > section.is-revealed,
main > section#hero{
  opacity:1;
  transform:none;
}

main > section > h2{
  position:relative;
  padding-bottom:14px;
  margin-bottom:28px;
}

main > section > h2::after{
  content:"";
  position:absolute;
  left:0;
  bottom:0;
  width:64px;
  height:4px;
  border-radius:var(--radius-pill);
  background:var(--grad-accent);
}

/* ---------- Hero ---------- */

#hero{
  margin-top:28px;
  padding:clamp(20px,4vw,44px);
  border-radius:var(--radius-lg);
  background:var(--grad-banner);
  box-shadow:var(--shadow-lg);
  position:relative;
  overflow:hidden;
  color:#2b2416;
}

#hero::before{
  content:"";
  position:absolute;
  inset:0;
  background:
    radial-gradient(600px 300px at 90% 0%,rgba(255,255,255,.45),transparent 60%),
    radial-gradient(500px 260px at 0% 100%,rgba(255,255,255,.25),transparent 60%);
  pointer-events:none;
}

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

#hero h1{
  margin-top:28px;
  color:#2b2416;
  text-shadow:0 1px 0 rgba(255,255,255,.35);
}

body.theme-dark #hero h1{
  color:#fff8e1;
  text-shadow:0 2px 10px rgba(0,0,0,.5);
}

.hero-lead{
  max-width:900px;
  font-size:1.02rem;
  line-height:1.85;
  color:#3a3020;
}

body.theme-dark .hero-lead{
  color:#f0e6cc;
}

.hero-carousel{
  position:relative;
  border-radius:var(--radius-md);
  overflow:hidden;
  box-shadow:var(--shadow-md);
  background:var(--brand-soft);
  aspect-ratio:1200 / 220;
  min-height:150px;
}

.hero-carousel .slide{
  position:absolute;
  inset:0;
  opacity:0;
  transform:scale(1.04);
  transition:opacity .7s var(--ease),transform .9s var(--ease);
  pointer-events:none;
}

.hero-carousel .slide.is-active{
  opacity:1;
  transform:scale(1);
  pointer-events:auto;
}

.hero-carousel .slide svg{
  width:100%;
  height:100%;
  object-fit:cover;
}

.carousel-prev,
.carousel-next{
  position:absolute;
  top:50%;
  transform:translateY(-50%);
  z-index:3;
  font:inherit;
  font-size:.82rem;
  font-weight:700;
  padding:8px 14px;
  border-radius:var(--radius-pill);
  border:1px solid rgba(255,255,255,.6);
  background:rgba(255,255,255,.55);
  color:#3a3020;
  cursor:pointer;
  -webkit-backdrop-filter:blur(10px);
  backdrop-filter:blur(10px);
  transition:background-color .25s var(--ease),transform .25s var(--ease);
}

.carousel-prev{left:14px;}
.carousel-next{right:14px;}

.carousel-prev:hover,
.carousel-next:hover{
  background:rgba(255,255,255,.9);
  transform:translateY(-50%) scale(1.05);
}

.hero-stats{
  list-style:none;
  margin:26px 0 18px;
  padding:0;
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(150px,1fr));
  gap:14px;
}

.hero-stats li{
  margin:0;
  padding:16px 18px;
  border-radius:var(--radius-md);
  background:rgba(255,255,255,.5);
  border:1px solid rgba(255,255,255,.65);
  -webkit-backdrop-filter:blur(14px) saturate(150%);
  backdrop-filter:blur(14px) saturate(150%);
  font-size:.9rem;
  font-weight:600;
  color:#3a3020;
  transition:transform .3s var(--ease),box-shadow .3s var(--ease);
}

body.theme-dark .hero-stats li{
  background:rgba(20,17,10,.5);
  border-color:rgba(200,162,74,.35);
  color:#f4ecd8;
}

.hero-stats li:hover{
  transform:translateY(-4px);
  box-shadow:var(--shadow-md);
}

.hero-stats strong{
  display:block;
  font-size:1.7rem;
  font-weight:900;
  line-height:1.2;
  color:var(--brand-deep);
  font-variant-numeric:tabular-nums;
}

body.theme-dark .hero-stats strong{
  color:var(--brand);
}

.breadcrumb{
  list-style:none;
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin:0;
  padding:0;
  font-size:.85rem;
  color:#4a3f28;
}

body.theme-dark .breadcrumb{
  color:#d3c8ab;
}

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

.breadcrumb li + li::before{
  content:"/";
  opacity:.6;
}

.breadcrumb a{
  color:inherit;
  font-weight:600;
}

/* ---------- Cards / Articles ---------- */

#about,
#products,
#solutions,
#cases,
#news,
#articles,
#faq,
#howto,
#contact,
#sitemap,
#links{
  scroll-margin-top:calc(var(--header-h) + 12px);
}

#about article,
#products article,
#solutions article,
#cases article,
#news article,
#articles article,
#howto article,
#contact article{
  position:relative;
  padding:clamp(18px,2.6vw,28px);
  margin-bottom:20px;
  border-radius:var(--radius-lg);
  background:var(--surface);
  border:1px solid var(--border);
  box-shadow:var(--shadow-sm);
  -webkit-backdrop-filter:blur(16px) saturate(150%);
  backdrop-filter:blur(16px) saturate(150%);
  transition:transform .35s var(--ease),box-shadow .35s var(--ease),border-color .35s var(--ease);
}

#about article:hover,
#products article:hover,
#solutions article:hover,
#cases article:hover,
#news article:hover,
#articles article:hover,
#howto article:hover,
#contact article:hover{
  transform:translateY(-4px);
  box-shadow:var(--shadow-md);
  border-color:var(--border-strong);
}

#about article::before,
#products article::before,
#solutions article::before,
#cases article::before,
#news article::before,
#articles article::before,
#howto article::before{
  content:"";
  position:absolute;
  left:0;
  top:22px;
  bottom:22px;
  width:4px;
  border-radius:var(--radius-pill);
  background:var(--grad-accent);
  opacity:.75;
  transition:opacity .3s var(--ease);
}

#about article:hover::before,
#products article:hover::before,
#solutions article:hover::before,
#cases article:hover::before,
#news article:hover::before,
#articles article:hover::before,
#howto article:hover::before{
  opacity:1;
}

#about article h3,
#products article h3,
#solutions article h3,
#cases article h3,
#news article h3,
#articles article h3,
#howto article h3{
  color:var(--brand-deep);
}

body.theme-dark #about article h3,
body.theme-dark #products article h3,
body.theme-dark #solutions article h3,
body.theme-dark #cases article h3,
body.theme-dark #news article h3,
body.theme-dark #articles article h3,
body.theme-dark #howto article h3{
  color:var(--brand);
}

/* Articles grid */

#articles{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(320px,1fr));
  gap:20px;
}

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

#articles article{
  margin-bottom:0;
  display:flex;
  flex-direction:column;
}

#articles article > p:nth-of-type(1){
  font-size:.82rem;
  font-weight:600;
  color:var(--text-muted);
  letter-spacing:.02em;
}

#articles article > p:nth-of-type(2){
  color:var(--text-soft);
  flex:1 1 auto;
}

#articles article > a{
  align-self:flex-start;
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:8px 18px;
  border-radius:var(--radius-pill);
  background:var(--brand-soft);
  color:var(--brand-deep);
  font-size:.88rem;
  font-weight:700;
  transition:background-color .25s var(--ease),color .25s var(--ease),transform .25s var(--ease),box-shadow .25s var(--ease);
}

#articles article > a::after{
  content:"→";
  transition:transform .25s var(--ease);
}

#articles article > a:hover{
  background:var(--grad-accent);
  color:#fff;
  text-decoration:none;
  transform:translateY(-2px);
  box-shadow:0 8px 20px var(--brand-glow);
}

#articles article > a:hover::after{
  transform:translateX(4px);
}

body.theme-dark #articles article > a{
  color:var(--brand);
}

body.theme-dark #articles article > a:hover{
  color:#fff;
}

#articles article > div{
  margin-top:14px;
  padding:14px 16px;
  border-radius:var(--radius-md);
  background:var(--bg-alt);
  border:1px dashed var(--border-strong);
  font-size:.92rem;
  color:var(--text-soft);
}

#articles article > div h4{
  margin-bottom:.4em;
  font-size:.95rem;
  color:var(--brand-deep);
}

body.theme-dark #articles article > div h4{
  color:var(--brand);
}

#articles article > div p{
  margin:0;
}

/* ---------- Timeline ---------- */

.timeline{
  list-style:none;
  margin:0;
  padding:0 0 0 26px;
  position:relative;
}

.timeline::before{
  content:"";
  position:absolute;
  left:7px;
  top:6px;
  bottom:6px;
  width:2px;
  border-radius:var(--radius-pill);
  background:linear-gradient(180deg,var(--brand),transparent);
}

.timeline li{
  position:relative;
  margin-bottom:16px;
  padding:10px 14px;
  border-radius:var(--radius-sm);
  background:var(--bg-alt);
  transition:transform .3s var(--ease),background-color .3s var(--ease);
}

.timeline li::before{
  content:"";
  position:absolute;
  left:-26px;
  top:18px;
  width:12px;
  height:12px;
  border-radius:50%;
  background:var(--brand);
  box-shadow:0 0 0 4px var(--brand-glow);
}

.timeline li:hover{
  transform:translateX(6px);
  background:var(--brand-soft);
}

.timeline strong{
  color:var(--brand-deep);
  margin-right:6px;
}

body.theme-dark .timeline strong{
  color:var(--brand);
}

/* ---------- FAQ ---------- */

#faq details{
  margin-bottom:12px;
  border-radius:var(--radius-md);
  background:var(--surface);
  border:1px solid var(--border);
  -webkit-backdrop-filter:blur(14px);
  backdrop-filter:blur(14px);
  box-shadow:var(--shadow-sm);
  overflow:hidden;
  transition:border-color .3s var(--ease),box-shadow .3s var(--ease),transform .3s var(--ease);
}

#faq details:hover{
  border-color:var(--border-strong);
  box-shadow:var(--shadow-md);
  transform:translateY(-2px);
}

#faq summary{
  position:relative;
  padding:16px 52px 16px 20px;
  font-weight:700;
  color:var(--text);
  cursor:pointer;
  list-style:none;
  transition:background-color .25s var(--ease),color .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%;
  background:var(--brand-soft);
  color:var(--brand-deep);
  font-size:1.15rem;
  font-weight:700;
  line-height:1;
  transition:transform .3s var(--ease),background-color .3s var(--ease),color .3s var(--ease);
}

#faq details[open] summary{
  background:var(--brand-soft);
  color:var(--brand-deep);
}

body.theme-dark #faq details[open] summary{
  color:var(--brand);
}

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

#faq details p{
  margin:0;
  padding:0 20px 18px;
  color:var(--text-soft);
  animation:fadeSlide .45s var(--ease);
}

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

/* ---------- Contact ---------- */

#contact address{
  font-style:normal;
  padding:clamp(18px,2.6vw,28px);
  margin-bottom:20px;
  border-radius:var(--radius-lg);
  background:var(--surface);
  border:1px solid var(--border);
  box-shadow:var(--shadow-sm);
  -webkit-backdrop-filter:blur(16px);
  backdrop-filter:blur(16px);
  display:grid;
  gap:8px;
}

#contact address p{
  margin:0;
  padding:10px 14px;
  border-radius:var(--radius-sm);
  background:var(--bg-alt);
  transition:background-color .25s var(--ease),transform .25s var(--ease);
}

#contact address p:hover{
  background:var(--brand-soft);
  transform:translateX(4px);
}

/* ---------- Sitemap / Links ---------- */

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

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

#sitemap a,
#links a{
  display:inline-block;
  padding:9px 18px;
  border-radius:var(--radius-pill);
  background:var(--surface);
  border:1px solid var(--border);
  color:var(--text-soft);
  font-size:.9rem;
  font-weight:600;
  -webkit-backdrop-filter:blur(10px);
  backdrop-filter:blur(10px);
  transition:background-color .25s var(--ease),color .25s var(--ease),transform .25s var(--ease),box-shadow .25s var(--ease),border-color .25s var(--ease);
}

#sitemap a:hover,
#links a:hover{
  background:var(--grad-accent);
  color:#fff;
  border-color:transparent;
  text-decoration:none;
  transform:translateY(-3px);
  box-shadow:0 10px 24px var(--brand-glow);
}

/* ---------- Footer ---------- */

#site-footer{
  position:relative;
  margin-top:40px;
  padding:clamp(32px,5vw,60px) 20px 40px;
  background:linear-gradient(180deg,transparent,rgba(200,162,74,.12));
  border-top:1px solid var(--border);
}

#site-footer::before{
  content:"";
  position:absolute;
  top:0;
  left:50%;
  transform:translateX(-50%);
  width:min(1240px,90%);
  height:2px;
  background:var(--grad-accent);
  border-radius:var(--radius-pill);
  opacity:.6;
}

#site-footer > section{
  max-width:1240px;
  margin:0 auto 26px;
  padding:clamp(16px,2.4vw,24px);
  border-radius:var(--radius-lg);
  background:var(--surface);
  border:1px solid var(--border);
  -webkit-backdrop-filter:blur(14px);
  backdrop-filter:blur(14px);
  box-shadow:var(--shadow-sm);
  transition:transform .3s var(--ease),box-shadow .3s var(--ease);
}

#site-footer > section:hover{
  transform:translateY(-3px);
  box-shadow:var(--shadow-md);
}

#site-footer h2{
  font-size:1.05rem;
  margin-bottom:.5em;
  color:var(--brand-deep);
}

#site-footer h3{
  font-size:.98rem;
  margin-bottom:.4em;
  color:var(--brand-deep);
}

body.theme-dark #site-footer h2,
body.theme-dark #site-footer h3{
  color:var(--brand);
}

#site-footer p{
  font-size:.92rem;
  color:var(--text-soft);
  margin-bottom:.6em;
}

#site-footer p:last-child{
  margin-bottom:0;
}

#site-footer > p{
  max-width:1240px;
  margin:0 auto;
  text-align:center;
  font-size:.85rem;
  color:var(--text-muted);
  padding-top:10px;
}

#site-footer a{
  font-weight:600;
}

/* ---------- Back to top ---------- */

#back-to-top{
  position:fixed;
  right:20px;
  bottom:24px;
  z-index:90;
  font:inherit;
  font-size:.85rem;
  font-weight:700;
  padding:12px 18px;
  border-radius:var(--radius-pill);
  border:1px solid var(--border-strong);
  background:var(--surface-strong);
  color:var(--text-soft);
  cursor:pointer;
  -webkit-backdrop-filter:blur(14px);
  backdrop-filter:blur(14px);
  box-shadow:var(--shadow-md);
  opacity:0;
  visibility:hidden;
  transform:translateY(16px);
  transition:opacity .3s var(--ease),transform .3s var(--ease),visibility .3s var(--ease),background-color .25s var(--ease),color .25s var(--ease);
}

#back-to-top.is-visible{
  opacity:1;
  visibility:visible;
  transform:none;
}

#back-to-top:hover{
  background:var(--grad-accent);
  color:#fff;
  transform:translateY(-3px);
}

/* ---------- Responsive ---------- */

@media (max-width:1100px){
  #site-search input{width:160px;}
  #site-search input:focus{width:180px;}
  #main-nav a{padding:6px 9px;font-size:.86rem;}
}

@media (max-width:900px){
  .brand-bar{
    gap:10px;
    padding:10px 16px;
  }

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

  #main-nav.is-open{
    max-height:520px;
    padding-top:8px;
  }

  #main-nav ul{
    flex-direction:column;
    gap:2px;
    padding:6px 0;
    border-top:1px solid var(--border);
  }

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

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

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

  #site-search input{
    flex:1 1 auto;
    width:auto;
  }

  #site-search input:focus{
    width:auto;
  }

  #theme-toggle{
    order:3;
  }

  main > section{
    margin-top:44px;
  }

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

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

  .brand-name{font-size:1rem;}

  .brand-logo svg{width:34px;height:34px;}

  main{padding:0 14px 44px;}

  #hero{
    margin-top:16px;
    padding:18px;
    border-radius:var(--radius-md);
  }

  .hero-carousel{
    min-height:130px;
    aspect-ratio:16 / 7;
  }

  .carousel-prev,
  .carousel-next{
    font-size:0;
    width:34px;
    height:34px;
    padding:0;
    display:grid;
    place-items:center;
  }

  .carousel-prev::before,
  .carousel-next::before{
    font-size:1rem;
    font-weight:900;
  }

  .carousel-prev::before{content:"‹";}
  .carousel-next::before{content:"›";}

  .hero-stats{
    grid-template-columns:repeat(2,1fr);
    gap:10px;
  }

  .hero-stats li{
    padding:12px 14px;
    font-size:.8rem;
  }

  .hero-stats strong{
    font-size:1.35rem;
  }

  #about article,
  #products article,
  #solutions article,
  #cases article,
  #news article,
  #articles article,
  #howto article,
  #contact article{
    padding:16px 16px 16px 20px;
    border-radius:var(--radius-md);
  }

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

  #faq details p{
    padding:0 16px 16px;
    font-size:.92rem;
  }

  .timeline{
    padding-left:22px;
  }

  .timeline li::before{
    left:-22px;
  }

  #sitemap a,
  #links a{
    padding:8px 14px;
    font-size:.84rem;
  }

  #site-footer{
    padding:28px 14px 32px;
  }

  #site-footer > section{
    padding:16px;
    border-radius:var(--radius-md);
  }

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

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

  .brand-name{
    font-size:.92rem;
  }
}

/* ---------- Motion preferences ---------- */

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

  main > section{
    opacity:1;
    transform:none;
  }
}

/* ---------- Print ---------- */

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

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

  main > section{
    opacity:1;
    transform:none;
    break-inside:avoid;
  }

  a{
    color:#000;
    text-decoration:underline;
  }
}