/**
 * KM Technolabs — Layout & Base
 */

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

* {
  margin: 0;
  padding: 0;
}

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

ul, ol { list-style: none; }

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

::selection {
  background: rgba(34, 176, 125, 0.2);
  color: var(--text);
}

.container {
  width: min(100% - 40px, var(--container));
  margin-inline: auto;
}

.container-wide {
  width: min(100% - 40px, var(--container-wide));
  margin-inline: auto;
}

.section {
  position: relative;
  padding-block: var(--section-y);
  overflow: hidden;
}

.section-alt { background: var(--background-alt); }
.section-dark {
  background: var(--gradient-indigo);
  color: var(--text-inverse);
}

.section-dark h2,
.section-dark h3,
.section-dark .eyebrow { color: var(--text-inverse); }

.section-dark .eyebrow { color: var(--primary-light); }
.section-dark .eyebrow::before { background: var(--primary-light); }
.section-dark p { color: rgba(255, 255, 255, 0.78); }

.section-header {
  max-width: 680px;
  margin-bottom: var(--space-7);
}

.section-header.center {
  text-align: center;
  margin-inline: auto;
}

.section-header.center .eyebrow {
  justify-content: center;
}

.section-header.center .lead {
  margin-inline: auto;
}

.section-header h2 { margin-bottom: var(--space-4); }

/* Grids */
.grid {
  display: grid;
  gap: var(--space-5);
}

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

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }
.gap-6 { gap: var(--space-6); }

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

/* Geometric helpers from brochure */
.poly-cut {
  clip-path: polygon(0 0, 100% 0, 100% 85%, 88% 100%, 0 100%);
}

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

.curve-separator {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  width: 100%;
  height: 80px;
  color: var(--background);
  pointer-events: none;
}

.curve-separator.top {
  bottom: auto;
  top: -1px;
  transform: rotate(180deg);
}

.curve-separator path { fill: currentColor; }

/* Indigo block with large rounded corner (brochure motif) */
.brand-panel {
  background: var(--secondary);
  color: var(--text-inverse);
  border-radius: 0 var(--radius-lg) 0 0;
  position: relative;
  overflow: hidden;
  padding: var(--space-7);
}

.brand-panel::after {
  content: "";
  position: absolute;
  width: 120px;
  height: 120px;
  background: var(--primary);
  bottom: -30px;
  left: -20px;
  clip-path: polygon(20% 0%, 100% 0%, 80% 100%, 0% 100%);
  opacity: 0.9;
}

/* Green ribbon CTA (brochure motif) */
.ribbon {
  display: inline-flex;
  align-items: center;
  gap: var(--space-4);
  background: var(--primary);
  color: white;
  padding: 14px 28px;
  clip-path: polygon(0 0, 96% 0, 100% 50%, 96% 100%, 0 100%);
  font-weight: 600;
  box-shadow: var(--shadow-green);
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  z-index: 1000;
  background: var(--primary);
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
}

.skip-link:focus { top: var(--space-4); }

/* Responsive breakpoints */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .container, .container-wide { width: min(100% - 32px, var(--container)); }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  :root { --header-h: 72px; }
}

@media (max-width: 480px) {
  .container, .container-wide { width: min(100% - 24px, var(--container)); }
}
