/* ==========================================================================
   KEGUANG — Direct-drive motor systems
   Design system: engineering-drawing language (hairline rules, tick marks,
   numbering), cool paper ground, deep green-black structure, copper accent.
   Self-contained: no external fonts, no CDN, no framework.
   ========================================================================== */

/* ---------- 1. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body, h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, picture, svg { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--copper); outline-offset: 3px; }

/* ---------- 2. Tokens ---------- */
:root {
  --paper:      #E8ECEE;   /* cool drawing paper          */
  --paper-2:    #F4F6F7;   /* raised paper                */
  --white:      #FFFFFF;
  --ink:        #0B1F1C;   /* deep green-black structure  */
  --ink-2:      #16302B;
  --panel:      #0E2420;
  --copper:     #B9713F;   /* copper winding — the accent */
  --copper-2:   #D99A6C;
  --steel:      #5C6E72;   /* secondary text              */
  --line:       #CFD8DB;
  --line-2:     #E1E7E9;
  --on-dark:    #E9EEE9;
  --on-dark-2:  #9FB0AC;

  --font-sans: "Segoe UI", "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "Consolas", "SFMono-Regular", ui-monospace, "Cascadia Mono", Menlo, monospace;

  --maxw: 1280px;
  --gutter: clamp(20px, 4vw, 56px);
  --sect-y: clamp(64px, 9vw, 128px);

  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ---------- 3. Base ---------- */
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  font-feature-settings: "kern" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body[data-lang="zh"] { font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif; }

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }

h1, h2, h3 { font-weight: 700; letter-spacing: -0.025em; line-height: 1.08; text-wrap: balance; }
h1 { font-size: clamp(38px, 5.4vw, 76px); }
h2 { font-size: clamp(28px, 3.4vw, 46px); }
h3 { font-size: clamp(19px, 1.7vw, 23px); letter-spacing: -0.015em; line-height: 1.25; }
p  { max-width: 68ch; }

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--ink); color: var(--white); padding: 12px 20px;
}
.skip-link:focus { left: 12px; top: 12px; }

/* Eyebrow: real structural label (section index), not decoration */
.eyebrow {
  display: flex; align-items: center; gap: 14px;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--copper);
}
.eyebrow::after { content: ""; flex: 1; height: 1px; background: var(--line); max-width: 120px; }
.on-dark .eyebrow::after { background: rgba(233, 238, 233, .22); }

.lede { color: var(--steel); font-size: clamp(16px, 1.35vw, 18.5px); line-height: 1.6; }

/* ---------- 4. Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 26px; border: 1px solid transparent; border-radius: 0;
  font-size: 14.5px; font-weight: 600; letter-spacing: .01em;
  text-decoration: none; cursor: pointer;
  transition: background .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease);
}
.btn--copper { background: var(--copper); color: #fff; }
.btn--copper:hover { background: #A4602F; }
.btn--ghost { border-color: rgba(233,238,233,.32); color: var(--on-dark); }
.btn--ghost:hover { border-color: var(--copper); color: var(--copper-2); }
.btn--ink { border-color: var(--ink); color: var(--ink); }
.btn--ink:hover { background: var(--ink); color: var(--white); }

.link-arrow {
  display: inline-flex; align-items: baseline; gap: 8px;
  font-weight: 600; font-size: 14.5px; color: var(--ink);
  text-decoration: none; border-bottom: 1px solid var(--copper);
  padding-bottom: 2px; transition: color .18s var(--ease);
}
.link-arrow:hover { color: var(--copper); }

/* ---------- 5. Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--ink); color: var(--on-dark);
  border-bottom: 1px solid rgba(233,238,233,.10);
}
.site-header__in {
  display: flex; align-items: center; gap: clamp(18px, 3vw, 48px);
  min-height: 74px;
}
.brand { display: flex; align-items: center; gap: 13px; text-decoration: none; flex-shrink: 0; }
.brand__mark {
  width: 34px; height: 34px; position: relative; flex-shrink: 0;
  border: 1.5px solid var(--copper);
}
.brand__mark::before, .brand__mark::after {
  content: ""; position: absolute; background: var(--copper);
}
.brand__mark::before { inset: 9px auto 9px 50%; width: 1.5px; transform: translateX(-50%); }
.brand__mark::after  { inset: 50% 9px auto 50%; height: 1.5px; transform: translateY(-50%); }
.brand__name { display: flex; flex-direction: column; line-height: 1.1; }
.brand__name b { font-size: 17px; letter-spacing: .14em; font-weight: 700; }
.brand__name span { font-size: 10.5px; letter-spacing: .18em; color: var(--on-dark-2); text-transform: uppercase; margin-top: 4px; }

.nav { margin-left: auto; }
.nav ul { display: flex; align-items: center; gap: clamp(18px, 2.2vw, 34px); }
.nav a {
  position: relative; font-size: 14.5px; font-weight: 500; text-decoration: none;
  color: var(--on-dark-2); padding: 6px 0; transition: color .18s var(--ease);
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--on-dark); }
.nav a[aria-current="page"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: var(--copper);
}

.lang {
  display: flex; align-items: center; gap: 2px; margin-left: clamp(12px, 2vw, 28px);
  border: 1px solid rgba(233,238,233,.22); padding: 3px;
}
.lang button {
  border: 0; background: transparent; color: var(--on-dark-2);
  font-size: 12.5px; font-weight: 600; letter-spacing: .06em;
  padding: 6px 11px; cursor: pointer; transition: background .16s var(--ease), color .16s var(--ease);
}
.lang button:hover { color: var(--on-dark); }
.lang button[aria-pressed="true"] { background: var(--copper); color: #fff; }

.nav-toggle { display: none; }

/* ---------- 6. Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background: var(--ink); color: var(--on-dark);
  padding: clamp(56px, 8vw, 108px) 0 0;
}
.hero__grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(233,238,233,.055) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(233,238,233,.055) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.9), rgba(0,0,0,.25) 70%, transparent);
}
.hero__in { position: relative; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(32px, 5vw, 72px); align-items: center; padding-bottom: clamp(52px, 7vw, 88px); }
.hero h1 { color: var(--white); margin: 22px 0 0; }
.hero h1 em { font-style: normal; color: var(--copper-2); }
.hero__lede { margin-top: 24px; color: var(--on-dark-2); font-size: clamp(16px, 1.3vw, 18px); max-width: 52ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.hero__media { position: relative; }
.hero__media img { width: 100%; height: auto; aspect-ratio: 4 / 4.2; object-fit: cover; filter: saturate(.92) contrast(1.02); }
.hero__media::before {
  content: ""; position: absolute; inset: -14px 14px 14px -14px; border: 1px solid rgba(185,113,63,.55); pointer-events: none;
}
.hero__media figcaption {
  margin-top: 12px; font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--on-dark-2);
}

/* Fact strip — the one memorable element: measured facts on a ruler */
.facts { position: relative; border-top: 1px solid rgba(233,238,233,.16); }
.facts::before {
  content: ""; position: absolute; top: -5px; left: 0; right: 0; height: 5px;
  background-image: repeating-linear-gradient(to right, rgba(233,238,233,.30) 0 1px, transparent 1px 24px);
}
.facts ul { display: grid; grid-template-columns: repeat(4, 1fr); }
.facts li { padding: 30px 0 34px; border-left: 1px solid rgba(233,238,233,.13); padding-left: clamp(16px, 2.4vw, 32px); }
.facts li:first-child { border-left: 0; padding-left: 0; }
.facts b { display: block; font-family: var(--font-mono); font-size: clamp(26px, 2.6vw, 36px); font-weight: 500; color: var(--copper-2); letter-spacing: -.02em; }
.facts span { display: block; margin-top: 6px; font-size: 13px; color: var(--on-dark-2); letter-spacing: .02em; }

/* ---------- 7. Sections ---------- */
.section { padding-block: var(--sect-y); }
.section--tint { background: var(--paper-2); border-block: 1px solid var(--line-2); }
.section__head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .85fr); gap: 24px 48px; align-items: end; margin-bottom: clamp(36px, 4.5vw, 60px); }
.section__head h2 { margin-top: 18px; }
.section__head .lede { padding-bottom: 6px; }

/* ---------- 8. Product lines ---------- */
.lines { display: grid; gap: 0; border-top: 1px solid var(--line); }
.line {
  display: grid; grid-template-columns: 84px minmax(0, 1.25fr) minmax(0, .95fr);
  gap: clamp(20px, 3vw, 48px); align-items: start;
  padding-block: clamp(28px, 3.6vw, 44px);
  border-bottom: 1px solid var(--line);
  transition: background .2s var(--ease);
}
.line:hover { background: rgba(255,255,255,.55); }
.line__no { font-family: var(--font-mono); font-size: 13px; color: var(--copper); letter-spacing: .08em; padding-top: 5px; }
.line__body h3 { margin-bottom: 10px; }
.line__body p { color: var(--steel); font-size: 15px; max-width: 56ch; }
.line__models { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chip {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .04em;
  color: var(--steel); border: 1px solid var(--line); background: var(--white);
  padding: 6px 10px; text-decoration: none; transition: border-color .16s var(--ease), color .16s var(--ease);
}
.chip:hover { border-color: var(--copper); color: var(--copper); }
.line__media { position: relative; }
.line__media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--white); }

/* ---------- 9. Applications ---------- */
.apps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.app { background: var(--paper-2); padding: clamp(22px, 2.4vw, 34px); display: flex; flex-direction: column; gap: 12px; min-height: 210px; }
.app__no { font-family: var(--font-mono); font-size: 12px; color: var(--copper); letter-spacing: .1em; }
.app h3 { font-size: 18px; }
.app p { font-size: 14px; color: var(--steel); line-height: 1.6; }

/* ---------- 10. About ---------- */
.about { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.about__body h2 { margin: 18px 0 22px; }
.about__body p { color: var(--steel); }
.about__body p + p { margin-top: 16px; }
.specs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 34px; border-top: 1px solid var(--line); padding-top: 26px; }
.specs b { display: block; font-family: var(--font-mono); font-size: 24px; color: var(--copper); font-weight: 500; }
.specs span { display: block; margin-top: 4px; font-size: 13px; color: var(--steel); }
.about__media img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.about__media figcaption { margin-top: 10px; font-size: 12.5px; color: var(--steel); }

/* ---------- 11. News ---------- */
.news-list { border-top: 1px solid var(--line); }
.news-item { display: grid; grid-template-columns: 150px minmax(0, 1fr) 150px; gap: 24px; align-items: baseline; padding-block: 26px; border-bottom: 1px solid var(--line); text-decoration: none; }
.news-item time { font-family: var(--font-mono); font-size: 12.5px; color: var(--steel); letter-spacing: .04em; }
.news-item h3 { font-size: 19px; transition: color .16s var(--ease); }
.news-item p { font-size: 14.5px; color: var(--steel); margin-top: 6px; }
.news-item:hover h3 { color: var(--copper); }
.news-item__more { justify-self: end; font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; color: var(--copper); text-transform: uppercase; }

/* ---------- 12. CTA ---------- */
.cta { background: var(--ink); color: var(--on-dark); padding-block: clamp(56px, 7vw, 92px); position: relative; overflow: hidden; }
.cta .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 32px; }
.cta h2 { color: var(--white); max-width: 18ch; }
.cta p { color: var(--on-dark-2); margin-top: 14px; font-size: 16px; }
.cta .actions { display: flex; flex-wrap: wrap; gap: 14px; }

/* ---------- 13. Footer ---------- */
.site-footer { background: var(--panel); color: var(--on-dark-2); padding-block: 56px 30px; border-top: 1px solid rgba(233,238,233,.08); }
.site-footer__top { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, .7fr)); gap: 32px 40px; padding-bottom: 44px; border-bottom: 1px solid rgba(233,238,233,.10); }
.site-footer h4 { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--on-dark); margin-bottom: 16px; font-weight: 600; }
.site-footer ul { display: grid; gap: 9px; }
.site-footer a { color: var(--on-dark-2); text-decoration: none; font-size: 14px; transition: color .16s var(--ease); }
.site-footer a:hover { color: var(--copper-2); }
.site-footer .brand { color: var(--on-dark); margin-bottom: 16px; }
.site-footer__note { font-size: 13.5px; max-width: 34ch; line-height: 1.65; }
.site-footer__bottom { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; padding-top: 24px; font-size: 12.5px; }
.site-footer__bottom p { color: var(--on-dark-2); }

/* ---------- 14. Page hero (inner pages) ---------- */
.page-hero { background: var(--ink); color: var(--on-dark); padding: clamp(52px, 7vw, 92px) 0 clamp(40px, 5vw, 64px); position: relative; overflow: hidden; }
.page-hero__grid { position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(to right, rgba(233,238,233,.05) 1px, transparent 1px), linear-gradient(to bottom, rgba(233,238,233,.05) 1px, transparent 1px);
  background-size: 72px 72px; mask-image: linear-gradient(to bottom, rgba(0,0,0,.8), transparent); }
.page-hero h1 { color: var(--white); font-size: clamp(32px, 4.2vw, 58px); margin-top: 18px; }
.page-hero .lede { color: var(--on-dark-2); margin-top: 18px; max-width: 58ch; }
.crumbs { display: flex; gap: 8px; align-items: center; font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; color: var(--on-dark-2); text-transform: uppercase; }
.crumbs a { color: var(--on-dark-2); text-decoration: none; }
.crumbs a:hover { color: var(--copper-2); }
.crumbs span { color: rgba(233,238,233,.35); }

/* ---------- 15. Products page ---------- */
.line-group { border-top: 1px solid var(--line); padding-block: clamp(36px, 5vw, 64px); }
.line-group:last-child { border-bottom: 1px solid var(--line); }
.line-group__head { display: grid; grid-template-columns: 70px minmax(0, 1fr) minmax(0, 1fr); gap: 24px 44px; margin-bottom: 34px; }
.line-group__head h2 { font-size: clamp(24px, 2.6vw, 34px); margin-top: 0; }
.line-group__head p { color: var(--steel); }
.models { display: flex; flex-wrap: wrap; border-top: 1px solid var(--line); border-left: 1px solid var(--line); background: var(--white); }
.model { flex: 0 0 25%; max-width: 25%; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--white); display: flex; flex-direction: column; }
.model figure { background: var(--white); }
.model img { width: 100%; aspect-ratio: 1 / 1; object-fit: contain; padding: 22px; background: var(--white); }
.model__body { padding: 20px 22px 26px; border-top: 1px solid var(--line-2); flex: 1; }
.model__body h3 { font-size: 17px; }
.model__body p { font-size: 13.5px; color: var(--steel); margin-top: 8px; line-height: 1.55; }
.model__tag { display: inline-block; font-family: var(--font-mono); font-size: 11px; color: var(--copper); letter-spacing: .08em; margin-bottom: 10px; text-transform: uppercase; }

/* ---------- 16. Contact ---------- */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
.contact-card { background: var(--white); border: 1px solid var(--line); padding: clamp(26px, 3vw, 40px); }
.contact-card h2 { font-size: clamp(24px, 2.4vw, 32px); margin-bottom: 24px; }
.contact-row { display: grid; grid-template-columns: 110px minmax(0,1fr); gap: 16px; padding-block: 18px; border-top: 1px solid var(--line-2); }
.contact-row:first-of-type { border-top: 0; }
.contact-row dt { font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--copper); padding-top: 3px; }
.contact-row dd { margin: 0; font-size: 15.5px; line-height: 1.6; }
.contact-row dd a { text-decoration: none; border-bottom: 1px solid var(--line); }
.contact-row dd a:hover { border-color: var(--copper); color: var(--copper); }
.contact-note { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line-2); font-size: 14px; color: var(--steel); }
.contact-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

/* ---------- 16b. Timeline / posts / value grid ---------- */
.timeline { border-top: 1px solid var(--line); max-width: 920px; }
.timeline__item { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 18px 48px; padding-block: 28px; border-bottom: 1px solid var(--line); }
.timeline__item b { font-family: var(--font-mono); font-size: 21px; font-weight: 500; color: var(--copper); letter-spacing: -.01em; }
.timeline__item h3 { margin-bottom: 8px; }
.timeline__item p { color: var(--steel); font-size: 15px; }

.apps--3 { grid-template-columns: repeat(3, 1fr); }

.post { border-top: 1px solid var(--line); padding-block: 36px; max-width: 76ch; }
.post:last-of-type { border-bottom: 1px solid var(--line); }
.post time { font-family: var(--font-mono); font-size: 12.5px; color: var(--steel); letter-spacing: .04em; }
.post h2 { font-size: clamp(22px, 2.3vw, 30px); margin: 12px 0 16px; }
.post p { color: var(--steel); font-size: 16px; line-height: 1.7; }

/* ---------- 17. Motion ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.hero__in > *, .hero .facts { animation: rise .7s var(--ease) both; }
.hero__in > *:nth-child(2) { animation-delay: .08s; }
.hero .facts { animation-delay: .16s; }
body.lang-switching main, body.lang-switching .site-header__in { animation: rise .32s var(--ease) both; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0ms !important; transition-duration: .001ms !important; }
}

/* ---------- 18. Responsive ---------- */
@media (max-width: 1080px) {
  .line { grid-template-columns: 64px minmax(0, 1fr); }
  .line__media { grid-column: 2; }
  .model { flex-basis: 50%; max-width: 50%; }
  .section__head { grid-template-columns: 1fr; }
  .apps { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .hero__in { grid-template-columns: 1fr; }
  .hero__media { order: -1; max-width: 460px; }
  .hero__media::before { inset: -10px 10px 10px -10px; }
  .facts ul { grid-template-columns: repeat(2, 1fr); }
  .facts li:nth-child(3) { border-left: 0; padding-left: 0; }
  .facts li:nth-child(3), .facts li:nth-child(4) { border-top: 1px solid rgba(233,238,233,.13); }
  .about { grid-template-columns: 1fr; }
  .about__media { max-width: 420px; }
  .contact-grid { grid-template-columns: 1fr; }
  .apps--3 { grid-template-columns: 1fr; }
  .timeline__item { grid-template-columns: 76px minmax(0, 1fr); gap: 12px 28px; }
  .site-footer__top { grid-template-columns: 1fr 1fr; }
  .line-group__head { grid-template-columns: 56px 1fr; }
  .line-group__head p { grid-column: 2; }
  .news-item { grid-template-columns: 1fr; gap: 6px; }
  .news-item__more { justify-self: start; }
  .nav { display: none; }
  .nav.is-open {
    display: block; position: absolute; left: 0; right: 0; top: 100%;
    background: var(--ink); border-bottom: 1px solid rgba(233,238,233,.12); padding: 12px var(--gutter) 22px;
  }
  .nav.is-open ul { flex-direction: column; align-items: flex-start; gap: 4px; }
  .nav.is-open a { display: block; padding: 12px 0; font-size: 16px; }
  .nav-toggle {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 40px; height: 40px; margin-left: auto; padding: 0 9px;
    background: transparent; border: 1px solid rgba(233,238,233,.22); cursor: pointer;
  }
  .nav-toggle span { display: block; height: 1.5px; background: var(--on-dark); transition: transform .2s var(--ease), opacity .2s var(--ease); }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
  .lang { margin-left: 10px; }
  .line { grid-template-columns: 44px 1fr; }
  .line__media { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .model { flex-basis: 100%; max-width: 100%; }
  .apps { grid-template-columns: 1fr; }
  .specs { grid-template-columns: 1fr 1fr; }
  .facts ul { grid-template-columns: 1fr; }
  .facts li { border-left: 0; padding-left: 0; }
  .facts li + li { border-top: 1px solid rgba(233,238,233,.13); }
  .site-footer__top { grid-template-columns: 1fr; }
  .contact-row { grid-template-columns: 1fr; gap: 4px; }
}
