/* ============ TrainPlex Global Styles ============ */
:root {
  --indigo: #1A1A5E;
  --indigo-deep: #12123f;
  --indigo-soft: #2a2a7a;
  --orange: #FF6B35;
  --orange-soft: #ff8a5f;
  --silver: #A0AEC0;
  --ink: #0e0e2c;
  --line: #e6e8ef;
  --paper: #ffffff;
  --paper-warm: #fbfaf7;
  --muted: #6b7280;
  --grad-hero: radial-gradient(1100px 700px at 70% 30%, rgba(255,107,53,0.18), transparent 60%),
               radial-gradient(900px 600px at 15% 80%, rgba(120,120,255,0.18), transparent 60%),
               #1A1A5E;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overflow-x: hidden; max-width: 100vw; }
body {
  font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.font-display {
  font-family: 'Fraunces', 'Inter', serif;
  font-optical-sizing: auto;
  letter-spacing: -0.02em;
}
.mono { font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace; }
.deva { font-family: 'Noto Serif Devanagari', 'Noto Sans Devanagari', serif; }

.container { max-width: 1280px; margin: 0 auto; padding: 0 28px; }

/* ============ Nav ============ */
.nav {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: background .3s ease, border-color .3s ease;
}
.nav.on-dark { background: rgba(26,26,94,0.55); border-bottom: 1px solid rgba(255,255,255,0.08); }
.nav.on-light { background: #ffffff; border-bottom: 1px solid var(--line); }
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px;
}
.nav-logo { display: flex; align-items: center; gap: 10px; }
.nav-logo-img img { height: 44px; width: auto; display: block; background: transparent; }
.nav-logo-mark {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--orange);
  display: grid; place-items: center;
  position: relative;
}
.nav-logo-mark::before {
  content: ""; position: absolute; inset: 4px; border-radius: 5px; background: #fff;
}
.nav-logo-mark svg { position: relative; z-index: 1; }
.nav-logo-text { font-weight: 800; font-size: 20px; letter-spacing: -0.01em; }
.nav.on-dark .nav-logo-text { color: #fff; }
.nav.on-light .nav-logo-text { color: var(--indigo); }

.nav-links { display: flex; gap: 6px; align-items: center; }
.nav-toggle {
  display: none;
  background: none;
  border: 0;
  width: 40px;
  height: 40px;
  padding: 10px 8px;
  cursor: pointer;
  flex-direction: column;
  justify-content: space-between;
}
.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--indigo);
  border-radius: 2px;
  transition: transform .25s, opacity .25s;
  transform-origin: center;
}
.nav.on-dark .nav-toggle span { background: #fff; }
.nav.nav-open .nav-toggle span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
.nav.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
.nav-link {
  font-size: 14.5px; font-weight: 500;
  padding: 8px 14px; border-radius: 8px;
  transition: all .15s ease;
}
.nav.on-dark .nav-link { color: rgba(255,255,255,0.85); }
.nav.on-dark .nav-link:hover { color: #fff; background: rgba(255,255,255,0.08); }
.nav.on-light .nav-link { color: #1a1a5e; font-weight: 600; }
.nav.on-light .nav-link:hover { color: #1a1a5e; background: #f4f5f9; }
.nav-link.active { color: var(--orange); }

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 8px;
  font-weight: 600; font-size: 14.5px;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
  white-space: nowrap;
  font-family: inherit;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--orange); color: #fff;
  box-shadow: 0 4px 14px rgba(255,107,53,0.35);
}
.btn-primary:hover {
  background: #ff7a47;
  box-shadow: 0 8px 22px rgba(255,107,53,0.45);
}
.btn-ghost-light {
  background: transparent; color: #fff;
  border-color: rgba(255,255,255,0.35);
}
.btn-ghost-light:hover { background: rgba(255,255,255,0.1); border-color: #fff; }
.btn-outline {
  background: #fff; color: var(--indigo);
  border-color: var(--line);
}
.btn-outline:hover { border-color: var(--indigo); }
.btn-indigo {
  background: var(--indigo); color: #fff;
}
.btn-indigo:hover { background: #27278a; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-lg { padding: 16px 26px; font-size: 15.5px; border-radius: 10px; }

/* ============ Section helpers ============ */
.section { padding: 120px 0; }
.section-sm { padding: 80px 0; }
.section-dark { background: var(--indigo); color: #fff; }
.section-warm { background: var(--paper-warm); }

.eyebrow {
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--orange);
}
.eyebrow-muted { color: var(--silver); }

h1, h2, h3, h4 { font-family: 'Fraunces', 'Inter', serif; font-weight: 600; letter-spacing: -0.02em; color: var(--indigo); margin: 0; }
.on-dark h1, .on-dark h2, .on-dark h3, .on-dark h4 { color: #fff; }
h1 { font-size: clamp(48px, 6vw, 84px); line-height: 1.02; }
h2 { font-size: clamp(36px, 4.2vw, 56px); line-height: 1.05; }
h3 { font-size: 22px; line-height: 1.2; }
p { margin: 0; }
.lede { font-size: 19px; line-height: 1.55; color: var(--muted); max-width: 620px; }
.on-dark .lede { color: var(--silver); }

/* ============ Cards ============ */
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(26,26,94,0.08);
  border-color: #dadde8;
}

/* ============ Footer ============ */
.footer {
  background: var(--indigo-deep);
  color: #d6d8e8;
  padding: 80px 0 32px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr 1.2fr;
  gap: 48px;
}
.footer h5 {
  font-family: 'Inter', sans-serif;
  font-size: 12px; letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #fff; margin: 0 0 18px; font-weight: 700;
}
.footer-links { display: flex; flex-direction: column; gap: 10px; }
.footer-links a {
  font-size: 14px; color: rgba(255,255,255,0.7);
  transition: color .15s;
}
.footer-links a:hover { color: var(--orange); }
.footer-langs {
  font-size: 13px; line-height: 1.8; color: rgba(255,255,255,0.6);
}
.footer-bottom {
  margin-top: 60px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
  flex-wrap: wrap;
  font-size: 13px; color: rgba(255,255,255,0.55);
}
.footer-bottom-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-logo-wrap { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.footer-tag { font-size: 14px; color: rgba(255,255,255,0.7); max-width: 260px; line-height: 1.5; }
.footer-company { font-size: 12px; color: var(--silver); margin-top: 12px; letter-spacing: 0.04em; }

@media (max-width: 960px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .nav-links .nav-link.hide-mobile { display: none; }
  .section { padding: 80px 0; }
}

/* Tablet & down */
@media (max-width: 768px) {
  .container { padding: 0 20px; }
  .section { padding: 64px 0; }
  h1 { font-size: clamp(32px, 7vw, 48px); }
  h2 { font-size: clamp(26px, 5.5vw, 40px); line-height: 1.15; }
  .eyebrow { font-size: 10.5px; letter-spacing: 0.16em; }

  /* Mobile nav: hamburger menu */
  .nav-toggle { display: flex; }
  .nav-inner { position: relative; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 12px 20px 20px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 20px 40px rgba(0,0,0,0.08);
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: transform .25s, opacity .25s;
  }
  .nav.on-dark .nav-links {
    background: #12123f;
    border-bottom-color: rgba(255,255,255,0.08);
  }
  .nav.nav-open .nav-links {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .nav-link {
    padding: 14px 16px;
    font-size: 16px;
    border-radius: 8px;
    width: 100%;
  }
  .nav-cta { margin: 8px 0 0 !important; width: 100%; text-align: center; justify-content: center; }
}

/* Small phones */
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .section { padding: 56px 0; }
  .container { padding: 0 18px; }
  .btn-lg { padding: 14px 20px; font-size: 14.5px; }
  .nav-inner { padding: 12px 18px; }
  .nav-logo-text { font-size: 17px; }
  /* Stack the hero bullets tighter */
  ul, ol { padding-left: 18px; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============ Forms ============ */
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field label { font-size: 13px; font-weight: 600; color: #2a2a3d; }
.form-field input, .form-field select, .form-field textarea {
  font-family: inherit; font-size: 15px;
  padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 8px;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  outline: none;
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px rgba(26,26,94,0.12);
}
.form-field textarea { min-height: 110px; resize: vertical; }

/* ============ Utility ============ */
.grid { display: grid; gap: 24px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 960px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 500;
  background: #f4f5f9; color: #40405a;
  border: 1px solid var(--line);
}
.chip.orange { background: #fff1ea; color: #c24a1c; border-color: #ffd9c7; }
.chip.indigo { background: #edefff; color: var(--indigo); border-color: #d4d8ff; }
.chip.dark { background: rgba(255,255,255,0.08); color: #fff; border-color: rgba(255,255,255,0.15); }

.hindi-accent { font-family: 'Noto Serif Devanagari', serif; color: var(--orange); }

/* Animations */
@keyframes pulse-glow {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
}
@keyframes rise {
  from { transform: translateY(0); opacity: 0; }
  20% { opacity: 1; }
  to { transform: translateY(-120px); opacity: 0; }
}
@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes word-grow {
  0%   { opacity: 0; transform: scale(0.6) translateY(4px); }
  18%  { opacity: 1; transform: scale(1.05) translateY(0); }
  35%  { opacity: 1; transform: scale(1) translateY(-2px); }
  75%  { opacity: 1; transform: scale(1) translateY(-18px); }
  100% { opacity: 0; transform: scale(0.95) translateY(-28px); }
}
