/* ============================================================
   PHAINO PREPARATORY SCHOOL — DESIGN SYSTEM
   main.css | Core tokens, typography, reset, utilities
   ============================================================ */

/* --- Google Fonts Import --- */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700;900&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

/* --- CSS Custom Properties (Design Tokens) --- */
:root {
  /* Brand Colors */
  --color-primary:        #0D5C5A;
  --color-primary-dark:   #084240;
  --color-primary-light:  #1a7a77;
  --color-primary-50:     rgba(13, 92, 90, 0.05);
  --color-primary-100:    rgba(13, 92, 90, 0.1);
  --color-primary-200:    rgba(13, 92, 90, 0.2);

  --color-secondary:      #F59E0B;
  --color-secondary-dark: #D97706;
  --color-secondary-light:#FCD34D;
  --color-secondary-50:   rgba(245, 158, 11, 0.08);

  --color-accent:         #F97316;
  --color-accent-light:   #FB923C;
  --color-danger:         #DC2626;
  --color-danger-light:   #FEE2E2;

  --color-heading:        #881337;
  --color-heading-alt:    #9B1239;

  /* Neutrals */
  --color-text:           #1E293B;
  --color-text-muted:     #475569;
  --color-text-light:     #64748B;
  --color-text-inverse:   #FFFFFF;

  /* Backgrounds */
  --color-bg:             #FAF9F5;
  --color-bg-alt:         #F4F2EC;
  --color-bg-card:        #FFFFFF;
  --color-bg-dark:        #0A2929;
  --color-bg-dark-alt:    #0D3535;

  /* Borders */
  --color-border:         #E2E0D8;
  --color-border-light:   #EDE9DC;

  /* Typography */
  --font-heading:         'Cinzel', 'Playfair Display', Georgia, serif;
  --font-subheading:      'Playfair Display', Georgia, serif;
  --font-body:            'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Font Sizes (fluid) */
  --text-xs:    0.75rem;
  --text-sm:    0.875rem;
  --text-base:  1rem;
  --text-lg:    1.125rem;
  --text-xl:    1.25rem;
  --text-2xl:   1.5rem;
  --text-3xl:   1.875rem;
  --text-4xl:   2.25rem;
  --text-5xl:   3rem;
  --text-6xl:   3.75rem;
  --text-7xl:   4.5rem;

  /* Spacing */
  --space-1:    0.25rem;
  --space-2:    0.5rem;
  --space-3:    0.75rem;
  --space-4:    1rem;
  --space-5:    1.25rem;
  --space-6:    1.5rem;
  --space-8:    2rem;
  --space-10:   2.5rem;
  --space-12:   3rem;
  --space-16:   4rem;
  --space-20:   5rem;
  --space-24:   6rem;
  --space-32:   8rem;

  /* Borders & Radius */
  --radius-sm:  0.375rem;
  --radius-md:  0.75rem;
  --radius-lg:  1rem;
  --radius-xl:  1.5rem;
  --radius-2xl: 2rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm:  0 1px 2px rgba(0,0,0,0.05);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.12);
  --shadow-xl:  0 16px 48px rgba(0,0,0,0.14);
  --shadow-2xl: 0 24px 64px rgba(0,0,0,0.18);
  --shadow-teal: 0 8px 32px rgba(13, 92, 90, 0.25);
  --shadow-gold: 0 8px 32px rgba(245, 158, 11, 0.25);

  /* Transitions */
  --transition-fast:   150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base:   250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow:   400ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Layout */
  --container-max: 1280px;
  --nav-height:    80px;
  --nav-height-top: 40px;
}

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

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

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

a {
  color: inherit;
  text-decoration: none;
}

ul, ol { list-style: none; }

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

button { cursor: pointer; border: none; background: none; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: 1.2;
  color: var(--color-heading);
  font-weight: 700;
}

p { line-height: 1.75; }

/* --- Container --- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.container-sm {
  max-width: 820px;
  margin-inline: auto;
  padding-inline: var(--space-6);
}

/* --- Typography Utilities --- */
.text-heading {
  font-family: var(--font-heading);
  color: var(--color-heading);
}

.text-subheading {
  font-family: var(--font-subheading);
  color: var(--color-heading);
}

.text-display {
  font-size: clamp(2.5rem, 6vw, var(--text-7xl));
  font-family: var(--font-heading);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.text-h1 { font-size: clamp(2rem, 4.5vw, var(--text-6xl)); font-weight: 700; }
.text-h2 { font-size: clamp(1.6rem, 3.5vw, var(--text-4xl)); font-weight: 700; }
.text-h3 { font-size: clamp(1.3rem, 2.5vw, var(--text-3xl)); font-weight: 600; }
.text-h4 { font-size: clamp(1.1rem, 2vw, var(--text-2xl)); font-weight: 600; }

.lead {
  font-size: clamp(1rem, 1.5vw, var(--text-xl));
  line-height: 1.8;
  color: var(--color-text-muted);
  font-weight: 400;
}

.text-primary   { color: var(--color-primary); }
.text-secondary { color: var(--color-secondary); }
.text-accent    { color: var(--color-accent); }
.text-danger    { color: var(--color-danger); }
.text-heading-c { color: var(--color-heading); }
.text-muted     { color: var(--color-text-muted); }
.text-light-c   { color: var(--color-text-light); }
.text-inverse   { color: var(--color-text-inverse); }
.text-white     { color: #fff; }

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

/* --- Section Utilities --- */
.section {
  padding-block: var(--space-24);
}

.section-sm {
  padding-block: var(--space-16);
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 3.5vw, var(--text-4xl));
  font-weight: 700;
  color: var(--color-heading);
  margin-bottom: var(--space-4);
  position: relative;
}

.section-subtitle {
  font-size: clamp(1rem, 1.4vw, var(--text-xl));
  color: var(--color-text-muted);
  max-width: 620px;
  margin-inline: auto;
  margin-bottom: var(--space-12);
  line-height: 1.8;
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-primary);
  margin-bottom: var(--space-4);
}

.section-label::before {
  content: '';
  display: inline-block;
  width: 28px;
  height: 2px;
  background: linear-gradient(90deg, var(--color-secondary), var(--color-primary));
  border-radius: 2px;
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-12);
}

/* --- Background Utilities --- */
.bg-primary      { background: var(--color-primary); }
.bg-primary-dark { background: var(--color-bg-dark); }
.bg-secondary    { background: var(--color-secondary); }
.bg-alt          { background: var(--color-bg-alt); }
.bg-white        { background: #fff; }
.bg-teal-gradient {
  background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 50%, var(--color-primary-light) 100%);
}
.bg-gold-gradient {
  background: linear-gradient(135deg, var(--color-secondary-dark) 0%, var(--color-secondary) 100%);
}
.bg-warm-gradient {
  background: linear-gradient(135deg, #FAF9F5 0%, #F0EDE0 50%, #FAF9F5 100%);
}

/* --- Grid Utilities --- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-8); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-8); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-6); }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--space-6); }

/* --- Flex Utilities --- */
.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-col        { display: flex; flex-direction: column; }
.gap-2           { gap: var(--space-2); }
.gap-4           { gap: var(--space-4); }
.gap-6           { gap: var(--space-6); }
.gap-8           { gap: var(--space-8); }

/* --- Divider --- */
.divider {
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--color-secondary), var(--color-primary));
  border-radius: var(--radius-full);
  margin-block: var(--space-4);
}

.divider-center { margin-inline: auto; }

/* --- Badges & Pills --- */
.badge {
  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: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.badge-primary { background: var(--color-primary-100); color: var(--color-primary); }
.badge-secondary { background: var(--color-secondary-50); color: var(--color-secondary-dark); }
.badge-gold { background: linear-gradient(135deg, var(--color-secondary-dark), var(--color-secondary)); color: #fff; }
.badge-teal { background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary-light)); color: #fff; }

/* --- Quote / Bible Verse --- */
.verse-block {
  position: relative;
  padding: var(--space-10) var(--space-12);
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  border-radius: var(--radius-xl);
  color: #fff;
  text-align: center;
  overflow: hidden;
}

.verse-block::before {
  content: '\201C';
  position: absolute;
  top: -30px;
  left: 30px;
  font-size: 10rem;
  font-family: var(--font-subheading);
  color: rgba(255,255,255,0.08);
  line-height: 1;
}

.verse-text {
  font-family: var(--font-subheading);
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  font-style: italic;
  line-height: 1.8;
  margin-bottom: var(--space-4);
  color: #fff;
}

.verse-ref {
  font-weight: 700;
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-secondary-light);
}

/* --- Animated Counters --- */
.stat-number {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 4vw, 4rem);
  font-weight: 900;
  color: var(--color-primary);
  line-height: 1;
  display: block;
}

/* --- Animation Keyframes --- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(40px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-50px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(50px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes flamePulse {
  0%, 100% { transform: scale(1) rotate(-2deg); }
  50%       { transform: scale(1.06) rotate(2deg); }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

@keyframes scrollIndicator {
  0%   { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(16px); }
}

@keyframes progressBar {
  from { width: 0; }
  to   { width: var(--progress-width, 100%); }
}

/* --- Scroll Reveal --- */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-scale.visible {
  opacity: 1;
  transform: scale(1);
}

/* Stagger delays */
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }
.delay-5 { transition-delay: 0.5s; }
.delay-6 { transition-delay: 0.6s; }
.delay-7 { transition-delay: 0.7s; }
.delay-8 { transition-delay: 0.8s; }

/* --- Scrollbar Styling --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--color-bg-alt); }
::-webkit-scrollbar-thumb {
  background: var(--color-primary);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--color-primary-dark); }

/* --- Selection --- */
::selection {
  background: var(--color-primary-200);
  color: var(--color-primary-dark);
}

/* --- Focus Rings (Accessibility) --- */
:focus-visible {
  outline: 3px solid var(--color-secondary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

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

/* --- Margin / Padding Helpers --- */
.mt-auto  { margin-top: auto; }
.mb-4     { margin-bottom: var(--space-4); }
.mb-6     { margin-bottom: var(--space-6); }
.mb-8     { margin-bottom: var(--space-8); }
.mb-12    { margin-bottom: var(--space-12); }
.mt-6     { margin-top: var(--space-6); }
.mt-8     { margin-top: var(--space-8); }
.mt-12    { margin-top: var(--space-12); }
.p-6      { padding: var(--space-6); }
.p-8      { padding: var(--space-8); }

/* --- Aspect Ratios --- */
.aspect-video  { aspect-ratio: 16 / 9; }
.aspect-square { aspect-ratio: 1 / 1; }
.aspect-4-3    { aspect-ratio: 4 / 3; }

/* --- Overflow --- */
.overflow-hidden { overflow: hidden; }
.overflow-auto   { overflow: auto; }

/* --- Position --- */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed    { position: fixed; }
.sticky   { position: sticky; }

/* --- Width/Height --- */
.w-full  { width: 100%; }
.h-full  { height: 100%; }
.min-h-screen { min-height: 100vh; }

/* --- Rounded --- */
.rounded-sm  { border-radius: var(--radius-sm); }
.rounded-md  { border-radius: var(--radius-md); }
.rounded-lg  { border-radius: var(--radius-lg); }
.rounded-xl  { border-radius: var(--radius-xl); }
.rounded-2xl { border-radius: var(--radius-2xl); }
.rounded-full { border-radius: var(--radius-full); }

/* --- Shadow --- */
.shadow-sm  { box-shadow: var(--shadow-sm); }
.shadow-md  { box-shadow: var(--shadow-md); }
.shadow-lg  { box-shadow: var(--shadow-lg); }
.shadow-xl  { box-shadow: var(--shadow-xl); }
.shadow-teal { box-shadow: var(--shadow-teal); }

/* --- Object Fit --- */
.object-cover  { object-fit: cover; }
.object-center { object-position: center; }
