/* cbsocks.com — warm editorial + trust & authority.
   All color/font/spacing values live here as tokens; sections reference tokens only. */

:root {
  /* Palette: terracotta + slate on warm tinted paper */
  --paper: #FAF4ED;
  --paper-2: #F1E7DA;
  --ink: #2B2622;
  --taupe: #6E6055;
  --linen: #E3D6C4;
  --accent: #C2410C;
  --accent-dark: #9A3412;
  --slate: #2B3A42;
  --warm-white: #FDF8F1;

  /* Type: 3 families max (Jakarta display / Plex body / Noto SC for ZH) */
  --font-display: 'Plus Jakarta Sans', 'Noto Sans SC', system-ui, sans-serif;
  --font-body: 'IBM Plex Sans', 'Noto Sans SC', system-ui, sans-serif;

  /* 4pt-semantic spacing scale */
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 40px;
  --space-2xl: 64px;
  --space-3xl: 96px;

  --radius-card: 12px;
  --radius-ctl: 8px;

  /* Motion: three durations, one named easing family */
  --dur-fast: 120ms;
  --dur-mid: 220ms;
  --dur-slow: 420ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --shadow-whisper: 0 1px 2px rgba(43, 38, 34, 0.06);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

html, body { overflow-x: clip; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.15;
  margin: 0 0 var(--space-md);
  text-wrap: balance;
}

h2 { font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.5rem); }
h3 { font-size: 1.125rem; font-weight: 700; }

p { margin: 0 0 var(--space-md); max-width: 65ch; }

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

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

ul, ol { margin: 0; padding: 0; list-style: none; }

address { font-style: normal; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.container {
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 4rem);
}

section { padding-block: var(--space-2xl); }
section + section { padding-block: var(--space-3xl) var(--space-2xl); }

.section-intro { color: var(--taupe); margin-bottom: var(--space-xl); }

.eyebrow {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-sm);
}

.fine-print { font-size: 0.875rem; color: var(--taupe); }

.skip-link {
  position: absolute;
  left: var(--space-md);
  top: -100%;
  z-index: 100;
  background: var(--ink);
  color: var(--warm-white);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-ctl);
  transition: top var(--dur-fast) var(--ease-out);
}
.skip-link:focus { top: var(--space-md); text-decoration: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  min-height: 44px;
  padding: 0 var(--space-lg);
  border-radius: var(--radius-ctl);
  border: 1px solid transparent;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9375rem;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: transform var(--dur-mid) var(--ease-out),
              background-color var(--dur-mid) var(--ease-out),
              border-color var(--dur-mid) var(--ease-out);
}
.btn:active { transform: scale(0.98); }

.btn-primary { background: var(--accent-dark); color: var(--warm-white); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--linen); }

@media (hover: hover) {
  .btn:hover { transform: translateY(-1px); text-decoration: none; }
  .btn-primary:hover { background: var(--accent); }
  .btn-ghost:hover { border-color: var(--taupe); }
}

.btn:disabled { opacity: 0.7; cursor: progress; }

.btn-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(253, 248, 241, 0.4);
  border-top-color: var(--warm-white);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Nav ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 244, 237, 0.72);
  -webkit-backdrop-filter: blur(12px) saturate(1.3);
  backdrop-filter: blur(12px) saturate(1.3);
  border-bottom: 1px solid var(--linen);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-nav { background: var(--paper); }
}
@media (prefers-reduced-transparency: reduce) {
  .site-nav { background: var(--paper); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

.nav-inner {
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 4rem);
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.125rem;
  color: var(--ink);
  white-space: nowrap;
}
.wordmark:hover { text-decoration: none; color: var(--accent); }

.nav-links {
  display: none;
  gap: var(--space-lg);
  margin-left: auto;
}
.nav-links a {
  color: var(--ink);
  font-size: 0.9375rem;
  white-space: nowrap;
}
.nav-links a:hover { color: var(--accent); text-decoration: none; }

.nav-links.open {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--paper);
  border-bottom: 1px solid var(--linen);
  padding: var(--space-md) clamp(1rem, 4vw, 4rem) var(--space-lg);
  gap: var(--space-md);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-left: auto;
}
.nav-links + .nav-actions { margin-left: 0; }

.lang-toggle {
  min-height: 44px;
  padding: 0 var(--space-md);
  background: transparent;
  border: 1px solid var(--linen);
  border-radius: 999px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.875rem;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color var(--dur-mid) var(--ease-out);
}
@media (hover: hover) { .lang-toggle:hover { border-color: var(--taupe); } }

.btn-nav { display: none; }

.menu-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: transparent;
  border: 1px solid var(--linen);
  border-radius: var(--radius-ctl);
  cursor: pointer;
}
.menu-toggle span {
  display: block;
  height: 2px;
  background: var(--ink);
  border-radius: 1px;
}

/* ---------- Hero ---------- */
.hero { padding-block: var(--space-2xl) var(--space-3xl); }

.hero-grid {
  display: grid;
  gap: var(--space-xl);
  align-items: center;
}

.hero-title {
  font-size: clamp(2.75rem, 5vw + 1rem, 5.25rem);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-lg);
}
.hero-line { display: block; }
.hero-line.accent { color: var(--accent); }
:lang(zh-CN) .hero-title { letter-spacing: 0; }

.hero-sub { color: var(--taupe); margin-bottom: var(--space-xl); }

.hero-ctas { display: flex; flex-wrap: wrap; gap: var(--space-md); }

.hero-media img {
  width: 100%;
  border-radius: var(--radius-card);
  border: 1px solid var(--linen);
}

/* ---------- Trust bar ---------- */
.trustbar {
  background: var(--paper-2);
  border-block: 1px solid var(--linen);
  padding-block: var(--space-xl);
}

.trustbar-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
}

.stat { display: flex; flex-direction: column; gap: var(--space-xs); }

.stat-num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.75rem, 1.3rem + 1.8vw, 2.5rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.stat-label { font-size: 0.875rem; color: var(--taupe); }

/* ---------- Split layout (process / factory / clients) ---------- */
.split {
  display: grid;
  gap: var(--space-xl);
  align-items: center;
}

.split-media img {
  width: 100%;
  border-radius: var(--radius-card);
  border: 1px solid var(--linen);
}

/* Steps */
.steps { display: flex; flex-direction: column; gap: var(--space-lg); margin-top: var(--space-lg); }

.step { display: flex; gap: var(--space-md); align-items: flex-start; }

.step-num {
  flex: none;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--accent);
  border-radius: 50%;
  color: var(--accent);
  font-family: var(--font-display);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.step h3 { margin-bottom: var(--space-xs); }
.step p { color: var(--taupe); margin-bottom: 0; }

/* ---------- Products ---------- */
.products { background: var(--paper-2); border-block: 1px solid var(--linen); }

.product-grid {
  display: grid;
  gap: var(--space-lg);
  grid-template-columns: 1fr;
  margin-top: var(--space-xl);
}

.product-card {
  background: var(--paper);
  border: 1px solid var(--linen);
  border-radius: var(--radius-card);
  overflow: hidden;
  transition: transform var(--dur-mid) var(--ease-out), box-shadow var(--dur-mid) var(--ease-out);
}
@media (hover: hover) {
  .product-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-whisper); }
}

.product-card img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }

.product-body { padding: var(--space-lg); }
.product-body h3 { margin-bottom: var(--space-sm); }
.product-body p { font-size: 0.9375rem; color: var(--taupe); margin-bottom: 0; }

/* ---------- Factory ---------- */
.collage {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}
.collage img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 3; }
.collage-main { grid-column: 1 / -1; }

.param-groups {
  display: grid;
  gap: var(--space-lg);
  margin-top: var(--space-xl);
}

.param-group h3 {
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-sm);
}
.param-group ul { display: flex; flex-direction: column; gap: var(--space-xs); }
.param-group li { padding-left: var(--space-md); border-left: 2px solid var(--linen); }

/* ---------- Certifications ---------- */
.cert-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}
.cert-list li {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  border: 1px solid var(--linen);
  border-radius: var(--radius-card);
  background: var(--paper);
  font-weight: 500;
}
.cert-list svg { flex: none; width: 22px; height: 22px; color: var(--accent); }

.wrap-callout {
  margin: 0;
  padding: var(--space-lg);
  background: var(--paper-2);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-card) var(--radius-card) 0;
}
.wrap-callout p { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 1.0625rem; }

/* ---------- Clients ---------- */
.clients { background: var(--paper-2); border-block: 1px solid var(--linen); }

.client-markets {
  display: grid;
  gap: var(--space-lg);
  margin: var(--space-lg) 0;
}

.client-market h3 {
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-sm);
}
.client-market ul { display: flex; flex-direction: column; gap: var(--space-xs); }
.client-market li span { color: var(--taupe); }

.client-tags {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  margin-top: var(--space-2xl);
}
.client-tags img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: var(--paper);
  border: 1px solid var(--linen);
  border-radius: var(--radius-card);
  padding: var(--space-sm);
}

/* ---------- FAQ ---------- */
.faq-list {
  display: grid;
  gap: var(--space-md);
  margin-top: var(--space-xl);
}

.faq-item {
  background: var(--warm-white);
  border: 1px solid var(--linen);
  border-radius: var(--radius-card);
  padding: var(--space-lg);
}

.faq-item h3 { margin-bottom: var(--space-xs); }
.faq-item p { margin-bottom: 0; }

/* ---------- Inquiry ---------- */
.inquiry-grid {
  display: grid;
  gap: var(--space-xl);
  margin-top: var(--space-xl);
}

.inquiry-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  align-content: start;
}

.field label {
  display: block;
  font-weight: 500;
  font-size: 0.9375rem;
  margin-bottom: var(--space-xs);
}
.field label em { color: var(--accent-dark); font-style: normal; }

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px var(--space-sm);
  background: var(--warm-white);
  border: 1px solid var(--linen);
  border-radius: var(--radius-ctl);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  outline: 2px solid transparent;
  outline-offset: 1px;
  transition: border-color var(--dur-fast) var(--ease-out),
              outline-color var(--dur-fast) var(--ease-out);
}
.field textarea { min-height: 6rem; resize: vertical; }
.field input::placeholder,
.field textarea::placeholder { color: var(--taupe); opacity: 0.8; }

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline-color: var(--accent);
  border-color: var(--accent);
}

.field.error input,
.field.error select,
.field.error textarea { border-color: var(--accent-dark); }

.field-msg {
  min-height: 1.5em;
  margin: 2px 0 0;
  font-size: 0.8125rem;
  color: var(--accent-dark);
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.btn-submit { justify-self: start; }

.form-status { margin: 0; min-height: 1.5em; font-size: 0.9375rem; }
.form-status.ok { color: var(--ink); font-weight: 500; }
.form-status.err { color: var(--accent-dark); }

.trust-card {
  background: var(--warm-white);
  border: 1px solid var(--linen);
  border-radius: var(--radius-card);
  overflow: hidden;
  align-self: start;
}
.trust-card > img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }

.trust-card-body { padding: var(--space-lg); }

.trust-reply {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.125rem;
  margin-bottom: var(--space-lg);
}

.trust-contact { display: flex; flex-direction: column; gap: var(--space-md); margin-bottom: var(--space-lg); }
.trust-contact li { display: flex; flex-direction: column; gap: 2px; }
.trust-k { font-size: 0.8125rem; color: var(--taupe); }

/* ---------- Footer (single deliberate dark reversal) ---------- */
.site-footer {
  background: var(--slate);
  color: var(--warm-white);
  padding-block: var(--space-2xl) var(--space-xl);
}
.site-footer a { color: var(--warm-white); text-decoration: underline; }
.site-footer a:hover { color: var(--paper); }

.footer-grid {
  display: grid;
  gap: var(--space-2xl);
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid rgba(253, 248, 241, 0.16);
}

.footer-brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.125rem;
  margin-bottom: var(--space-md);
}
.footer-contact address p { margin-bottom: var(--space-xs); color: rgba(253, 248, 241, 0.85); }

.footer-index {
  display: grid;
  gap: var(--space-xl);
  grid-template-columns: 1fr 1fr;
}
.footer-index h2 {
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(253, 248, 241, 0.6);
  margin-bottom: var(--space-md);
}
.footer-index ul { display: flex; flex-direction: column; gap: var(--space-sm); }
.footer-index a { text-decoration: none; }
.footer-index a:hover { text-decoration: underline; }

.footer-certs { font-size: 0.875rem; color: rgba(253, 248, 241, 0.85); margin-bottom: var(--space-lg); }

.lang-toggle-footer { border-color: rgba(253, 248, 241, 0.35); color: var(--warm-white); }

.footer-bottom { padding-top: var(--space-lg); }
.footer-bottom p { margin: 0; font-size: 0.875rem; color: rgba(253, 248, 241, 0.6); }

/* ---------- Sticky mobile CTA ---------- */
.sticky-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding-bottom: env(safe-area-inset-bottom, 0);
  background: var(--accent-dark);
  color: var(--warm-white);
  font-family: var(--font-display);
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 -1px 0 var(--linen);
}
.sticky-cta:hover { text-decoration: none; background: var(--accent); }

/* Slid away by JS while the inquiry section is in view, so the fixed bar can
   never cover the submit button on narrow screens (bar only renders <960px). */
.sticky-cta {
  transition: transform var(--dur-mid) var(--ease-out);
}
.sticky-cta.cta-hidden {
  transform: translateY(100%);
  pointer-events: none;
}

/* ---------- Reveal-once ---------- */
.reveal { opacity: 0; transform: translateY(8px); }
.reveal.in {
  opacity: 1;
  transform: none;
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
  transition-delay: calc(var(--i, 0) * 60ms);
}

/* ---------- Breakpoints (min-width, content-driven) ---------- */
@media (min-width: 640px) {
  .trustbar-grid { grid-template-columns: repeat(4, 1fr); }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .cert-list { grid-template-columns: repeat(3, 1fr); }
  .client-tags { grid-template-columns: repeat(4, 1fr); }
  .client-markets { grid-template-columns: 1fr 1fr; }
  .inquiry-form { grid-template-columns: 1fr 1fr; }
  .field-full, .btn-submit, .form-status { grid-column: 1 / -1; }
}

@media (min-width: 960px) {
  .nav-links { display: flex; }
  .btn-nav { display: inline-flex; }
  .menu-toggle { display: none; }
  .hero-grid { grid-template-columns: 5fr 7fr; gap: var(--space-2xl); }
  .split { grid-template-columns: 7fr 5fr; gap: var(--space-2xl); }
  .split-reverse { grid-template-columns: 7fr 5fr; }
  .split-reverse .split-media { order: 1; }
  .split-reverse .split-text { order: 2; }
  .clients .split { grid-template-columns: 5fr 7fr; }
  .param-groups { grid-template-columns: repeat(3, 1fr); }
  .faq-list { grid-template-columns: repeat(2, 1fr); }
  .inquiry-grid { grid-template-columns: 7fr 5fr; gap: var(--space-2xl); }
  .footer-grid { grid-template-columns: 1.2fr 0.8fr; }
  .sticky-cta { display: none; }
}

@media (min-width: 1440px) {
  .hero { padding-block: var(--space-3xl); }
}

/* Mobile section collapse, explicit per brief */
@media (max-width: 959px) {
  .hero-grid { grid-template-rows: auto auto; }
  .hero { min-height: 100dvh; display: grid; align-items: center; }
  body { padding-bottom: calc(56px + env(safe-area-inset-bottom, 0)); }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
  .reveal.in { transition: opacity 150ms ease; transition-delay: 0ms; }
  .btn, .product-card, .lang-toggle { transition: none; }
}
