/* ========================================
   VAKTA — Nordic Precision Design System
   Derived from the VAKTA crystal mark
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* ── Brand spectrum — extracted from mark columns ── */
  --navy:         #042C53;   /* col 1 bottom — primary dark surface */
  --navy-mid:     #1E256A;   /* col 2 bottom */
  --purple:       #3C3489;   /* col 3 bottom */
  --purple-warm:  #541E70;   /* col 4 bottom */
  --maroon:       #6E1E48;   /* col 5 bottom */
  --burgundy:     #501313;   /* col 6 bottom */

  --ice-blue:     #B5D4F4;   /* col 1 top */
  --ice-purple:   #CECBF6;   /* col 3 top */
  --ice-pink:     #EEC0DE;   /* col 5 top */

  /* ── Surface & text ── */
  --surface-dark:   #031E3A;   /* slightly deeper than navy, for depth layering */
  --surface-light:  #F6F5F2;   /* warm off-white — replaces --snow */
  --surface-mid:    #EDECEA;   /* subtle warm light surface — replaces --ice */
  --text-on-dark:   #F0EEF8;   /* primary text on navy/dark backgrounds */
  --text-muted-dark:#B5D4F4;   /* secondary text on dark backgrounds */
  --text-on-light:  #0F172A;   /* primary text on light backgrounds */
  --text-muted-light:#4A5568;  /* secondary text on light backgrounds */
  --border-dark:    rgba(176, 212, 244, 0.15); /* borders on dark surfaces */
  --border-light:   #DDE1E8;   /* borders on light surfaces */

  /* ── Semantic — preserved for functional use ── */
  --teal:         #0F6E56;   /* safe/success — from brand teal family */
  --teal-light:   #E1F5EE;
  --amber:        #BA7517;   /* warning */
  --amber-light:  #FAEEDA;
  --red:          #7A1828;   /* danger — from brand burgundy family */
  --red-light:    #F7C1C1;   /* from mark col 6 top */

  /* ── Legacy aliases — keeps existing HTML classes working ── */
  --snow:         var(--surface-light);
  --ice:          var(--surface-mid);
  --mist:         var(--border-light);
  --stone:        #94A3B8;
  --slate:        var(--text-muted-light);
  --charcoal:     #334155;
  --ink:          var(--text-on-light);
  --accent:       var(--navy);
  --accent-light: #DBEAFE;
  --accent-dark:  var(--navy-mid);
  --primary:      var(--navy);
  --safe:         var(--teal);
  --safe-light:   var(--teal-light);
  --warn:         var(--amber);
  --warn-light:   var(--amber-light);
  --danger:       var(--red);
  --danger-light: var(--red-light);

  /* ── Typography — unchanged ── */
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* ── Spacing — unchanged ── */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2.5rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;

  /* ── Layout — unchanged ── */
  --max-width: 1140px;
  --radius: 8px;
  --radius-lg: 16px;

  /* ── Shadows ── */
  --shadow-sm: 0 1px 3px rgba(4, 44, 83, 0.08);
  --shadow-md: 0 4px 16px rgba(4, 44, 83, 0.12);
  --shadow-lg: 0 8px 32px rgba(4, 44, 83, 0.18);
  --shadow-glow: 0 0 0 3px rgba(176, 212, 244, 0.2);
}

/* ---- Reset & Base ---- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--snow);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-dark); }

/* ---- Typography ---- */
h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink);
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); margin-bottom: var(--space-md); }
h3 { font-size: 1.25rem; margin-bottom: var(--space-md); }

p { color: var(--charcoal); max-width: 65ch; }
p + p { margin-top: var(--space-md); }

.label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ice-purple);
}

.mono { font-family: var(--font-mono); font-size: 0.9em; }

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

section {
  padding: var(--space-lg) 0;
}

section + section {
  border-top: 1px solid var(--mist);
}

/* ---- Navigation ---- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--navy);
  border-bottom: 1px solid var(--border-dark);
  padding: var(--space-md) 0;
}

.nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-on-dark);
  letter-spacing: 0.06em;
}

/* Mark in nav: 48px tall, auto width */
.nav-logo .vakta-mark {
  height: 48px;
  width: auto;
}

.nav-links {
  display: flex;
  gap: var(--space-xl);
  list-style: none;
}

.nav-links a {
  color: var(--text-muted-dark);
  font-size: 0.875rem;
  font-weight: 500;
  position: relative;
  padding-bottom: 2px;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--ice-blue);
  transition: width 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-on-dark);
}

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

.nav-lang {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding-left: var(--space-lg);
  margin-left: var(--space-sm);
  border-left: 1px solid var(--border-dark);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.07em;
}

.nav-lang a {
  color: var(--text-muted-dark);
  text-decoration: none;
  opacity: 0.55;
  transition: opacity 0.2s ease;
}

.nav-lang a:hover {
  opacity: 1;
}

.lang-active {
  color: var(--text-on-dark);
  opacity: 1;
}

.lang-sep {
  color: var(--border-dark);
  opacity: 0.6;
  user-select: none;
}

.nav-mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-sm);
  color: var(--text-on-dark);
}

/* ---- Hero ---- */
.hero {
  padding: var(--space-2xl) 0 var(--space-xl);
  background: var(--navy);
  position: relative;
}

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

.hero-content--split {
  display: flex;
  align-items: center;
  gap: var(--space-2xl);
}

.hero-text {
  flex: 1 1 0;
  min-width: 0;
}

.hero-mark {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero h1 {
  color: var(--text-on-dark);
  margin-bottom: var(--space-md);
}

.hero h1 span {
  color: var(--ice-blue);
}

.hero p.lead {
  font-size: 1.15rem;
  color: var(--text-muted-dark);
  max-width: 55ch;
  margin-bottom: var(--space-lg);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.75rem 1.75rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

/* Primary button — on light background */
.btn-primary {
  background: var(--navy);
  color: var(--text-on-dark);
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  background: var(--navy-mid);
  color: var(--text-on-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

/* Primary button — on dark background */
.btn-primary--light {
  background: var(--ice-blue);
  color: var(--navy);
}

.btn-primary--light:hover {
  background: #D4E8FA;
  color: var(--navy);
}

/* Secondary button */
.btn-secondary {
  background: transparent;
  color: var(--text-on-light);
  border: 1.5px solid var(--border-light);
}

.btn-secondary:hover {
  border-color: var(--navy);
  color: var(--navy);
  background: var(--surface-mid);
}

/* Secondary on dark background */
.btn-secondary--dark {
  background: transparent;
  color: var(--text-on-dark);
  border: 1.5px solid var(--border-dark);
}

.btn-secondary--dark:hover {
  border-color: var(--ice-blue);
  color: var(--ice-blue);
  background: rgba(176, 212, 244, 0.08);
}

/* ---- Cards ---- */
.card {
  background: white;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  transition: all 0.25s ease;
}

.card:hover {
  box-shadow: var(--shadow-lg);
  border-color: rgba(4, 44, 83, 0.15);
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-md);
  background: rgba(4, 44, 83, 0.06);
  color: var(--navy);
}

.card h3 { color: var(--ink); }
.card p { color: var(--slate); font-size: 0.95rem; }

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

/* Cards on dark backgrounds */
.card--dark {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-dark);
}

.card--dark:hover {
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.card--dark h3 {
  color: var(--text-on-dark);
}

.card--dark p {
  color: var(--text-muted-dark);
}

.card--dark .card-icon {
  background: rgba(176, 212, 244, 0.1);
  color: var(--ice-blue);
}

/* ---- Regulation Badge ---- */
.reg-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.reg-badge.active {
  background: rgba(15, 110, 86, 0.2);
  color: #9FE1CB;
  border: 1px solid rgba(15, 110, 86, 0.4);
}

.reg-badge.upcoming {
  background: rgba(186, 117, 23, 0.15);
  color: #FAC775;
  border: 1px solid rgba(186, 117, 23, 0.3);
}

/* ---- Animation Container ---- */
.anim-container {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  margin: var(--space-xl) 0;
  position: relative;
  overflow: hidden;
  min-height: 340px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.anim-container svg {
  width: 100%;
  max-width: 100%;
  height: auto;
}

/* ---- Deployment Tiers ---- */
.tier-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

.tier-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  text-align: center;
  transition: all 0.3s ease;
}

.tier-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: rgba(4, 44, 83, 0.15);
  transform: translateY(-2px);
}

.tier-card .tier-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ice-blue);
  margin-bottom: var(--space-sm);
}

.tier-card h3 {
  font-size: 1.15rem;
  margin-bottom: var(--space-sm);
  color: var(--text-on-dark);
}

.tier-card p {
  font-size: 0.9rem;
  color: var(--text-muted-dark);
  margin: 0 auto;
}

.tier-card .tier-fit {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-dark);
  font-size: 0.85rem;
  color: var(--ice-purple);
  font-weight: 500;
}

.tier-card[style*="border-color: var(--accent)"] {
  border-color: var(--ice-blue) !important;
}

/* ---- Changelog / Releases ---- */
.release-item {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: var(--space-xl);
  padding: var(--space-lg) 0;
  border-bottom: 1px solid var(--mist);
}

.release-item:last-child { border-bottom: none; }

.release-meta {
  text-align: right;
}

.release-version {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
}

.release-date {
  font-size: 0.85rem;
  color: var(--stone);
  margin-top: var(--space-xs);
}

.release-body h4 {
  font-size: 1rem;
  margin-bottom: var(--space-sm);
}

.release-body ul {
  list-style: none;
  padding: 0;
}

.release-body li {
  position: relative;
  padding-left: 1.25rem;
  font-size: 0.9rem;
  color: var(--charcoal);
  margin-bottom: var(--space-xs);
}

.release-body li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 600;
}

.commit-hash {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--stone);
  background: var(--ice);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}

/* ---- MSP Section ---- */
.msp-highlight {
  background: rgba(4, 44, 83, 0.04);
  border: 1px solid rgba(4, 44, 83, 0.15);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
}

.msp-highlight h2 { color: var(--navy); }

/* ---- Contact Form ---- */
.contact-form {
  display: grid;
  gap: var(--space-md);
  max-width: 520px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--charcoal);
  margin-bottom: var(--space-xs);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  border: 1.5px solid var(--mist);
  border-radius: var(--radius);
  background: white;
  color: var(--ink);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(4, 44, 83, 0.08);
}

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

/* ---- Footer ---- */
.footer {
  margin-top: auto;
  padding: var(--space-2xl) 0 var(--space-xl);
  background: var(--surface-dark);
  border-top: 1px solid var(--border-dark);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: start;
  flex-wrap: wrap;
  gap: var(--space-xl);
}

.footer-brand p,
.footer-brand .nav-logo {
  font-size: 0.85rem;
  color: var(--text-muted-dark);
  margin-top: var(--space-sm);
}

.footer-links {
  display: flex;
  gap: var(--space-2xl);
}

.footer-links h4 {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(176, 212, 244, 0.5);
  margin-bottom: var(--space-sm);
}

.footer-links ul {
  list-style: none;
}

.footer-links li { margin-bottom: var(--space-xs); }

.footer-links a {
  font-size: 0.9rem;
  color: var(--text-muted-dark);
}

.footer-links a:hover { color: var(--ice-blue); }

.footer-bottom {
  margin-top: var(--space-xl);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-dark);
  font-size: 0.8rem;
  color: rgba(176, 212, 244, 0.35);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

/* ---- Animations ---- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  opacity: 0;
  animation: fadeInUp 0.6s ease forwards;
}

.fade-in-d1 { animation-delay: 0.1s; }
.fade-in-d2 { animation-delay: 0.2s; }
.fade-in-d3 { animation-delay: 0.3s; }
.fade-in-d4 { animation-delay: 0.4s; }
.fade-in-d5 { animation-delay: 0.5s; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
  section { padding: var(--space-md) 0; }

  .nav-links { display: none; }
  .nav-mobile-toggle { display: block; }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface-dark);
    border-bottom: 1px solid var(--border-dark);
    padding: var(--space-md) var(--space-lg);
    gap: var(--space-md);
  }

  .tier-grid {
    grid-template-columns: 1fr;
  }

  .release-item {
    grid-template-columns: 1fr;
    gap: var(--space-sm);
  }

  .release-meta { text-align: left; }

  .hero h1 { font-size: 1.75rem; }

  .hero-content--split {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-mark svg {
    height: 160px;
  }

  .footer-content { flex-direction: column; }

  .card-grid {
    grid-template-columns: 1fr;
  }
}

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

/* ---- Typography — tighten heading tracking to match mark's precision ---- */
h1 { letter-spacing: -0.025em; }
h2 { letter-spacing: -0.02em; }
h3 { letter-spacing: -0.015em; }

/* ---- Dark section rules ---- */
.dark-section + .dark-section {
  border-top: none;
}

.dark-section h2,
.dark-section h3,
.dark-section h4 {
  color: var(--text-on-dark);
}

.dark-section p {
  color: var(--text-muted-dark);
}

.dark-section a {
  color: var(--ice-blue);
}

.dark-section a:hover {
  color: #D4E8FA;
}

.dark-section .btn-primary--light,
.dark-section .btn-primary--light:hover {
  color: var(--navy);
}

section.dark-section .label,
.hero .label {
  color: var(--ice-purple);
  opacity: 0.85;
}

/* ---- FAQ styles ---- */
.faq-item {
  background: white;
  border: 1px solid var(--border-light);
}

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

.faq-section-title {
  color: var(--navy);
}

.faq-section-title::before {
  background: var(--navy);
}

.source-box {
  border-left-color: var(--navy);
  background: var(--surface-mid);
}

.stat {
  color: var(--navy);
}

.faq-tag--accent {
  background: rgba(4, 44, 83, 0.08);
  color: var(--navy);
}
