/* ============================================================================
   DIZITIVE IT SOLUTIONS — DESIGN SYSTEM
   Dark Premium Tech Aesthetic
   ============================================================================ */

:root {
  /* -----------------------------------------------------------------------
   * Color Palette — Norwaves.no design system applied to DIZITIVE dark theme
   *
   * Source palette (norwaves.no):
   *   primary:    #046BD2   primary-hover: #045CB4
   *   heading:    #1E293B   body-text:     #334155
   *   bg-white:   #FFFFFF   bg-subtle:     #F0F5FA
   *   border:     #D1D5DB
   * ----------------------------------------------------------------------- */

  /* Backgrounds — Norwaves slate tones deepened for dark theme */
  --color-bg-dark: #080E1A;
  /* Changed from #0F172A to make background uniform */
  --color-bg-darker: #080E1A;
  /* near-black with blue undertone */
  --color-bg-light: #1E293B;
  /* Norwaves heading colour as card/surface */
  --color-bg-subtle: #162032;
  /* mid-point for subtle sections */

  /* Primary — exact Norwaves blue */
  --color-primary: #046BD2;
  --color-primary-hover: #045CB4;
  --color-primary-glow: #046BD2;

  /* Accent — DIZITIVE brand teal kept for differentiation */
  --color-accent: #00FFB2;

  /* Highlight — adapted from Norwaves slate-900 as purple-shifted deep */
  --color-highlight: #3B82F6;
  /* Tailwind blue-500, harmonises with #046BD2 */

  /* Text — Norwaves slate palette mapped to dark backgrounds */
  --color-text-primary: #F0F5FA;
  /* Norwaves subtle-bg used as light text */
  --color-text-secondary: #94A3B8;
  /* Tailwind slate-400 */
  --color-text-tertiary: #64748B;
  /* Tailwind slate-500 */

  /* Borders — Norwaves slate body text used as border */
  --color-border: #334155;
  /* Norwaves body text = clean visible border */
  --color-border-light: #475569;
  /* Tailwind slate-600, lighter variant */

  /* Status */
  --color-error: #EF4444;
  /* Tailwind red-500 */
  --color-success: #10B981;
  /* Tailwind emerald-500 */
  --color-warning: #F59E0B;
  /* Tailwind amber-500 */

  /* Typography */
  --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Font Weights */
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fw-extrabold: 800;

  /* Font Sizes (mobile-first scale) */
  --fs-xs: 0.75rem;
  /* 12px */
  --fs-sm: 0.875rem;
  /* 14px */
  --fs-base: 1rem;
  /* 16px */
  --fs-lg: 1.125rem;
  /* 18px */
  --fs-xl: 1.25rem;
  /* 20px */
  --fs-2xl: 1.5rem;
  /* 24px */
  --fs-3xl: 1.875rem;
  /* 30px */
  --fs-4xl: 2.25rem;
  /* 36px */
  --fs-5xl: 3rem;
  /* 48px */
  --fs-6xl: 3.75rem;
  /* 60px */

  /* Line Heights */
  --lh-tight: 1.2;
  --lh-normal: 1.5;
  --lh-relaxed: 1.75;

  /* Spacing Scale */
  --space-xs: 0.25rem;
  /* 4px */
  --space-sm: 0.5rem;
  /* 8px */
  --space-md: 1rem;
  /* 16px */
  --space-lg: 1.5rem;
  /* 24px */
  --space-xl: 2rem;
  /* 32px */
  --space-2xl: 3rem;
  /* 48px */
  --space-3xl: 4rem;
  /* 64px */
  --space-4xl: 6rem;
  /* 96px */

  /* Border Radius */
  --radius-sm: 0.375rem;
  /* 6px */
  --radius-md: 0.5rem;
  /* 8px */
  --radius-lg: 1rem;
  /* 16px */
  --radius-xl: 1.5rem;
  /* 24px */
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 1s cubic-bezier(0.4, 0, 0.2, 1);

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.16);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.16);
  --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.32);
  --shadow-xl: 0 16px 32px rgba(0, 0, 0, 0.48);
  --shadow-2xl: 0 32px 64px rgba(0, 0, 0, 0.64);

  /* Glow Effects — keyed to Norwaves primary blue */
  --glow-primary: 0 0 20px rgba(4, 107, 210, 0.35);
  --glow-accent: 0 0 20px rgba(0, 255, 178, 0.2);
  --glow-highlight: 0 0 20px rgba(59, 130, 246, 0.3);

  /* Z-Index Scale */
  --z-hide: -1;
  --z-base: 0;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-modal-backdrop: 400;
  --z-modal: 500;
  --z-tooltip: 600;
  --z-notification: 700;
}

/* ============================================================================
   FONTS
   ============================================================================ */

/* Inter — self-hosted, no external CDN dependency */
/* latin-ext: covers accented characters (Å, ø, ñ etc.) */
@font-face {
  font-family: 'Inter';
  src: url('../fonts/Inter-latin-ext.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0,
    U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin: primary character set */
@font-face {
  font-family: 'Inter';
  src: url('../fonts/Inter.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}

/* ============================================================================
   RESET & BASE STYLES
   ============================================================================ */

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  color-scheme: dark;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  color: var(--color-text-primary);
  background-color: var(--color-bg-dark);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='500' height='432'%3E%3Cpolygon points='125,0.0 245.0,69.25 245.0,207.75 125,277.0 5.0,207.75 5.0,69.25' fill='none' stroke='%2301c8ef' stroke-opacity='.06' stroke-width='1.5'/%3E%3Cpolygon points='375,0.0 495.0,69.25 495.0,207.75 375,277.0 255.0,207.75 255.0,69.25' fill='none' stroke='%2301c8ef' stroke-opacity='.06' stroke-width='1.5'/%3E%3Cpolygon points='0,216.0 120.0,285.25 120.0,423.75 0,493.0 -120.0,423.75 -120.0,285.25' fill='none' stroke='%2301c8ef' stroke-opacity='.06' stroke-width='1.5'/%3E%3Cpolygon points='250,216.0 370.0,285.25 370.0,423.75 250,493.0 130.0,423.75 130.0,285.25' fill='none' stroke='%2301c8ef' stroke-opacity='.06' stroke-width='1.5'/%3E%3Cpolygon points='500,216.0 620.0,285.25 620.0,423.75 500,493.0 380.0,423.75 380.0,285.25' fill='none' stroke='%2301c8ef' stroke-opacity='.06' stroke-width='1.5'/%3E%3Cpolygon points='0,-216.0 120.0,-146.75 120.0,-8.25 0,61.0 -120.0,-8.25 -120.0,-146.75' fill='none' stroke='%2301c8ef' stroke-opacity='.06' stroke-width='1.5'/%3E%3Cpolygon points='250,-216.0 370.0,-146.75 370.0,-8.25 250,61.0 130.0,-8.25 130.0,-146.75' fill='none' stroke='%2301c8ef' stroke-opacity='.06' stroke-width='1.5'/%3E%3Cpolygon points='500,-216.0 620.0,-146.75 620.0,-8.25 500,61.0 380.0,-8.25 380.0,-146.75' fill='none' stroke='%2301c8ef' stroke-opacity='.06' stroke-width='1.5'/%3E%3C/svg%3E");
  background-size: 500px 432px;
  background-repeat: repeat;
  /* background-position is set dynamically by alignHexBackground() in main.js */
  background-position: 50% 0;
  overflow-x: hidden;
}

/* ============================================================================
   TYPOGRAPHY
   ============================================================================ */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  margin-bottom: var(--space-lg);
}

h1 {
  font-size: var(--fs-4xl);
}

h2 {
  font-size: var(--fs-3xl);
}

h3 {
  font-size: var(--fs-2xl);
}

h4 {
  font-size: var(--fs-xl);
}

h5 {
  font-size: var(--fs-lg);
}

h6 {
  font-size: var(--fs-base);
}

p {
  margin-bottom: var(--space-md);
  color: var(--color-text-secondary);
  line-height: var(--lh-relaxed);
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-accent);
}

strong {
  font-weight: var(--fw-bold);
}

em {
  font-style: italic;
}

/* ============================================================================
   BUTTONS
   ============================================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  font-family: var(--font-heading);
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--color-bg-darker), 0 0 0 6px var(--color-primary);
}

/* Primary Button */
.btn-primary {
  background-color: var(--color-primary);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--color-primary-hover);
  box-shadow: var(--glow-primary);
}

.btn-primary:active {
  transform: scale(0.98);
}

/* Secondary Button (Outline) */
.btn-secondary {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background-color: transparent;
}

.btn-secondary:hover {
  background-color: rgba(4, 107, 210, 0.1);
  box-shadow: var(--glow-primary);
}

/* Accent Button */
.btn-accent {
  background-color: var(--color-accent);
  color: var(--color-bg-dark);
}

.btn-accent:hover {
  background-color: #00E5A0;
  box-shadow: var(--glow-accent);
}

/* Ghost Button */
.btn-ghost {
  color: var(--color-text-primary);
  border-color: var(--color-border);
}

.btn-ghost:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* ============================================================================
   CARDS & CONTAINERS
   ============================================================================ */

.card {
  background: rgba(26, 31, 46, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  transition: all var(--transition-base);
}

.card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--glow-primary);
  transform: translateY(-2px);
}

.card-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
}

/* ============================================================================
   FORMS
   ============================================================================ */

.form-group {
  margin-bottom: var(--space-lg);
}

label {
  display: block;
  font-weight: var(--fw-semibold);
  margin-bottom: var(--space-sm);
  color: var(--color-text-primary);
}

input,
textarea,
select {
  width: 100%;
  padding: var(--space-md);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  background-color: rgba(26, 31, 46, 0.6);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(4, 107, 210, 0.1);
}

input::placeholder {
  color: var(--color-text-tertiary);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

/* ============================================================================
   ANIMATIONS
   ============================================================================ */

@media (prefers-reduced-motion: no-preference) {

  /* Entrance animations */
  @keyframes fadeInUp {
    from {
      opacity: 0;
      transform: translateY(20px);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  @keyframes fadeInDown {
    from {
      opacity: 0;
      transform: translateY(-20px);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  @keyframes slideInLeft {
    from {
      opacity: 0;
      transform: translateX(-20px);
    }

    to {
      opacity: 1;
      transform: translateX(0);
    }
  }

  @keyframes slideInRight {
    from {
      opacity: 0;
      transform: translateX(20px);
    }

    to {
      opacity: 1;
      transform: translateX(0);
    }
  }

  @keyframes pulse {

    0%,
    100% {
      opacity: 1;
    }

    50% {
      opacity: 0.5;
    }
  }

  @keyframes glow {

    0%,
    100% {
      box-shadow: var(--glow-primary);
    }

    50% {
      box-shadow: 0 0 30px rgba(4, 107, 210, 0.5);
    }
  }

  /* Particle animation (background effect) */
  @keyframes float {

    0%,
    100% {
      transform: translateY(0px);
    }

    50% {
      transform: translateY(-20px);
    }
  }

  .fade-in-up {
    animation: fadeInUp 0.6s ease-out;
  }

  .fade-in-down {
    animation: fadeInDown 0.6s ease-out;
  }

  .slide-in-left {
    animation: slideInLeft 0.6s ease-out;
  }

  .slide-in-right {
    animation: slideInRight 0.6s ease-out;
  }
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

@media (max-width: 480px) {
  .container {
    padding: 0 var(--space-md);
  }
}

.section {
  padding: var(--space-4xl) var(--space-lg);
}

.section-small {
  padding: var(--space-2xl) var(--space-lg);
}

.gradient-text {
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-center {
  text-align: center;
}

.text-muted {
  color: var(--color-text-tertiary);
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============================================================================
   ACCESSIBILITY
   ============================================================================ */

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

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-primary);
  color: white;
  padding: 8px;
  text-decoration: none;
  z-index: var(--z-notification);
}

.skip-link:focus {
  top: 0;
}

/* ============================================================================
   RESPONSIVE TYPOGRAPHY
   ============================================================================ */

@media (min-width: 768px) {
  h1 {
    font-size: var(--fs-5xl);
  }

  h2 {
    font-size: var(--fs-4xl);
  }

  h3 {
    font-size: var(--fs-3xl);
  }
}

@media (min-width: 1024px) {
  h1 {
    font-size: var(--fs-6xl);
  }

  h2 {
    font-size: var(--fs-5xl);
  }

  h3 {
    font-size: var(--fs-4xl);
  }

  .section {
    padding: var(--space-4xl) 0;
  }
}