@import url("https://fonts.googleapis.com/css2?family=Jost:wght@400;500;600;700;900&display=swap");

/*
 * Samarth Chemical Industry — global design foundations
 * Source: Figma homepage 621:2 (1440 px desktop canvas).
 * Desktop content: 1140 px, centered with 150 px side margins.
 * Responsive sizes below are adaptations of the desktop design.
 */

:root {
  /* Font families and weights */
  --font-family-base: "Jost", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-family-heading: var(--font-family-base);
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-black: 900;

  /* Original Figma palette */
  --color-brand: #B17457;
  --color-white: #FAF7F0;
  --color-ink: #0F0E0E;
  --color-button-hover: #3f3f3f;
  --color-charcoal: #333333;
  --color-gray: #7d7d7d;
  --color-gray-light: #d9d9d9;
  --color-gray-border: #e4e4e4;
  --color-cream: #f6f6f0;
  --color-map-background: #001220;
  --color-map-blue: #002d62;
  --color-decoration-cyan: #00f5e5;

  /* Semantic colors: update these to change the site globally. */
  --color-primary: var(--color-brand);
  --color-text: var(--color-charcoal);
  --color-heading: var(--color-ink);
  --color-text-muted: var(--color-gray);
  --color-text-inverse: var(--color-white);
  --color-text-on-primary: var(--color-ink);
  --color-background: var(--color-white);
  --color-background-soft: var(--color-cream);
  --color-background-dark: var(--color-ink);
  --color-surface: var(--color-white);
  --color-surface-accent: rgb(198 204 72 / 10%);
  --color-border: var(--color-gray-border);
  --color-border-brand: var(--color-brand);
  --color-overlay-hero: rgb(15 14 14 / 50%);
  --color-overlay-image: rgb(15 14 14 / 60%);
  --color-decoration-dark: rgb(15 14 14 / 10%);
  --color-decoration-light: rgb(255 255 255 / 12%);
  --color-control-muted: rgb(255 255 255 / 45%);
  --color-focus: var(--color-map-blue);

  /* Type scale, in rem so browser font-size preferences are respected. */
  --font-size-caption: 0.75rem; /* 12 px */
  --font-size-small: 0.875rem; /* 14 px */
  --font-size-base: 1rem; /* 16 px */
  --font-size-body: 1.125rem; /* 18 px */
  --font-size-eyebrow: 1.25rem; /* 20 px */
  --font-size-product-title: 1.375rem; /* 22 px */
  --font-size-h4: 1.5rem; /* 24 px */
  --font-size-h3: 1.875rem; /* 30 px */
  --font-size-h2: 2.625rem; /* 42 px */
  --font-size-feature-title: 2.875rem; /* 46 px */
  --font-size-marquee: 3rem; /* 48 px */
  --font-size-h1: 4rem; /* 64 px */
  --font-size-stat: 5rem; /* 80 px */
  --line-height-tight: 1.2;
  --line-height-title: 1.3;
  --line-height-heading: 1.4;
  --line-height-normal: 1.5;
  --line-height-body: 1.6;
  --letter-spacing-default: 0;
  --letter-spacing-counter: 0.12em;

  /* Spacing scale includes the existing button and section measurements. */
  --space-0: 0;
  --space-1: 0.25rem; /* 4 px */
  --space-2: 0.5rem; /* 8 px */
  --space-3: 0.75rem; /* 12 px */
  --space-4: 1rem; /* 16 px */
  --space-5: 1.25rem; /* 20 px */
  --space-6: 1.5rem; /* 24 px */
  --space-8: 2rem; /* 32 px */
  --space-10: 2.5rem; /* 40 px */
  --space-12: 3rem; /* 48 px */
  --space-16: 4rem; /* 64 px */
  --space-20: 5rem; /* 80 px */
  --space-24: 6rem; /* 96 px */
  --space-5px: 0.3125rem;
  --space-10px: 0.625rem;
  --space-15px: 0.9375rem;
  --space-25px: 1.5625rem;
  --space-30px: 1.875rem;
  --space-50px: 3.125rem;
  --space-60px: 3.75rem;
  --space-70px: 4.375rem;
  --space-90px: 5.625rem;
  --space-100px: 6.25rem;
  --space-110px: 6.875rem;
  --space-120px: 7.5rem;
  --space-150px: 9.375rem;

  /* Layout: the max-width generates the 150 px margins at 1440 px. */
  --container-max-width: 71.25rem; /* 1140 px */
  --page-gutter: var(--space-6);
  --page-padding-desktop: var(--space-150px);
  --section-spacing: var(--space-110px);
  --section-heading-gap: var(--space-30px);
  --grid-gap: var(--space-30px);
  --card-padding: var(--space-30px);
  --top-bar-height: var(--space-60px);

  /* Corners and borders */
  --radius-none: 0;
  --radius-xs: 0.25rem; /* 4 px */
  --radius-sm: 0.625rem; /* 10 px */
  --radius-md: 1rem; /* 16 px */
  --radius-lg: 1.25rem; /* 20 px */
  --radius-button: 3.125rem; /* 50 px */
  --radius-full: 9999px;
  --border-width: 1px;

  /* Shadows and ambient blur from Figma */
  --shadow-button: 0 2px 4px rgb(15 14 14 / 15%);
  --shadow-image-soft: 0 4px 15px rgb(15 14 14 / 10%);
  --shadow-product: 0 4px 15px rgb(15 14 14 / 15%);
  --shadow-image: 0 4px 15px rgb(15 14 14 / 20%);
  --shadow-card-soft: 0 4px 20px rgb(15 14 14 / 10%);
  --shadow-card: 0 4px 20px rgb(15 14 14 / 20%);
  --shadow-card-raised: 0 4px 30px rgb(15 14 14 / 20%);
  --shadow-inset: inset 0 2px 10px rgb(0 0 0 / 5%);
  --blur-ambient-small: 300px;
  --blur-ambient: 350px;
  --blur-ambient-large: 380px;

  /* Shared controls */
  --button-height: var(--space-50px);
  --button-padding-start: var(--space-25px);
  --button-padding-end: var(--space-5px);
  --button-gap: var(--space-15px);
  --button-icon-size: var(--space-10);
  --transition-duration: 180ms;
  --transition-easing: ease;
}

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

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--color-background);
  color: var(--color-text);
  font-family: var(--font-family-base);
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-body);
  letter-spacing: var(--letter-spacing-default);
}

h1, h2, h3, h4, h5, h6,
p, figure, blockquote, dl, dd {
  margin: 0;
}

/* Keep images out of text selections without affecting image links. */
img, svg {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
}

img::selection {
  background: transparent;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

img, video {
  height: auto;
}

button, input, select, textarea {
  font: inherit;
  letter-spacing: inherit;
}

button, select {
  text-transform: none;
}

button:not(:disabled),
[type="button"]:not(:disabled),
[type="submit"]:not(:disabled),
[type="reset"]:not(:disabled) {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
}

textarea {
  max-width: 100%;
  resize: vertical;
}

a {
  color: inherit;
  text-underline-offset: 0.18em;
}

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

::selection {
  background-color: var(--color-primary);
  color: var(--color-text-on-primary);
}

[hidden] {
  display: none !important;
}

/* Typography */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4 {
  color: var(--color-heading);
  font-family: var(--font-family-heading);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-heading);
  overflow-wrap: break-word;
}

h1, .h1 {
  font-size: var(--font-size-h1);
  line-height: var(--line-height-tight);
}

h2, .h2 { font-size: var(--font-size-h2); }
h3, .h3 { font-size: var(--font-size-h3); }
h4, .h4 { font-size: var(--font-size-h4); }
h5 { font-size: var(--font-size-eyebrow); }
h6 { font-size: var(--font-size-body); }

small, .text-small { font-size: var(--font-size-small); }
.text-base { font-size: var(--font-size-base); }
.text-caption { font-size: var(--font-size-caption); }
.text-muted { color: var(--color-text-muted); }
.text-brand { color: var(--color-primary); }
.text-inverse { color: var(--color-text-inverse); }
.text-center { text-align: center; }

.eyebrow {
  color: var(--color-primary);
  font-size: var(--font-size-eyebrow);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
}

.product-title {
  font-size: var(--font-size-product-title);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-title);
}

.stat-value {
  font-size: var(--font-size-stat);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
}

/* Layout helpers */
.container {
  width: min(var(--container-max-width), calc(100% - 2 * var(--page-gutter)));
  margin-inline: auto;
}

.container-fluid {
  width: 100%;
  padding-inline: var(--page-gutter);
}

/* Choose one section rhythm per page to avoid doubling the 110 px gap:
 * .section gives a standalone section top/bottom padding;
 * .sections-stack gives adjacent sections a single shared gap.
 */
.section { padding-block: var(--section-spacing); }

.sections-stack {
  display: flex;
  flex-direction: column;
  gap: var(--section-spacing);
}

.sections-stack > .section { padding-block: 0; }

.section-heading {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  margin-block-end: var(--section-heading-gap);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--stack-gap, var(--space-5));
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--cluster-gap, var(--space-5));
}

.grid {
  display: grid;
  gap: var(--grid-gap);
}

.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)); }
.grid > *, .cluster > * { min-width: 0; }

/* Shared surfaces */
.bg-white { background-color: var(--color-background); }
.bg-soft { background-color: var(--color-background-soft); }
.bg-brand {
  background-color: var(--color-primary);
  color: var(--color-text-on-primary);
}

.bg-dark {
  --color-heading: var(--color-text-inverse);
  --color-focus: var(--color-primary);
  background-color: var(--color-background-dark);
  color: var(--color-text-inverse);
}

.card {
  padding: var(--card-padding);
  border-radius: var(--radius-sm);
  background-color: var(--color-surface);
  color: var(--color-text);
  box-shadow: var(--shadow-card-soft);
}

.image-rounded { border-radius: var(--radius-lg); }

/* Pill button: .btn .btn-primary, with an optional .btn-icon child. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--button-gap);
  min-height: var(--button-height);
  max-width: 100%;
  padding: calc(var(--space-5px) - var(--border-width)) var(--button-padding-start);
  border: var(--border-width) solid transparent;
  border-radius: var(--radius-button);
  font-size: var(--font-size-small);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-tight);
  text-align: center;
  text-decoration: none;
  /* box-shadow: var(--shadow-button); */
  transition: background-color var(--transition-duration) var(--transition-easing),
    color var(--transition-duration) var(--transition-easing),
    box-shadow var(--transition-duration) var(--transition-easing);
}

.btn-primary {
  background-color: var(--color-primary);
  color: var(--color-text-on-primary);
}

.btn-secondary {
  background-color: var(--color-white);
  color: var(--color-ink);
}

.btn-with-icon { padding-inline-end: var(--button-padding-end); }

.btn-icon {
  display: inline-flex;
  flex: 0 0 var(--button-icon-size);
  align-items: center;
  justify-content: center;
  width: var(--button-icon-size);
  height: var(--button-icon-size);
  border-radius: var(--radius-full);
  background-color: var(--color-white);
  color: var(--color-ink);
}

.btn-secondary .btn-icon { background-color: var(--color-primary); }
.btn-icon .btn-arrow { display: block; width: 40px; height: 40px; max-width: none; flex: 0 0 40px; border-radius: 0; background: transparent; transform: rotate(0deg); transition: transform var(--transition-duration) var(--transition-easing); }
.btn:hover .btn-arrow, .btn:focus-visible .btn-arrow,
button:hover .btn-arrow, button:focus-visible .btn-arrow { transform: rotate(45deg); }
@media (prefers-reduced-motion: reduce) {
  .btn-icon .btn-arrow { transition: none; }
}
.btn:not(:disabled):hover { box-shadow: var(--shadow-product); }
.btn:disabled { opacity: 0.55; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Tablet adaptations. Breakpoints are CSS constants, not custom properties. */
@media (max-width: 63.999rem) {
  :root {
    --font-size-h1: 3rem;
    --font-size-h2: 2.25rem;
    --font-size-feature-title: 2.5rem;
    --font-size-stat: 4rem;
    --section-spacing: var(--space-20);
    --card-padding: var(--space-6);
  }

  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Mobile adaptations */
@media (max-width: 47.999rem) {
  :root {
    --font-size-body: 1rem;
    --font-size-h1: 2.25rem;
    --font-size-h2: 1.875rem;
    --font-size-h3: 1.5rem;
    --font-size-h4: 1.25rem;
    --font-size-feature-title: 2rem;
    --font-size-marquee: 2rem;
    --font-size-stat: 3.5rem;
    --page-gutter: var(--space-5);
    --section-spacing: var(--space-16);
    --section-heading-gap: var(--space-6);
    --grid-gap: var(--space-5);
    --card-padding: var(--space-5);
  }

  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  :root { --transition-duration: 0ms; }
}
