/* ag3nt.homes marketing site — shared theme.
 * Colors and typography mirror the app theme (lib/core/theme/app_colors.dart,
 * app_typography.dart, brand_typography.dart). Per-page styles live in each
 * page's <style> block; everything in this file is global. */

/* ---- Self-hosted brand fonts ---- */

@font-face {
  font-family: 'ALTRONED';
  src: url('/assets/fonts/ALTRONED.woff2') format('woff2');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('/assets/fonts/Inter-Variable.ttf') format('truetype-variations'),
       url('/assets/fonts/Inter-Variable.ttf') format('truetype');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('/assets/fonts/Inter-VariableItalic.ttf') format('truetype-variations'),
       url('/assets/fonts/Inter-VariableItalic.ttf') format('truetype');
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
}

/* ---- Design tokens (mirrors app_colors.dart) ---- */

:root {
  /* Primary palette */
  --color-primary-black: #262626;
  --color-primary-white: #D9D9D9;

  /* Surfaces (dark theme — app uses dark by default) */
  --color-bg: #1A1A1A;             /* AppColors.backgroundDark */
  --color-bg-elevated: #262626;    /* AppColors.primaryBlack */
  --color-bg-card: #2A2A2A;        /* AppColors.surfaceDark */
  --color-border: #404040;         /* AppColors.borderGray */
  --color-border-subtle: #333333;  /* derived: subtler borderGray */

  /* Text */
  --color-text: #D9D9D9;            /* AppColors.textPrimary (= primaryWhite) */
  --color-text-secondary: #B0B0B0;  /* AppColors.textSecondary */
  --color-text-tertiary: #808080;   /* AppColors.textTertiary */

  /* Brand accents */
  --color-accent: #E97132;          /* AppColors.secondaryOrange */
  --color-accent-dim: #B85A1F;      /* AppColors.otherMarker (darker orange) */
  --color-accent-glow: rgba(233, 113, 50, 0.15);
  --color-secondary-blue: #156082;  /* AppColors.secondaryBlue */

  /* Semantic */
  --color-success: #4CAF50;         /* AppColors.success */
  --color-error: #EF5350;           /* AppColors.error */
  --color-warning: #FFA726;         /* AppColors.warning */
  --color-info: #29B6F6;            /* AppColors.info */

  /* Overlays */
  --color-overlay-dark: rgba(0, 0, 0, 0.5);
  --color-overlay-light: rgba(38, 38, 38, 0.25);

  /* Chart palette — used by research-article bar charts.
   * Drawn from app_colors.dart for brand alignment; palette ordering kept
   * close to the original (warm orange → cool purple → warm red → warm yellow)
   * so existing pages render with the same visual hierarchy. */
  --color-chart-1: var(--color-accent);    /* secondaryOrange #E97132 */
  --color-chart-2: #9C27B0;                /* AppColors.accentPurple */
  --color-chart-3: #EF5350;                /* AppColors.error (used as a chart hue, not semantic) */
  --color-chart-4: var(--color-warning);   /* AppColors.warning #FFA726 */

  /* Typography stacks */
  --font-serif: 'Instrument Serif', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-logo: 'ALTRONED', monospace;

  /* Motion */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
}

/* ---- Shared navigation component ----
 * Pages may declare their own .nav-links/.nav-cta inline (e.g. homepage)
 * — those take precedence via cascade order. These rules cover pages that
 * don't, and provide the dropdown styles used everywhere. */

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links > a:not(.nav-cta) {
  color: var(--color-text-secondary);
  text-decoration: none;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s ease;
}

.nav-dropdown-toggle {
  color: var(--color-text-secondary);
  text-decoration: none;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s ease;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  line-height: 1;
}

.nav-links > a:not(.nav-cta):hover,
.nav-dropdown-toggle:hover {
  color: var(--color-text);
}

.nav-links > a:not(.nav-cta).is-current,
.nav-dropdown.is-current > .nav-dropdown-toggle {
  color: var(--color-text);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--color-accent);
  color: var(--color-bg) !important;
  text-decoration: none;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nav-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--color-accent-glow);
}

.nav-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.nav-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nav-dropdown-toggle svg {
  transition: transform 0.2s ease;
}

.nav-dropdown:hover .nav-dropdown-toggle svg,
.nav-dropdown:focus-within .nav-dropdown-toggle svg {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 14px);
  right: 0;
  min-width: 180px;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s linear 0.15s;
  z-index: 1100;
}

/* Invisible hover bridge so pointer can travel from toggle to menu without dropping.
 * Sits directly under the toggle only — does not extend past it. */
.nav-dropdown::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 14px;
  pointer-events: none;
}

.nav-dropdown:hover::after,
.nav-dropdown:focus-within::after {
  pointer-events: auto;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s;
}

.nav-dropdown-menu a {
  display: block;
  padding: 10px 14px;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-secondary);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-dropdown-menu a:hover,
.nav-dropdown-menu a.is-current {
  background: var(--color-bg-card);
  color: var(--color-text);
}

.nav-mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--color-text);
  cursor: pointer;
  padding: 0;
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  .nav-mobile-toggle {
    display: block;
  }
}
