/* ============================================================
   HUIHUI homepage: "The Stamping Line"
   Homepage-only layout. Built on main.css tokens; no new colours.
   Shared by all six language homepages (text lives in the HTML).
   ============================================================ */

.home { --pad: clamp(20px, 4vw, 40px); }
.home main section, .home main .proof { scroll-margin-top: 80px; }

/* ---------- CBAM strip: a slim steel plate, amber only on its action ---------- */
.cbam { background: var(--g750); border-bottom: 1px solid var(--g600); }
.cbam-in { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px 16px; padding-block: 8px; text-align: left; }
.cbam-txt { font-size: .9rem; color: var(--graphite); line-height: 1.4; }
.cbam-txt b { color: var(--ink); }
.cbam-cta { padding: .6rem 1rem; font-size: .88rem; flex: none; }
.cbam .tag { flex: none; }

/* ---------- Hero: the press ---------- */
.pl-hero {
  position: relative; isolation: isolate; overflow: hidden;
  background: var(--ink-section);
  height: clamp(640px, calc(100svh - 150px), 820px);
  --hole: var(--ink-section);   /* what shows through a blanked washer on the canvas */
}
.pl-photo {
  position: absolute; inset: 0; z-index: -2;
  background: url(/assets/img/factory/press-row.jpg) center 40% / cover;
  filter: grayscale(1) contrast(1.05); opacity: .55; transition: opacity .6s;
}
.pl-hero.is-live .pl-photo { opacity: .32; }
.pl-hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(to top, rgba(227,231,235,.97) 8%, rgba(227,231,235,.74) 52%, rgba(227,231,235,.30));
}
.pl-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.pl-hero.no-canvas .pl-canvas { display: none; }

.pl-copy { position: absolute; inset: auto 0 clamp(36px, 7vh, 72px) 0; margin-inline: auto; z-index: 2; pointer-events: none; }
.pl-copy-in { max-width: min(760px, 54vw); pointer-events: auto; }
.pl-copy .eyebrow { color: var(--steel); margin-bottom: 10px; }
.pl-hero h1 { font-size: clamp(2.6rem, 5.3vw, 5.4rem); line-height: .92; margin-bottom: 16px; }
.pl-lead { color: var(--graphite); font-size: clamp(1rem, 1.25vw, 1.15rem); max-width: 52ch; }
.pl-spec { color: var(--steel); font-size: .95rem; margin-top: 4px; }
.pl-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }

.pl-readout { opacity: 0; transition: opacity .4s; position: absolute; right: max(var(--pad), calc((100% - var(--container)) / 2 + var(--pad))); bottom: clamp(150px, 22vh, 220px); z-index: 2; width: 230px; text-align: right; font-size: .88rem; line-height: 1.5; color: var(--steel); }
.pl-readout .row { display: block; }
.pl-readout b { display: inline-block; min-width: 2.4ch; font: 700 2rem/1 var(--f-display); color: var(--ink); font-variant-numeric: tabular-nums; }
.pl-readout .hint { display: block; margin-top: 6px; color: var(--mist); font-size: .82rem; }
.pl-hero.is-live .pl-readout { opacity: 1; }
.pl-hero.is-armed .pl-readout .arm { color: var(--accent-ink); }

/* ---------- Shared plates ---------- */
.nb { white-space: nowrap; }
.home .tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.home h2 { color: var(--ink); }

/* ---------- Range: parts dropped on the bench ---------- */
.range { background: var(--paper); padding: clamp(40px, 5vw, 64px) 0 clamp(36px, 4.5vw, 56px); }
.range-list { display: grid; gap: 14px; }
.range-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

.part { display: flex; flex-direction: column; background: var(--g750); border: 1px solid var(--g700); border-top: 6px solid var(--g500); color: var(--graphite); text-decoration: none; transition: border-color .15s; }
.part:hover { border-top-color: var(--accent); color: var(--graphite); }
.part:focus-visible { outline-offset: 0; }
.stage { position: relative; overflow: hidden; background: var(--g800); display: flex; align-items: flex-end; justify-content: center; padding: 18px 12px 26px; aspect-ratio: 4 / 3; }
/* the bench: a steel ledge the parts land on */
.stage::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 12px; background: var(--steel-grad); border-top: 1px solid var(--g100); box-shadow: 0 -1px 0 var(--g900); }
.cut { width: 100%; display: flex; align-items: flex-end; justify-content: center; will-change: transform; }
.cut img { width: 92%; height: auto; max-height: 100%; object-fit: contain; }
.range-grid .stage { padding: 0; }
.range-grid .cut { position: absolute; inset: 0; display: block; }
.range-grid .cut img {
  position: absolute; left: 50%; top: calc(50% - 6px); width: calc(var(--s) * 100%); max-width: none; height: auto;
  transform: translate(calc(var(--cx) * -100%), calc(var(--cy) * -100%));
}
.cut img[src$="fender.png"] { --s: 1.6; --cx: .55; --cy: .43; clip-path: inset(0 8%); }
.cut img[src$="square.png"] { --s: 1.55; --cx: .338; --cy: .315; }
.cut img[src$="custom.png"] { --s: .92; --cx: .5; --cy: .5; }
.part-info { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.part-info h3 { font-size: clamp(1.3rem, 1.7vw, 1.6rem); line-height: 1.02; }
.part .std { font-size: .88rem; color: var(--steel); line-height: 1.4; flex: 1; }
.part .tags { margin-top: 4px; }

.feat { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
.feat .stage { aspect-ratio: auto; min-height: 250px; padding: 26px 28px 36px; }
.feat .cut img { width: 100%; max-height: 240px; }
.feat-meta { padding: 28px 32px; display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.feat-meta h2 { font-size: clamp(2.2rem, 3.6vw, 3.4rem); line-height: .95; }
.feat-meta .std { font-size: 1rem; color: var(--steel); line-height: 1.5; }
.feat-meta .eyebrow { color: var(--mist); }
.more { align-self: flex-start; margin-top: 6px; color: var(--ink); font-weight: 600; border-bottom: 1px solid var(--accent); padding-bottom: 2px; }
.feat:hover .more { color: var(--accent-ink); border-bottom-width: 2px; }

/* ---------- RFQ intercept ---------- */
.intercept { background: var(--g750); border-block: 1px solid var(--g600); }
.intercept-in { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 12px 28px; padding-block: 16px; text-align: center; }
.intercept-txt { font-family: var(--f-display); font-weight: 600; font-size: clamp(1.15rem, 1.7vw, 1.4rem); line-height: 1.15; color: var(--ink); max-width: none; }
.intercept-mail { color: var(--ink); font-weight: 500; border-bottom: 1px solid var(--accent); padding-bottom: 1px; }
.intercept-mail:hover { color: var(--accent-ink); }

/* ---------- Size finder callout ---------- */
.finder { background: var(--paper); padding: clamp(28px, 3.5vw, 44px) 0; }
.finder-in { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 20px 40px; padding: clamp(22px, 3vw, 32px); }
.finder-txt { max-width: 66ch; }
.finder-txt .eyebrow { margin-bottom: 4px; }
.finder-txt h2 { font-size: clamp(1.7rem, 2.6vw, 2.3rem); margin-bottom: 8px; }
.finder-txt p { color: var(--steel); font-size: 1rem; line-height: 1.55; max-width: none; }
.finder .btn { white-space: nowrap; }

/* ---------- Process line ---------- */
.line { background: var(--paper-2); padding: clamp(40px, 5vw, 64px) 0 clamp(44px, 5vw, 68px); }
.line-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 8px 32px; margin-bottom: 30px; }
.line-head h2 { font-size: clamp(2rem, 3.4vw, 3rem); }
.line-head p { color: var(--steel); max-width: 44ch; }
.line-body { position: relative; }

/* the rail: a punched strip; the bright part is what has been fed through so far */
.rail { display: none; }
.steps { display: grid; grid-template-columns: 1fr; gap: 14px; padding: 0; margin: 0; list-style: none; }
.step { position: relative; display: grid; grid-template-columns: 112px 1fr; grid-template-areas: "fig h" "fig p"; column-gap: 16px; align-content: start; }
.step figure { grid-area: fig; aspect-ratio: 4 / 3; overflow: hidden; background: var(--g900); border: 1px solid var(--g700); align-self: start; }
.step img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.8) contrast(1.04); }
.step h3 { grid-area: h; font-size: 1.45rem; line-height: 1.05; align-self: end; }
.step p { grid-area: p; font-size: .92rem; color: var(--steel); margin-top: 4px; }
.step .n { position: absolute; left: 0; top: 0; z-index: 2; min-width: 28px; height: 28px; padding: 0 8px; display: grid; place-items: center; background: var(--g850); border: 1px solid var(--g600); border-left: 0; border-top: 0; font: 800 1.15rem/1 var(--f-display); color: var(--ink); }

@media (min-width: 640px) {
  .steps { grid-template-columns: repeat(3, 1fr); gap: 26px 18px; }
  .step { display: block; }
  .step figure { aspect-ratio: 4 / 3; margin-bottom: 12px; }
  .step h3 { margin-bottom: 4px; }
  .step p { margin-top: 0; }
}

/* line view: six columns on a rail, scrubbed as the section passes */
@media (min-width: 1100px) {
  .line-body { padding-top: 0; }
  .rail {
    display: block; position: absolute; left: 0; right: 0; top: 0; height: 16px;
    background:
      radial-gradient(circle at 16px 50%, var(--paper-2) 5px, transparent 6px) 0 0 / 32px 100% repeat-x,
      linear-gradient(#8e959c, #c9cdd1 45%, #7d848b);
    border-block: 1px solid var(--g900);
    filter: brightness(.55);
  }
  .rail-fill {
    position: absolute; inset: -1px 0; background: inherit; filter: brightness(1.8);
    border-block: 1px solid var(--g900);
  }
  .steps { grid-template-columns: repeat(6, 1fr); gap: 0 18px; padding-top: 34px; }
  .step .n { top: -42px; left: 0; height: 32px; min-width: 32px; background: var(--g750); border: 1px solid var(--g600); font-size: 1.3rem; transition: background-color .25s, color .25s, border-color .25s; }
  .step h3 { font-size: 1.4rem; margin-bottom: 4px; }
  .step p { font-size: .9rem; line-height: 1.5; }
  .line.is-scrub .step img { filter: grayscale(1) brightness(.55); transition: filter .5s; }
  .line.is-scrub .step h3, .line.is-scrub .step p { color: var(--mist); transition: color .3s; }
  .line.is-scrub .step.done img, .line.is-scrub .step.on img { filter: saturate(.85) contrast(1.04); }
  .line.is-scrub .step.done h3, .line.is-scrub .step.on h3 { color: var(--ink); }
  .line.is-scrub .step.done p, .line.is-scrub .step.on p { color: var(--steel); }
  .line.is-scrub .step.done .n { background: var(--g200); color: var(--g900); border-color: var(--g200); }
  .line.is-scrub .step.on .n { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
}

/* ---------- Company / proof ---------- */
.proof { background: var(--ink-section); padding: clamp(40px, 5vw, 64px) 0; }
.proof .container { display: grid; gap: 22px; }
.figs { display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid var(--g600); border-bottom: 1px solid var(--g600); }
.fig { padding: 18px 18px 16px; border-right: 1px solid var(--g600); }
.fig:first-child { padding-left: 0; }
.fig:last-child { border-right: 0; }
.fig .n { white-space: nowrap; font: 800 clamp(2.4rem, 4.1vw, 3.8rem)/.92 var(--f-display); color: var(--ink); font-variant-numeric: tabular-nums; }
.fig .n b { font: inherit; color: inherit; }
.fig .u { font-size: .42em; color: var(--steel); font-weight: 700; }
.fig .l { margin-top: 8px; font-size: .9rem; color: var(--steel); }

.creds { display: grid; grid-template-columns: repeat(5, 1fr); background: var(--g750); border: 1px solid var(--g600); }
.creds li { padding: 12px 18px 14px; border-right: 1px solid var(--g600); display: flex; flex-direction: column; gap: 2px; }
.creds li:last-child { border-right: 0; }
.k { font-size: .84rem; font-weight: 600; color: var(--mist); }
.v { font-weight: 600; color: var(--ink); line-height: 1.3; }

.stds { display: flex; flex-wrap: wrap; gap: 14px 40px; align-items: center; }
.chip-group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.chip-group .k { margin-right: 6px; }
.stds .tag { font-size: .88rem; padding: .42rem .7rem; }
.chip { font-size: .88rem; font-weight: 600; color: var(--ink); background: var(--g750); border: 1px solid var(--g600); padding: .42rem .7rem; text-decoration: none; transition: border-color .15s; }
.chip:hover { border-color: var(--accent); color: var(--ink); }
.chip-link { background: transparent; border-color: transparent; text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; padding-inline: .3rem; }
.chip-link:hover { border-color: transparent; color: var(--accent-ink); }

.quick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; padding-top: 18px; border-top: 1px solid var(--g700); }
.quick a { color: var(--ink); font-size: .95rem; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.quick a:hover { color: var(--accent-ink); text-decoration-thickness: 2px; }

/* ---------- FAQ ---------- */
.faq-home { background: var(--paper); padding: clamp(44px, 5vw, 72px) 0; }
.faq-home .eyebrow { display: block; margin-bottom: 8px; }
.faq-home h2 { font-size: clamp(1.9rem, 3.2vw, 2.8rem); max-width: 26ch; margin-bottom: 30px; }
.qa-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 clamp(28px, 5vw, 72px); }
.qa { padding: 18px 0 22px; border-top: 1px solid var(--g600); }
.qa h3 { font-size: clamp(1.3rem, 1.9vw, 1.6rem); line-height: 1.1; margin-bottom: 8px; }
.qa p { font-size: .95rem; line-height: 1.65; color: var(--graphite); max-width: 62ch; }

/* ---------- RFQ section ---------- */
.rfq-home { background: var(--ink-section); padding: clamp(44px, 5vw, 72px) 0; }
.rfq-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
.rfq-side .eyebrow { display: block; margin-bottom: 8px; }
.rfq-side h2 { font-size: clamp(2.2rem, 4vw, 3.4rem); margin-bottom: 14px; }
.rfq-side p { color: var(--steel); }
.rfq-side p strong { color: var(--graphite); font-weight: 600; }
.checks { margin-top: 18px; display: flex; flex-direction: column; gap: .6rem; }
.checks li { display: flex; gap: .7rem; color: var(--steel); align-items: flex-start; }
.onetap { margin-top: 26px; }
.onetap-label { font-size: .9rem; font-weight: 600; color: var(--mist); margin-bottom: 10px; }
.onetap-btns { display: flex; flex-wrap: wrap; gap: 12px; }
.onetap-btns .btn svg { width: 1.2em; height: 1.2em; }
.onetap-num { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 4px 20px; color: var(--mist); font-size: .9rem; max-width: none; }
.rfq-home .rfq { padding: clamp(22px, 3vw, 34px); }
.form-intro { margin: 0 0 16px; color: var(--steel); font-size: .92rem; }
.form-intro strong { color: var(--ink); }
.rfq-form .btn-block { margin-top: 18px; }

/* ---------- Tablet ---------- */
@media (max-width: 1099px) {
  .range-grid { grid-template-columns: repeat(3, 1fr); }
  .figs { grid-template-columns: repeat(3, 1fr); }
  .fig { border-bottom: 1px solid var(--g600); }
  .fig:nth-child(3) { border-right: 0; }
  .fig:nth-child(4) { padding-left: 0; }
  .fig:nth-child(n+4) { border-bottom: 0; }
  .creds { grid-template-columns: repeat(3, 1fr); }
  .creds li { border-bottom: 1px solid var(--g600); }
  .creds li:nth-child(3n) { border-right: 0; }
  .creds li:nth-child(n+4) { border-bottom: 0; }
}
@media (max-width: 899px) {
  .pl-copy-in { max-width: min(640px, 72vw); }
  .feat { grid-template-columns: 1fr; }
  .feat .stage { min-height: 200px; }
  .qa-grid { grid-template-columns: 1fr; }
  .rfq-grid { grid-template-columns: 1fr; }
}

/* ---------- Phone ---------- */
@media (max-width: 759px) {
  .pl-hero { height: auto; min-height: 800px; }
  .pl-copy { inset: auto 0 84px 0; }
  .pl-copy-in { max-width: none; }
  .pl-hero h1 { font-size: clamp(2.5rem, 11.6vw, 3.6rem); }
  .pl-cta { gap: 10px; }
  .pl-cta .btn { flex: 1 1 auto; }
  .pl-readout { display: none; }
  .cbam-in { justify-content: flex-start; }
  .range-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .range-list { gap: 10px; }
  .part-info { padding: 10px 12px 14px; }
  .range-grid .part:last-child { grid-column: 1 / -1; }
  .range-grid .part:last-child .stage { aspect-ratio: 16 / 8; }
  .range-grid .part:last-child .cut img { --s: .62; }
  .part-info h3 { font-size: 1.2rem; }
  .part .std { font-size: .82rem; }
  .feat-meta { padding: 20px 18px 22px; }
  .intercept-in { flex-direction: column; gap: 12px; }
  .finder-in { flex-direction: column; align-items: flex-start; }
  .figs { grid-template-columns: repeat(2, 1fr); }
  .fig { padding: 14px 14px 12px; }
  .fig:nth-child(n) { border-right: 1px solid var(--g600); border-bottom: 1px solid var(--g600); padding-left: 14px; }
  .fig:nth-child(2n) { border-right: 0; }
  .fig:nth-child(odd) { padding-left: 0; }
  .fig:nth-child(5) { border-bottom: 0; grid-column: 1 / -1; border-right: 0; }
  .creds { grid-template-columns: 1fr 1fr; }
  .creds li { border-right: 1px solid var(--g600); border-bottom: 1px solid var(--g600); }
  .creds li:nth-child(2n) { border-right: 0; }
  .creds li:nth-child(n+4) { border-bottom: 1px solid var(--g600); }
  .creds li:nth-child(5) { border-bottom: 0; grid-column: 1 / -1; border-right: 0; }
  .steps { grid-template-columns: 1fr; gap: 16px; }
  .step { display: grid; }
  .onetap-btns .btn { flex: 1 1 100%; }
}

/* ---------- Reduced motion: the strip and parts simply sit still ---------- */
@media (prefers-reduced-motion: reduce) {
  .pl-photo, .pl-readout { transition: none; }
  .pl-readout { display: none; }
  .step img, .step .n, .step h3, .step p { transition: none; }
}

/* CJK: the condensed Latin display leading is too tight for CJK glyphs (full em squares) */
:lang(ja) .pl-hero h1, :lang(zh) .pl-hero h1 { line-height: 1.12; }
:lang(ja) .feat-meta h2, :lang(zh) .feat-meta h2,
:lang(ja) .part-info h3, :lang(zh) .part-info h3,
:lang(ja) .step h3, :lang(zh) .step h3,
:lang(ja) .qa h3, :lang(zh) .qa h3 { line-height: 1.25; }
