/* ═══════════════════════════════════════════════════════
   RivalDesk - Shared Stylesheet
   ═══════════════════════════════════════════════════════ */

/* === Variables === */
:root {
  --serif: 'Source Serif 4', Georgia, serif;
  --body: 'Karla', sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --amber: #d97706;
  --ink: #0f1419;
  --bg: #fcfcfa;
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--body); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
::selection { background: rgba(217,119,6,0.18); }
a { text-decoration: none; color: inherit; }
button { font-family: var(--body); cursor: pointer; }
input, textarea, select { font-family: var(--body); }

/* === Animations === */
@keyframes up { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes typeIn { from { width: 0; } to { width: 100%; } }
.anim-up { animation: up 0.9s ease-out both; }
.anim-up-d1 { animation: up 0.8s ease-out 0.15s both; }
.anim-up-d2 { animation: up 0.8s ease-out 0.3s both; }
.anim-up-d3 { animation: up 0.8s ease-out 0.45s both; }

/* === Nav === */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: 68px; padding: 0 48px;
  background: #fff; border-bottom: 1px solid rgba(0,0,0,0.08);
}
.nav-inner {
  max-width: 1240px; margin: 0 auto;
  height: 100%; width: 100%;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-link { transition: color 0.2s; }
.nav-link:hover { color: var(--ink) !important; }

/* === Nav Dropdowns === */
.nav-dropdown { position: relative; }
.nav-dropdown-trigger {
  display: flex; align-items: center; gap: 4px;
  font-size: 13px; font-weight: 500; color: rgba(15,20,25,0.65);
  cursor: pointer; transition: color 0.2s;
  background: none; border: none; padding: 0; font-family: var(--body);
}
.nav-dropdown-trigger:hover { color: var(--ink); }
.nav-dropdown-trigger svg { transition: transform 0.2s; }
.nav-dropdown:hover .nav-dropdown-trigger svg,
.nav-dropdown.dropdown-open .nav-dropdown-trigger svg { transform: rotate(180deg); }
.nav-dropdown-menu {
  position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  min-width: 240px; background: #fff;
  border: 1px solid rgba(0,0,0,0.08); border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.1);
  padding: 8px; opacity: 0; visibility: hidden;
  transition: all 0.2s ease; pointer-events: none;
}
.nav-dropdown-menu::before {
  content: ''; position: absolute; top: -12px; left: 0; right: 0; height: 12px;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.dropdown-open .nav-dropdown-menu {
  opacity: 1; visibility: visible; pointer-events: auto;
}
.nav-dropdown-menu a {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 12px; border-radius: 8px; transition: background 0.15s;
}
.nav-dropdown-menu a:hover { background: rgba(217,119,6,0.05); }
.nav-dropdown-menu .dd-icon {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0;
}
.nav-dropdown-menu .dd-name { font-size: 13px; font-weight: 600; color: var(--ink); }
.nav-dropdown-menu .dd-desc { font-size: 11px; color: rgba(15,20,25,0.45); margin-top: 1px; }

/* === Buttons === */
.btn-dark { transition: all 0.25s; border: none; }
.btn-dark:hover { transform: translateY(-1px); box-shadow: 0 8px 28px rgba(15,20,25,0.22); }
.btn-ghost { transition: all 0.2s; }
.btn-ghost:hover { background: rgba(0,0,0,0.04) !important; }

/* === Layout === */
.section-pad { padding: 96px 48px; }
.max-w { max-width: 1240px; margin: 0 auto; }
.max-w-sm { max-width: 1100px; margin: 0 auto; }

/* === Typography === */
.mono-label {
  font-family: var(--mono); font-size: 10px; color: var(--amber);
  letter-spacing: 2.5px; text-transform: uppercase;
  font-weight: 500; margin-bottom: 16px;
}
.section-title {
  font-family: var(--serif); font-size: 38px; font-weight: 300;
  line-height: 1.2; letter-spacing: -1px; margin-bottom: 16px;
}

/* === Interactive === */
.lift { transition: all 0.3s ease; }
.lift:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(0,0,0,0.08); }

/* === Feature Tabs (index.html) === */
.feat-tab { transition: all 0.2s; }
.feat-tab:hover { color: var(--ink) !important; }
.feat-item {
  cursor: pointer; transition: all 0.2s;
  border: none; background: none; text-align: left; width: 100%;
}
.feat-item:hover { background: rgba(217,119,6,0.03); }
.feat-item.active { background: rgba(217,119,6,0.04); border-left-color: var(--amber) !important; }

/* === Utility Classes (extracted from inline styles) === */

/* Nav logo */
.nav-logo {
  display: flex; align-items: center; gap: 10px;
}
.nav-logo-icon {
  width: 30px; height: 30px; border-radius: 7px;
  background: var(--ink); display: flex;
  align-items: center; justify-content: center;
}
.nav-logo-text {
  font-family: var(--serif); font-size: 19px; font-weight: 500;
}
.nav-links {
  display: flex; align-items: center; gap: 28px;
}
.nav-link-text {
  font-size: 13px; font-weight: 500; color: rgba(15,20,25,0.65);
}
.nav-sep {
  width: 1px; height: 18px; background: rgba(0,0,0,0.08);
}
.nav-cta {
  padding: 9px 22px; background: var(--ink); border-radius: 7px;
  color: #fcfcfa; font-size: 13px; font-weight: 600;
}

/* Section typography */
.section-desc {
  font-size: 15px; color: rgba(15,20,25,0.55); line-height: 1.75;
}

/* Footer */
.site-footer {
  padding: 48px 48px 32px; border-top: 1px solid rgba(0,0,0,0.09);
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr 1fr; gap: 36px;
}
.footer-col-label {
  font-family: var(--mono); font-size: 9px; color: rgba(15,20,25,0.32);
  letter-spacing: 1.5px; text-transform: uppercase;
  font-weight: 500; margin-bottom: 14px;
}
.footer-link {
  display: block; font-size: 12px; color: rgba(15,20,25,0.5); padding: 3px 0;
  transition: color 0.2s;
}
.footer-link:hover { color: rgba(15,20,25,0.75); }
.footer-bottom {
  margin-top: 32px; padding-top: 16px;
  border-top: 1px solid rgba(0,0,0,0.07);
  display: flex; justify-content: space-between;
}
.footer-bottom span {
  font-size: 11px; color: rgba(15,20,25,0.28);
}
.footer-desc {
  font-size: 12px; color: rgba(15,20,25,0.58); line-height: 1.6; max-width: 240px;
}

/* Common CTA buttons */
.btn-primary {
  padding: 14px 32px; background: var(--ink); border-radius: 9px;
  color: #fcfcfa; font-size: 15px; font-weight: 600;
  border: none; cursor: pointer; transition: all 0.25s;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 28px rgba(15,20,25,0.22); }
.btn-primary-amber {
  padding: 14px 32px; background: var(--amber); border-radius: 9px;
  color: #fff; font-size: 15px; font-weight: 600;
  border: none; cursor: pointer; transition: all 0.25s;
}
.btn-primary-amber:hover { background: #b45309; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(217,119,6,0.25); }
.btn-outline {
  padding: 14px 28px; background: transparent;
  border: 1px solid rgba(0,0,0,0.1); border-radius: 9px;
  color: rgba(15,20,25,0.58); font-size: 15px; font-weight: 500;
  cursor: pointer; transition: all 0.2s;
}
.btn-outline:hover { background: rgba(0,0,0,0.03); border-color: rgba(0,0,0,0.15); }

/* Mobile menu toggle */
.nav-mobile-toggle {
  display: none; background: none; border: none;
  padding: 8px; cursor: pointer; color: var(--ink);
}

/* === Responsive === */

/* Tablet: 768px - 1024px */
@media (max-width: 1024px) {
  .site-nav { padding: 0 24px; }
  .section-pad { padding: 72px 24px; }
  .max-w, .max-w-sm { padding: 0 24px; }

  .section-title { font-size: 32px; }

  .footer-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 28px;
  }
  .footer-grid > div:first-child {
    grid-column: 1 / -1;
  }
}

/* Mobile: below 768px */
@media (max-width: 768px) {
  .site-nav { height: 56px; padding: 0 16px; }
  .section-pad { padding: 56px 16px; }
  .max-w, .max-w-sm { padding: 0 16px; }
  .site-footer { padding: 40px 16px 24px; }

  .section-title { font-size: 28px; letter-spacing: -0.5px; }
  .mono-label { font-size: 9px; letter-spacing: 2px; }

  /* Hide desktop nav links, show mobile toggle */
  .nav-links { display: none; }
  .nav-links.mobile-open {
    display: flex; flex-direction: column;
    position: fixed; top: 56px; left: 0; right: 0;
    background: #fff; padding: 16px 20px; gap: 4px;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 12px 40px rgba(0,0,0,0.08);
    z-index: 99;
  }
  .nav-links.mobile-open .nav-dropdown { width: 100%; }
  .nav-links.mobile-open .nav-link-text { padding: 10px 0; font-size: 15px; display: block; }
  .nav-links.mobile-open .nav-sep { display: none; }
  .nav-links.mobile-open .nav-cta { width: 100%; text-align: center; margin-top: 8px; }

  .nav-mobile-toggle { display: block; }

  /* Stack footer */
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }
  .footer-grid > div:first-child {
    grid-column: 1 / -1;
  }
  .footer-bottom {
    flex-direction: column; gap: 8px; align-items: center;
    text-align: center;
  }

  /* Disable hover dropdowns on mobile - use JS tap toggle only */
  .nav-dropdown:hover .nav-dropdown-menu {
    opacity: 0; visibility: hidden; pointer-events: none;
  }
  .nav-dropdown.dropdown-open .nav-dropdown-menu {
    opacity: 1; visibility: visible; pointer-events: auto;
  }

  /* Stack nav dropdowns inline within mobile menu */
  .nav-dropdown-menu {
    position: static;
    transform: none;
    border-radius: 8px;
    min-width: 100%;
    max-height: 70vh;
    overflow-y: auto;
    box-shadow: none;
    border: 1px solid rgba(0,0,0,0.06);
    margin-top: 4px;
  }
}

/* === Global inline-style responsive overrides ===
   Most pages use inline styles for layout grids and footers.
   These rules use !important to override inline styles on mobile. */

@media (max-width: 1024px) {
  /* Override inline-styled footer grids */
  footer { padding: 48px 24px 32px !important; }
  footer > .max-w,
  footer > div[style*="grid"] { grid-template-columns: repeat(3, 1fr) !important; gap: 28px !important; }
  footer > .max-w:first-child > div:first-child,
  footer > div[style*="grid"]:first-child > div:first-child { grid-column: 1 / -1; }

  /* Override inline section padding */
  section[style*="padding:0 48px"],
  section[style*="padding: 0 48px"] { padding-left: 24px !important; padding-right: 24px !important; }
  section[style*="padding:96px 48px"],
  section[style*="padding:140px 48px"] { padding-left: 24px !important; padding-right: 24px !important; }
}

@media (max-width: 768px) {
  /* Override inline-styled footer grids */
  footer { padding: 40px 16px 24px !important; }
  footer > .max-w,
  footer > div[style*="grid"] { grid-template-columns: 1fr 1fr !important; gap: 20px !important; }
  footer > .max-w:first-child > div:first-child,
  footer > div[style*="grid"]:first-child > div:first-child { grid-column: 1 / -1; }
  footer > .max-w:last-child,
  footer > .max-w + .max-w,
  footer > div[style*="flex"]:last-child { flex-direction: column !important; align-items: center !important; text-align: center !important; gap: 8px !important; }

  /* Override inline section padding */
  section[style*="padding:0 48px"],
  section[style*="padding: 0 48px"] { padding-left: 16px !important; padding-right: 16px !important; }
  section[style*="padding:96px 48px"] { padding: 56px 16px !important; }
  section[style*="padding:140px 48px"] { padding: 96px 16px 56px !important; }
  section[style*="padding:48px"] { padding-left: 16px !important; padding-right: 16px !important; }

  /* Tables should scroll horizontally on mobile */
  .mock-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* Small mobile: below 480px */
@media (max-width: 480px) {
  .site-nav { padding: 0 12px; }
  .section-pad { padding: 40px 12px; }
  .max-w, .max-w-sm { padding: 0 12px; }
  .section-title { font-size: 24px; }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  footer > .max-w,
  footer > div[style*="grid"] { grid-template-columns: 1fr !important; }
}
