/*
 * Shared Styles - Bundled Entry Point
 * All shared styles inlined to avoid @import issues with Hexo's asset pipeline.
 */

/* ============================================
 * TOKENS (tokens.css)
 * ============================================ */

:root {
  /* Primary colors */
  --color-light-text: #FFF6EE;
  --color-dark-main-brown: #190702;
  --color-dark-peach: #FCE1C8;
  --color-dark-peach-80-percent: #f0bf8fd0;
  --color-dark-gold: #F0BF8F;
  --color-cta-gradient: #C66433;
  --color-orange: #FF791B;

  /* Transparency utilities */
  --color-white-5-percent: rgba(255, 255, 255, 0.05);
  --color-white-20-percent: rgba(255, 255, 255, 0.20);

  /* Light theme alternative */
  --color-light-bg: #F2E8DE;
  --color-light-text-dark: #36090B;
  --color-light-headings: #211505;

  /* Gradients */
  --gradient-cta: linear-gradient(223deg, #C66433 -49.41%, #FFF6E6 99.89%);
  --gradient-hero-text: linear-gradient(222deg, #F1C276 -34.33%, #FF681C 155.51%);
  --gradient-border: linear-gradient(90deg, #fff6e648, #c664333f);
}

/* ============================================
 * THEME (theme.css)
 * ============================================ */

@layer base {
  /* Legacy variables (used by marketing pages) */
  :root {
    --color-light-text: #FFF6EE;
    --color-dark-main-brown: #190702;
    --color-dark-peach: #FCE1C8;
    --color-dark-peach-80-percent: #f0bf8fd0;
    --color-dark-gold: #F0BF8F;
    --color-cta-gradient: #C66433;
    --color-orange: #FF791B;
    --color-white-5-percent: rgba(255,255,255,.05);
    --color-white-20-percent: rgba(255,255,255,.20);
  }
}

/* ---- LIGHT THEME (DEFAULT) ---- */
:root,
.theme-light {
  --page-bg: #F7F8FA;
  --page-text: #1A1D26;
  --sidebar-bg: #FFFFFF;
  --sidebar-border: #E8EBF0;

  --surface-card: #FFFFFF;
  --surface-card-inner: #F7F8FA;
  --surface-modal: #FFFFFF;
  --surface-input: #F2F4F7;
  --surface-hover: rgba(0, 0, 0, 0.03);
  --surface-hover-strong: rgba(0, 0, 0, 0.06);
  --surface-active: rgba(255, 121, 27, 0.07);
  --surface-overlay: rgba(15, 23, 42, 0.45);
  --surface-overlay-light: rgba(15, 23, 42, 0.25);
  --surface-code: #F2F4F7;
  --surface-separator: #E8EBF0;

  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-card-hover: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-dropdown: 0 10px 40px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-modal: 0 20px 60px rgba(0, 0, 0, 0.15), 0 4px 16px rgba(0, 0, 0, 0.08);

  --text-primary: #1A1D26;
  --text-secondary: #5E6577;
  --text-tertiary: #8B93A7;
  --text-faint: #B0B8C9;
  --text-placeholder: #9CA3B4;
  --text-placeholder-alt: #B0B8C9;
  --text-accent: #D4621A;
  --text-accent-muted: rgba(212, 98, 26, 0.7);
  --text-on-primary: #FFFFFF;
  --text-icon: #5E6577;
  --text-icon-muted: #C5CBD6;
  --text-table-header: #5E6577;
  --text-light-85: #3D4355;

  --border-default: #E8EBF0;
  --border-strong: #D5DAE3;
  --border-subtle: #E8EBF0;
  --border-input: #D5DAE3;
  --border-focus: rgba(255, 121, 27, 0.45);
  --border-separator: #E8EBF0;
  --border-separator-strong: #D5DAE3;
  --border-sidebar-toggle: #D5DAE3;

  --color-primary: #FF791B;
  --color-primary-end: #E0621A;
  --color-primary-ring: rgba(255, 121, 27, 0.2);
  --color-accent: #D4621A;
  --color-accent-80: rgba(212, 98, 26, 0.8);
  --brand-icon-fallback: #E8EBF0;
  --color-primary-bg: rgba(255, 121, 27, 0.08);

  --chart-text-color: #1A1D26;
  --chart-muted-text-color: #8B93A7;
  --chart-grid-color: #E8EBF0;

  --status-success: #16A34A;
  --status-success-muted: rgba(22, 163, 74, 0.85);
  --status-success-bg: rgba(22, 163, 74, 0.08);
  --status-success-bg-light: rgba(22, 163, 74, 0.05);
  --status-success-border: rgba(22, 163, 74, 0.18);
  --status-success-text: #15803D;

  --status-error: #DC2626;
  --status-error-muted: rgba(220, 38, 38, 0.85);
  --status-error-bg: rgba(220, 38, 38, 0.08);
  --status-error-bg-light: rgba(220, 38, 38, 0.04);
  --status-error-border: rgba(220, 38, 38, 0.18);
  --status-error-text: #B91C1C;

  --status-warning: #EA580C;
  --status-warning-bg: rgba(234, 88, 12, 0.08);
  --status-warning-bg-light: rgba(234, 88, 12, 0.04);
  --status-warning-border: rgba(234, 88, 12, 0.18);
  --status-warning-text: #C2410C;

  --status-info: #2563EB;
  --status-info-bg: rgba(37, 99, 235, 0.08);
  --status-info-bg-light: rgba(37, 99, 235, 0.04);
  --status-info-border: rgba(37, 99, 235, 0.18);
  --status-info-text: #1D4ED8;

  --impact-high: #16A34A;
  --impact-high-bg-1: rgba(22, 163, 74, 0.08);
  --impact-high-bg-2: rgba(22, 163, 74, 0.03);
  --impact-medium: #D97706;
  --impact-medium-bg-1: rgba(217, 119, 6, 0.08);
  --impact-medium-bg-2: rgba(217, 119, 6, 0.03);
  --impact-low: #DC2626;
  --impact-low-bg-1: rgba(220, 38, 38, 0.08);
  --impact-low-bg-2: rgba(220, 38, 38, 0.03);
  --impact-info: #2563EB;
  --impact-info-bg-1: rgba(37, 99, 235, 0.08);
  --impact-info-bg-2: rgba(37, 99, 235, 0.03);
  --impact-neutral: #6B7280;
  --impact-neutral-bg-1: rgba(107, 114, 128, 0.08);
  --impact-neutral-bg-2: rgba(107, 114, 128, 0.03);

  --score-good-text: #15803D;
  --score-good-bg: #DCFCE7;
  --score-fair-text: #92400E;
  --score-fair-bg: #FEF3C7;
  --score-poor-text: #991B1B;
  --score-poor-bg: #FEE2E2;

  --processing-text: #B45309;
  --processing-bg: rgba(245, 158, 11, 0.1);
  --processing-border: rgba(245, 158, 11, 0.2);

  --badge-purple-bg: rgba(139, 92, 246, 0.08);
  --badge-purple-text: #7C3AED;

  --popover-shadow: rgba(0, 0, 0, 0.12);
  --textarea-bg: #FFFFFF;
  --table-header-bg: #F7F8FA;
  --table-header-subtitle: #8B93A7;
  --toggle-knob: #FFFFFF;
  --toggle-knob-border: rgba(0, 0, 0, 0.1);

  --btn-primary-bg: #FF791B;
  --btn-primary-color: #FFFFFF;
  --btn-primary-hover-bg: #E86A10;
  --btn-primary-hover-color: #FFFFFF;
  --btn-primary-hover-border: transparent;

  --btn-transparent-color: #5E6577;
  --btn-transparent-bg: rgba(0, 0, 0, 0.03);
  --btn-transparent-border-gradient: rgba(0, 0, 0, 0.12);

  --btn-secondary-bg: #FFFFFF;

  --btn-borderless-color: #1A1D26;
  --btn-borderless-hover-bg: rgba(0, 0, 0, 0.04);

  --btn-danger-color: #DC2626;
  --btn-danger-bg: rgba(220, 38, 38, 0.06);
  --btn-danger-border: rgba(220, 38, 38, 0.15);
  --btn-danger-bg-hover: rgba(220, 38, 38, 0.12);
  --btn-danger-border-hover: rgba(220, 38, 38, 0.3);

  --modal-border-icon: #D4621A;

  --tier-1-bg: rgba(212, 98, 26, 0.08);
  --tier-1-text: #D4621A;
  --tier-2-bg: rgba(180, 150, 40, 0.08);
  --tier-2-text: #92710E;
  --tier-3-bg: rgba(200, 170, 0, 0.1);
  --tier-3-text: #7C6300;

  --glow-opacity: 0.15;
}

/* ---- DARK THEME ---- */
.theme-dark {
  --page-bg: #190702;
  --page-text: #FFF;
  --sidebar-bg: #190702;
  --sidebar-border: rgba(240, 191, 143, 0.15);

  --surface-card: rgba(0, 0, 0, 0.25);
  --surface-card-inner: rgba(0, 0, 0, 0.15);
  --surface-modal: rgba(25, 7, 2, 0.95);
  --surface-input: rgba(255, 255, 255, 0.08);
  --surface-hover: rgba(255, 255, 255, 0.05);
  --surface-hover-strong: rgba(255, 255, 255, 0.1);
  --surface-active: rgba(252, 225, 200, 0.10);
  --surface-overlay: rgba(0, 0, 0, 0.75);
  --surface-overlay-light: rgba(0, 0, 0, 0.5);
  --surface-code: rgba(0, 0, 0, 0.30);
  --surface-separator: rgba(229, 229, 229, 0.35);

  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow-card-hover: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-dropdown: 0 10px 40px rgba(0, 0, 0, 0.5);
  --shadow-modal: 0 20px 60px rgba(0, 0, 0, 0.5);

  --text-primary: #FFF6EE;
  --text-secondary: #FCE1C8;
  --text-tertiary: rgba(255, 246, 238, 0.6);
  --text-faint: rgba(255, 255, 255, 0.40);
  --text-placeholder: rgba(252, 225, 200, 0.50);
  --text-placeholder-alt: rgba(252, 225, 200, 0.4);
  --text-accent: #F0BF8F;
  --text-accent-muted: rgba(240, 191, 143, 0.75);
  --text-on-primary: #FFFFFF;
  --text-icon: #E6E6E6;
  --text-icon-muted: rgba(255, 255, 255, 0.3);
  --text-table-header: rgba(255, 246, 238, 0.85);
  --text-light-85: rgba(255, 246, 238, 0.85);

  --border-default: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.15);
  --border-subtle: rgba(255, 255, 255, 0.20);
  --border-input: rgba(252, 225, 200, 0.25);
  --border-focus: rgba(240, 191, 143, 0.5);
  --border-separator: rgba(252, 225, 200, 0.10);
  --border-separator-strong: rgba(252, 225, 200, 0.75);
  --border-sidebar-toggle: rgba(240, 191, 143, 0.2);

  --color-primary: #FF791B;
  --color-primary-end: #C66433;
  --color-primary-ring: rgba(255, 121, 27, 0.3);
  --color-accent: #F0BF8F;
  --color-accent-80: #f0bf8fd0;
  --brand-icon-fallback: #A3A3A3;
  --color-primary-bg: rgba(255, 121, 27, 0.2);

  --chart-text-color: #FFF6EE;
  --chart-muted-text-color: rgba(255, 246, 238, 0.6);
  --chart-grid-color: rgba(255, 255, 255, 0.08);

  --status-success: rgba(34, 197, 94, 1);
  --status-success-muted: rgba(34, 197, 94, 0.8);
  --status-success-bg: rgba(34, 197, 94, 0.2);
  --status-success-bg-light: rgba(34, 197, 94, 0.15);
  --status-success-border: rgba(34, 197, 94, 0.3);
  --status-success-text: #86efac;

  --status-error: rgba(239, 68, 68, 1);
  --status-error-muted: rgba(239, 68, 68, 0.8);
  --status-error-bg: rgba(239, 68, 68, 0.2);
  --status-error-bg-light: rgba(239, 68, 68, 0.15);
  --status-error-border: rgba(239, 68, 68, 0.3);
  --status-error-text: #fca5a5;

  --status-warning: rgba(245, 158, 11, 1);
  --status-warning-bg: rgba(245, 158, 11, 0.2);
  --status-warning-bg-light: rgba(245, 158, 11, 0.15);
  --status-warning-border: rgba(245, 158, 11, 0.3);
  --status-warning-text: #fcd34d;

  --status-info: rgba(59, 130, 246, 1);
  --status-info-bg: rgba(59, 130, 246, 0.2);
  --status-info-bg-light: rgba(59, 130, 246, 0.15);
  --status-info-border: rgba(59, 130, 246, 0.3);
  --status-info-text: #93c5fd;

  --impact-high: #6DFF40;
  --impact-high-bg-1: rgba(77, 255, 64, 0.04);
  --impact-high-bg-2: rgba(38, 153, 40, 0.05);
  --impact-medium: #FF9340;
  --impact-medium-bg-1: rgba(255, 147, 64, 0.05);
  --impact-medium-bg-2: rgba(153, 88, 38, 0.05);
  --impact-low: #FF6340;
  --impact-low-bg-1: rgba(255, 99, 64, 0.05);
  --impact-low-bg-2: rgba(153, 59, 38, 0.05);
  --impact-info: #40A0FF;
  --impact-info-bg-1: rgba(64, 160, 255, 0.05);
  --impact-info-bg-2: rgba(38, 96, 153, 0.05);
  --impact-neutral: #A0A0A0;
  --impact-neutral-bg-1: rgba(160, 160, 160, 0.05);
  --impact-neutral-bg-2: rgba(96, 96, 96, 0.05);

  --score-good-text: #166534;
  --score-good-bg: #dcfce7;
  --score-fair-text: #854d0e;
  --score-fair-bg: #fef9c3;
  --score-poor-text: #991b1b;
  --score-poor-bg: #fee2e2;

  --processing-text: #fde047;
  --processing-bg: rgba(234, 179, 8, 0.2);
  --processing-border: rgba(234, 179, 8, 0.3);

  --badge-purple-bg: rgba(168, 85, 247, 0.2);
  --badge-purple-text: #d8b4fe;

  --popover-shadow: rgba(0, 0, 0, 0.5);
  --textarea-bg: rgba(25, 7, 2, 0.6);
  --table-header-bg: #1f0e08;
  --table-header-subtitle: #8A7D7A;
  --toggle-knob: rgba(255, 255, 255, 0.8);
  --toggle-knob-border: rgba(255, 255, 255, 0.30);

  --btn-primary-bg: #FFF6EE;
  --btn-primary-color: #190702;
  --btn-primary-hover-bg: rgba(255, 255, 255, 0.05);
  --btn-primary-hover-color: #FFFFFF;
  --btn-primary-hover-border: rgba(255, 255, 255, 0.20);

  --btn-transparent-color: #FCE1C8;
  --btn-transparent-bg: rgba(255, 255, 255, 0.05);
  --btn-transparent-border-gradient: rgba(240, 191, 143, 0.8);

  --btn-secondary-bg: #190702;

  --btn-borderless-color: #FFF6EE;
  --btn-borderless-hover-bg: rgba(255, 255, 255, 0.05);

  --btn-danger-color: #f87171;
  --btn-danger-bg: rgba(239, 68, 68, 0.2);
  --btn-danger-border: rgba(239, 68, 68, 0.3);
  --btn-danger-bg-hover: rgba(239, 68, 68, 0.3);
  --btn-danger-border-hover: rgba(239, 68, 68, 0.5);

  --modal-border-icon: #E3AD8E;

  --tier-1-bg: rgba(240, 191, 143, 0.15);
  --tier-1-text: #F0BF8F;
  --tier-2-bg: rgba(212, 175, 55, 0.2);
  --tier-2-text: #D4AF37;
  --tier-3-bg: rgba(255, 215, 0, 0.25);
  --tier-3-text: #FFD700;

  --glow-opacity: 1;
}

/* ============================================
 * FONTS (fonts.css)
 * ============================================ */

@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/poppins-v24-latin-regular.woff2') format('woff2');
}

@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/poppins-v24-latin-500.woff2') format('woff2');
}

@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/poppins-v24-latin-600.woff2') format('woff2');
}

@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/manrope-v20-latin-regular.woff2') format('woff2');
}

@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/manrope-v20-latin-500.woff2') format('woff2');
}

@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/manrope-v20-latin-600.woff2') format('woff2');
}

@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/manrope-v20-latin-700.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/inter-v20-latin-regular.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/inter-v20-latin-500.woff2') format('woff2');
}

/* ============================================
 * TYPOGRAPHY (typography.css)
 * ============================================ */

:root {
  --font-sans: 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Manrope', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
}

body {
  font-family: var(--font-sans);
  background: var(--page-bg);
  color: var(--text-secondary);
  line-height: 1.75;
}

h1:not([class*="text-"]) {
  font-family: var(--font-heading);
  font-style: normal;
  font-weight: 700;
  letter-spacing: -0.03rem;
  font-size: 3rem;
  line-height: 3.5rem;
  color: var(--text-primary);
}

h2:not([class*="text-"]) {
  font-family: var(--font-heading);
  font-style: normal;
  font-weight: 500;
  letter-spacing: -0.045rem;
  font-size: 2.25rem;
  line-height: 120%;
  color: var(--text-primary);
}

h3:not([class*="text-"]) {
  font-family: var(--font-heading);
  font-style: normal;
  font-weight: 700;
  letter-spacing: -0.03rem;
  font-size: 1.75rem;
  line-height: 120%;
  color: var(--text-primary);
}

h4:not([class*="text-"]) {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.25rem;
  line-height: 1.4;
  color: var(--text-primary);
}

h5:not([class*="text-"]),
h6:not([class*="text-"]) {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.4;
  color: var(--text-primary);
}

.txt {
  font-size: 1.375rem;
  font-style: normal;
  font-weight: 400;
  line-height: 1.75rem;
  letter-spacing: -0.01375rem;
}

@media (max-width: 768px) {
  h1:not([class*="text-"]) {
    font-size: 2.0625rem;
    line-height: 2.40625rem;
    letter-spacing: -0.02063rem;
  }

  h2:not([class*="text-"]) {
    font-size: 1.75rem;
    line-height: 2rem;
    letter-spacing: -0.02063rem;
  }

  h3:not([class*="text-"]) {
    font-size: 1.5rem;
    line-height: 1.75rem;
    letter-spacing: -0.02063rem;
  }

  .txt {
    font-size: 1.03125rem;
    line-height: 1.5rem;
    letter-spacing: -0.01031rem;
  }
}

.text-light {
  color: var(--color-light-text);
}

.text-dark-peach {
  color: var(--color-dark-peach);
}

.text-dark-gold {
  color: var(--color-dark-gold);
}

/* ============================================
 * UTILITIES (utilities.css)
 * ============================================ */

[class^="border-gradient-"] {
  position: relative;
}

.border-gradient-bottom::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--gradient-border);
}

.border-gradient-top::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--gradient-border);
}

.has-glow {
  position: relative;
}

.has-glow::before {
  content: '';
  width: 21.875rem;
  height: 21.875rem;
  position: absolute;
  right: 0;
  top: 0;
  background: var(--color-orange);
  border-radius: 50%;
  filter: blur(312px);
  pointer-events: none;
  z-index: -1;
}

.has-glow::after {
  content: '';
  width: 21.875rem;
  height: 21.875rem;
  position: absolute;
  left: 0;
  bottom: 0;
  background: var(--color-orange);
  border-radius: 50%;
  filter: blur(312px);
  pointer-events: none;
  z-index: -1;
}

.caged {
  max-width: 80rem;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 768px) {
  .caged {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

html {
  scroll-behavior: smooth;
}

[id] {
  scroll-margin-top: 4rem;
}

html, body {
  overflow-x: clip;
  max-width: 100vw;
}
