/* ================================================================
   DESIGN SYSTEM — Școala Gimnazială "Dan Iordăchescu" Hlipiceni
   Agency-grade token system | 2026
   ================================================================ */

/* ────────────────────────────────────────────────────────────────
   1. SPACE SCALE  (4px base × 2 progression)
   Use: var(--space-1) through var(--space-20)
   ──────────────────────────────────────────────────────────────── */
:root {
  --space-0: 0px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 28px;
  --space-8: 32px;
  --space-9: 36px;
  --space-10: 40px;
  --space-12: 48px;
  --space-14: 56px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;
  --space-32: 128px;

  /* Section vertical padding */
  --section-py: 80px;
  --section-py-sm: 60px;
  --section-py-lg: 100px;
}

/* ────────────────────────────────────────────────────────────────
   2. COLOR SYSTEM
   ──────────────────────────────────────────────────────────────── */
:root {
  /* Brand */
  --color-accent: #D3224D;
  /* Crimson Red — primary brand */
  --color-accent-dark: #B01A3A;
  /* Hover / pressed */
  --color-accent-light: #FDF0F4;
  /* Backgrounds, tints */
  --color-accent-alpha: rgba(211, 34, 77, 0.1);

  /* Heading */
  --color-navy: #081933;
  /* Primary heading, topbar */
  --color-navy-mid: #0F2545;
  /* Gradient mid-point */
  --color-navy-light: #1A3A6B;
  /* Lighter navy variant */

  /* Neutrals */
  --color-steel: #506172;
  /* Body text */
  --color-steel-light: #8A9AB0;
  /* Muted text */
  --color-border: #E2E8F0;
  /* All borders */
  --color-bg: #F8F9FC;
  /* Light section bg */
  --color-bg-white: #FFFFFF;
  --color-bg-card: #FFFFFF;

  /* Semantic */
  --color-success: #22C55E;
  --color-warning: #F59E0B;
  --color-error: #EF4444;
  --color-info: #3B82F6;

  /* Text on dark */
  --color-on-dark: rgba(255, 255, 255, 0.85);
  --color-on-dark-muted: rgba(255, 255, 255, 0.55);
}

/* ────────────────────────────────────────────────────────────────
   3. TYPOGRAPHY SCALE
   ──────────────────────────────────────────────────────────────── */
:root {
  /* Fonts */
  --font-heading: "Playfair Display", Georgia, serif;
  --font-body: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", monospace;

  /* Size scale */
  --text-xs: 11px;
  --text-sm: 13px;
  --text-base: 15px;
  --text-md: 17px;
  --text-lg: 19px;
  --text-xl: 22px;
  --text-2xl: 26px;
  --text-3xl: 32px;
  --text-4xl: 40px;
  --text-5xl: 52px;
  --text-6xl: 64px;

  /* Line heights */
  --lh-tight: 1.2;
  --lh-snug: 1.35;
  --lh-normal: 1.6;
  --lh-relaxed: 1.75;
  --lh-loose: 1.9;

  /* Letter spacing */
  --ls-tight: -0.02em;
  --ls-normal: 0;
  --ls-wide: 0.04em;
  --ls-wider: 0.08em;
  --ls-widest: 0.12em;

  /* Weights */
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fw-black: 800;
}

/* ────────────────────────────────────────────────────────────────
   4. BORDER RADIUS SYSTEM
   ──────────────────────────────────────────────────────────────── */
:root {
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;
  --radius-full: 9999px;
}

/* ────────────────────────────────────────────────────────────────
   5. SHADOW SYSTEM
   ──────────────────────────────────────────────────────────────── */
:root {
  --shadow-xs: 0 1px 3px rgba(8, 25, 51, 0.06);
  --shadow-sm: 0 2px 8px rgba(8, 25, 51, 0.08);
  --shadow-md: 0 4px 16px rgba(8, 25, 51, 0.10);
  --shadow-lg: 0 8px 32px rgba(8, 25, 51, 0.12);
  --shadow-xl: 0 16px 48px rgba(8, 25, 51, 0.14);
  --shadow-2xl: 0 24px 64px rgba(8, 25, 51, 0.18);
  --shadow-accent-sm: 0 4px 16px rgba(211, 34, 77, 0.20);
  --shadow-accent-md: 0 8px 28px rgba(211, 34, 77, 0.28);
}

/* ────────────────────────────────────────────────────────────────
   6. TRANSITION SYSTEM
   ──────────────────────────────────────────────────────────────── */
:root {
  --ease-default: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);

  --duration-fast: 150ms;
  --duration-base: 250ms;
  --duration-slow: 400ms;
  --duration-slower: 600ms;

  --transition-base: all var(--duration-base) var(--ease-default);
  --transition-fast: all var(--duration-fast) var(--ease-default);
  --transition-slow: all var(--duration-slow) var(--ease-default);
  --transition-bounce: all var(--duration-slow) var(--ease-bounce);
}

/* ────────────────────────────────────────────────────────────────
   7. Z-INDEX SCALE
   ──────────────────────────────────────────────────────────────── */
:root {
  --z-below: -1;
  --z-base: 0;
  --z-raised: 10;
  --z-dropdown: 200;
  --z-sticky: 500;
  --z-overlay: 800;
  --z-modal: 900;
  --z-toast: 1000;
}

/* ────────────────────────────────────────────────────────────────
   8. GRID SYSTEM
   ──────────────────────────────────────────────────────────────── */
:root {
  --container-max: 1360px;
  --container-pad: var(--space-6);
  --grid-gap: var(--space-6);
  --grid-gap-lg: var(--space-10);
}

/* ────────────────────────────────────────────────────────────────
   9. GLOBAL BASE RESETS & TYPOGRAPHY APPLICATION
   ──────────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--fw-regular);
  line-height: var(--lh-relaxed);
  color: var(--color-steel);
  background-color: var(--color-bg-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Heading defaults */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  color: var(--color-navy);
  margin-top: 0;
}

h1 {
  font-size: var(--text-5xl);
  letter-spacing: var(--ls-tight);
}

h2 {
  font-size: var(--text-3xl);
  letter-spacing: var(--ls-tight);
}

h3 {
  font-size: var(--text-xl);
}

h4 {
  font-size: var(--text-lg);
}

h5 {
  font-size: var(--text-base);
}

h6 {
  font-size: var(--text-sm);
}

p {
  margin-top: 0;
  margin-bottom: var(--space-4);
  color: var(--color-steel);
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--color-accent);
  transition: var(--transition-fast);
}

a:hover {
  color: var(--color-accent-dark);
}

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

ul,
ol {
  margin-top: 0;
}

/* ────────────────────────────────────────────────────────────────
   10. BUTTON VARIANTS
   ──────────────────────────────────────────────────────────────── */

/* Base button reset */
.ds-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--fw-semibold);
  line-height: 1;
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-base);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.ds-btn i {
  transition: transform var(--duration-base) var(--ease-default);
}

.ds-btn:hover i {
  transform: translateX(3px);
}

/* VARIANT: Primary (Crimson filled) */
.ds-btn-primary {
  background: var(--color-accent);
  color: #fff !important;
  border-color: var(--color-accent);
}

.ds-btn-primary:hover {
  background: var(--color-accent-dark);
  border-color: var(--color-accent-dark);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-accent-md);
}

.ds-btn-primary:focus-visible {
  outline: 3px solid rgba(211, 34, 77, 0.5);
  outline-offset: 3px;
}

/* VARIANT: Secondary (Navy filled) */
.ds-btn-secondary {
  background: var(--color-navy);
  color: #fff !important;
  border-color: var(--color-navy);
}

.ds-btn-secondary:hover {
  background: var(--color-navy-mid);
  border-color: var(--color-navy-mid);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* VARIANT: Ghost (Outline — transparent bg) */
.ds-btn-ghost {
  background: transparent;
  color: var(--color-navy) !important;
  border-color: var(--color-border);
}

.ds-btn-ghost:hover {
  border-color: var(--color-accent);
  color: var(--color-accent) !important;
  transform: translateY(-1px);
}

/* VARIANT: Ghost White (on dark backgrounds) */
.ds-btn-ghost-white {
  background: transparent;
  color: rgba(255, 255, 255, 0.9) !important;
  border-color: rgba(255, 255, 255, 0.35);
}

.ds-btn-ghost-white:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.8);
  color: #fff !important;
}

/* SIZE VARIANTS */
.ds-btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
}

.ds-btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-md);
}

.ds-btn-xl {
  padding: var(--space-5) var(--space-10);
  font-size: var(--text-lg);
}

/* ────────────────────────────────────────────────────────────────
   11. UTILITY CLASSES
   ──────────────────────────────────────────────────────────────── */

/* Section container */
.ds-section {
  padding: var(--section-py) 0;
}

.ds-section-sm {
  padding: var(--section-py-sm) 0;
}

.ds-section-lg {
  padding: var(--section-py-lg) 0;
}

.ds-section-bg {
  background-color: var(--color-bg);
}

.ds-section-dark {
  background: linear-gradient(135deg, var(--color-navy), var(--color-navy-mid));
  color: var(--color-on-dark);
}

.ds-section-dark h1,
.ds-section-dark h2,
.ds-section-dark h3,
.ds-section-dark h4,
.ds-section-dark h5,
.ds-section-dark h6 {
  color: #fff;
}

/* Section heading group */
.ds-section-header {
  margin-bottom: var(--space-12);
}

.ds-section-header.centered {
  text-align: center;
}

.ds-section-header.centered .ds-section-lead {
  margin: 0 auto;
}

.ds-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-widest);
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-3);
}

.ds-eyebrow::before {
  content: '';
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-accent);
  flex-shrink: 0;
}

.ds-section-title {
  font-family: var(--font-heading);
  font-size: clamp(var(--text-2xl), 3.5vw, var(--text-4xl));
  font-weight: var(--fw-bold);
  color: var(--color-navy);
  line-height: var(--lh-snug);
  margin-bottom: var(--space-4);
  letter-spacing: var(--ls-tight);
}

.ds-section-title em {
  font-style: italic;
  color: var(--color-accent);
}

.ds-section-lead {
  font-size: var(--text-md);
  color: var(--color-steel);
  line-height: var(--lh-relaxed);
  max-width: 600px;
}

/* Card Base */
.ds-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition-slow);
}

.ds-card:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-4px);
}

/* Card body */
.ds-card-body {
  padding: var(--space-6);
}

.ds-card-body-lg {
  padding: var(--space-8);
}

/* Icon box */
.ds-icon-box {
  width: 52px;
  height: 52px;
  background: var(--color-accent-alpha);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--color-accent);
  transition: var(--transition-base);
  flex-shrink: 0;
}

.ds-card:hover .ds-icon-box,
.ds-icon-box:hover {
  background: var(--color-accent);
  color: #fff;
  transform: rotate(-5deg) scale(1.05);
}

/* Tag / badge */
.ds-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
}

.ds-tag-accent {
  background: var(--color-accent);
  color: #fff;
}

.ds-tag-accent-light {
  background: var(--color-accent-light);
  color: var(--color-accent);
}

.ds-tag-navy {
  background: var(--color-navy);
  color: #fff;
}

.ds-tag-neutral {
  background: var(--color-border);
  color: var(--color-navy);
}

/* Divider with accent */
.ds-divider-accent {
  display: block;
  width: 48px;
  height: 3px;
  background: var(--color-accent);
  border-radius: var(--radius-full);
  margin: var(--space-4) 0 var(--space-6);
}

/* Focus ring */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

/* Screen reader only */
.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;
}

/* Skip link (accessibility) */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-6);
  background: var(--color-accent);
  color: #fff;
  padding: var(--space-2) var(--space-4);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-weight: var(--fw-semibold);
  font-size: var(--text-sm);
  z-index: var(--z-toast);
  transition: top 0.2s;
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
}

/* ────────────────────────────────────────────────────────────────
   12. RESPONSIVE CONTAINER OVERRIDE
   ──────────────────────────────────────────────────────────────── */
.container {
  max-width: var(--container-max) !important;
  padding-left: var(--container-pad) !important;
  padding-right: var(--container-pad) !important;
}

@media (max-width: 767px) {
  :root {
    --section-py: var(--section-py-sm);
    --container-pad: var(--space-4);
  }

  h2 {
    font-size: var(--text-2xl);
  }
}

@media (min-width: 1200px) {
  .mobile-nav-toggle {
    display: none;
  }
}

@media (max-width: 1199px) {
  .navmenu ul {
    display: none;
  }
}

h1 {
  font-size: var(--text-3xl);
}

h2 {
  font-size: var(--text-2xl);
}