:root {
  --navy: #1d2c54;
  --navy-2: #222c59;
  --ink: #2a2f3a;
  --muted: #6b7280;
  --line: #e5e7eb;
  --paper: #ffffff;
  --wash: #f5f6f8;
  --accent: #f0c020;
  --accent-dark: #e0b010;
  --danger: #c45c5c;
  --shell: min(1180px, calc(100% - 2.5rem));
  --font: Helvetica, "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", "Noto Sans", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
}
img { max-width: 100%; display: block; }
a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--danger); }
.shell { width: var(--shell); margin-inline: auto; }
.skip-link { position: absolute; left: -999px; }
.skip-link:focus { left: 0; z-index: 99; background: #000; color: #fff; padding: .5rem; }

/* —— Header (HF: transparent on home, cleaner) —— */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.site-header--transparent {
  position: absolute; left: 0; right: 0;
  background: transparent;
  border-bottom: 0;
}
.site-header--transparent .brand,
.site-header--transparent .nav-list a,
.site-header--transparent .brand-zh { color: #fff; }
.site-header--transparent .brand-en { color: rgba(255,255,255,.75); }
.site-header--transparent .lang-btn {
  background: transparent; color: #fff; border: 0;
}
.site-header--transparent .lang-switch { border: 0; background: transparent; gap: .35rem; }
.site-header--transparent .lang-btn.is-active {
  background: transparent; color: var(--accent); border-bottom: 2px solid var(--accent);
}
.site-header--transparent .nav-toggle { border-color: rgba(255,255,255,.4); background: transparent; }
.site-header--transparent .nav-toggle span { background: #fff; }
.site-header--transparent .header-cta { display: none; }

.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 78px;
}
.brand { display: flex; align-items: center; gap: .75rem; color: var(--navy); }
.brand:hover { color: var(--navy); }
.brand-mark {
  width: 44px; height: 44px; display: grid; place-items: center;
  background: var(--danger); color: #fff; font-weight: 800; font-size: .9rem;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-zh { font-weight: 800; font-size: 1.02rem; }
.brand-en { font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.site-nav { display: flex; align-items: center; gap: 1.25rem; }
.nav-list { display: flex; gap: 1.35rem; list-style: none; margin: 0; padding: 0; }
.nav-list a {
  font-size: .95rem; font-weight: 600; color: var(--navy-2);
}
.nav-list a:hover,
.nav-list .current-menu-item > a { color: var(--danger); }
.site-header--transparent .nav-list a:hover,
.site-header--transparent .nav-list .current-menu-item > a { color: var(--accent); }
.nav-toggle { display: none; width: 42px; height: 42px; border: 1px solid var(--line); background: #fff; }
.nav-toggle span { display: block; width: 16px; height: 2px; margin: 5px auto; background: var(--ink); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .75rem 1.25rem; border: 1px solid transparent;
  font-weight: 700; font-size: .92rem; cursor: pointer; text-decoration: none;
}
.btn-accent { background: var(--accent); color: #1a1a1a; border-color: var(--accent); }
.btn-accent:hover { background: var(--accent-dark); color: #1a1a1a; }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.75); }
.btn-ghost:hover { background: #fff; color: var(--navy); }
.btn-dark { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn-dark:hover { background: #14203f; color: #fff; }
.btn-sm { padding: .45rem .85rem; font-size: .8rem; }
.header-cta { background: var(--navy); color: #fff; border-color: var(--navy); }
.header-cta:hover { background: var(--danger); border-color: var(--danger); color: #fff; }

.lang-switch { display: inline-flex; border: 1px solid var(--line); overflow: hidden; }
.lang-btn {
  min-width: 2.3rem; padding: .35rem .5rem; font-size: .72rem; font-weight: 700;
  color: var(--navy); background: #fff; border-right: 1px solid var(--line); text-decoration: none;
  text-align: center;
}
.lang-btn:last-child { border-right: 0; }
.lang-btn.is-active { background: var(--accent); color: #1a1a1a; }

/* —— HF Hero: short centered title only —— */
.hf-hero {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  color: #fff;
  overflow: hidden;
  background: #0b1224;
}
.hf-hero-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center;
}
.hf-hero-shade {
  position: absolute; inset: 0;
  background: rgba(10, 16, 32, .42);
}
.hf-hero-copy {
  position: relative; z-index: 1;
  text-align: center;
  padding: 5rem 1.25rem 3rem;
  max-width: 56rem;
}
.hf-hero-copy h1 {
  margin: 0;
  font-size: clamp(2.1rem, 5.2vw, 3.6rem);
  font-weight: 800;
  letter-spacing: .12em;
  line-height: 1.25;
  text-shadow: 0 2px 24px rgba(0,0,0,.35);
}

/* —— Section titles —— */
.hf-title {
  margin: 0 0 2rem;
  text-align: center;
  color: var(--navy);
  font-size: clamp(1.45rem, 2.6vw, 1.9rem);
  font-weight: 800;
  letter-spacing: .08em;
}
.hf-title::after {
  content: "";
  display: block;
  width: 72px; height: 2px;
  margin: .95rem auto 0;
  background: var(--navy);
}
.hf-lead {
  max-width: 48rem;
  margin: -0.75rem auto 2.25rem;
  text-align: center;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.8;
}

/* —— Certs —— */
.hf-certs { padding: 4.5rem 0 3.5rem; background: #fff; }
.hf-cert-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.15rem;
  max-width: 980px;
  margin-inline: auto;
}
.hf-cert-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .35rem;
  min-height: 130px;
  padding: 1.4rem 1rem;
  border: 1px solid var(--line);
  background: #fafafa;
  text-align: center;
}
.hf-cert-item strong {
  font-weight: 800;
  color: var(--navy);
  font-size: 1.05rem;
  letter-spacing: .02em;
}
.hf-cert-item span {
  font-size: .78rem;
  color: var(--muted);
}

/* —— Product image tiles —— */
.hf-products { padding: 3.5rem 0 4.5rem; background: #fff; }
.hf-cat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
.hf-cat-card {
  position: relative;
  display: block;
  min-height: 360px;
  overflow: hidden;
  color: #fff;
  isolation: isolate;
  border-radius: 2px;
}
.hf-cat-card img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
.hf-cat-card:hover img { transform: scale(1.05); }
.hf-cat-overlay {
  position: relative; z-index: 1;
  height: 100%;
  min-height: 360px;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center;
  padding: 2.25rem 1.75rem;
  background: rgba(12, 18, 36, .58);
}
.hf-cat-overlay h3 {
  margin: 0 0 1rem;
  font-size: clamp(1.35rem, 2.3vw, 1.7rem);
  font-weight: 800;
  letter-spacing: .08em;
  color: #fff;
}
.hf-cat-overlay ul {
  margin: 0; padding: 0; list-style: none;
  display: grid; gap: .4rem;
}
.hf-cat-overlay li {
  font-size: .98rem;
  color: rgba(255,255,255,.92);
  letter-spacing: .04em;
}
.hf-cat-overlay li::before {
  content: "· ";
  color: var(--accent);
  font-weight: 800;
}

/* —— Service —— */
.hf-service { padding: 4rem 0; background: var(--wash); }
.hf-service-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
.hf-service-card {
  background: #fff;
  border-top: 3px solid var(--navy);
  padding: 1.5rem 1.2rem 1.4rem;
  box-shadow: 0 8px 24px rgba(29,44,84,.06);
}
.hf-service-num {
  display: inline-block;
  margin-bottom: .6rem;
  font-weight: 800;
  color: var(--accent-dark);
  letter-spacing: .08em;
}
.hf-service-card h3 {
  margin: 0 0 .5rem;
  color: var(--navy);
  font-size: 1.05rem;
}
.hf-service-card p {
  margin: 0;
  color: var(--muted);
  font-size: .92rem;
}

/* —— Why —— */
.hf-why { padding: 4rem 0; background: #fff; }
.hf-why-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
.hf-why-card {
  padding: 1.5rem 1.2rem;
  border: 1px solid var(--line);
  background: var(--wash);
}
.hf-why-card h3 {
  margin: 0 0 .55rem;
  color: var(--navy);
  font-size: 1.05rem;
}
.hf-why-card p { margin: 0; color: var(--muted); font-size: .92rem; }

/* —— Partners —— */
.hf-partners { padding: 3.25rem 0 3.75rem; background: var(--wash); }
.hf-partner-list {
  display: flex; flex-wrap: wrap; justify-content: center; gap: .65rem;
  list-style: none; margin: 0; padding: 0;
}
.hf-partner-list li {
  padding: .7rem 1.1rem;
  background: #fff;
  border: 1px solid var(--line);
  font-weight: 800;
  color: var(--navy);
  letter-spacing: .04em;
}

/* —— Inquiry (HF yellow CTA) —— */
.hf-inquiry {
  padding: 4rem 0;
  background: linear-gradient(135deg, var(--accent) 0%, #f5d45a 100%);
}
.hf-inquiry-inner { max-width: 44rem; text-align: center; }
.hf-inquiry h2 {
  margin: 0 0 1.25rem;
  color: #1a1a1a;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
}
.hf-steps {
  text-align: left;
  margin: 0 auto 1.5rem;
  padding-left: 1.2rem;
  color: #333;
  max-width: 36rem;
}
.hf-steps li { margin: .45rem 0; }

/* —— Service page (match hfrubber.com.tw/service/) —— */
.svc-page {
  position: relative;
  background: #dfe5ee center / cover fixed no-repeat;
  background-image: linear-gradient(rgba(255,255,255,.72), rgba(255,255,255,.78)), var(--svc-bg);
}
.svc-stage {
  padding: 2.5rem 0 3.5rem;
  min-height: 70vh;
}
.svc-stage--continue {
  min-height: 0;
  padding: 1.25rem 0 2.5rem;
}
.svc-stage-inner { max-width: 1100px; }
.svc-crumb {
  margin: 0 0 .75rem;
  color: var(--muted);
  font-size: .85rem;
}
.svc-page-title {
  margin: 0 0 1.75rem;
  color: var(--navy);
  font-size: clamp(1.9rem, 3.2vw, 2.5rem);
  font-weight: 800;
  letter-spacing: .08em;
}
.svc-glass {
  background: rgba(255, 255, 255, .88);
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(29, 44, 84, .1);
  padding: 2.4rem 2rem 2.2rem;
  backdrop-filter: blur(2px);
}
.svc-glass--block {
  max-width: 920px;
  margin-inline: auto;
  padding: 2.2rem 2rem 2rem;
}
.svc-glass-title {
  margin: 0;
  text-align: center;
  color: var(--navy);
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
  font-weight: 800;
  letter-spacing: .06em;
}
.svc-glass-rule {
  width: 64px;
  height: 2px;
  margin: .95rem auto 1.25rem;
  background: var(--navy);
}
.svc-glass-lead {
  max-width: 46rem;
  margin: 0 auto 1.75rem;
  text-align: center;
  color: #333;
  font-size: .98rem;
  line-height: 1.85;
}
.svc-icons {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  max-width: 980px;
  margin: 0.5rem auto 0;
}
.svc-icon-card { text-align: center; }
.svc-icon-frame {
  background: #000;
  border-radius: 4px;
  overflow: hidden;
  aspect-ratio: 1;
  margin-bottom: .75rem;
}
.svc-icon-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.svc-icon-card h3 {
  margin: 0;
  color: var(--navy);
  font-size: .92rem;
  font-weight: 800;
  letter-spacing: .03em;
  line-height: 1.4;
}
.svc-list {
  max-width: 28rem;
  margin: 0 auto 1.5rem;
  padding: 0;
  list-style: none;
  display: grid;
  gap: .5rem;
}
.svc-list li {
  position: relative;
  padding-left: 1.1rem;
  color: #222;
  font-size: .98rem;
}
.svc-list li::before {
  content: "";
  position: absolute;
  left: 0; top: .55em;
  width: .4rem; height: .4rem;
  background: var(--accent);
}
.svc-suit {
  text-align: center;
  color: var(--navy);
  font-weight: 700;
  font-size: .95rem;
  margin: 0 0 .5rem;
}
.svc-carousel {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .75rem;
  margin-top: 1.25rem;
}
.svc-carousel img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  border-radius: 4px;
}
.svc-product-shot {
  max-width: 420px;
  margin: 1.25rem auto 0;
}
.svc-product-shot img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
}

/* legacy svc-* cleanup kept minimal */
.svc-hero, .svc-block, .svc-body, .svc-process-grid, .svc-process-card,
.svc-process-icon, .svc-bullets, .svc-gallery { display: contents; }

/* —— Inner pages keep usable —— */
.section { padding: 3rem 0; }
.section-alt { background: var(--wash); }
.section-head { margin-bottom: 1.4rem; }
.section-head h2, .page-hero h1 {
  margin: 0 0 .4rem; color: var(--navy); font-weight: 800;
}
.page-hero { padding: 2.4rem 0 1.2rem; border-bottom: 1px solid var(--line); background: var(--wash); }
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .85rem; }
.product-card { background: #fff; border: 1px solid var(--line); overflow: hidden; }
.product-visual { aspect-ratio: 1; background: #eef1f5; }
.product-visual img { width: 100%; height: 100%; object-fit: cover; }
.product-body { padding: .85rem .9rem 1rem; }
.product-cat { font-size: .68rem; letter-spacing: .08em; color: var(--danger); font-weight: 800; }
.product-name { margin: .2rem 0; font-size: 1rem; color: var(--navy); }
.product-en, .product-desc { margin: .15rem 0 0; font-size: .86rem; color: var(--muted); }
.products-layout { display: grid; grid-template-columns: 220px 1fr; gap: 1.5rem; }
.filter-list { list-style: none; margin: 0; padding: 0; }
.filter-list a {
  display: flex; flex-direction: column; padding: .55rem 0;
  border-bottom: 1px solid var(--line); color: var(--navy); font-weight: 700;
}
.filter-list a.is-active { color: var(--danger); }
.prose p { color: var(--muted); }
.contact-grid, .about-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 1.5rem; }
.sales-card, .info-card, .location-card, .contact-form-wrap, .cap-card {
  background: #fff; border: 1px solid var(--line); padding: 1rem;
}
.sales-list, .cap-grid { display: grid; gap: .75rem; }
.cap-grid { grid-template-columns: 1fr 1fr; }
.contact-form { display: grid; gap: .7rem; }
.contact-form label { display: grid; gap: .25rem; font-size: .85rem; font-weight: 700; }
.contact-form input, .contact-form textarea {
  width: 100%; padding: .65rem .75rem; border: 1px solid var(--line); background: var(--wash); font: inherit;
}
.form-success { padding: .7rem; background: #e8f5ee; border: 1px solid #b7dfc8; }
.location-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
.text-link { font-weight: 700; color: var(--navy); }
.muted { color: var(--muted); }

.site-footer {
  background: #0f172a; color: rgba(255,255,255,.72); padding: 2.75rem 0 1.2rem;
}
.footer-grid {
  display: grid; grid-template-columns: 1.3fr 1fr 1.2fr 1.1fr; gap: 1.4rem;
  padding-bottom: 1.4rem; border-bottom: 1px solid rgba(255,255,255,.1);
}
.footer-name { color: #fff; font-weight: 800; margin: 0 0 .25rem; }
.footer-en { margin: 0 0 .4rem; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
.footer-tag { margin: 0; }
.footer-heading { margin: 0 0 .65rem; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: #fff; }
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links a, .footer-meta a { color: inherit; }
.footer-links a:hover, .site-footer a:hover { color: var(--accent); }
.footer-meta { margin: 0 0 .7rem; font-size: .85rem; }
.footer-bottom { padding-top: 1rem; font-size: .78rem; color: rgba(255,255,255,.4); }

@media (max-width: 980px) {
  .hf-cat-grid, .hf-cert-row, .hf-service-grid, .hf-why-grid,
  .product-grid, .footer-grid, .about-grid, .contact-grid, .cap-grid, .location-grid,
  .machine-grid {
    grid-template-columns: 1fr 1fr;
  }
  .svc-icons { grid-template-columns: repeat(3, 1fr); }
  .svc-carousel { grid-template-columns: 1fr 1fr; }
  .products-layout { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: .75rem;
    padding: .9rem 1rem 1.1rem; background: #0f172a; border-bottom: 1px solid rgba(255,255,255,.1);
  }
  .site-header:not(.site-header--transparent) .site-nav { background: #fff; }
  .site-nav.is-open { display: flex; }
  .nav-list { flex-direction: column; gap: 0; width: 100%; }
  .nav-list a { display: block; padding: .7rem 0; border-bottom: 1px solid rgba(255,255,255,.12); color: #fff; }
  .site-header:not(.site-header--transparent) .nav-list a { color: var(--navy); border-color: var(--line); }
  .lang-switch { width: 100%; }
  .lang-btn { flex: 1; }
  .header-cta { width: 100%; }
  .hf-hero { min-height: 78vh; }
  .hf-cat-grid, .hf-cert-row, .hf-service-grid, .hf-why-grid,
  .product-grid, .footer-grid, .about-grid, .contact-grid, .cap-grid, .location-grid,
  .machine-grid, .svc-icons, .svc-carousel {
    grid-template-columns: 1fr;
  }
  .svc-icons { grid-template-columns: 1fr 1fr; }
  .product-grid { grid-template-columns: 1fr 1fr; }
  .hf-cat-card, .hf-cat-overlay { min-height: 260px; }
  .svc-glass { padding: 1.5rem 1.1rem 1.4rem; }
  .svc-page { background-attachment: scroll; }
}
@media (max-width: 420px) {
  .product-grid { grid-template-columns: 1fr; }
  .hf-hero-actions { flex-direction: column; }
  .hf-hero-actions .btn { width: 100%; }
}
