/* ==========================================================================
   KLIC BUSINESS SOLUTION — CORE DESIGN SYSTEM & FOUNDATION
   Aesthetic: International Editorial Creative Agency
   Colors: #000000 (Black), #FFFFFF (White), #16C653 (KLIC Green Accent)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Syne:wght@500;600;700;800&display=swap');

:root {
  /* Brand Color Palette — Default Dark Theme */
  --bg: #000000;
  --bg-surface: #0a0a0a;
  --bg-surface-elevated: #111111;
  --bg-surface-subtle: #161616;
  
  --text: #FFFFFF;
  --text-muted: #8E8E93;
  --text-subtle: #555555;
  --text-dim: rgba(255, 255, 255, 0.4);
  --text-editorial-lead: #E4E4E7;
  
  /* KLIC Green Accent (Use strictly as accent) */
  --klic-green: #16C653;
  --klic-green-hover: #19db5c;
  --klic-green-dim: rgba(22, 198, 83, 0.12);
  --klic-green-border: rgba(22, 198, 83, 0.35);
  --klic-green-glow: rgba(22, 198, 83, 0.25);
  
  /* Borders & Hairlines */
  --border-hairline: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.16);
  --border-active: rgba(255, 255, 255, 0.3);

  /* Surfaces & Structural Components */
  --header-bg-scrolled: rgba(0, 0, 0, 0.85);
  --card-bg: #080808;
  --card-bg-hover: #0E0E0E;
  --card-bg-elevated: #141414;
  --input-bg: #0B0B0B;
  --input-bg-focus: #121212;
  --modal-bg: #0D0D0D;
  --footer-bg: #040404;

  /* Typography Stacks (Configurable official brand font) */
  --font-display: 'Syne', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Space Grotesk', monospace;

  /* Spacing Scale */
  --container-max: 1440px;
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --section-pad: clamp(4.5rem, 9vw, 9.5rem);
  --header-height: 84px;

  /* Transitions */
  --ease-editorial: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --duration-fast: 0.25s;
  --duration-normal: 0.45s;
  --duration-slow: 0.8s;
  --theme-transition: background-color 0.35s var(--ease-editorial), color 0.35s var(--ease-editorial), border-color 0.35s var(--ease-editorial);
}

@media (max-width: 768px) {
  :root {
    --header-height: 64px;
    --gutter: 1.25rem;
    --section-pad: clamp(3.25rem, 8vw, 5rem);
  }
}

/* Light Theme Variables */
[data-theme="light"] {
  --bg: #FFFFFF;
  --bg-surface: #F5F5F7;
  --bg-surface-elevated: #EAEAEE;
  --bg-surface-subtle: #F0F0F3;
  
  --text: #080808;
  --text-muted: #52525B;
  --text-subtle: #71717A;
  --text-dim: rgba(0, 0, 0, 0.52);
  --text-editorial-lead: #18181B;
  
  --klic-green: #10963E;
  --klic-green-hover: #0D7A32;
  --klic-green-dim: rgba(16, 150, 62, 0.12);
  --klic-green-border: rgba(16, 150, 62, 0.4);
  --klic-green-glow: rgba(16, 150, 62, 0.2);
  
  --border-hairline: rgba(0, 0, 0, 0.09);
  --border-medium: rgba(0, 0, 0, 0.18);
  --border-active: rgba(0, 0, 0, 0.36);

  --header-bg-scrolled: rgba(255, 255, 255, 0.88);
  --card-bg: #F7F7F9;
  --card-bg-hover: #EDEDF2;
  --card-bg-elevated: #E5E5EB;
  --input-bg: #F3F3F6;
  --input-bg-focus: #FFFFFF;
  --modal-bg: #FFFFFF;
  --footer-bg: #F4F4F6;
}

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

html {
  font-size: 16px;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: auto; /* Handled smoothly by Lenis */
  overflow-x: hidden;
  transition: var(--theme-transition);
}

body {
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 1rem;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
  transition: var(--theme-transition);
}

/* Selection */
::selection {
  background: var(--klic-green);
  color: #000000;
}

/* Typography Hierarchy */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.035em;
  color: var(--text);
}

.headline-hero {
  font-size: clamp(1.85rem, 7.5vw, 6.5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.98;
  text-transform: uppercase;
  overflow-wrap: break-word;
  word-break: break-word;
}

.headline-huge {
  font-size: clamp(1.75rem, 5.5vw, 4.75rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.05;
  text-transform: uppercase;
  overflow-wrap: break-word;
  word-break: break-word;
}

.headline-section {
  font-size: clamp(1.5rem, 4vw, 3.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.12;
  text-transform: uppercase;
  overflow-wrap: break-word;
  word-break: break-word;
}

.headline-sub {
  font-size: clamp(1.25rem, 2.2vw, 1.85rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.label-mono {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 600;
  color: var(--text-dim);
}

.label-mono.green {
  color: var(--klic-green);
}

.text-editorial {
  font-size: clamp(1.05rem, 1.35vw, 1.25rem);
  color: var(--text-muted);
  font-weight: 400;
  line-height: 1.65;
  max-width: 68ch;
}

.text-editorial-large {
  font-size: clamp(1.2rem, 1.8vw, 1.6rem);
  color: var(--text-editorial-lead);
  font-weight: 400;
  line-height: 1.5;
  max-width: 60ch;
}

/* Links & Base Elements */
a {
  color: inherit;
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-editorial);
}

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

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

ul, ol {
  list-style: none;
}

button, input, textarea, select {
  font-family: inherit;
  color: inherit;
  border: none;
  background: none;
  outline: none;
}

button {
  cursor: pointer;
}

/* Structural Layout */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.section {
  position: relative;
  padding-top: var(--section-pad);
  padding-bottom: var(--section-pad);
}

.section-divider {
  width: 100%;
  height: 1px;
  background: var(--border-hairline);
  position: relative;
}

.section-divider::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 60px;
  height: 1px;
  background: var(--klic-green);
}

/* Editorial Grid Utility */
.grid-editorial {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(1.5rem, 3vw, 3.5rem);
}

@media (max-width: 768px) {
  .grid-editorial {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
  }
  .grid-editorial > * {
    grid-column: span 12 !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  .grid-editorial > div[style*="justify-content: flex-end"] {
    justify-content: flex-start !important;
    align-items: flex-start !important;
  }
}

/* Responsive Form Utilities */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 640px) {
  .form-row {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

/* Accent Utilities */
.green-accent {
  color: var(--klic-green) !important;
}

.green-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--klic-green);
  border-radius: 50%;
  margin: 0 0.5rem;
  vertical-align: middle;
}

.green-line {
  display: block;
  width: 36px;
  height: 2px;
  background: var(--klic-green);
  margin: 1.25rem 0;
}

/* Badge Component */
.badge-klic {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.9rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-hairline);
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #D1D1D6;
  width: fit-content;
}

.badge-klic .pulse-dot {
  width: 6px;
  height: 6px;
  background: var(--klic-green);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--klic-green);
}

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

:focus-visible {
  outline: 2px solid var(--klic-green);
  outline-offset: 3px;
}
