:root {
  --brand: #ff6b35;
  --brand-dark: #e8551f;
  --brand-light: #ff8f5e;
  --bg-primary: #0d0d1a;
  --bg-secondary: #141428;
  --bg-card: #1a1a2e;
  --bg-card-hover: #22223a;
  --bg-glass: rgba(26, 26, 46, 0.65);
  --bg-glass-border: rgba(255, 107, 53, 0.18);
  --text-primary: #f0f0f5;
  --text-secondary: #b8b8cc;
  --text-muted: #7a7a94;
  --border-color: rgba(255, 255, 255, 0.08);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 24px rgba(255, 107, 53, 0.25);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --transition-fast: 0.18s ease;
  --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --max-width: 1200px;
  --header-height: 64px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg-primary: #f5f5fa;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f0f0f8;
    --bg-glass: rgba(255, 255, 255, 0.72);
    --bg-glass-border: rgba(255, 107, 53, 0.2);
    --text-primary: #1a1a2e;
    --text-secondary: #4a4a68;
    --text-muted: #8a8aa8;
    --border-color: rgba(0, 0, 0, 0.08);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 24px rgba(255, 107, 53, 0.15);
  }
}

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

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.75;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color var(--transition-base), color var(--transition-base);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 60% at 20% 0%, rgba(255, 107, 53, 0.08), transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 100%, rgba(15, 52, 96, 0.12), transparent 60%);
  pointer-events: none;
}

::selection {
  background: rgba(255, 107, 53, 0.35);
  color: #fff;
}

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

a:hover {
  color: var(--brand-light);
}

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

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

ul,
ol {
  list-style: none;
}

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

h1 {
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  margin-bottom: 1rem;
}

h2 {
  font-size: clamp(1.35rem, 3vw, 2rem);
  margin-bottom: 1.2rem;
  position: relative;
  padding-bottom: 0.6rem;
}

h2::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 48px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--brand), var(--brand-light));
}

h3 {
  font-size: clamp(1.1rem, 2.2vw, 1.45rem);
  margin-bottom: 0.8rem;
  color: var(--text-primary);
}

h4 {
  font-size: clamp(1rem, 1.8vw, 1.15rem);
  margin-bottom: 0.6rem;
  color: var(--brand-light);
}

p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* ===== Header ===== */
header[role="banner"] {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-glass);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border-bottom: 1px solid var(--bg-glass-border);
  transition: background var(--transition-base), box-shadow var(--transition-base);
}

header[role="banner"]::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--brand), transparent);
  opacity: 0.5;
}

header[role="banner"] nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-height);
  flex-wrap: wrap;
  gap: 8px;
}

header[role="banner"] nav > p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-secondary);
  white-space: nowrap;
  order: 1;
}

header[role="banner"] nav > p strong {
  color: var(--brand);
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

header[role="banner"] nav > ul {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
  order: 2;
}

header[role="banner"] nav > ul li a {
  display: inline-block;
  padding: 8px 14px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  position: relative;
  transition: color var(--transition-fast), background var(--transition-fast);
}

header[role="banner"] nav > ul li a::after {
  content: "";
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 60%;
  height: 2px;
  border-radius: 2px;
  background: var(--brand);
  transition: transform var(--transition-base);
  transform-origin: center;
}

header[role="banner"] nav > ul li a:hover {
  color: var(--brand);
  background: rgba(255, 107, 53, 0.08);
}

header[role="banner"] nav > ul li a:hover::after {
  transform: translateX(-50%) scaleX(1);
}

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

main > section {
  padding: 56px 0;
  border-bottom: 1px solid var(--border-color);
}

main > section:last-of-type {
  border-bottom: none;
}

/* ===== Hero / Home section ===== */
#home {
  position: relative;
  padding: 72px 0 56px;
  overflow: hidden;
}

#home::before {
  content: "";
  position: absolute;
  top: -120px;
  left: -10%;
  right: -10%;
  height: 420px;
  background: linear-gradient(135deg, rgba(255, 107, 53, 0.14) 0%, rgba(255, 107, 53, 0.04) 40%, transparent 70%);
  border-radius: 50%;
  filter: blur(60px);
  z-index: -1;
  pointer-events: none;
}

#home > h1 {
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--brand) 60%, var(--brand-light) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-fill-color: transparent;
  margin-bottom: 1.4rem;
  animation: fadeInUp 0.7s ease both;
}

#home > p {
  font-size: 1.02rem;
  max-width: 860px;
  animation: fadeInUp 0.7s 0.1s ease both;
}

#home > figure {
  margin: 2rem 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  animation: fadeInUp 0.7s 0.2s ease both;
  transition: transform var(--transition-slow), box-shadow var(--transition-slow);
}

#home > figure:hover {
  transform: translateY(-6px) scale(1.005);
  box-shadow: var(--shadow-lg), 0 0 40px rgba(255, 107, 53, 0.35);
}

#home > figure svg {
  width: 100%;
  height: auto;
  display: block;
}

#home > figure figcaption {
  padding: 12px 20px;
  font-size: 0.86rem;
  color: var(--text-muted);
  text-align: center;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
}

#home > div {
  margin-top: 2rem;
  animation: fadeInUp 0.7s 0.3s ease both;
}

#home > div > h2 {
  margin-bottom: 1.6rem;
}

#home dl {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

#home dl > div {
  display: contents;
}

#home dl dt {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--brand);
  padding: 18px 20px 4px;
  background: var(--bg-card);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  border: 1px solid var(--border-color);
  border-bottom: none;
  transition: background var(--transition-base), transform var(--transition-base);
  position: relative;
}

#home dl dt::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--brand), var(--brand-light));
  border-radius: 0 2px 2px 0;
}

#home dl dd {
  padding: 4px 20px 18px;
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-secondary);
  background: var(--bg-card);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  border: 1px solid var(--border-color);
  border-top: none;
  transition: background var(--transition-base), transform var(--transition-base);
}

#home dl dt:hover,
#home dl dt:hover + dd {
  background: var(--bg-card-hover);
  transform: translateY(-3px);
}

#home dl dt:hover + dd {
  box-shadow: var(--shadow-md);
}

/* ===== About section ===== */
#about ul {
  display: grid;
  gap: 10px;
  margin: 1rem 0 1.5rem;
}

#about ul li {
  position: relative;
  padding: 12px 16px 12px 42px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  font-size: 0.94rem;
  color: var(--text-secondary);
  transition: background var(--transition-base), transform var(--transition-base), border-color var(--transition-base);
}

#about ul li::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 8px rgba(255, 107, 53, 0.5);
}

#about ul li:hover {
  background: var(--bg-card-hover);
  border-color: var(--bg-glass-border);
  transform: translateX(4px);
}

#about ul li strong {
  color: var(--brand-light);
}

/* ===== Products section ===== */
#products h4 {
  margin-top: 1.4rem;
  padding-left: 14px;
  border-left: 3px solid var(--brand);
}

#products > ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 1.5rem;
}

#products > ul li {
  padding: 18px 20px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  font-size: 0.94rem;
  color: var(--text-secondary);
  transition: background var(--transition-base), transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}

#products > ul li strong {
  display: block;
  margin-bottom: 4px;
  color: var(--brand);
  font-size: 1rem;
}

#products > ul li:hover {
  background: var(--bg-card-hover);
  border-color: var(--bg-glass-border);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

/* ===== Solutions section ===== */
#solutions h3 {
  margin-top: 1.6rem;
  padding-left: 14px;
  border-left: 3px solid var(--brand);
}

#solutions h3:first-of-type {
  margin-top: 0.5rem;
}

/* ===== Cases section ===== */
#cases h3 {
  margin-top: 1.6rem;
  padding-left: 14px;
  border-left: 3px solid var(--brand);
}

#cases blockquote {
  position: relative;
  margin: 1rem 0;
  padding: 20px 24px 20px 52px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--brand);
  font-style: normal;
  transition: background var(--transition-base), transform var(--transition-base), box-shadow var(--transition-base);
}

#cases blockquote::before {
  content: "\201C";
  position: absolute;
  left: 16px;
  top: 8px;
  font-size: 3rem;
  line-height: 1;
  color: var(--brand);
  opacity: 0.4;
  font-family: Georgia, serif;
}

#cases blockquote p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

#cases blockquote:hover {
  background: var(--bg-card-hover);
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
}

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

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

#articles article {
  padding: 22px 24px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  transition: background var(--transition-base), transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
  display: flex;
  flex-direction: column;
}

#articles article:hover {
  background: var(--bg-card-hover);
  border-color: var(--bg-glass-border);
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
}

#articles article h3 {
  font-size: 1.08rem;
  margin-bottom: 6px;
  line-height: 1.45;
}

#articles article h3 a {
  color: var(--text-primary);
  transition: color var(--transition-fast);
}

#articles article h3 a:hover {
  color: var(--brand);
}

#articles article time {
  display: inline-block;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

#articles article p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  flex: 1;
}

#articles article p:last-child {
  margin-bottom: 0;
  margin-top: 12px;
}

#articles article p:last-child a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--brand);
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 107, 53, 0.1);
  transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}

#articles article p:last-child a::after {
  content: "\2192";
  transition: transform var(--transition-fast);
}

#articles article p:last-child a:hover {
  background: var(--brand);
  color: #fff;
  transform: translateX(2px);
}

#articles article p:last-child a:hover::after {
  transform: translateX(3px);
}

/* ===== FAQ section ===== */
#faq details {
  margin-bottom: 10px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  overflow: hidden;
  transition: background var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base);
}

#faq details[open] {
  border-color: var(--bg-glass-border);
  box-shadow: var(--shadow-sm);
}

#faq details:hover {
  border-color: var(--bg-glass-border);
}

#faq summary {
  cursor: pointer;
  padding: 16px 48px 16px 20px;
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--text-primary);
  position: relative;
  list-style: none;
  transition: color var(--transition-fast), background var(--transition-fast);
  user-select: none;
}

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

#faq summary::after {
  content: "";
  position: absolute;
  right: 20px;
  top: 50%;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--brand);
  border-bottom: 2px solid var(--brand);
  transform: translateY(-70%) rotate(45deg);
  transition: transform var(--transition-base);
}

#faq details[open] summary::after {
  transform: translateY(-30%) rotate(-135deg);
}

#faq summary:hover {
  color: var(--brand);
  background: rgba(255, 107, 53, 0.05);
}

#faq details > p {
  padding: 0 20px 18px;
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-secondary);
  animation: fadeInUp 0.3s ease both;
}

/* ===== HowTo section ===== */
#howto h3 {
  margin-top: 1.6rem;
  padding-left: 14px;
  border-left: 3px solid var(--brand);
}

#howto h3:first-of-type {
  margin-top: 0.5rem;
}

#howto ul {
  display: grid;
  gap: 8px;
  margin: 1rem 0 1.5rem;
}

#howto ul li {
  position: relative;
  padding: 10px 16px 10px 40px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  font-size: 0.92rem;
  color: var(--text-secondary);
  transition: background var(--transition-base), transform var(--transition-base), border-color var(--transition-base);
}

#howto ul li::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 8px rgba(255, 107, 53, 0.5);
}

#howto ul li:hover {
  background: var(--bg-card-hover);
  border-color: var(--bg-glass-border);
  transform: translateX(4px);
}

#howto ul li strong {
  color: var(--brand-light);
}

#howto h4 {
  margin-top: 1.4rem;
  padding: 12px 18px;
  background: linear-gradient(135deg, rgba(255, 107, 53, 0.12), rgba(255, 107, 53, 0.03));
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--brand);
  color: var(--brand-light);
}

/* ===== Contact section ===== */
#contact dl {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin: 1.2rem 0 1.8rem;
}

#contact dl dt {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 14px 18px 2px;
  background: var(--bg-card);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  border: 1px solid var(--border-color);
  border-bottom: none;
}

#contact dl dd {
  margin: 0;
  padding: 2px 18px 14px;
  font-size: 0.94rem;
  color: var(--text-secondary);
  background: var(--bg-card);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  border: 1px solid var(--border-color);
  border-top: none;
  transition: background var(--transition-base);
}

#contact dl dt:hover,
#contact dl dt:hover + dd {
  background: var(--bg-card-hover);
}

#contact ul {
  display: grid;
  gap: 10px;
  margin: 1rem 0 1.5rem;
}

#contact ul li {
  position: relative;
  padding: 12px 16px 12px 42px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  font-size: 0.94rem;
  color: var(--text-secondary);
  transition: background var(--transition-base), transform var(--transition-base), border-color var(--transition-base);
}

#contact ul li::before {
  content: "\2713";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  background: var(--brand);
  border-radius: 50%;
}

#contact ul li:hover {
  background: var(--bg-card-hover);
  border-color: var(--bg-glass-border);
  transform: translateX(4px);
}

/* ===== Sitemap & Links sections ===== */
#sitemap > ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

#sitemap > ul > li {
  padding: 16px 20px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  font-weight: 600;
  transition: background var(--transition-base), transform var(--transition-base), border-color var(--transition-base);
}

#sitemap > ul > li:hover {
  background: var(--bg-card-hover);
  border-color: var(--bg-glass-border);
  transform: translateY(-3px);
}

#sitemap > ul > li > a {
  color: var(--text-primary);
  font-size: 1rem;
}

#sitemap > ul > li > a:hover {
  color: var(--brand);
}

#sitemap > ul > li > ul {
  margin-top: 10px;
  padding-left: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#sitemap > ul > li > ul li a {
  font-size: 0.88rem;
  font-weight: 400;
  color: var(--text-secondary);
  padding: 4px 0;
  display: inline-block;
  transition: color var(--transition-fast), transform var(--transition-fast);
}

#sitemap > ul > li > ul li a:hover {
  color: var(--brand);
  transform: translateX(4px);
}

#links > ul {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

#links > ul li a {
  display: inline-block;
  padding: 10px 20px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  transition: background var(--transition-base), color var(--transition-base), border-color var(--transition-base), transform var(--transition-base), box-shadow var(--transition-base);
}

#links > ul li a:hover {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow);
}

/* ===== Footer ===== */
footer[role="contentinfo"] {
  position: relative;
  margin-top: 40px;
  padding: 48px 20px 32px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
}

footer[role="contentinfo"]::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--brand), transparent);
  opacity: 0.6;
}

footer[role="contentinfo"] > section {
  max-width: var(--max-width);
  margin: 0 auto 28px;
}

footer[role="contentinfo"] > section:last-of-type {
  margin-bottom: 0;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

footer[role="contentinfo"] h2 {
  font-size: 1.05rem;
  margin-bottom: 0.8rem;
  padding-bottom: 0.4rem;
}

footer[role="contentinfo"] h2::after {
  width: 32px;
  height: 2px;
}

footer[role="contentinfo"] p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 0.6rem;
}

footer[role="contentinfo"] p:last-child {
  margin-bottom: 0;
}

/* ===== Scroll animations ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

main > section {
  animation: fadeInUp 0.6s ease both;
  animation-timeline: view();
  animation-range: entry 0% entry 30%;
}

@supports not (animation-timeline: view()) {
  main > section {
    animation: fadeIn 0.5s ease both;
  }
}

/* ===== Responsive: Tablet ===== */
@media (max-width: 900px) {
  header[role="banner"] nav {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 20px;
    gap: 10px;
  }

  header[role="banner"] nav > ul {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  header[role="banner"] nav > ul::-webkit-scrollbar {
    display: none;
  }

  header[role="banner"] nav > ul li a {
    white-space: nowrap;
    padding: 7px 12px;
    font-size: 0.86rem;
  }

  :root {
    --header-height: 96px;
  }

  main > section {
    padding: 44px 0;
  }

  #home {
    padding: 48px 0 44px;
  }

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

/* ===== Responsive: Mobile ===== */
@media (max-width: 600px) {
  body {
    font-size: 15px;
  }

  main {
    padding: 0 16px;
  }

  header[role="banner"] nav {
    padding: 10px 16px;
  }

  header[role="banner"] nav > p {
    font-size: 0.82rem;
  }

  header[role="banner"] nav > p strong {
    font-size: 0.95rem;
  }

  main > section {
    padding: 36px 0;
  }

  #home {
    padding: 36px 0;
  }

  #home dl {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  #home dl dt {
    padding: 14px 16px 4px;
    font-size: 1rem;
  }

  #home dl dd {
    padding: 4px 16px 14px;
    font-size: 0.88rem;
  }

  #products > ul {
    grid-template-columns: 1fr;
  }

  #products > ul li {
    padding: 16px;
  }

  #contact dl {
    grid-template-columns: 1fr;
  }

  #cases blockquote {
    padding: 16px 18px 16px 44px;
  }

  #cases blockquote::before {
    font-size: 2.4rem;
    left: 12px;
  }

  #sitemap > ul {
    grid-template-columns: 1fr;
  }

  #links > ul {
    gap: 8px;
  }

  #links > ul li a {
    padding: 8px 16px;
    font-size: 0.84rem;
  }

  footer[role="contentinfo"] {
    padding: 36px 16px 24px;
  }

  h2::after {
    width: 36px;
  }

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

  #faq summary::after {
    right: 16px;
  }

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

  #howto h4 {
    padding: 10px 14px;
    font-size: 0.96rem;
  }

  #articles article {
    padding: 18px 18px;
  }
}

/* ===== Small mobile ===== */
@media (max-width: 380px) {
  main {
    padding: 0 12px;
  }

  header[role="banner"] nav {
    padding: 8px 12px;
  }

  header[role="banner"] nav > ul li a {
    padding: 6px 10px;
    font-size: 0.82rem;
  }

  #home > figure figcaption {
    font-size: 0.78rem;
    padding: 10px 14px;
  }
}

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

/* ===== Print ===== */
@media print {
  header[role="banner"],
  footer[role="contentinfo"],
  #links,
  #sitemap {
    display: none;
  }

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

  main > section {
    page-break-inside: avoid;
  }
}

/* ===== Focus visible for accessibility ===== */
summary:focus-visible,
details:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ===== Custom scrollbar ===== */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--brand), var(--brand-dark));
  border-radius: 6px;
  border: 2px solid var(--bg-primary);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--brand-light);
}