/* ==========================================================================
   Kuida storefront — design tokens, resets, base typography.
   Replaces assets/css/company-home.css, company-pages.css,
   company-products.css, news.css, and the legacy style.css payload.
   ========================================================================== */

:root {
  /* Color palette — modern premium, dark hero + warm neutral. */
  --color-bg: #ffffff;
  --color-bg-elev: #f6f7f9;
  --color-bg-inverse: #0b0d12;
  --color-surface: #ffffff;
  --color-surface-translucent: rgba(255, 255, 255, 0.7);
  --color-surface-glass: rgba(255, 255, 255, 0.12);
  --color-border: rgba(15, 23, 42, 0.08);
  --color-border-strong: rgba(15, 23, 42, 0.16);
  --color-text: #0f172a;
  --color-text-soft: #475569;
  --color-text-muted: #94a3b8;
  --color-text-on-dark: #f8fafc;
  --color-text-on-dark-soft: #cbd5e1;
  --color-accent: #b08d57;
  --color-accent-soft: #d8b985;
  --color-accent-deep: #8a6a3c;
  --color-accent-contrast: #0b0d12;
  --color-success: #16a34a;
  --color-warning: #f59e0b;
  --color-danger: #dc2626;
  --color-info: #2563eb;

  /* Brand gradient stops used in hero / cta. */
  --gradient-hero: linear-gradient(135deg, #0b0d12 0%, #1c2230 55%, #2a2418 100%);
  --gradient-cta: linear-gradient(120deg, #b08d57 0%, #8a6a3c 100%);
  --gradient-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.4));

  /* Typography. */
  --font-sans: "Inter", "Helvetica Neue", Arial, "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-serif: "Cormorant Garamond", "Noto Serif SC", Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;

  --fs-xs: 0.75rem;     /* 12 */
  --fs-sm: 0.875rem;    /* 14 */
  --fs-base: 1rem;      /* 16 */
  --fs-md: 1.125rem;    /* 18 */
  --fs-lg: 1.375rem;    /* 22 */
  --fs-xl: 1.75rem;     /* 28 */
  --fs-2xl: 2.25rem;    /* 36 */
  --fs-3xl: 3rem;       /* 48 */
  --fs-4xl: 4rem;       /* 64 */
  --fs-5xl: 5.25rem;    /* 84 */

  --lh-tight: 1.15;
  --lh-snug: 1.35;
  --lh-base: 1.6;

  /* Spacing scale. */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;
  --space-10: 8rem;

  /* Radii. */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 28px;
  --radius-pill: 999px;

  /* Shadows. */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-sm: 0 4px 12px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.12);
  --shadow-xl: 0 40px 80px rgba(15, 23, 42, 0.18);
  --shadow-glow: 0 20px 50px rgba(176, 141, 87, 0.25);

  /* Motion. */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --duration-fast: 160ms;
  --duration-base: 280ms;
  --duration-slow: 520ms;

  /* Layout. */
  --container-max: 1280px;
  --container-gutter: clamp(1.5rem, 5vw, 5rem);
  --header-h: 84px;
  --header-h-condensed: 64px;
  --z-header: 80;
  --z-drawer: 100;
  --z-lightbox: 120;
  --z-toast: 140;
}

/* Respect dark mode preference. */
@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #0b0d12;
    --color-bg-elev: #11151c;
    --color-bg-inverse: #ffffff;
    --color-surface: #11151c;
    --color-surface-translucent: rgba(17, 21, 28, 0.7);
    --color-border: rgba(255, 255, 255, 0.08);
    --color-border-strong: rgba(255, 255, 255, 0.16);
    --color-text: #f1f5f9;
    --color-text-soft: #cbd5e1;
    --color-text-muted: #94a3b8;
  }
}

/* ---------- Reset (compact, modern) ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body, h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd, ul, ol {
  margin: 0;
}
ul, ol { padding: 0; list-style: none; }
img, picture, svg, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; background: none; border: 0; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 4px;
}
::selection { background: var(--color-accent-soft); color: var(--color-accent-deep); }

/* ---------- Base typography ---------- */
body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  min-height: 100vh;
}

h1, h2, h3, h4 { font-family: var(--font-sans); font-weight: 700; line-height: var(--lh-tight); color: var(--color-text); }
h1 { font-size: var(--fs-3xl); letter-spacing: -0.02em; }
h2 { font-size: var(--fs-2xl); letter-spacing: -0.015em; }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-md); }
p  { line-height: var(--lh-base); color: var(--color-text-soft); }
a  { transition: color var(--duration-fast) var(--ease-out); }
a:hover { color: var(--color-accent-deep); }

img { border-radius: var(--radius-md); }

::placeholder { color: var(--color-text-muted); }

/* ---------- Layout primitives ---------- */
.container,
body.kd-shell-body .container { width: 100%; max-width: calc(var(--container-max) + (var(--container-gutter) * 2)); margin-inline: auto; padding-inline: var(--container-gutter); }
.section { padding-block: clamp(3rem, 8vw, 6rem); position: relative; }
.section--tight { padding-block: clamp(2rem, 5vw, 3.5rem); }
.section--inverse { background: var(--color-bg-inverse); color: var(--color-text-on-dark); }
.section--inverse h1, .section--inverse h2, .section--inverse h3, .section--inverse h4 { color: var(--color-text-on-dark); }
.section--inverse p { color: var(--color-text-on-dark-soft); }

.grid { display: grid; gap: var(--space-5); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1024px) {
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
}

/* Eyebrow / section title. */
.eyebrow {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-accent-deep);
  margin-bottom: var(--space-3);
}
.section-title {
  font-size: clamp(1.75rem, 3.2vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-3);
}
.section-subtitle {
  font-size: var(--fs-md);
  color: var(--color-text-soft);
  max-width: 60ch;
  margin: 0 auto;
}
.section-head { text-align: center; margin-bottom: var(--space-7); }

/* Section divider (replaces elementor-divider markup). */
.kd-divider {
  display: flex; align-items: center; gap: var(--space-4);
  margin-block: var(--space-6);
}
.kd-divider::before, .kd-divider::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-border-strong), transparent);
}
.kd-divider__label {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--fs-lg);
  color: var(--color-text-soft);
  letter-spacing: 0.02em;
}

/* Scroll-reveal animation. */
[data-reveal] { opacity: 0; transform: translate3d(0, 24px, 0); transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out); }
[data-reveal].is-visible { opacity: 1; transform: none; }
[data-reveal-delay="1"] { transition-delay: 80ms; }
[data-reveal-delay="2"] { transition-delay: 160ms; }
[data-reveal-delay="3"] { transition-delay: 240ms; }
[data-reveal-delay="4"] { transition-delay: 320ms; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; animation-iteration-count: 1 !important; }
  [data-reveal] { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* Skip link. */
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--color-accent); color: #fff;
  padding: var(--space-3) var(--space-4);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  z-index: var(--z-toast);
}
.skip-link:focus { left: var(--space-4); top: var(--space-3); color: #fff; }

/* Screen reader only. */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Generic visually-hidden focusable. */
.visually-hidden-focusable:not(:focus):not(:focus-within) {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Shell layout. */
.kd-shell { display: flex; flex-direction: column; min-height: 100vh; }
.kd-shell > main { flex: 1; }
