:root {
  --primary: #00508F;
  --primary-dark: #003c6c;
  --bg-light: #f9fafc;
  --bg-highlight: #eaf4ff;
  --bg-dark: #0f172a;
  --text-light: #f2f2f2;
  --text-dark: #1a1a1a;
  --shadow-light: rgba(0,0,0,0.1);
  --shadow-dark: rgba(0,0,0,0.4);
  --max-width: 1200px;
  --transition: 0.4s ease;
}

/* --- GLOBAL --- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  margin: 0;
  background: white;
  color: var(--text-dark);
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition), color var(--transition);
}

/* --- LINKS --- */
a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.5s ease, text-decoration-color 0.25s ease;
}
a:hover, a:focus {
  color: var(--primary-dark);
  text-decoration: underline;
  text-decoration-color: var(--primary-dark);
}
a:active { color: #002a4f; }
a:visited { color: #4b6ea8; }

/* --- HEADER --- */
header {
  text-align: center;
  padding: 4rem 1.5rem 3rem;
  background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 60%, #eaf2f8 100%);
  position: relative;
  overflow: hidden;
}
header::before {
  content: "";
  position: absolute;
  top: -150px;
  left: 50%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(0,80,143,0.25) 0%, transparent 70%);
  transform: translateX(-50%);
}
header img.logo {
  width: 110px;
  margin-bottom: 1rem;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.25));
}
header h1 {
  font-size: 2.1rem;
  color: var(--primary);
  margin: 0.4rem 0;
  font-weight: 700;
  letter-spacing: -0.02em;
}
header p {
  font-size: 1.05rem;
  color: #444;
  max-width: 480px;
  margin: 0.5rem auto 1.8rem;
  line-height: 1.6;
}

/* --- BUTTONS --- */
.button-group a {
  display: inline-block;
  margin: 0.3rem;
  padding: 0.7rem 2rem;
  border-radius: 999px;
  font-weight: 600;
  color: white;
  background: linear-gradient(145deg, var(--primary), var(--primary-dark));
  box-shadow: 0 3px 12px rgba(0,80,143,0.35);
  transition: all var(--transition);
}
.button-group a:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,80,143,0.45);
}

/* --- SECTIONS --- */
section {
  max-width: var(--max-width);
  margin: 3rem auto;
  padding: 0 1.5rem;
  text-align: center;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
section.visible { opacity: 1; transform: translateY(0); }
section h2 {
  font-size: 1.8rem;
  color: var(--primary-dark);
  margin-bottom: 0.7rem;
}
section p {
  font-size: 1.05rem;
  color: #555;
  margin: 0 auto 2rem;
  line-height: 1.6;
}

/* --- FEATURES --- */
.feature-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
  text-align: left;
}
.feature {
  display: flex;
  gap: 1rem;
  background: var(--bg-light);
  padding: 1.2rem 1.5rem;
  border-radius: 12px;
  box-shadow: 0 5px 18px rgba(0,0,0,0.05);
  transition: transform var(--transition), box-shadow var(--transition);
}

.feature:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 22px var(--shadow-light);
}
.feature img.icon {
  width: 24px;
  height: 24px;
  margin-top: 0.1rem;
  filter: invert(22%) sepia(95%) saturate(2475%) hue-rotate(192deg) brightness(74%) contrast(101%);
}
.feature h3 { margin: 0; color: var(--primary); font-size: 1.05rem; }
.feature p { margin: 0.3rem 0 0; color: #333; font-size: 0.95rem; line-height: 1.5; }
.feature.full { background: var(--bg-highlight);
    border-left: 2px solid rgb(from var(--primary) r g b / 1);}

/* --- SCREENSHOTS --- */
.screenshots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  justify-items: center;
  margin-top: 1.5rem;
}
.screenshots figure {
  text-align: center;
  max-width: 300px;
}
.screenshots img {
  width: 100%;
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.15);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
}
.screenshots img:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 25px rgba(0,0,0,0.25);
}
.screenshots figcaption {
  margin-top: 0.3rem;
  font-size: 0.9rem;
  color: var(--primary-dark);
  font-weight: 300;
}

/* --- FOOTER --- */
footer {
  background: var(--primary-dark);
  color: white;
  text-align: center;
  padding: 2.5rem 1rem;
  font-size: 0.9rem;
}
footer a { color: #cce7ff; text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* --- TEXTPAGES --- */
.textpage {
  text-align: left;
  line-height: 1.7;
  font-size: 1.05rem;
}
.textpage h2, .textpage h3 {
  margin-top: 2rem;
  color: var(--primary-dark);
}
.textpage ul {
  margin: 0 0 1.5rem 1.2rem;
  padding-left: 1rem;
}
.textpage li { margin-bottom: 0.4rem; }

/* --- LIGHTBOX --- */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: 999;
}
.lightbox.active { display: flex; }
.lightbox img {
  max-width: 90%;
  max-height: 80%;
  border-radius: 12px;
  box-shadow: 0 0 30px rgba(0,0,0,0.6);
}
.lightbox .caption {
  margin-top: 1rem;
  color: white;
  font-size: 1rem;
  text-align: center;
}
.lightbox .nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.15);
  border: none;
  color: white;
  font-size: 2rem;
  padding: 0.5rem 1rem;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.2s ease;
}
.lightbox .nav:hover { background: rgba(255,255,255,0.3); }
.lightbox .prev { left: 2rem; }
.lightbox .next { right: 2rem; }

/* --- UPDATE POPUP --- */
.update-popup {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.update-popup.active { opacity: 1; pointer-events: auto; }
.update-popup-content {
  background: white;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  padding: 2rem 2.5rem;
  max-width: 480px;
  width: 90%;
  color: var(--text-dark);
  position: relative;
  animation: popupFadeIn 0.4s ease;
}
.update-popup-content h3 {
  color: var(--primary-dark);
  margin-top: 0;
  font-size: 1.4rem;
  text-align: center;
}
.update-popup-content ul {
  margin: 1rem 0 0;
  padding-left: 1.2rem;
  text-align: left;
  line-height: 1.5;
}
.update-close {
  position: absolute;
  top: 0.6rem;
  right: 0.8rem;
  background: transparent;
  border: none;
  font-size: 1.8rem;
  color: var(--primary-dark);
  cursor: pointer;
  transition: color 0.2s ease;
}
.update-close:hover { color: var(--primary); }

@keyframes popupFadeIn {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* --- RESPONSIVE --- */
@media (max-width: 600px) {
  header h1 { font-size: 1.8rem; }
  section h2 { font-size: 1.5rem; }
  footer { font-size: 0.8rem; }
}

/* --- DARK MODE --- */
@media (prefers-color-scheme: dark) {
  body { background: var(--bg-dark); color: var(--text-light); }

  a { color: #7dd3fc; }
  a:hover, a:focus { color: #bae6fd; text-decoration: underline; }
  a:visited { color: #9ec5f8; }

  header { background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%); }
  header h1 { color: #6bb5ff; }
  header p { color: #cbd5e1; }

  section h2, section h3, .textpage h2, .textpage h3 {
    color: #9dd5ff;
    text-shadow: 0 0 8px rgba(100,180,255,0.15);
  }
  section p, section li, .textpage p, .textpage li { color: #e5e7eb; }

  .feature {
    background: #1e293b;
    box-shadow: 0 5px 18px var(--shadow-dark);
  }
  .feature h3 { color: #7dd3fc; }
  .feature p { color: #e2e8f0; }
  .feature.full { background: rgba(56,189,248,0.1); }

  .screenshots img { box-shadow: 0 0 18px rgba(255,255,255,0.08); }
  .screenshots figcaption { color: #9dd5ff; text-shadow: 0 0 6px rgba(100,180,255,0.25); }

  footer { background: #1E2638; }

  .update-popup-content {
    background: #1e293b;
    color: #e5e7eb;
  }
  .update-popup-content h3, .update-close { color: #9dd5ff; }
  .update-close:hover { color: #bae6fd; }
}
