/* ==========================================================================
   TSW Smart STP — design tokens, base styles and layout primitives
   Palette: Deep Navy #102C46 · Water Blue #087EAA · Smart Teal #18A69A · Light Grey #F2F6F8
   ========================================================================== */

/* IBM Plex (SIL Open Font License, see assets/fonts/OFL-LICENSE.txt) */
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url('../assets/fonts/IBMPlexSans-Regular-Latin1.woff2') format('woff2'); unicode-range: U+0020-007E, U+00A0-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2013-2014, U+2018-201A, U+201C-201E, U+2020-2022, U+2026, U+2030, U+2039-203A, U+2044, U+20AC, U+2122, U+2212, U+FB01-FB02; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url('../assets/fonts/IBMPlexSans-Medium-Latin1.woff2') format('woff2'); unicode-range: U+0020-007E, U+00A0-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2013-2014, U+2018-201A, U+201C-201E, U+2020-2022, U+2026, U+2030, U+2039-203A, U+2044, U+20AC, U+2122, U+2212, U+FB01-FB02; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url('../assets/fonts/IBMPlexSans-SemiBold-Latin1.woff2') format('woff2'); unicode-range: U+0020-007E, U+00A0-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2013-2014, U+2018-201A, U+201C-201E, U+2020-2022, U+2026, U+2030, U+2039-203A, U+2044, U+20AC, U+2122, U+2212, U+FB01-FB02; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 700; font-display: swap; src: url('../assets/fonts/IBMPlexSans-Bold-Latin1.woff2') format('woff2'); unicode-range: U+0020-007E, U+00A0-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2013-2014, U+2018-201A, U+201C-201E, U+2020-2022, U+2026, U+2030, U+2039-203A, U+2044, U+20AC, U+2122, U+2212, U+FB01-FB02; }
/* Rupee and other currency signs, loaded only on pages that use them */
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url('../assets/fonts/IBMPlexSans-Regular-Latin2.woff2') format('woff2'); unicode-range: U+0100-0101, U+0104-0130, U+0132-0151, U+0154-017F, U+20A8-20AA, U+20B8-20BA; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url('../assets/fonts/IBMPlexSans-Medium-Latin2.woff2') format('woff2'); unicode-range: U+0100-0101, U+0104-0130, U+0132-0151, U+0154-017F, U+20A8-20AA, U+20B8-20BA; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url('../assets/fonts/IBMPlexSans-SemiBold-Latin2.woff2') format('woff2'); unicode-range: U+0100-0101, U+0104-0130, U+0132-0151, U+0154-017F, U+20A8-20AA, U+20B8-20BA; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 700; font-display: swap; src: url('../assets/fonts/IBMPlexSans-Bold-Latin2.woff2') format('woff2'); unicode-range: U+0100-0101, U+0104-0130, U+0132-0151, U+0154-017F, U+20A8-20AA, U+20B8-20BA; }
/* Arrows, superscripts, check marks */
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url('../assets/fonts/IBMPlexSans-Regular-Pi.woff2') format('woff2'); unicode-range: U+2070, U+2074-2079, U+2080-2089, U+2190-2199, U+2248, U+2264-2265, U+2713; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url('../assets/fonts/IBMPlexSans-SemiBold-Pi.woff2') format('woff2'); unicode-range: U+2070, U+2074-2079, U+2080-2089, U+2190-2199, U+2248, U+2264-2265, U+2713; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('../assets/fonts/IBMPlexMono-Regular-Latin1.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url('../assets/fonts/IBMPlexMono-Medium-Latin1.woff2') format('woff2'); }

:root {
  /* Brand */
  --navy: #102C46;
  --navy-950: #0A1D2F;
  --navy-800: #183A59;
  --blue: #087EAA;
  --blue-700: #066A8F;
  --blue-050: #E6F3F8;
  --teal: #18A69A;
  --teal-700: #0E7C72;
  --teal-050: #E5F5F3;
  --grey: #F2F6F8;
  --grey-200: #E3EAEF;
  --line: #D6E0E7;
  --ink: #1B2733;
  --muted: #4E5D6B;
  --white: #FFFFFF;
  --danger: #B42318;
  --danger-050: #FEF1F0;

  /* Legacy aliases (kept so older markup continues to render on-brand) */
  --deep-olive: var(--navy);
  --forest-green: var(--blue-700);
  --muted-sage: var(--teal);
  --terracotta: var(--danger);
  --main-bg: var(--white);
  --alt-bg: var(--grey);
  --pale-sage: var(--teal-050);
  --warm-cream: var(--grey);
  --main-text: var(--ink);
  --secondary-text: var(--muted);
  --border-color: var(--line);

  /* Type */
  --font-sans: 'IBM Plex Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --font-primary: var(--font-sans);
  --fs-xs: 0.8125rem;   /* 13 */
  --fs-sm: 0.9375rem;   /* 15 */
  --fs-base: 1.0625rem; /* 17 */
  --fs-md: 1.25rem;     /* 20 */
  --fs-lg: clamp(1.375rem, 1.1rem + 0.9vw, 1.5625rem);   /* 22–25 */
  --fs-xl: clamp(1.625rem, 1.2rem + 1.4vw, 1.9375rem);   /* 26–31 */
  --fs-2xl: clamp(1.9rem, 1.3rem + 2.2vw, 2.5rem);       /* 30–40 */
  --fs-3xl: clamp(2.3rem, 1.4rem + 3.4vw, 3.5rem);       /* 37–56 */

  /* Space (8pt) */
  --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;
  --section-y: clamp(4rem, 2.5rem + 5vw, 7rem);

  /* Legacy spacing aliases */
  --spacing-xs: var(--space-2);
  --spacing-sm: var(--space-4);
  --spacing-md: var(--space-6);
  --spacing-lg: var(--space-8);
  --spacing-xl: var(--space-9);

  /* Shape & depth: radius scales with hierarchy */
  --r-sm: 6px;   /* controls */
  --r-md: 10px;  /* cards, images */
  --r-lg: 16px;  /* large panels */
  --r-drawing: 2px; /* technical drawing frames */
  --border-radius: var(--r-sm);
  --border-radius-lg: var(--r-md);
  --shadow-sm: 0 1px 2px rgba(16, 44, 70, 0.06), 0 1px 3px rgba(16, 44, 70, 0.08);
  --shadow-md: 0 8px 24px -8px rgba(16, 44, 70, 0.18);
  --shadow-lg: 0 24px 48px -16px rgba(16, 44, 70, 0.28);

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --transition-fast: 0.18s var(--ease);
  --transition-normal: 0.3s var(--ease);

  --container: 1240px;
  --container-width: var(--container);
  --measure: 68ch;
  --header-h: 76px;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.65;
  color: var(--ink);
  background: var(--white);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, svg, video { display: block; max-width: 100%; }
[hidden] { display: none !important; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--navy);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
h1 { font-size: var(--fs-3xl); letter-spacing: -0.025em; line-height: 1.08; }
h2 { font-size: var(--fs-2xl); letter-spacing: -0.02em; }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-md); line-height: 1.3; }
h5, h6 { font-size: var(--fs-base); line-height: 1.4; }

p { color: var(--muted); text-wrap: pretty; }
p + p { margin-top: var(--space-4); }
strong { color: var(--ink); font-weight: 600; }

a { color: var(--blue); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--blue-700); }

:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; border-radius: 2px; }

::selection { background: var(--blue-050); color: var(--navy); }

/* Layout */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 0.6rem + 2.5vw, 2.5rem);
}
.container-narrow { max-width: 860px; }

.section { padding-block: var(--section-y); }
.section-alt, .section--grey { background: var(--grey); }
.section--navy { background: var(--navy); color: rgba(255, 255, 255, 0.86); }
.section--navy :is(h1, h2, h3, h4, h5) { color: var(--white); }
.section--navy p { color: rgba(255, 255, 255, 0.76); }
.section--navy strong { color: var(--white); }
.section--tight { padding-block: clamp(3rem, 2rem + 3vw, 4.5rem); }

/* Blueprint grid texture — reserved for technical visuals and dark hero areas */
.blueprint {
  background-color: var(--grey);
  background-image:
    linear-gradient(rgba(16, 44, 70, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 44, 70, 0.055) 1px, transparent 1px);
  background-size: 24px 24px;
}
.blueprint--dark {
  background-color: var(--navy-950);
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 32px 32px;
}

/* Section heading: title left, intro right */
.section-head {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: var(--space-4) var(--space-8);
  align-items: end;
  margin-bottom: clamp(2rem, 1.5rem + 2vw, 3.5rem);
}
.section-head h2 { max-width: 18ch; }
.section-head p { max-width: 56ch; font-size: var(--fs-md); line-height: 1.55; }
.section-head--stacked { grid-template-columns: 1fr; align-items: start; }
.section-head--stacked h2 { max-width: 26ch; }

.lede { font-size: var(--fs-md); line-height: 1.55; color: var(--muted); max-width: 60ch; }

.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(2rem, 1rem + 4vw, 5rem);
  align-items: center;
}
.split--top { align-items: start; }
.split--wide-left { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.split--wide-right { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }

.grid-2, .grid-3, .grid-4 { display: grid; gap: clamp(1.25rem, 0.8rem + 1.5vw, 2rem); }
.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)); }

.stack > * + * { margin-top: var(--space-4); }
.stack-lg > * + * { margin-top: var(--space-6); }
.text-center { text-align: center; }
.mt-6 { margin-top: var(--space-6); }

.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;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Grid and flex children may shrink below their content (lets wide drawings scroll inside their frame) */
.split > *, .grid-2 > *, .grid-3 > *, .grid-4 > *, .hero-grid > *, .industry-row > *, .page-header--split .container > * { min-width: 0; }
