/* UK Systems Infrastructure - Main Stylesheet */

/* ========================================
   CSS Variables & Design Tokens
   ======================================== */
:root {
  /* Color Palette */
  --graphite-black: #111827;
  --infrastructure-blue: #2563EB;
  --steel-grey: #6B7280;
  --light-mist: #F3F4F6;
  --signal-teal: #2DD4BF;
  
  /* Typography */
  --font-title: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --size-title: 45px;
  --size-body: 18px;
  --size-caption: 14px;
  --line-height: 1.65;
  
  /* Layout Widths */
  --width-wide: 1400px;
  --width-medium: 1000px;
  --width-compact: 720px;
  
  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 2rem;
  --spacing-lg: 4rem;
  --spacing-xl: 6rem;
  
  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-medium: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* ========================================
   Global Reset & Base Styles
   ======================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  font-size: var(--size-body);
  line-height: var(--line-height);
  color: var(--graphite-black);
  background-color: #FFFFFF;
  overflow-x: hidden;
}

/* ========================================
   Typography
   ======================================== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-title);
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--graphite-black);
}

h1 {
  font-size: var(--size-title);
  margin-bottom: 1.5rem;
}

h2 {
  font-size: 38px;
  margin-bottom: 1.25rem;
}

h3 {
  font-size: 28px;
  margin-bottom: 1rem;
}

h4 {
  font-size: 22px;
}

p {
  margin-bottom: 1rem;
  color: var(--steel-grey);
}

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

a:hover {
  color: var(--signal-teal);
}

code, .mono {
  font-family: var(--font-mono);
  font-size: var(--size-caption);
  background-color: var(--light-mist);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
}

/* ========================================
   Layout Containers
   ======================================== */
.container-wide {
  max-width: var(--width-wide);
  margin: 0 auto;
  padding: 0 2rem;
}

.container-medium {
  max-width: var(--width-medium);
  margin: 0 auto;
  padding: 0 2rem;
}

.container-compact {
  max-width: var(--width-compact);
  margin: 0 auto;
  padding: 0 2rem;
}

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

.section-alt {
  background-color: var(--light-mist);
}

/* ========================================
   Navigation Header
   ======================================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  transition: transform var(--transition-medium);
}

.site-header.hidden {
  transform: translateY(-100%);
}

.nav-container {
  max-width: var(--width-wide);
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-title);
  font-size: 20px;
  font-weight: 700;
  color: var(--graphite-black);
  text-decoration: none;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--infrastructure-blue), var(--signal-teal));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
}

.main-nav ul {
  display: flex;
  list-style: none;
  gap: 2rem;
  align-items: center;
}

.main-nav a {
  color: var(--graphite-black);
  font-weight: 500;
  transition: color var(--transition-fast);
  position: relative;
}

.main-nav a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--infrastructure-blue);
  transition: width var(--transition-fast);
}

.main-nav a:hover::after,
.main-nav a.active::after {
  width: 100%;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--infrastructure-blue);
}

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--graphite-black);
  padding: 0.5rem;
}

/* ========================================
   Hero Section
   ======================================== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: linear-gradient(135deg, var(--graphite-black) 0%, #1e293b 100%);
  color: white;
  overflow: hidden;
  padding: 6rem 2rem;
}

.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0.1;
  background-image: 
    repeating-linear-gradient(0deg, transparent, transparent 50px, var(--infrastructure-blue) 50px, var(--infrastructure-blue) 51px),
    repeating-linear-gradient(90deg, transparent, transparent 50px, var(--infrastructure-blue) 50px, var(--infrastructure-blue) 51px);
  animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
  0% { transform: translate(0, 0); }
  100% { transform: translate(50px, 50px); }
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 900px;
}

.hero h1 {
  font-size: clamp(36px, 5vw, 60px);
  color: white;
  margin-bottom: 1.5rem;
  animation: fadeInUp 0.8s ease;
}

.hero-subtitle {
  font-size: clamp(18px, 2vw, 24px);
  color: var(--light-mist);
  margin-bottom: 2rem;
  animation: fadeInUp 0.8s ease 0.2s backwards;
}

.hero p {
  color: var(--light-mist);
  margin-bottom: 2.5rem;
  animation: fadeInUp 0.8s ease 0.4s backwards;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========================================
   Buttons & CTAs
   ======================================== */
.btn {
  display: inline-block;
  padding: 1rem 2rem;
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 16px;
  text-align: center;
  text-decoration: none;
  border-radius: 8px;
  transition: all var(--transition-medium);
  cursor: pointer;
  border: 2px solid transparent;
}

.btn-primary {
  background-color: var(--infrastructure-blue);
  color: white;
}

.btn-primary:hover {
  background-color: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
  background-color: transparent;
  color: white;
  border-color: white;
}

.btn-secondary:hover {
  background-color: white;
  color: var(--infrastructure-blue);
}

.btn-teal {
  background-color: var(--signal-teal);
  color: var(--graphite-black);
}

.btn-teal:hover {
  background-color: #14b8a6;
  transform: translateY(-2px);
}

.cta-group {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  animation: fadeInUp 0.8s ease 0.6s backwards;
}

/* ========================================
   Infrastructure Grid
   ======================================== */
.infra-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.infra-card {
  background-color: white;
  border: 2px solid var(--light-mist);
  border-radius: 12px;
  padding: 2rem;
  transition: all var(--transition-medium);
  position: relative;
  overflow: hidden;
}

.infra-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--infrastructure-blue), var(--signal-teal));
  transform: scaleX(0);
  transition: transform var(--transition-medium);
}

.infra-card:hover {
  border-color: var(--infrastructure-blue);
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.infra-card:hover::before {
  transform: scaleX(1);
}

.infra-card-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--infrastructure-blue), var(--signal-teal));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 28px;
  margin-bottom: 1.5rem;
}

.infra-card h3 {
  color: var(--graphite-black);
  margin-bottom: 1rem;
}

.infra-card p {
  color: var(--steel-grey);
  margin-bottom: 0;
}

/* ========================================
   Technical Panels
   ======================================== */
.tech-panel {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.05), rgba(45, 212, 191, 0.05));
  border-left: 4px solid var(--infrastructure-blue);
  padding: 2rem;
  border-radius: 8px;
  margin: 2rem 0;
}

.tech-panel h3 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--infrastructure-blue);
}

.tech-panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.tech-stat {
  text-align: center;
  padding: 1rem;
}

.tech-stat-value {
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 700;
  color: var(--infrastructure-blue);
  display: block;
}

.tech-stat-label {
  font-size: var(--size-caption);
  color: var(--steel-grey);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 0.5rem;
}

/* ========================================
   Schematic Diagrams
   ======================================== */
.diagram-container {
  background-color: var(--graphite-black);
  border-radius: 12px;
  padding: 3rem;
  margin: 2rem 0;
  position: relative;
  overflow: hidden;
}

.diagram-grid {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    repeating-linear-gradient(0deg, transparent, transparent 30px, rgba(45, 212, 191, 0.1) 30px, rgba(45, 212, 191, 0.1) 31px),
    repeating-linear-gradient(90deg, transparent, transparent 30px, rgba(45, 212, 191, 0.1) 30px, rgba(45, 212, 191, 0.1) 31px);
}

.diagram-content {
  position: relative;
  z-index: 1;
}

.layer-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.layer {
  background-color: rgba(37, 99, 235, 0.1);
  border: 2px solid var(--infrastructure-blue);
  border-radius: 8px;
  padding: 1.5rem;
  color: white;
  transition: all var(--transition-medium);
}

.layer:hover {
  background-color: rgba(37, 99, 235, 0.2);
  transform: translateX(10px);
}

.layer-title {
  font-family: var(--font-title);
  font-size: 20px;
  color: var(--signal-teal);
  margin-bottom: 0.5rem;
}

.layer-description {
  font-size: 14px;
  color: var(--light-mist);
}

/* ========================================
   Modal System
   ======================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(17, 24, 39, 0.8);
  backdrop-filter: blur(5px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 2rem;
  opacity: 0;
  transition: opacity var(--transition-medium);
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal-content {
  background-color: white;
  border-radius: 12px;
  max-width: 700px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  transform: scale(0.9);
  transition: transform var(--transition-medium);
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.modal-header {
  padding: 2rem;
  border-bottom: 2px solid var(--light-mist);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: var(--steel-grey);
  padding: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background-color: var(--light-mist);
  color: var(--graphite-black);
}

.modal-body {
  padding: 2rem;
}

/* ========================================
   Filter System
   ======================================== */
.filter-bar {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background-color: var(--light-mist);
  border-radius: 8px;
}

.filter-btn {
  padding: 0.5rem 1rem;
  background-color: white;
  border: 2px solid var(--steel-grey);
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--graphite-black);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-btn:hover {
  border-color: var(--infrastructure-blue);
  color: var(--infrastructure-blue);
}

.filter-btn.active {
  background-color: var(--infrastructure-blue);
  border-color: var(--infrastructure-blue);
  color: white;
}

/* ========================================
   Accordion FAQ
   ======================================== */
.accordion {
  border: 2px solid var(--light-mist);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.accordion-header {
  padding: 1.5rem;
  background-color: white;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color var(--transition-fast);
  user-select: none;
}

.accordion-header:hover {
  background-color: var(--light-mist);
}

.accordion-header.active {
  background-color: var(--infrastructure-blue);
  color: white;
}

.accordion-title {
  font-family: var(--font-title);
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.accordion-header.active .accordion-title {
  color: white;
}

.accordion-icon {
  font-size: 24px;
  transition: transform var(--transition-fast);
}

.accordion-header.active .accordion-icon {
  transform: rotate(45deg);
}

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-medium);
}

.accordion-body.active {
  max-height: 1000px;
}

.accordion-content {
  padding: 1.5rem;
  background-color: var(--light-mist);
}

/* ========================================
   Forms
   ======================================== */
.form-container {
  background-color: white;
  border: 2px solid var(--light-mist);
  border-radius: 12px;
  padding: 2rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-weight: 600;
  color: var(--graphite-black);
  margin-bottom: 0.5rem;
}

.form-label .required {
  color: var(--infrastructure-blue);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font-body);
  font-size: 16px;
  border: 2px solid var(--light-mist);
  border-radius: 8px;
  transition: border-color var(--transition-fast);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--infrastructure-blue);
}

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

.form-checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.form-checkbox {
  margin-top: 0.25rem;
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.form-checkbox-label {
  font-size: 14px;
  color: var(--steel-grey);
  flex: 1;
}

.form-error {
  color: #dc2626;
  font-size: 14px;
  margin-top: 0.5rem;
  display: none;
}

.form-group.error .form-error {
  display: block;
}

.form-group.error .form-input,
.form-group.error .form-textarea {
  border-color: #dc2626;
}

/* ========================================
   Cookie Banner
   ======================================== */
.cookie-banner {
  position: fixed;
  bottom: -200px;
  left: 0;
  right: 0;
  background-color: var(--graphite-black);
  color: white;
  padding: 1.5rem;
  box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.3);
  z-index: 3000;
  transition: bottom var(--transition-slow);
}

.cookie-banner.show {
  bottom: 0;
}

.cookie-content {
  max-width: var(--width-wide);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
}

.cookie-text {
  flex: 1;
  font-size: 14px;
  color: var(--light-mist);
}

.cookie-text a {
  color: var(--signal-teal);
  text-decoration: underline;
}

.cookie-actions {
  display: flex;
  gap: 1rem;
}

.cookie-btn {
  padding: 0.75rem 1.5rem;
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.cookie-accept {
  background-color: var(--signal-teal);
  color: var(--graphite-black);
  border: none;
}

.cookie-accept:hover {
  background-color: #14b8a6;
}

.cookie-decline {
  background-color: transparent;
  color: white;
  border: 2px solid white;
}

.cookie-decline:hover {
  background-color: white;
  color: var(--graphite-black);
}

/* ========================================
   Footer
   ======================================== */
.site-footer {
  background-color: var(--graphite-black);
  color: var(--light-mist);
  padding: 4rem 2rem 2rem;
}

.footer-content {
  max-width: var(--width-wide);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-section h3 {
  color: white;
  font-size: 20px;
  margin-bottom: 1rem;
}

.footer-section p,
.footer-section a {
  color: var(--light-mist);
  font-size: 14px;
  line-height: 1.8;
}

.footer-section a {
  display: block;
  margin-bottom: 0.5rem;
  transition: color var(--transition-fast);
}

.footer-section a:hover {
  color: var(--signal-teal);
}

.footer-contact-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.footer-bottom {
  max-width: var(--width-wide);
  margin: 0 auto;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  font-size: 14px;
  color: var(--steel-grey);
}

/* ========================================
   Utility Classes
   ======================================== */
.text-center {
  text-align: center;
}

.text-blue {
  color: var(--infrastructure-blue);
}

.text-teal {
  color: var(--signal-teal);
}

.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }

.hidden {
  display: none;
}

.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;
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: block;
  }
  
  .main-nav {
    position: fixed;
    top: 73px;
    left: 0;
    right: 0;
    background-color: white;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-medium);
  }
  
  .main-nav.active {
    max-height: 500px;
  }
  
  .main-nav ul {
    flex-direction: column;
    padding: 1rem 2rem;
    gap: 0;
  }
  
  .main-nav li {
    width: 100%;
    border-bottom: 1px solid var(--light-mist);
  }
  
  .main-nav a {
    display: block;
    padding: 1rem 0;
  }
  
  .cta-group {
    flex-direction: column;
  }
  
  .btn {
    width: 100%;
  }
  
  .cookie-content {
    flex-direction: column;
    text-align: center;
  }
  
  .cookie-actions {
    width: 100%;
    flex-direction: column;
  }
  
  .cookie-btn {
    width: 100%;
  }
  
  h1 {
    font-size: 36px;
  }
  
  h2 {
    font-size: 28px;
  }
}

@media (max-width: 480px) {
  .infra-grid {
    grid-template-columns: 1fr;
  }
  
  .filter-bar {
    flex-direction: column;
  }
  
  .filter-btn {
    width: 100%;
  }
}
