/* Onyx Mail CSS - Black Onyx Theme with Hexagon Motifs */

/* ===== CSS VARIABLES ===== */
:root {
  /* Color Palette - Black Onyx Theme */
  --color-primary: #0A0A0A;      /* Deep Obsidian Black */
  --color-secondary: #1C1C1C;    /* Charcoal */
  --color-accent: #2D2D2D;       /* Graphite */
  --color-highlight: #E5E5E5;    /* Moonstone - for text on dark backgrounds */
  --color-shimmer: #4A4A4A;      /* Subtle shimmer for hover effects */
  --color-shadow: #0A0A1A;       /* Blue-black tint for shadows */
  --color-hexagon: #2D2D2D;      /* Hexagon accent color */
  --color-hexagon-subtle: #1C1C1C; /* Subtle hexagon background */
  
  /* Typography - Enhanced for readability and performance */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  
  /* Enhanced Typography Scale */
  --font-size-xs: 0.75rem;       /* 12px */
  --font-size-sm: 0.875rem;      /* 14px */
  --font-size-base: 1rem;        /* 16px */
  --font-size-lg: 1.125rem;      /* 18px */
  --font-size-xl: 1.25rem;       /* 20px */
  --font-size-2xl: 1.5rem;       /* 24px */
  --font-size-3xl: 1.875rem;     /* 30px */
  --font-size-4xl: 2.25rem;      /* 36px */
  --font-size-5xl: 3rem;         /* 48px */
  
  /* Line Heights for Better CLS */
  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;
  
  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;
  
  /* Layout */
  --container-max-width: 1200px;
  --border-radius: 2px;
  --border-radius-lg: 4px;
  
  /* Enhanced Transitions for Smoothness */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  
  /* Hexagon Dimensions */
  --hexagon-size-sm: 24px;
  --hexagon-size-md: 48px;
  --hexagon-size-lg: 72px;
  
  /* Z-index */
  --z-dropdown: 1000;
  --z-modal: 2000;
  --z-toast: 3000;
}

/* ===== RESET & BASE STYLES ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  /* Prevent layout shift from font loading */
  font-display: swap;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--color-highlight);
  background-color: var(--color-primary);
  overflow-x: hidden;
  /* Improve font rendering */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Prevent invisible text during font load */
  font-display: swap;
}

/* Loading state to prevent CLS */
body.loading {
  visibility: hidden;
}

body.loaded {
  visibility: visible;
}

/* ===== HEXAGON UTILITIES ===== */
.hexagon {
  position: relative;
  display: inline-block;
  width: var(--hexagon-size-md);
  height: var(--hexagon-size-md);
}

.hexagon::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--color-hexagon);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  transition: all var(--transition-smooth);
}

.hexagon--sm {
  width: var(--hexagon-size-sm);
  height: var(--hexagon-size-sm);
}

.hexagon--lg {
  width: var(--hexagon-size-lg);
  height: var(--hexagon-size-lg);
}

.hexagon--outline::before {
  background: transparent;
  border: 2px solid var(--color-hexagon);
}

.hexagon--subtle::before {
  background: var(--color-hexagon-subtle);
  opacity: 0.6;
}

.hexagon:hover::before {
  transform: scale(1.05);
  opacity: 0.8;
}

/* Hexagon background pattern */
.hexagon-pattern {
  position: relative;
  overflow: hidden;
}

.hexagon-pattern::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url('/static/images/hexagon-pattern.svg');
  background-repeat: repeat;
  background-size: 60px 52px;
  opacity: 0.1;
  z-index: -1;
}

/* ===== ENHANCED TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: var(--line-height-tight);
  margin: 0 0 var(--space-md) 0;
  color: var(--color-highlight);
  /* Prevent layout shift from font loading */
  font-display: swap;
  /* Reserve space to prevent CLS */
  min-height: 1em;
}

h1 { 
  font-size: var(--font-size-5xl); 
  line-height: var(--line-height-tight);
  /* Fixed height to prevent CLS */
  min-height: 3.75rem;
}
h2 { 
  font-size: var(--font-size-4xl); 
  min-height: 2.8rem;
}
h3 { 
  font-size: var(--font-size-3xl); 
  min-height: 2.3rem;
}
h4 { 
  font-size: var(--font-size-2xl); 
  min-height: 1.9rem;
}
h5 { 
  font-size: var(--font-size-xl); 
  min-height: 1.6rem;
}
h6 { 
  font-size: var(--font-size-lg); 
  min-height: 1.4rem;
}
h2 { font-size: 2.25rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
  margin: 0 0 var(--space-md) 0;
}

.lead {
  font-size: 1.25rem;
  font-weight: 300;
  line-height: 1.7;
}

/* ===== UTILITY CLASSES ===== */
.container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--color-highlight);
  color: var(--color-primary);
  padding: 8px;
  text-decoration: none;
  border-radius: var(--border-radius);
  z-index: var(--z-toast);
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 6px;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-md) var(--space-xl);
  border: 2px solid transparent;
  border-radius: var(--border-radius);
  background: transparent;
  color: var(--color-highlight);
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-smooth);
  position: relative;
  overflow: hidden;
  /* Prevent layout shift */
  min-height: 3rem;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(74, 74, 74, 0.1), transparent);
  transition: left var(--transition-slow);
  z-index: 1;
}

.btn:hover::before {
  left: 100%;
}

/* Hexagon accent for primary buttons */
.btn--primary::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 12px;
  width: 8px;
  height: 8px;
  background: var(--color-highlight);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  transform: translateY(-50%) scale(0);
  transition: transform var(--transition-smooth);
  z-index: 2;
  opacity: 0.6;
}

.btn--primary:hover::after {
  transform: translateY(-50%) scale(1);
}

.btn--primary {
  background: var(--color-accent);
  border-color: var(--color-shimmer);
  box-shadow: 0 2px 8px rgba(10, 10, 26, 0.3);
}

.btn--primary:hover {
  background: var(--color-shimmer);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(10, 10, 26, 0.4);
}

.btn--secondary {
  border-color: var(--color-shimmer);
}

.btn--secondary:hover {
  background: var(--color-accent);
  border-color: var(--color-highlight);
}

.btn--large {
  padding: var(--space-lg) var(--space-2xl);
  font-size: var(--font-size-lg);
  min-height: 3.5rem;
}

.btn__icon {
  font-size: 1.25rem;
  transition: transform var(--transition-base);
}

.btn:hover .btn__icon {
  transform: translateY(2px);
}

/* ===== HEADER & NAVIGATION ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-accent);
  z-index: var(--z-dropdown);
  transition: all var(--transition-base);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) 0;
}

.nav__logo {
  /* Fixed dimensions removed - now using flexible sizing from logo-enhancements.css */
  display: block;
}

.nav__logo-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: var(--space-sm);
}



.nav__list {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__link {
  color: var(--color-highlight);
  text-decoration: none;
  font-weight: 500;
  padding: var(--space-sm) 0;
  position: relative;
  transition: color var(--transition-base);
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-shimmer);
  transition: width var(--transition-base);
}

.nav__link:hover::after,
.nav__link--active::after {
  width: 100%;
}

.nav__link:hover,
.nav__link--active {
  color: var(--color-shimmer);
}

/* ===== HERO SECTION ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero__background {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
}

.hero__pattern {
  position: absolute;
  top: -50%;
  left: -50%;
  right: -50%;
  bottom: -50%;
  background: 
    radial-gradient(circle at 20% 30%, rgba(45, 45, 45, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(45, 45, 45, 0.03) 0%, transparent 50%),
    linear-gradient(135deg, transparent 40%, rgba(45, 45, 45, 0.02) 50%, transparent 60%);
  animation: float 20s ease-in-out infinite;
}

.hero__shimmer {
  position: absolute;
  top: 0;
  left: -100%;
  width: 200%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(74, 74, 74, 0.02), transparent);
  animation: shimmer 8s ease-in-out infinite;
}

.hero__content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4xl);
  align-items: center;
  padding: var(--space-4xl) 0;
}

.hero__title-main {
  display: block;
  font-size: 4rem;
  font-weight: 400;
  color: var(--color-highlight);
}

.hero__title-accent {
  display: block;
  font-size: 4rem;
  font-weight: 700;
  color: var(--color-shimmer);
  background: linear-gradient(135deg, var(--color-shimmer), var(--color-highlight));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero__subtitle {
  font-size: 1.25rem;
  font-weight: 300;
  line-height: 1.7;
  margin: var(--space-xl) 0 var(--space-2xl) 0;
  max-width: 500px;
}

.hero__visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero__crystal {
  position: relative;
  width: 300px;
  height: 300px;
  transform-style: preserve-3d;
  animation: crystalRotate 20s linear infinite;
}

.crystal-facet {
  position: absolute;
  width: 150px;
  height: 150px;
  background: linear-gradient(135deg, rgba(45, 45, 45, 0.1), rgba(74, 74, 74, 0.05));
  border: 1px solid rgba(74, 74, 74, 0.2);
  border-radius: var(--border-radius);
}

.crystal-facet--1 {
  transform: rotateY(0deg) translateZ(75px);
}

.crystal-facet--2 {
  transform: rotateY(90deg) translateZ(75px);
}

.crystal-facet--3 {
  transform: rotateY(180deg) translateZ(75px);
}

.crystal-facet--4 {
  transform: rotateY(270deg) translateZ(75px);
}

.hero__scroll-indicator {
  position: absolute;
  bottom: var(--space-xl);
  left: 50%;
  transform: translateX(-50%);
}

.scroll-arrow {
  width: 24px;
  height: 24px;
  border-right: 2px solid var(--color-shimmer);
  border-bottom: 2px solid var(--color-shimmer);
  transform: rotate(45deg);
  animation: bounce 2s infinite;
}

/* ===== SECTIONS ===== */
.section-header {
  text-align: center;
  margin-bottom: var(--space-4xl);
}

.section-title {
  font-size: 2.5rem;
  margin-bottom: var(--space-md);
}

.section-subtitle {
  font-size: 1.25rem;
  font-weight: 300;
  color: rgba(229, 229, 229, 0.8);
  max-width: 600px;
  margin: 0 auto;
}

/* ===== FEATURES SECTION ===== */
.features {
  padding: var(--space-4xl) 0;
  background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-secondary) 100%);
}

.features__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: var(--space-2xl);
}

.feature-card {
  padding: var(--space-2xl);
  background: rgba(45, 45, 45, 0.1);
  border: 1px solid rgba(74, 74, 74, 0.2);
  border-radius: var(--border-radius-lg);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-shimmer), transparent);
  transform: translateX(-100%);
  transition: transform var(--transition-slow);
}

.feature-card:hover::before {
  transform: translateX(100%);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(10, 10, 26, 0.3);
  border-color: var(--color-shimmer);
}

.feature-card__icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(74, 74, 74, 0.1);
  border-radius: var(--border-radius);
  margin-bottom: var(--space-lg);
  color: var(--color-shimmer);
}

.feature-card__title {
  font-size: 1.5rem;
  margin-bottom: var(--space-md);
}

.feature-card__description {
  color: rgba(229, 229, 229, 0.8);
  margin-bottom: var(--space-lg);
}

.feature-card__stats {
  padding-top: var(--space-lg);
  border-top: 1px solid rgba(74, 74, 74, 0.2);
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.stat__number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-shimmer);
  font-family: var(--font-mono);
}

.stat__label {
  font-size: 0.875rem;
  color: rgba(229, 229, 229, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===== TRUST INDICATORS ===== */
.trust-indicators {
  padding: var(--space-3xl) 0;
  background: var(--color-secondary);
}

.trust-indicators__content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-xl);
}

.trust-badge {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-lg);
  background: rgba(45, 45, 45, 0.3);
  border-radius: var(--border-radius-lg);
  transition: all var(--transition-base);
}

.trust-badge:hover {
  background: rgba(45, 45, 45, 0.5);
  transform: translateY(-2px);
}

.trust-badge__icon {
  color: var(--color-shimmer);
}

.trust-badge__title {
  font-size: 1.125rem;
  margin-bottom: var(--space-xs);
}

.trust-badge__text {
  font-size: 0.875rem;
  color: rgba(229, 229, 229, 0.7);
  margin: 0;
}

/* ===== FOOTER ===== */
.footer {
  background: var(--color-secondary);
  border-top: 1px solid var(--color-accent);
  padding: var(--space-3xl) 0 var(--space-xl) 0;
}

.footer__content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-2xl);
  margin-bottom: var(--space-2xl);
}

.footer__brand img {
  height: 32px;
  margin-bottom: var(--space-md);
}

.footer__tagline {
  color: rgba(229, 229, 229, 0.7);
  font-style: italic;
}

.footer__title {
  font-size: 1.125rem;
  margin-bottom: var(--space-lg);
  color: var(--color-shimmer);
}

.footer__links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer__links li {
  margin-bottom: var(--space-sm);
}

.footer__link {
  color: rgba(229, 229, 229, 0.8);
  text-decoration: none;
  transition: color var(--transition-base);
}

.footer__link:hover {
  color: var(--color-shimmer);
}

.footer__badges {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.badge {
  padding: var(--space-sm) var(--space-md);
  background: rgba(45, 45, 45, 0.3);
  border: 1px solid rgba(74, 74, 74, 0.3);
  border-radius: var(--border-radius);
  text-align: center;
}

.badge__text {
  font-size: 0.875rem;
  color: var(--color-highlight);
  font-weight: 500;
}

.footer__bottom {
  text-align: center;
  padding-top: var(--space-xl);
  border-top: 1px solid var(--color-accent);
}

.footer__copyright p {
  margin: 0;
  color: rgba(229, 229, 229, 0.6);
  font-size: 0.875rem;
}

.footer__motto {
  font-style: italic;
  margin-top: var(--space-sm) !important;
}

/* Social Media Links */
.footer__link--social {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--border-radius);
  transition: all var(--transition-smooth);
  background: rgba(45, 45, 45, 0.2);
  border: 1px solid transparent;
}

.footer__link--social:hover {
  background: rgba(45, 45, 45, 0.4);
  border-color: var(--color-hexagon);
  transform: translateY(-1px);
}

.footer__social-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.8;
  transition: opacity var(--transition-base);
}

.footer__link--social:hover .footer__social-icon {
  opacity: 1;
}

/* ===== MODAL ===== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: var(--z-modal);
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
}

.modal.is-open {
  display: flex;
}

.modal__overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 10, 10, 0.8);
  backdrop-filter: blur(5px);
}

.modal__content {
  position: relative;
  background: var(--color-secondary);
  border: 1px solid var(--color-accent);
  border-radius: var(--border-radius-lg);
  max-width: 500px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  animation: modalIn 0.3s ease-out;
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg);
  border-bottom: 1px solid var(--color-accent);
}

.modal__title {
  margin: 0;
  font-size: 1.25rem;
}

.modal__close {
  background: transparent;
  border: none;
  color: var(--color-highlight);
  font-size: 1.5rem;
  cursor: pointer;
  padding: var(--space-sm);
  border-radius: var(--border-radius);
  transition: all var(--transition-base);
}

.modal__close:hover {
  background: var(--color-accent);
}

.modal__body {
  padding: var(--space-lg);
}

/* ===== CONTACT INFO ===== */
.contact-info__item {
  margin-bottom: var(--space-xl);
}

.contact-info__item h3 {
  margin-bottom: var(--space-md);
  color: var(--color-shimmer);
}

.email-reveal {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.email-reveal-btn {
  align-self: flex-start;
  padding: var(--space-sm) var(--space-lg);
  background: var(--color-accent);
  border: 1px solid var(--color-shimmer);
  border-radius: var(--border-radius);
  color: var(--color-highlight);
  cursor: pointer;
  transition: all var(--transition-base);
}

.email-reveal-btn:hover {
  background: var(--color-shimmer);
}

/* ===== ERROR PAGES ===== */
.error-page {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4xl) 0;
}

.error-page__content {
  text-align: center;
  max-width: 600px;
}

.error-page__visual {
  margin-bottom: var(--space-2xl);
}

.error-code {
  position: relative;
  display: inline-block;
}

.error-code__number {
  font-size: 6rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--color-shimmer);
  text-shadow: 0 0 20px rgba(74, 74, 74, 0.3);
}

.error-page__title {
  font-size: 2rem;
  margin-bottom: var(--space-lg);
}

.error-page__description {
  font-size: 1.125rem;
  color: rgba(229, 229, 229, 0.8);
  margin-bottom: var(--space-2xl);
}

.error-page__actions {
  display: flex;
  gap: var(--space-lg);
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: var(--space-2xl);
}

.error-page__help {
  text-align: left;
  max-width: 400px;
  margin: 0 auto var(--space-xl) auto;
}

.error-page__help ul {
  color: rgba(229, 229, 229, 0.7);
}

.error-page__help a {
  color: var(--color-shimmer);
  text-decoration: none;
}

.error-page__help a:hover {
  text-decoration: underline;
}

/* ===== LEGAL PAGES ===== */
.legal-page {
  padding: var(--space-4xl) 0;
}

.legal-content {
  max-width: 800px;
  margin: 0 auto;
}

.legal-updated {
  color: rgba(229, 229, 229, 0.6);
  font-style: italic;
  margin-bottom: var(--space-2xl);
}

.legal-section {
  margin-bottom: var(--space-2xl);
}

.legal-section h2 {
  color: var(--color-shimmer);
  border-bottom: 1px solid var(--color-accent);
  padding-bottom: var(--space-sm);
}

/* ===== ANIMATIONS ===== */
@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(180deg); }
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

@keyframes crystalRotate {
  from { transform: rotateY(0deg) rotateX(15deg); }
  to { transform: rotateY(360deg) rotateX(15deg); }
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
  40% { transform: translateX(-50%) translateY(-10px); }
  60% { transform: translateX(-50%) translateY(-5px); }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(-50px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
  :root {
    --space-4xl: 3rem;
    --space-3xl: 2rem;
  }
  
  .hero__title-main,
  .hero__title-accent {
    font-size: 2.5rem;
  }
  
  .hero__content {
    grid-template-columns: 1fr;
    text-align: center;
    gap: var(--space-2xl);
  }
  
  .hero__crystal {
    width: 200px;
    height: 200px;
  }
  
  .crystal-facet {
    width: 100px;
    height: 100px;
  }
  
  .nav__toggle {
    display: flex;
  }
  
  .nav__menu {
    display: none;
  }
  
  .nav__menu--open {
    display: block;
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 10, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1000;
    padding: var(--space-lg);
  }
  
  .nav__list {
    flex-direction: column;
    gap: var(--space-lg);
    height: 100%;
    align-items: center;
    justify-content: flex-start;
    padding-top: var(--space-3xl);
  }
  
  .nav__link {
    font-size: var(--font-size-lg);
    padding: var(--space-md);
    display: block;
    text-align: center;
    min-height: 44px;
    line-height: 1.5;
  }
  
  .features__grid {
    grid-template-columns: 1fr;
  }
  
  .error-page__actions {
    flex-direction: column;
    align-items: center;
  }
  
  .error-code__number {
    font-size: 4rem;
  }
  
  /* Mobile-optimized text sizing */
  h1, .hero__title-main {
    font-size: 2.5rem !important;
    line-height: 1.2;
  }
  
  h2 {
    font-size: 2rem !important;
  }
  
  h3 {
    font-size: 1.5rem !important;
  }
  
  /* Ensure buttons are touch-friendly */
  .btn,
  button,
  a[href] {
    min-height: 44px;
    min-width: 44px;
    padding: var(--space-md) var(--space-lg);
    font-size: var(--font-size-base);
  }
  
  /* Mobile grid improvements */
  [style*="grid-template-columns: repeat(3, 1fr)"],
  [style*="grid-template-columns: repeat(4, 1fr)"] {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }
  
  [style*="grid-template-columns: repeat(2, 1fr)"] {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 var(--space-md);
  }
  
  .hero__title-main,
  .hero__title-accent {
    font-size: 2rem;
  }
  
  .section-title {
    font-size: 2rem;
  }
  
  .btn {
    width: 100%;
    justify-content: center;
  }
  
  .modal__content {
    margin: var(--space-md);
    max-height: calc(100vh - 2rem);
  }
  
  /* Ultra mobile optimizations */
  h1 {
    font-size: 1.875rem !important;
  }
  
  h2 {
    font-size: 1.5rem !important;
  }
  
  /* Improve readability on small screens */
  body {
    font-size: 16px;
    line-height: 1.6;
  }
  
  p {
    font-size: 1rem !important;
    line-height: 1.6 !important;
  }
  
  /* Better spacing for mobile */
  section {
    padding: 60px 0 !important;
  }
  
  .container {
    padding: 0 15px !important;
  }
  
  /* Form optimizations */
  input, textarea, select {
    font-size: 16px !important;
    padding: 12px !important;
    border-radius: 8px !important;
  }
  
  /* Mobile navigation improvements */
  .nav__menu--open {
    top: 60px;
  }
  
  .nav__toggle {
    width: 44px;
    height: 44px;
  }
}

/* ===== MOBILE DEVICE SPECIFIC ===== */
/* iOS specific optimizations */
.is-ios {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

.is-ios input,
.is-ios textarea {
  border-radius: 0;
  -webkit-appearance: none;
}

/* Android specific optimizations */
.is-android {
  -webkit-text-size-adjust: 100%;
}

/* Touch device optimizations */
.is-touch button:hover,
.is-touch .btn:hover {
  transform: none;
}

.is-touch a:hover {
  background-color: rgba(139, 92, 246, 0.1);
}

/* Mobile-first approach for better performance */
.is-mobile .hero__content {
  padding: 2rem 0;
}

.is-mobile .features__grid {
  gap: 1rem;
}

.is-mobile .footer {
  padding: 2rem 0;
}

.is-mobile .footer__links {
  flex-direction: column;
  gap: 0.5rem;
}

/* ===== HIGH CONTRAST MODE ===== */
@media (prefers-contrast: high) {
  :root {
    --color-primary: #000000;
    --color-highlight: #FFFFFF;
    --color-shimmer: #FFFFFF;
  }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .hero__pattern,
  .hero__shimmer,
  .hero__crystal {
    animation: none;
  }
}

/* ===== ONYX THEME ENHANCEMENTS ===== */
/* Additional Onyx Theme Variables for consistency */
:root {
    --onyx-primary: #1a1a1a;
    --onyx-secondary: #2d2d2d;
    --onyx-dark: #0c0c0c;
    --onyx-charcoal: #36454f;
    --onyx-accent: #4a4a4a;
    --onyx-light-grey: #6a6a6a;
    --onyx-text-primary: #e0e0e0;
    --onyx-text-secondary: #b0b0b0;
    --transition-standard: 0.3s ease;
}

/* Enhanced button styling for onyx theme */
.btn--primary {
    background: linear-gradient(135deg, var(--onyx-primary), var(--onyx-secondary)) !important;
    border-color: var(--onyx-charcoal) !important;
}

.btn--primary:hover {
    background: linear-gradient(135deg, var(--onyx-secondary), var(--onyx-accent)) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

/* CTA styling for closed membership */
.cta-subtitle {
    color: var(--onyx-text-secondary);
    font-size: 0.9rem;
    margin-top: 8px;
    font-style: italic;
}

/* Contact link in terms */
.contact-link {
    color: var(--onyx-text-primary);
    text-decoration: underline;
    transition: var(--transition-standard);
}

.contact-link:hover {
    color: var(--onyx-accent);
    text-decoration: none;
}

/* Specific icon implementations for features */
.feature-card__icon {
    background: linear-gradient(135deg, var(--onyx-dark), var(--onyx-charcoal));
    border: 1px solid var(--onyx-accent);
    transition: var(--transition-standard);
}

.feature-card__icon:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    transform: translateY(-2px);
}

/* Icon specific styling */
.icon-global-network {
    background: linear-gradient(45deg, #2a2a2a, var(--onyx-charcoal)) !important;
}

.icon-monitoring {
    background: var(--onyx-dark) !important;
    border: 2px solid var(--onyx-accent) !important;
}

.icon-auto-scaling {
    background: linear-gradient(135deg, var(--onyx-charcoal), #3a3a3a) !important;
    position: relative;
    overflow: hidden;
}

.icon-auto-scaling::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.05), transparent);
    transform: rotate(45deg);
    transition: var(--transition-standard);
}

.icon-disaster-recovery {
    background: var(--onyx-dark) !important;
    border: 1px solid var(--onyx-light-grey) !important;
}

/* ===== BREADCRUMB NAVIGATION ===== */
.breadcrumb {
    background: rgba(28, 28, 28, 0.5);
    border-bottom: 1px solid var(--color-accent);
    padding: var(--space-sm) 0;
    margin-bottom: var(--space-lg);
}

.breadcrumb__list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-sm);
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: var(--font-size-sm);
}

.breadcrumb__item {
    display: flex;
    align-items: center;
}

.breadcrumb__item:not(:last-child)::after {
    content: '›';
    margin-left: var(--space-sm);
    color: var(--color-shimmer);
    font-weight: 500;
}

.breadcrumb__link {
    color: var(--color-highlight);
    text-decoration: none;
    transition: color var(--transition-standard);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--border-radius-sm);
}

.breadcrumb__link:hover,
.breadcrumb__link:focus {
    color: var(--color-accent-purple, #8B5CF6);
    background: rgba(139, 92, 246, 0.1);
}

.breadcrumb__text {
    color: var(--color-shimmer);
    padding: var(--space-xs) var(--space-sm);
    font-weight: 500;
}

.breadcrumb__item--current {
    color: var(--color-accent-purple, #8B5CF6);
}

/* Mobile breadcrumb optimization */
@media (max-width: 768px) {
    .breadcrumb {
        padding: var(--space-xs) 0;
    }
    
    .breadcrumb__list {
        font-size: var(--font-size-xs);
        gap: var(--space-xs);
    }
    
    .breadcrumb__link,
    .breadcrumb__text {
        padding: var(--space-xs);
    }
}

/* ===== ENHANCED INTERNAL LINKING STYLES ===== */
.hero-section__link,
.cta-section__link,
.hero__footer-link,
.cta-section__footer-link {
    color: var(--color-accent-purple, #8B5CF6);
    text-decoration: none;
    position: relative;
    font-weight: 500;
    transition: all var(--transition-standard);
}

.hero-section__link::after,
.cta-section__link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: linear-gradient(90deg, var(--color-accent-purple, #8B5CF6), transparent);
    transition: width var(--transition-standard);
}

.hero-section__link:hover::after,
.cta-section__link:hover::after {
    width: 100%;
}

.hero-section__link:hover,
.cta-section__link:hover,
.hero__footer-link:hover,
.cta-section__footer-link:hover {
    color: #A78BFA;
    text-shadow: 0 0 8px rgba(139, 92, 246, 0.3);
}

.hero__footer-link,
.cta-section__footer-link {
    font-size: var(--font-size-sm);
    opacity: 0.8;
    border-bottom: 1px dotted var(--color-accent-purple, #8B5CF6);
}

.hero__footer-link:hover,
.cta-section__footer-link:hover {
    opacity: 1;
    border-bottom-style: solid;
}