/* ========================================================================== 
   Variables
   ========================================================================== */

:root {
  /* Colors */
  --color-bg: #f7fafc; /* Soft light background */
  --color-surface: #ffffff; /* Cards / surfaces */
  --color-text: #1f2933; /* Primary text */
  --color-muted-text: #6b7c93; /* Secondary text */

  --color-primary: #2f80ed; /* Soft but clear blue */
  --color-primary-soft: #e3f2ff;
  --color-primary-strong: #1b63c7;

  --color-success: #2f9e44;
  --color-warning: #f2a227;
  --color-danger: #e03131;

  /* Neutral grays */
  --gray-50: #f9fafb;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  /* Accent tones (beige / teal) */
  --color-accent-beige: #f5ede1;
  --color-accent-teal: #2c7a7b;
  --color-accent-teal-soft: #e0f4f4;

  /* Typography */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji",
    "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  --font-serif: "Merriweather", Georgia, "Times New Roman", serif;
  --font-mono: "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;

  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.25rem;

  --line-height-tight: 1.2;
  --line-height-snug: 1.35;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.7;

  /* Spacing scale (px) */
  --space-0: 0;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;

  /* Radius */
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Shadows - soft, educational, not harsh */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 6px 18px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 30px rgba(15, 23, 42, 0.10);

  /* Transitions */
  --transition-fast: 120ms ease-out;
  --transition-base: 180ms ease-out;
  --transition-slow: 250ms ease-out;
}

/* Reduced motion defaults */
@media (prefers-reduced-motion: reduce) {
  :root {
    --transition-fast: 0ms;
    --transition-base: 0ms;
    --transition-slow: 0ms;
  }
}

/* ========================================================================== 
   Reset / Normalize
   ========================================================================== */

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

html {
  margin: 0;
  padding: 0;
  scroll-behavior: smooth;
}

body {
  margin: 0;
}

h1, h2, h3, h4, h5, h6,
 p, figure, blockquote, dl, dd {
  margin: 0;
}

ul[role="list"],
ol[role="list"] {
  list-style: none;
  padding: 0;
  margin: 0;
}

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

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

button {
  border: none;
  padding: 0;
  background: none;
}

textarea {
  resize: vertical;
}

/* Respect user motion preferences */
@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;
    scroll-behavior: auto !important;
  }
}

/* ========================================================================== 
   Base Styles
   ========================================================================== */

body {
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height-relaxed);
  color: var(--color-text);
  background-color: var(--color-bg);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

main {
  min-height: 60vh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: 700;
  line-height: var(--line-height-tight);
  color: var(--gray-900);
}

h1 {
  font-size: clamp(2rem, 3vw, 2.5rem);
  letter-spacing: -0.03em;
  margin-bottom: var(--space-4);
}

h2 {
  font-size: clamp(1.75rem, 2.5vw, 2.125rem);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-3);
}

h3 {
  font-size: clamp(1.5rem, 2vw, 1.75rem);
  letter-spacing: -0.01em;
  margin-bottom: var(--space-3);
}

h4 {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-2);
}

h5 {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-2);
}

h6 {
  font-size: var(--font-size-sm);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-2);
  color: var(--color-muted-text);
}

p {
  margin-bottom: var(--space-3);
  color: var(--color-text);
}

p.lead {
  font-size: var(--font-size-lg);
  line-height: var(--line-height-relaxed);
  color: var(--gray-700);
}

small {
  font-size: var(--font-size-sm);
}

strong {
  font-weight: 600;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-base);
}

a:hover {
  color: var(--color-primary-strong);
}

a:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

code, pre {
  font-family: var(--font-mono);
}

hr {
  border: none;
  border-top: 1px solid var(--gray-200);
  margin: var(--space-6) 0;
}

/* ========================================================================== 
   Accessibility & Focus
   ========================================================================== */

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

:focus:not(:focus-visible) {
  outline: none;
}

/* 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;
}

.sr-only-focusable:active,
.sr-only-focusable:focus {
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

/* ========================================================================== 
   Utilities
   ========================================================================== */

/* Layout */

.container {
  width: 100%;
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

@media (min-width: 1200px) {
  .container {
    max-width: 1200px;
  }
}

.section {
  padding-top: var(--space-10);
  padding-bottom: var(--space-10);
}

.section--soft {
  background: linear-gradient(
    180deg,
    rgba(227, 242, 255, 0.3) 0%,
    rgba(245, 237, 225, 0.55) 100%
  );
}

/* Flex helpers */

.flex {
  display: flex;
}

.inline-flex {
  display: inline-flex;
}

.flex-row {
  flex-direction: row;
}

.flex-col {
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.items-center {
  align-items: center;
}

.items-start {
  align-items: flex-start;
}

.items-end {
  align-items: flex-end;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-around {
  justify-content: space-around;
}

.gap-2 {
  gap: var(--space-2);
}

.gap-3 {
  gap: var(--space-3);
}

.gap-4 {
  gap: var(--space-4);
}

.gap-6 {
  gap: var(--space-6);
}

/* Grid helpers */

.grid {
  display: grid;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-6);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-6);
}

@media (max-width: 768px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.m-auto {
  margin: auto;
}

.mt-0 { margin-top: 0; }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }

.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

.py-4 {
  padding-top: var(--space-4);
  padding-bottom: var(--space-4);
}

.py-6 {
  padding-top: var(--space-6);
  padding-bottom: var(--space-6);
}

.px-4 {
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

.rounded-full {
  border-radius: var(--radius-full);
}

/* Background helpers for subtle educational feel */

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

.bg-soft-blue {
  background-color: var(--color-primary-soft);
}

.bg-soft-beige {
  background-color: var(--color-accent-beige);
}

.bg-soft-teal {
  background-color: var(--color-accent-teal-soft);
}

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

/* ========================================================================== 
   Components
   ========================================================================== */

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: var(--font-size-sm);
  line-height: 1.2;
  cursor: pointer;
  border: 1px solid transparent;
  transition:
    background-color var(--transition-base),
    color var(--transition-base),
    border-color var(--transition-base),
    box-shadow var(--transition-base),
    transform var(--transition-fast);
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, #4ba3ff 100%);
  color: #ffffff!important;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--color-primary-strong) 0%, #2f80ed 100%);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-primary:active {
  box-shadow: var(--shadow-xs);
  transform: translateY(0);
}

.btn-secondary {
  background-color: #ffffff;
  color: var(--color-primary-strong);
  border-color: rgba(47, 128, 237, 0.3);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
  background-color: var(--color-primary-soft);
  border-color: rgba(47, 128, 237, 0.5);
}

.btn-ghost {
  background-color: transparent;
  color: var(--color-primary-strong);
}

.btn-ghost:hover {
  background-color: rgba(47, 128, 237, 0.06);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.6;
  box-shadow: none;
}

.btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Form inputs */

.input,
textarea,
select {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-300);
  background-color: #ffffff;
  color: var(--color-text);
  font-size: var(--font-size-sm);
  transition:
    border-color var(--transition-base),
    box-shadow var(--transition-base),
    background-color var(--transition-base);
}

.input::placeholder,
textarea::placeholder {
  color: var(--gray-400);
}

.input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px rgba(47, 128, 237, 0.25);
}

.input[aria-invalid="true"],
textarea[aria-invalid="true"],
select[aria-invalid="true"] {
  border-color: var(--color-danger);
}

label {
  display: block;
  margin-bottom: var(--space-2);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--gray-800);
}

.form-help {
  margin-top: var(--space-1);
  font-size: var(--font-size-xs);
  color: var(--color-muted-text);
}

.form-error {
  margin-top: var(--space-1);
  font-size: var(--font-size-xs);
  color: var(--color-danger);
}

/* Card */

.card {
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-5);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.card--soft {
  background: linear-gradient(135deg, #ffffff 0%, #f5f7fb 100%);
}

.card-header {
  margin-bottom: var(--space-3);
}

.card-title {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-1);
}

.card-subtitle {
  font-size: var(--font-size-sm);
  color: var(--color-muted-text);
}

.card-footer {
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--gray-200);
}

/* Callout / info box for educational notes */

.callout {
  border-radius: var(--radius-md);
  padding: var(--space-4);
  border: 1px solid var(--gray-200);
  background-color: #f4f7fb;
}

.callout--info {
  border-color: rgba(47, 128, 237, 0.25);
  background-color: var(--color-primary-soft);
}

.callout--success {
  border-color: rgba(47, 158, 68, 0.25);
  background-color: #e6f6ec;
}

.callout--warning {
  border-color: rgba(242, 162, 39, 0.25);
  background-color: #fff4e5;
}

.callout--danger {
  border-color: rgba(224, 49, 49, 0.25);
  background-color: #ffe9e9;
}

.callout-title {
  font-weight: 600;
  margin-bottom: var(--space-1);
}

/* Badges - for levels, categories, etc. */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 500;
  background-color: var(--gray-100);
  color: var(--gray-700);
}

.badge-primary {
  background-color: rgba(47, 128, 237, 0.1);
  color: var(--color-primary-strong);
}

.badge-success {
  background-color: rgba(47, 158, 68, 0.1);
  color: var(--color-success);
}

.badge-muted {
  background-color: var(--gray-100);
  color: var(--gray-600);
}

/* Navigation helpers (generic) */

.navbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background-color: rgba(247, 250, 252, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.nav-link {
  font-size: var(--font-size-sm);
  color: var(--gray-700);
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
}

.nav-link:hover {
  color: var(--color-primary-strong);
}

.nav-link--active {
  color: var(--color-primary-strong);
  border-bottom-color: var(--color-primary-strong);
}

/* Hero / key section helpers */

.hero {
  padding-top: var(--space-12);
  padding-bottom: var(--space-12);
}

@media (max-width: 768px) {
  .hero {
    padding-top: var(--space-8);
    padding-bottom: var(--space-8);
  }
}

.hero-eyebrow {
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  color: var(--color-accent-teal);
  margin-bottom: var(--space-2);
}

.hero-title {
  font-size: clamp(2.25rem, 3.2vw, 2.75rem);
}



/* Lists for organized educational content */

.list-check {
  list-style: none;
  padding: 0;
  margin: 0;
}

.list-check li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: var(--space-2);
}

.list-check li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, #ffffff 0, #ffffff 40%, #2f9e44 40%, #2f9e44 100%);
}

/* Footer helper */

.site-footer {
  padding-top: var(--space-8);
  padding-bottom: var(--space-6);
  border-top: 1px solid var(--gray-200);
  color: var(--gray-600);
  font-size: var(--font-size-sm);
}

.site-footer a {
  color: var(--gray-600);
}

.site-footer a:hover {
  color: var(--color-primary-strong);
}
