/* Gator Websites Core CSS
   - CSS reset + tokens (variables) + utilities + base elements
   - Do not edit per-site; use themes and custom.css instead.
*/

/* 1) Minimal reset */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font-sans, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif); }
img, svg, video { max-width: 100%; height: auto; }

/* Skip link: visually hidden until focused */
.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  transform: translateY(-120%);
  background: var(--color-brand);
  color: var(--color-brand-contrast);
  padding: 10px 14px;
  border-bottom-right-radius: var(--radius);
  z-index: 1000;
  transition: transform .15s ease;
}
.skip-link:focus,
.skip-link:focus-visible {
  transform: translateY(0);
  outline: 3px solid var(--focus-ring, rgba(43,127,255,.35));
  outline-offset: 2px;
}
.skip-link:hover, .demo-skip-link:hover {
  background: var(--color-brand-hover);
  color: var(--color-brand-contrast) !important;
}

/* 2) Tokens (defaults). Themes override these. */
:root {
  /* Spacing (4px scale) */
  --space-1: 4px;  --space-2: 8px;  --space-3: 12px;  --space-4: 16px;
  --space-5: 24px; --space-6: 32px; --space-7: 48px;  --space-8: 64px;

  /* Typography */
  --font-sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --text-xs: 12px; --text-sm: 14px; --text-md: 16px; --text-lg: 18px; --text-xl: 22px; --text-2xl: 28px; --text-3xl: 36px;

  /* Radius & Shadows */
  --radius: 12px;
  --shadow-1: 0 1px 2px rgba(0,0,0,.06), 0 1px 1px rgba(0,0,0,.04);
  --shadow-2: 0 4px 12px rgba(0,0,0,.08);
}

/* 3) Base elements */
body { background: var(--color-bg); color: var(--color-fg); line-height: 1.6; }
a { color: var(--color-brand); text-decoration: none; }
a:not(.button):hover { text-decoration: none; color: var(--color-brand-hover, var(--color-brand)); }
/* Smooth link color transitions (respects reduced motion via global guard below) */
a { transition: color .15s ease; }

h1,h2,h3,h4,h5,h6 { color: var(--color-fg); margin: 0 0 var(--space-4); line-height: 1.2; }
p { margin: 0 0 var(--space-4); color: var(--color-fg); }

/* Hero subtitle color defaults (light) */
.hero-sub { color: var(--color-muted-strong); }

/* 4) Layout helpers */
.container { width: min(1100px, 100% - 2*var(--space-6)); margin-inline: auto; }
.section { padding-top: var(--space-8); padding-bottom: 0; }
.stack > * + * { margin-top: var(--space-4); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: center; }

/* Shared header styles */
.nav { display:flex; align-items:center; justify-content: space-between; padding: var(--space-4) 0; }
.brand { display:flex; align-items:center; gap: var(--space-3); font-weight: 800; letter-spacing:.2px; }
.brand img { height: 44px; width: auto; display:block; }

/* Responsive navigation (hamburger on small screens) */
.nav { position: relative; gap: var(--space-4); }
.nav-actions { display: flex; align-items: center; gap: var(--space-3); }
#nav-toggle { display: inline-flex; }

/* Dropdown panel anchored to the right near the hamburger */
.primary-nav { position: absolute; top: calc(100% + 8px); right: 0; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); box-shadow: var(--shadow-2); padding: var(--space-3); display: grid; gap: var(--space-3); width: min(80vw, 320px); z-index: 1000; }
.primary-nav .button { width: 100%; justify-content: flex-start; }

/* Mobile default: menu closed unless opened via class */
@media (max-width: 767.98px) {
  .primary-nav { display: none; }
  .primary-nav.is-open { display: grid; }
}

@media (min-width: 768px) {
  /* Desktop: inline nav, hide hamburger */
  #nav-toggle { display: none; }
  .primary-nav { position: static; display: flex !important; gap: var(--space-4); background: transparent; border: 0; box-shadow: none; padding: 0; width: auto; }
  .primary-nav { flex-wrap: nowrap; align-items: center; }
  .primary-nav .button { width: auto; }
  /* Desktop layout: brand left; links + actions to the right with spacing */
  .nav { display: flex; align-items: center; justify-content: flex-start; }
  .nav .brand { margin-right: auto; }
  .nav .nav-actions { margin-left: var(--space-6); }
}

/* Dropdown navigation styles */
.nav-dropdown { position: relative; }

.nav-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--button-secondary-bg, rgba(43,127,255,.12));
  color: var(--color-fg);
  border: 1px solid var(--color-border);
  padding: 10px 16px;
  border-radius: 99px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  font-size: inherit;
  min-width: auto;
}

.nav-dropdown-trigger:hover {
  border-color: var(--color-accent-orange);
  color: var(--color-fg) !important; /* Override global link hover */
}

.nav-dropdown-trigger::after {
  content: '▼';
  font-size: 0.75rem;
  transition: transform 0.2s ease;
}

.nav-dropdown-trigger[aria-expanded="true"]::after {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-2);
  padding: var(--space-3);
  min-width: 200px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
}

.nav-dropdown-menu.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown-menu a {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  color: var(--color-fg);
  text-decoration: none;
  border-radius: calc(var(--radius) - 2px);
  transition: all 0.15s ease;
  font-size: var(--text-sm);
}

.nav-dropdown-menu a:hover {
  background: var(--button-secondary-bg);
  color: var(--color-fg);
}

.nav-dropdown-menu a[aria-current="page"] {
  background: var(--color-brand);
  color: var(--color-brand-contrast);
}

/* Mobile dropdown adjustments */
@media (max-width: 767.98px) {
  .nav-dropdown-menu {
    position: static;
    box-shadow: none;
    border: none;
    background: transparent;
    padding: 0;
    margin: var(--space-2) 0 0 var(--space-3);
    transform: none;
    opacity: 1;
    visibility: visible;
    display: block;
  }
  
  .nav-dropdown-menu a {
    display: block;
    padding: 10px 16px;
    margin-bottom: var(--space-2);
    background: var(--button-secondary-bg, rgba(43,127,255,.12));
    color: var(--color-fg);
    border: 1px solid var(--color-border);
    border-radius: 99px;
    font-size: var(--text-sm);
    font-weight: 600;
    text-align: left;
    transition: all 0.15s ease;
  }
  
  .nav-dropdown-menu a:hover {
    border-color: var(--color-accent-orange);
    background: var(--button-secondary-bg-hover, rgba(43,127,255,.22));
    color: var(--color-fg);
  }
  
  .nav-dropdown-menu a[aria-current="page"] {
    background: var(--color-brand);
    color: var(--color-brand-contrast);
    border-color: var(--color-brand);
  }
  
  /* Mobile-specific dropdown trigger fixes */
  .nav-dropdown-trigger {
    width: 100%;
    justify-content: flex-start;
  }
  
  .nav-dropdown-trigger::after {
    display: none; /* Hide arrow on mobile */
  }
  
  /* Add connecting lines for sub-items */
  .nav-dropdown-menu {
    margin-left: var(--space-5);
    position: relative;
  }
  
  .nav-dropdown-menu::before {
    content: '';
    position: absolute;
    left: -16px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--color-border);
    border-radius: 1px;
  }
  
  .nav-dropdown-menu a {
    position: relative;
  }
  
  .nav-dropdown-menu a::before {
    content: '';
    position: absolute;
    left: -17px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 2px;
    background: var(--color-border);
    border-radius: 1px;
  }
}

/* Breadcrumb navigation */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) 0;
  font-size: var(--text-sm);
  color: var(--color-muted);
}

.breadcrumb a {
  color: var(--color-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.breadcrumb a:hover {
  color: var(--color-brand);
}

.breadcrumb-current {
  color: var(--color-fg);
  font-weight: 500;
}

.breadcrumb-separator {
  color: var(--color-muted);
  user-select: none;
}

/* Full-bleed hero helpers */
.hero-full { position: relative; isolation: isolate; }
.hero-full .hero-bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.hero-full .hero-bg img, .hero-full .hero-bg svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-full .hero-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(7, 17, 36, 0.40), rgba(7, 17, 36, 0.15) 40%, rgba(7, 17, 36, 0.00)); }
.hero-full .hero-inner { padding-block: clamp(64px, 12vh, 160px); }

/* Hero: light/dark image swapping */
.hero-img { width: 100%; height: 100%; object-fit: cover; display: none; }
[data-theme="light"] .hero-img--light { display: block; filter: brightness(1.08) saturate(1.05); }
[data-theme="dark"] .hero-img--dark { display: block; filter: brightness(.85) saturate(1.1); }

/* Hero text panel for contrast */
.hero-panel { background: var(--color-hero-panel-bg); border: 1px solid var(--color-hero-panel-border); border-radius: calc(var(--radius) - 4px); box-shadow: var(--shadow-1); padding: var(--space-4); max-width: 700px; backdrop-filter: saturate(140%) blur(2px); }

/* Price badge and callouts */
.price-badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 6px; background: var(--color-surface); border: 1px solid var(--color-border); font-weight: 700; font-size: var(--text-sm); white-space: nowrap; }
.price-badge .period { font-weight: 600; color: var(--color-muted); }
.callout { background: var(--color-surface); border: 1px solid var(--color-border); border-left: 4px solid var(--color-brand); padding: var(--space-4); border-radius: var(--radius); }

/* Utility: callout header row (title left, price badge right) */
.callout-header { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }

/* Mobile tweaks: allow header wrap and keep badge readable/aligned */
@media (max-width: 520px) {
  .callout-header { flex-wrap: wrap; }
  .callout-header .price-badge { margin-left: auto; margin-top: 6px; }
  .price-badge { font-size: var(--text-xs); }
}

/* 5) Components (base) */
.card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); box-shadow: var(--shadow-1); padding: var(--space-5); }
.card .price-badge { display: inline-flex; margin-bottom: var(--space-2); }
.card-actions { display: block; margin-top: var(--space-2); }
.button { text-align: center; display: inline-flex; align-items: center; gap: .5rem; padding: 10px 16px; 
  border-radius: 99px; border: 1px solid transparent; background: var(--color-button, var(--color-brand)); 
  color: var(--color-button-contrast, var(--color-brand-contrast)); font-weight: 600; cursor: pointer; 
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .05s ease; }
.button:hover { background: var(--color-button-hover, var(--color-brand-hover)); color: var(--color-button-contrast, var(--color-brand-contrast)); }
.button:active { background: var(--color-button-active, var(--color-brand-active)); transform: translateY(1px); }
.button:focus-visible { outline: 3px solid var(--focus-ring, rgba(43,127,255,.35)); outline-offset: 2px; }
.button.secondary { background: var(--button-secondary-bg, rgba(43,127,255,.12)); color: var(--color-fg); border-color: var(--color-border); }
.button.secondary:hover { border-color: var(--color-accent-orange); color: var(--color-fg); background: var(--button-secondary-bg-hover, rgba(43,127,255,.22)); }
.button.secondary:active { border-color: var(--color-accent-orange); background: var(--button-secondary-bg-active, rgba(43,127,255,.28)); transform: translateY(1px); }

/* Micro-interactions: subtle hover, no click affordance */
.elevate { transition: box-shadow .2s ease; }
.elevate:hover { box-shadow: var(--shadow-2); }
.elevate:active { box-shadow: var(--shadow-1); }

/* Apply subtle hover to all card-like elements (border lighten only) */
.card, .callout { transition: border-color .2s ease; }
.card:hover, .callout:hover { border-color: var(--color-border-hover, var(--color-border)); }

/* Callout: keep left brand bar intact and bright on hover */
.callout:hover {
  border-left-color: var(--color-brand);
  border-top-color: var(--color-border-hover, var(--color-border));
  border-right-color: var(--color-border-hover, var(--color-border));
  border-bottom-color: var(--color-border-hover, var(--color-border));
}

/* Badges (used in performance section and elsewhere) */
.badge { display: inline-flex; align-items: center; gap: .4rem; padding: .25rem .6rem; border-radius: 6px; background: var(--color-surface); border: 1px solid var(--color-border); color: var(--color-fg); font-weight: 600; font-size: var(--text-sm); }

/* Current page indicator in nav: subtle outer ring via box-shadow */
.primary-nav .button[aria-current="page"] {
  box-shadow: 0 0 0 2px var(--nav-current-ring, rgba(255,255,255,.3));
}

/* Scroll-to-top button */
.back-to-top {
  position: fixed;
  right: 16px;
  bottom: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-fg);
  box-shadow: var(--shadow-1);
  opacity: 0; transform: translateY(8px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.back-to-top.is-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }

/* Utility: stronger muted text for subtitles on light theme */
.text-muted-strong { color: var(--color-muted-strong); }

/* Hero headings */
.hero-title { font-size: clamp(28px, 6vw, 44px); font-weight: 800; margin-bottom: var(--space-4); }
.hero-sub { max-width: 70ch; }

/* Grid helpers */
.grid { display: grid; grid-template-columns: 1fr; gap: var(--space-4); }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, 1fr); } }

/* Pricing grid (services) */
.pricing-grid { display: grid; gap: var(--space-4); grid-template-columns: 1fr; }
@media (min-width: 720px) { .pricing-grid { grid-template-columns: repeat(3, 1fr); } }
.plan { display: grid; gap: var(--space-4); }
.price { font-size: var(--text-3xl); font-weight: 800; }
.period { color: var(--color-muted); font-weight: 500; }
.features { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.features li::before { content: "✓"; margin-right: 8px; color: var(--color-brand); font-weight: 700; }

/* Forms */
.form { display: grid; gap: var(--space-4); max-width: 760px; }
.field { display: grid; gap: 8px; }
.field label { font-weight: 600; }
.field input, .field select, .field textarea { padding: 10px 12px; border: 1px solid var(--color-border);
  border-radius: var(--radius); background: var(--color-surface); color: var(--color-fg); }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible {
  outline: 3px solid var(--focus-ring, #1547a8EE);
  outline-offset: 2px;
}
form .field input, form .field select, form .field textarea { border-color: var(--color-border-input); }

/* Distinguish required vs optional fields when focused via keyboard */
.field input[required]:focus-visible,
.field select[required]:focus-visible,
.field textarea[required]:focus-visible {
  outline-color: var(--focus-required, #ff8a3dEE); /* orange required fields */
}
.field input:not([required]):focus-visible,
.field select:not([required]):focus-visible,
.field textarea:not([required]):focus-visible {
  outline-color: var(--focus-optional, rgba(43,127,255,.35)); /* blue-like for optional fields */
}
.field input::placeholder, .field textarea::placeholder { color: var(--color-muted); }
.field textarea { min-height: 140px; resize: vertical; }
.help { color: var(--color-muted); font-size: var(--text-sm); }
.required { color: var(--color-muted); font-weight: 400; font-size: var(--text-sm); }
.notice { display: none; margin-top: 8px; padding: 10px 12px; border-radius: var(--radius); border: 1px solid var(--color-border); background: var(--color-surface); }
.notice.success { border-left: 4px solid var(--color-accent-orange); }
.notice.error { border-left: 4px solid var(--color-accent-orange); }

/* Spacing utilities (minimal set) */
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.pt-8 { padding-top: var(--space-8); }

/* Gap utilities for grid/cluster overrides */
.gap-3 { gap: var(--space-3); }
.gap-6 { gap: var(--space-6); }

/* Footer layout */
.footer-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }
.footer-left { justify-self: start; }
.footer-center { justify-self: center; }
.footer-right { justify-self: end; }
@media (max-width: 520px) {
  .footer-grid { grid-template-columns: 1fr; text-align: center; }
  .footer-left, .footer-right, .footer-center { justify-self: center; }
}

/* 6) Media queries */
@media (min-width: 768px) {
  .section { padding-top: var(--space-8); padding-bottom: 0; }
}

/* Utility: add bottom padding at the end of main to avoid tight footer on short pages */
main > .section:last-of-type { padding-bottom: var(--space-8); }
footer.section { padding-bottom: var(--space-6); padding-top: var(--space-4); }

/* 7) Dark mode token values now live in themes (see css/themes/*.css) */

/* Dark mode hero subtitle color is theme-controlled */

/* Dark mode variants for translucent secondary buttons */
/* Secondary button dark-mode colors are provided via theme tokens */

/* Reusable Components */

/* Glassmorphism cards */
.glass-card {
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  border: 1px solid var(--color-border); /*rgba(255,255,255,0.2);*/
  border-radius: var(--radius);
  padding: var(--space-4);
}

/* Custom cursor effects */
.cursor-area {
  position: relative;
  cursor: default;
  overflow: hidden;
  border-radius: var(--radius);
  background: transparent;
  transition: background 0.1s ease;
}

.custom-cursor {
  position: absolute;
  width: 20px;
  height: 20px;
  background: transparent; /*var(--color-brand);*/
  border-radius: 50%;
  pointer-events: none;
  z-index: 1000;
  transition: transform 0.1s ease;
}

/* Morphing buttons */
.morph-button {
  position: relative;
  overflow: hidden;
  background: var(--color-brand);
  border: none;
  color: var(--color-brand-contrast);
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: var(--text-md);
  cursor: pointer;
  transition: all 0.3s ease;
  user-select: none;
}

.morph-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.morph-button:hover::before {
  left: 100%;
}

.morph-button:hover {
  transform: scale(1.05);
  box-shadow: 0 5px 20px rgba(43,127,255,0.4);
}

.morph-button:active {
  transform: scale(1.02) translateY(2px);
  box-shadow: 0 2px 10px rgba(43,127,255,0.6);
}

.morph-button.clicked::before {
  animation: reverse-flash 0.6s ease-out;
}

@keyframes reverse-flash {
  0% { 
    left: 100%; 
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  }
  100% { 
    left: -100%; 
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  }
}

/* Pulse animation for interactive elements */
.pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.8; }
  100% { transform: scale(1); opacity: 1; }
}

/* Respect reduced motion preferences globally */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Wide-screen centering for better content layout */
@media (min-width: 1400px) {
  .callout, 
  .form, 
  .cursor-area,
  .demo-focus-area,
  .component-demo,
  .animate-icon-wrapper {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
  }
}
