/* =============================================================
   main.css — Sanskar Vidya Sankul
   Core styles, CSS variables, reset, base elements
   ============================================================= */

/* Google Fonts — Inter (closest web match to Apple SF Pro) */
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,300;0,14..32,400;0,14..32,500;0,14..32,600;0,14..32,700;0,14..32,800;0,14..32,900;1,14..32,400;1,14..32,600&display=swap');

/* ─── CSS VARIABLES ─── */
:root {
  --bg-primary:       #FFFFFF;
  --bg-secondary:     #F0F6FD;
  --bg-tertiary:      #E3EFF9;
  --bg-card:          #FFFFFF;
  --bg-glass:         rgba(255,255,255,0.75);

  --accent-primary:   #185FA5;
  --accent-secondary: #378ADD;
  --accent-light:     #85B7EB;
  --accent-pale:      #D6EAFF;
  --accent-dark:      #0D3D72;
  --accent-xdark:     #061E3A;

  --text-primary:     #0A1628;
  --text-secondary:   #1A3A5C;
  --text-muted:       #5A7FA8;
  --text-on-accent:   #FFFFFF;

  --border-color:     #B5D4F4;
  --border-light:     #DCEDFB;

  --shadow-sm:        0 2px 8px rgba(24,95,165,0.08);
  --shadow-md:        0 8px 32px rgba(24,95,165,0.12);
  --shadow-lg:        0 20px 60px rgba(24,95,165,0.16);
  --shadow-glow:      0 0 40px rgba(55,138,221,0.25);
  --shadow-card:      0 4px 24px rgba(24,95,165,0.10);

  --gradient-primary: linear-gradient(135deg, #185FA5 0%, #378ADD 100%);
  --gradient-hero:    linear-gradient(135deg, #0D3D72 0%, #185FA5 45%, #2B7BE0 100%);
  --gradient-subtle:  linear-gradient(135deg, #F0F6FD 0%, #FFFFFF 100%);
  --gradient-card:    linear-gradient(160deg, #F0F6FD 0%, #FFFFFF 100%);

  /*
   * Apple-style font stack:
   * • -apple-system / BlinkMacSystemFont  →  SF Pro on Apple devices (native)
   * • 'Inter'                              →  closest Google-hosted match to SF Pro
   * • Fallbacks                            →  Segoe UI, Roboto, system-ui
   */
  --font-apple:   -apple-system, BlinkMacSystemFont, 'Inter', 'Helvetica Neue', 'Segoe UI', Roboto, Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, 'Inter', 'Helvetica Neue', sans-serif;
  --font-body:    -apple-system, BlinkMacSystemFont, 'Inter', 'Helvetica Neue', 'Segoe UI', Roboto, Arial, sans-serif;
  --font-ui:      -apple-system, BlinkMacSystemFont, 'Inter', 'Helvetica Neue', 'Segoe UI', sans-serif;

  /* Apple-style letter-spacing tokens */
  --tracking-tight:  -0.022em;
  --tracking-normal:  0em;
  --tracking-caps:    0.06em;

  --radius-xs:   4px;
  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   20px;
  --radius-xl:   32px;
  --radius-full: 9999px;

  --nav-height:  80px;

  --transition-fast:   0.15s ease;
  --transition-base:   0.3s ease;
  --transition-slow:   0.6s ease;
  --transition-spring: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-theme="dark"] {
  --bg-primary:       #040F1E;
  --bg-secondary:     #071525;
  --bg-tertiary:      #0C1E33;
  --bg-card:          #071D30;
  --bg-glass:         rgba(7,21,37,0.85);

  --accent-primary:   #378ADD;
  --accent-secondary: #5BA4E8;
  --accent-light:     #85B7EB;
  --accent-pale:      #0C2A48;
  --accent-dark:      #1A5FA5;

  --text-primary:     #E6F1FB;
  --text-secondary:   #A8C8E8;
  --text-muted:       #4A7FAA;

  --border-color:     #0C447C;
  --border-light:     #0A3060;

  --shadow-sm:        0 2px 8px rgba(0,0,0,0.3);
  --shadow-md:        0 8px 32px rgba(0,0,0,0.4);
  --shadow-lg:        0 20px 60px rgba(0,0,0,0.5);
  --shadow-glow:      0 0 60px rgba(55,138,221,0.3);
  --shadow-card:      0 4px 24px rgba(0,0,0,0.3);

  --gradient-subtle:  linear-gradient(135deg, #071D30 0%, #040F1E 100%);
  --gradient-card:    linear-gradient(160deg, #071D30 0%, #040F1E 100%);
}

/* ─── RESET ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { overflow-x: hidden; width: 100%; max-width: 100vw; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  letter-spacing: -0.003em;
  /* Apple-style font rendering — crisp on retina */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; }
ul, ol { list-style: none; }
input, textarea, select { font-family: inherit; }

/* ─── TYPOGRAPHY (Apple-style) ─── */
/*
 * Apple's type system:
 * • Large Display — heavy weight, very tight letter-spacing, generous size
 * • Body          — regular weight, comfortable line-height, easy to read
 * • Labels/UI     — medium weight, slightly tracked, consistent cap-height
 */
h1 {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: var(--tracking-tight);
}
h2 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.018em;
}
h3 {
  font-family: var(--font-ui);
  font-size: clamp(1.125rem, 2vw, 1.625rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.012em;
}
h4 {
  font-family: var(--font-ui);
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.008em;
}
p {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  letter-spacing: -0.003em;
  color: var(--text-secondary);
}

/* ─── LAYOUT ─── */
.container    { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.container-sm { max-width: 960px; margin: 0 auto; padding: 0 24px; }
.container-lg { max-width: 1440px; margin: 0 auto; padding: 0 24px; }

.section    { padding: 80px 0; position: relative; overflow-x: hidden; }
.section-lg { padding: 120px 0; position: relative; overflow-x: hidden; }
.section-sm { padding: 48px 0; position: relative; overflow-x: hidden; }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }

/* ─── SECTION TITLES ─── */
.section-title { text-align: center; margin-bottom: 60px; }
.section-tag {
  display: inline-block;
  background: var(--accent-pale);
  color: var(--accent-primary);
  padding: 5px 18px;
  border-radius: var(--radius-full);
  font-size: 0.6875rem; font-weight: 600;
  letter-spacing: var(--tracking-caps); text-transform: uppercase;
  font-family: var(--font-ui);
  margin-bottom: 16px;
}
.section-title h2 { margin-bottom: 16px; }
/* Apple uses bold not italic for emphasis in headings */
.section-title h2 em { color: var(--accent-secondary); font-style: normal; font-weight: 800; }
.section-title p { max-width: 560px; margin: 0 auto; }
.title-line {
  width: 60px; height: 4px;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  margin: 20px auto 0;
}

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 28px;
  border-radius: var(--radius-full);
  /* Apple buttons: medium weight, tight tracking, no uppercase */
  font-family: var(--font-ui); font-size: 0.9375rem; font-weight: 500;
  letter-spacing: -0.01em;
  transition: all var(--transition-spring);
  position: relative; overflow: hidden; white-space: nowrap;
}
.btn::before {
  content: ''; position: absolute; inset: 0;
  background: rgba(255,255,255,0.15);
  transform: translateX(-100%) skewX(-15deg);
  transition: transform 0.4s ease;
}
.btn:hover::before { transform: translateX(150%) skewX(-15deg); }

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 4px 20px rgba(24,95,165,0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(24,95,165,0.45); }
.btn-primary:active { transform: translateY(0); }

.btn-outline {
  background: transparent;
  color: var(--accent-primary);
  border: 2px solid var(--accent-primary);
}
.btn-outline:hover { background: var(--accent-primary); color: white; box-shadow: var(--shadow-md); }

.btn-ghost {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}
.btn-ghost:hover { background: var(--bg-secondary); border-color: var(--accent-primary); }

.btn-white {
  background: white;
  color: var(--accent-primary);
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}
.btn-white:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(0,0,0,0.15); }

.btn-sm { padding: 9px 20px; font-size: 0.875rem; }
.btn-lg { padding: 16px 36px; font-size: 1.0625rem; }

/* ─── CARDS ─── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: transform var(--transition-spring), box-shadow var(--transition-base);
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

/* ─── FORMS ─── */
.form-group { margin-bottom: 20px; }
.form-label { display: block; margin-bottom: 8px; font-family: var(--font-ui); font-weight: 500; font-size: 0.875rem; color: var(--text-secondary); }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 12px 16px;
  background: var(--bg-secondary);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: var(--font-body); font-size: 1rem;
  color: var(--text-primary);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(24,95,165,0.15);
  background: var(--bg-primary);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-muted); }
.form-textarea { resize: vertical; min-height: 120px; }
.form-select { appearance: none; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%235A7FA8' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; padding-right: 40px; }
.form-error { color: #ef4444; font-size: 0.8125rem; margin-top: 4px; }
.form-success { color: #22c55e; font-size: 0.875rem; padding: 12px 16px; background: rgba(34,197,94,0.1); border-radius: var(--radius-md); margin-bottom: 20px; }

/* ─── BADGE / PILL ─── */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 14px; border-radius: var(--radius-full);
  font-size: 0.8125rem; font-weight: 600; font-family: var(--font-ui);
}
.badge-primary { background: var(--accent-pale); color: var(--accent-primary); }
.badge-success { background: rgba(34,197,94,0.12); color: #16a34a; }
.badge-warning { background: rgba(245,158,11,0.12); color: #d97706; }

/* ─── DIVIDER ─── */
.divider { height: 1px; background: var(--border-light); margin: 48px 0; }

/* ─── GLASS CARD ─── */
.glass-card {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
}

/* ─── UTILITIES ─── */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--text-muted); }
.text-accent { color: var(--accent-primary); }
.fw-700      { font-weight: 700; }
.fw-600      { font-weight: 600; }
.mt-auto     { margin-top: auto; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.hidden  { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ─── RESPONSIVE ─── */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .container > .grid-2,
  .container-sm > .grid-2,
  .container-lg > .grid-2 {
    grid-template-columns: 1fr;
    gap: 32px !important;
  }
}
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .section    { padding: 60px 0; }
  .section-lg { padding: 80px 0; }
}
@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .section { padding: 48px 0; }
  .btn { padding: 11px 22px; font-size: 0.875rem; }
}
