﻿:root {
  color-scheme: light dark;
  font-size: 18px;
  --bg-main: #f9fafc;
  --bg-card: #ffffff;
  --bg-accent: #005fa3;
  --bg-accent-hover: #00497d;
  --text-main: #1b1b1b;
  --text-muted: #3e4a59;
  --border-soft: #d8dee7;
  --shadow-soft: 0 12px 32px rgba(0, 40, 80, 0.12);
}

.theme-dark {
  --bg-main: #101418;
  --bg-card: #182029;
  --bg-accent: #ffd447;
  --bg-accent-hover: #ffb300;
  --text-main: #f4f6f9;
  --text-muted: #d0d6e1;
  --border-soft: #2b3440;
  --shadow-soft: 0 16px 36px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg-main);
  color: var(--text-main);
  font-family: "Segoe UI", Arial, sans-serif;
  line-height: 1.5;
}

h1,
 h2,
 h3 {
  margin: 0;
  font-weight: 700;
  letter-spacing: 0.01em;
}

ul {
  padding-left: 1.5rem;
}

button,
 select {
  font-family: inherit;
  font-size: 1rem;
}

button {
  cursor: pointer;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1.25rem 2rem;
  padding: 1.25rem 5vw;
  background: #ffffff;
  color: #0a2540;
  border-bottom: 1px solid #e6ecf2;
}

.topbar .brand {
  max-width: 560px;
}

.topbar .brand h1 {
  font-size: clamp(2.6rem, 5.5vw, 3.6rem);
  line-height: 1.05;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}


.topbar p {
  margin-top: 0.35rem;
  font-size: 1.05rem;
  color: #334155;
}

.topbar nav {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex: 1 1 auto;
}

.topbar nav a {
  color: #0b4a78;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
}

.topbar nav a:hover,
.topbar nav a:focus-visible {
  text-decoration: underline;
}

.topbar .actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

#theme-toggle {
  border: none;
  border-radius: 999px;
  padding: 0.75rem 1.25rem;
  background: #0b6fc2;
  color: #ffffff;
  font-weight: 700;
  min-height: 44px;
}

#theme-toggle:focus-visible,
#theme-toggle:hover {
  outline: 3px solid rgba(255, 255, 255, 0.75);
  outline-offset: 2px;
}

.open-mode {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-weight: 600;
}

.open-mode span {
  font-size: 0.95rem;
}

.open-mode select {
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  padding: 0.55rem 0.9rem;
  min-height: 44px;
  background: #f1f5f9;
  color: #0a2540;
  font-weight: 600;
}

main {
  padding: 2rem 5vw 3rem;
}

.content {
  background: var(--bg-card);
  color: var(--text-main);
  border-radius: 20px;
  box-shadow: var(--shadow-soft);
  padding: 1.75rem;
  margin: 0 auto 2rem;
  border: 1px solid var(--border-soft);
  max-width: 860px;
}

.intro {
  background: var(--bg-card);
  color: var(--text-main);
  border-radius: 20px;
  box-shadow: var(--shadow-soft);
  padding: 1.75rem;
  margin-bottom: 2rem;
  border: 1px solid var(--border-soft);
}

.intro a {
  color: var(--bg-accent);
  font-weight: 700;
  text-decoration: none;
}

.intro a:visited {
  color: var(--bg-accent);
}

.intro a:hover,
.intro a:focus-visible {
  text-decoration: underline;
}

.intro ul {
  margin: 0 0 1.5rem;
  color: var(--text-muted);
}

#install-button {
  border: none;
  border-radius: 12px;
  padding: 0.9rem 1.8rem;
  background: var(--bg-accent);
  color: #101418;
  font-weight: 700;
  min-height: 52px;
}

#install-button:hover,
#install-button:focus-visible {
  background: var(--bg-accent-hover);
  color: #0a0d12;
}

.cards {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: var(--bg-card);
  border-radius: 24px;
  padding: 1.5rem;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover,
.card:focus-within {
  transform: translateY(-4px);
  box-shadow: 0 18px 38px rgba(0, 82, 138, 0.18);
}

.card__icon {
  width: clamp(96px, 20vw, 120px);
  height: clamp(96px, 20vw, 120px);
  object-fit: cover;
  border-radius: 20px;
  align-self: center;
}

.card__title {
  font-size: 1.35rem;
}

.card__description {
  margin: 0;
  color: var(--text-muted);
}

.card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: auto;
}

.card__button {
  flex: 1 1 200px;
  min-height: 52px;
  border-radius: 14px;
  border: none;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: var(--bg-accent);
  color: #0a0d12;
}

.card__button.secondary {
  background: transparent;
  border: 2px solid var(--bg-accent);
  color: var(--bg-accent);
}

.card__button:hover,
.card__button:focus-visible {
  background: var(--bg-accent-hover);
  color: #0a0d12;
}

.card__button.secondary:hover,
.card__button.secondary:focus-visible {
  background: var(--bg-accent);
  color: #0a0d12;
}

/* Light theme: stronger contrast on primary buttons */
.theme-light .card__button { color: #ffffff; }
.theme-light #install-button { color: #ffffff; }

.site-footer {
  padding: 2rem 5vw;
  text-align: center;
  background: #f2f5f9;
  color: #0a2540;
  border-top: 1px solid #e6ecf2;
  font-size: 0.95rem;
}

.site-footer a {
  color: #0b4a78;
  font-weight: 700;
  text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  text-decoration: underline;
}

/* Keep footer colors fixed even in dark theme */
.theme-dark .site-footer {
  background: #f2f5f9;
  color: #0a2540;
  border-top: 1px solid #e6ecf2;
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(4, 12, 24, 0.75);
}

.modal__content {
  position: relative;
  z-index: 1;
  width: min(960px, 92vw);
  height: min(680px, 85vh);
  background: var(--bg-card);
  color: var(--text-main);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border-soft);
}

.modal__header,
.modal__footer {
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.modal__header {
  border-bottom: 1px solid var(--border-soft);
}

.modal__footer {
  border-top: 1px solid var(--border-soft);
}

.modal__close,
.modal__open-tab {
  border: none;
  border-radius: 12px;
  padding: 0.7rem 1.4rem;
  background: var(--bg-accent);
  color: #0a0d12;
  font-weight: 700;
}

.modal__close {
  align-self: flex-start;
  font-size: 1.25rem;
  width: 44px;
  height: 44px;
  padding: 0;
}

.modal__open-tab {
  margin-left: auto;
}

.modal__close:hover,
.modal__close:focus-visible,
.modal__open-tab:hover,
.modal__open-tab:focus-visible {
  background: var(--bg-accent-hover);
}

#modal-frame {
  flex: 1 1 auto;
  border: none;
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  border-radius: 0;
  background: #0a1420;
}

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

@media (max-width: 720px) {
  .topbar {
    padding: 1rem 1.25rem;
  }

  .topbar .brand h1 {
    font-size: 1.85rem;
    white-space: nowrap;
  }

  .topbar .brand,
  .topbar nav,
  .topbar .actions {
    flex: 1 1 100%;
  }

  .topbar nav {
    order: 2;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    white-space: normal;
    flex-wrap: wrap;
    max-width: 100%;
    justify-content: center;
    padding-bottom: 0.25rem;
  }

  .topbar nav::-webkit-scrollbar { display: none; }

  main {
    padding: 1.5rem;
  }

  #theme-toggle,
  .open-mode select {
    width: 100%;
  }

  .topbar .actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .modal {
    padding: 0.75rem;
  }

  .modal__content {
    width: 100%;
    height: 100%;
    border-radius: 0;
  }
}






