/* ==========================================================================
   Klass360 – Base: reset, typography, utilities & shared components
   Mobile-first: base styles target small screens, media queries scale up.
   ========================================================================== */

/* ---------- 1. Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; padding: 0; }

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

body {
  font-family: var(--ff-base);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }

h1, h2, h3, h4, h5, h6 {
  color: var(--c-heading);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-snug);
  text-wrap: balance;
}

p { text-wrap: pretty; }

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

/* ---------- 2. Accessibility helpers ---------- */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 1rem; top: -100px;
  z-index: var(--z-top);
  padding: 0.75rem 1rem;
  background: var(--c-secondary);
  color: #fff;
  border-radius: var(--r-sm);
}
.skip-link:focus { top: 1rem; }

.sprite { display: none; }
[hidden] { display: none !important; }

/* ---------- 3. Layout primitives ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--section-y); }

/* ---------- 4. Icons ---------- */
.icon {
  width: 1.5rem; height: 1.5rem;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon--sm { width: 1.125rem; height: 1.125rem; }
.icon--xs { width: 0.875rem; height: 0.875rem; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: var(--r-sm);
  color: var(--c-heading);
  transition: background var(--t-fast);
}
.icon-btn:hover { background: var(--c-primary-soft); }

/* ---------- 5. Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.75rem 1.5rem;
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn--sm { min-height: 40px; padding: 0.5rem 1.125rem; }
.btn--lg { min-height: 52px; padding: 0.95rem 1.875rem; border-radius: var(--r-md); }

.btn--primary { background: var(--c-primary); color: var(--c-heading); }
.btn--primary:hover { background: var(--c-primary-hover); box-shadow: 0 10px 24px rgba(150, 207, 0, 0.35); }

.btn--secondary { background: var(--c-secondary); color: #fff; }
.btn--secondary:hover { background: var(--c-secondary-hover); box-shadow: 0 10px 24px rgba(6, 78, 106, 0.3); }

.btn--light { background: var(--c-surface); color: var(--c-heading); }
.btn--light:hover { box-shadow: var(--shadow-md); }

.btn--outline-light {
  border: 1px solid var(--c-on-dark-border);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  border-radius: var(--r-pill);
  text-transform: none;
  letter-spacing: 0;
  font-weight: var(--fw-medium);
}
.btn--outline-light:hover { background: var(--c-primary); color: var(--c-heading); border-color: var(--c-primary); }

.btn-group { display: flex; flex-wrap: wrap; gap: var(--space-4); }

/* ---------- 6. Section tag (pill subtitle) ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 4px 14px 4px 4px;
  margin-bottom: var(--space-5);
  border: 1px solid var(--c-border);
  border-radius: var(--r-pill);
  background: var(--c-surface);
  color: var(--c-heading);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  line-height: 1.4;
}
.tag__pill {
  padding: 3px 12px;
  border-radius: var(--r-pill);
  background: var(--c-primary);
  color: var(--c-heading);
  font-weight: var(--fw-semibold);
  white-space: nowrap;
}
@media (max-width: 399.98px) {
  .tag { font-size: var(--fs-xs); gap: 0.5rem; }
}
.tag--dark {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--c-on-dark-border);
  color: #fff;
}

/* ---------- 7. Section heading ---------- */
.section-head {
  max-width: 760px;
  margin: 0 auto var(--space-10);
  text-align: center;
}
.section-lead { max-width: 640px; margin: var(--space-5) auto 0; }
.section-title {
  font-size: var(--fs-h2);
  line-height: 1.18;
  letter-spacing: -0.02em;
}

/* ---------- 8. Small shared UI bits ---------- */
.avatar {
  display: inline-grid;
  place-items: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--c-secondary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: var(--fw-semibold);
  flex-shrink: 0;
}
.avatar--sm { width: 30px; height: 30px; font-size: 0.7rem; }
.avatar--xs { width: 20px; height: 20px; font-size: 0.55rem; }
.avatar--lime { background: var(--c-primary); color: var(--c-heading); }

.chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: var(--r-pill);
  background: rgba(6, 78, 106, 0.1);
  color: var(--c-secondary);
  font-size: 0.7rem;
  font-weight: var(--fw-semibold);
  white-space: nowrap;
}
.chip--lime { background: var(--c-primary); color: var(--c-heading); }

/* ---------- 9. Scroll reveal ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

@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;
  }
  .js .reveal { opacity: 1; transform: none; }
}
