/**
 * OSUS.AI — Foundation Design System
 * English edition · AAA contrast · creative direction layer
 * Loaded last in <head> so it governs the whole site.
 */

:root {
  color-scheme: dark;

  /* Contrast-safe luxury palette. Verified >= 7:1 on #0A0A0F / #1C1C24. */
  --gold: #E3C568;
  --gold-light: #F3DFA0;
  --gold-dark: #C9A227;
  --gold-pale: #F7EBC4;
  --light: #F7F4EC;
  --ivory: #FFFDF7;
  --gray-light: #C7D0DD;
  --gray: #AAB6C6;
  --emerald: #6EE7B7;
  --accent: #6EE7B7;
  --info: #9ECBFF;
  --danger: #FF9BAA;
  --warning: #F3DFA0;
  --secondary: #E58CAC;

  --font-primary: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-secondary: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-display: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 30px;

  --aaa-bg: #0A0A0F;
  --aaa-surface: #1C1C24;
  --aaa-text: #F7F4EC;
  --aaa-muted: #C7D0DD;
  --aaa-focus: #F3DFA0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-primary);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--aaa-text);
  background-color: var(--aaa-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.012em;
  color: var(--aaa-text);
}

h1 { font-size: clamp(2.35rem, 5vw, 4.15rem); }
h2 { font-size: clamp(1.85rem, 3.6vw, 2.9rem); }
h3 { font-size: clamp(1.3rem, 2.2vw, 1.6rem); }
p, li { line-height: 1.7; }
small { color: var(--aaa-muted); }

.hero-title, .section-title, .page-header-title, .cta-title,
.auth-visual h2, .footer-logo, .logo {
  font-family: var(--font-display);
  letter-spacing: -0.015em;
}

.text-gold, .gold-text {
  background: none !important;
  -webkit-text-fill-color: var(--gold) !important;
  color: var(--gold) !important;
}

/* Consistent editorial rhythm */
section { position: relative; }
.hero-section, .features-section, .ai-tools-section, .pricing-section,
.cta-section, .gallery-section, .section-padding { padding-block: clamp(64px, 8vw, 112px); }

/* Navigation — 44px minimum target, clear current-page state */
.main-header { min-height: 76px; }
.main-header a, .main-header button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.main-header nav, .nav-menu {
  flex-wrap: nowrap !important;
  gap: 0.35rem !important;
}
.main-header nav.main-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.main-header .btn-primary-gradient { white-space: nowrap; }
.main-header nav a, .nav-menu a {
  border-radius: var(--radius-sm);
  padding-inline: 0.6rem;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--light) !important;
  text-decoration: none !important;
}
.main-header .container { padding-inline: 1rem; }
.header-actions { gap: 0.5rem !important; }
.main-header .btn-primary-gradient { padding: 10px 16px !important; font-size: 0.85rem; }
@media (max-width: 1600px) {
  .main-header nav > ul + a { display: none; }
  .site-lang { display: none !important; }
  .nav-menu li:nth-child(4), .nav-menu li:nth-child(5) { display: none; }
  .nav-menu a { font-size: 0.8rem !important; padding-inline: 0.5rem !important; }
}
@media (max-width: 1100px) {
  .main-header nav a:nth-of-type(n+5) { display: none; }
}
@media (max-width: 820px) {
  .main-header nav a:nth-of-type(n+3) { display: none; }
  .header-actions .action-btn { display: none; }
}
.main-header nav a[aria-current='page'], .nav-menu a[aria-current='page'] {
  color: var(--aaa-bg) !important;
  background: var(--gold);
}
.site-lang {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  border: 1px solid rgba(227, 197, 104, 0.45);
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--gold);
  line-height: 1;
}

/* Buttons and interactive targets */
a.btn, button, .btn-luxury, .btn-luxury-outline, .btn-hero, .btn-cta,
.action-btn, .social-link, .qty-btn, .quantity-btn, .product-action-btn,
.faq-question, .tab-nav-item, .chip-close {
  min-height: 44px;
  min-width: 44px;
}
.btn-luxury, .btn-hero-primary, .btn-primary-gradient, .btn-cta-light {
  background: linear-gradient(135deg, #F3DFA0 0%, #D8B54A 100%);
  color: #0A0A0F !important;
  border: 1px solid #F3DFA0;
}
.btn-luxury:hover, .btn-hero-primary:hover, .btn-primary-gradient:hover, .btn-cta-light:hover {
  background: #F3DFA0;
  color: #0A0A0F !important;
}
.btn-luxury-outline, .btn-hero-outline, .btn-cta-outline {
  color: var(--gold-light) !important;
  border: 2px solid var(--gold);
  background: transparent;
}
.btn-luxury-outline:hover, .btn-hero-outline:hover, .btn-cta-outline:hover {
  background: var(--gold);
  color: #0A0A0F !important;
}

/* Focus — never removed, always visible */
:focus { outline: none; }
:focus-visible {
  outline: 3px solid var(--aaa-focus) !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 6px rgba(10, 10, 15, 0.85) !important;
}

/* Visually hidden but available to assistive technology */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip link */
.skip-link {
  position: fixed;
  top: -100px;
  left: 1rem;
  z-index: 100000;
  background: var(--gold);
  color: #0A0A0F !important;
  padding: 12px 20px;
  border-radius: 0 0 10px 10px;
  font-weight: 700;
  text-decoration: none;
  transition: top 0.18s ease;
}
.skip-link:focus, .skip-link:focus-visible { top: 0; }

/* Landmarks and semantics */
#main-content:focus { outline: none; }
[role='main'] { display: block; }

/* Images and media */
img, svg, video, canvas { max-width: 100%; }
img { height: auto; }
[loading='lazy'] { opacity: 1 !important; }

/* Forms */
label, .form-label { color: var(--aaa-text); font-weight: 600; }
input, select, textarea {
  font: inherit;
  color: var(--aaa-text);
}
input::placeholder, textarea::placeholder { color: var(--aaa-muted); opacity: 1; }
input[aria-invalid='true'], input.error { border-color: var(--danger) !important; }
.field-error, .error-message { color: var(--danger); font-size: 0.875rem; }

/* Tables */
.table-luxury th { color: var(--gold-light); }
.table-luxury td, .table-luxury th { vertical-align: middle; }

/* Status colours are always paired with text, never colour alone */
.status-badge, .badge-success, .text-success { color: var(--emerald) !important; }
.badge-info { color: var(--info) !important; }
.badge-ruby, .text-danger, .status-badge.cancelled { color: var(--danger) !important; }
.badge-premium, .badge-warning { color: var(--gold-light) !important; }

/* Tooltips must be reachable by keyboard too */
[data-tooltip]:focus-visible::after { opacity: 1; visibility: visible; }

/* Floating chat follows the LTR reading direction */
.live-chat-widget, .chat-widget {
  left: auto !important;
  right: 24px !important;
}

/* Reduced motion is a hard requirement */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* High contrast / forced colours */
@media (forced-colors: active) {
  .btn-luxury, .btn-luxury-outline { border: 2px solid ButtonText; }
  :focus-visible { outline: 3px solid Highlight; }
}

/* Responsive typography and navigation */
@media (max-width: 768px) {
  body { font-size: 0.975rem; }
  h1 { font-size: clamp(2rem, 9vw, 2.8rem); }
  h2 { font-size: clamp(1.65rem, 7vw, 2.2rem); }
  .main-header nav { gap: 0.25rem !important; }
  .main-header nav a { padding-inline: 0.6rem; font-size: 0.875rem; }
  .hero-section { padding-block: 72px; }
  .stats-highlight { gap: 14px; }
}

/* Print */
@media print {
  .main-header, .main-footer, .skip-link, .chat-widget, .demo-mode-panel,
  .live-chat-widget, .btn-luxury, .btn-luxury-outline { display: none !important; }
  body { background: #fff !important; color: #000 !important; }
  h1, h2, h3, h4, p, li, td, th { color: #000 !important; }
  a[href]::after { content: ' (' attr(href) ')'; font-size: 0.8em; }
}
