:root {
  color-scheme: dark;
  --bg: #080c13;
  --bg-elevated: #0e1520;
  --surface: rgba(18, 27, 40, 0.88);
  --surface-solid: #131d2a;
  --surface-hover: #192638;
  --text: #f3f7fb;
  --text-dim: #9aa9bc;
  --text-soft: #c7d1dc;
  --accent: #66d4ff;
  --accent-strong: #42bdf2;
  --accent-2: #a78bfa;
  --accent-warm: #ffb86b;
  --border: rgba(164, 190, 222, 0.16);
  --border-strong: rgba(102, 212, 255, 0.34);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.3);
  --max-width: 780px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background:
    radial-gradient(circle at 12% 8%, rgba(102, 212, 255, 0.12), transparent 28rem),
    radial-gradient(circle at 88% 75%, rgba(167, 139, 250, 0.1), transparent 30rem),
    linear-gradient(180deg, #0b111a 0%, var(--bg) 62%, #070a10 100%);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.6;
}

::selection {
  background: rgba(102, 212, 255, 0.28);
  color: var(--text);
}

a {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration: underline;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--border);
  background: rgba(8, 12, 19, 0.78);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
  backdrop-filter: blur(18px) saturate(135%);
}

nav {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.5rem;
  position: relative;
}

.brand {
  display: inline-flex;
  align-items: center;
  color: var(--text);
  font-weight: 780;
  font-size: 1.18rem;
  letter-spacing: -0.025em;
}

.brand:hover {
  color: #ffffff;
  text-decoration: none;
  filter: brightness(1.12);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links > li > a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 0.45rem 0.72rem;
  color: var(--text-dim);
  font: inherit;
  font-size: 0.93rem;
  font-weight: 560;
  line-height: 1;
  transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.nav-links > li > a:hover,
.nav-links > li > a.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
  border-color: var(--border);
  text-decoration: none;
}

.nav-links > li > a.active {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(102, 212, 255, 0.13), rgba(167, 139, 250, 0.09));
  border-color: rgba(102, 212, 255, 0.2);
}

.nav-toggle {
  display: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  padding: 0.43rem 0.65rem;
  font: inherit;
  font-size: 1rem;
  cursor: pointer;
}

.nav-toggle:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--border-strong);
}

main {
  flex: 1;
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 5rem;
}

h1,
h2,
h3 {
  line-height: 1.2;
  letter-spacing: -0.025em;
}

h1 {
  margin: 0 0 0.35rem;
  color: var(--text);
  font-size: clamp(2rem, 5vw, 2.55rem);
  font-weight: 780;
}

.center-page > h1 {
  font-size: clamp(3.25rem, 10vw, 5rem);
  letter-spacing: -0.045em;
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .brand,
  .center-page > h1,
  .page-header h1,
  .app-hero h1 {
    background: linear-gradient(110deg, #ffffff 12%, #bcecff 48%, #cfbfff 74%, #ffffff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}

.subtitle {
  color: var(--text-dim);
  font-size: 1.08rem;
  margin-top: 0;
  margin-bottom: 2rem;
}

.card {
  position: relative;
  background: linear-gradient(145deg, rgba(21, 31, 46, 0.92), rgba(14, 21, 32, 0.9));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.55rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.16);
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(102, 212, 255, 0.45), rgba(167, 139, 250, 0.28), transparent);
  opacity: 0.72;
}

.card h2 {
  margin-top: 0;
  font-size: 1.22rem;
}

.card p:last-child {
  margin-bottom: 0;
}

/* Centered "business card" page layout */
.center-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: calc(100vh - 65px - 62px);
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.center-page .card {
  width: 100%;
  box-shadow: var(--shadow);
}

.contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.contact-list li {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 0.5rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
  min-width: 0;
}

.contact-list li a {
  min-width: 0;
  overflow-wrap: anywhere;
}

.contact-list li:last-child {
  border-bottom: none;
}

.contact-list .label {
  color: var(--text-dim);
  min-width: 90px;
  flex-shrink: 0;
  text-align: right;
}

.empty-state {
  color: var(--text-dim);
  font-style: italic;
}

.page-header {
  text-align: center;
  margin-bottom: 0.4rem;
}

.donation-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 1.4rem 0 0;
  padding: 1.5rem 1.35rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(102, 212, 255, 0.08), rgba(167, 139, 250, 0.07)),
    rgba(14, 21, 32, 0.78);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.14);
  text-align: center;
}

.donation-copy h2 {
  margin: 0 0 0.25rem;
  font-size: 1.08rem;
}

.donation-copy p {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.92rem;
}

.donation-button {
  flex-shrink: 0;
}

.downloads-section-break {
  height: 1px;
  margin: 2.75rem 0;
  background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
}

.download-grid {
  display: grid;
  gap: 1.25rem;
}

.download-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.65rem;
}

.download-item h3 {
  margin: 0;
  font-size: 1.18rem;
}

.download-item p {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.94rem;
}

.btn {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent), #8fe3ff);
  color: #071018;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 9px 24px rgba(66, 189, 242, 0.18);
  font-weight: 720;
  padding: 0.58rem 1.08rem;
  border-radius: 9px;
  white-space: nowrap;
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.btn:hover {
  color: #071018;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(66, 189, 242, 0.26);
  filter: brightness(1.04);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}

.btn-secondary:hover {
  color: #ffffff;
  border-color: var(--border-strong);
  background: rgba(102, 212, 255, 0.07);
  box-shadow: none;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.btn-note {
  color: var(--text-dim);
  font-size: 0.84rem;
  margin-top: 0.75rem;
  text-align: center;
}

code {
  color: #d9cfff;
  background: rgba(167, 139, 250, 0.1);
  border: 1px solid rgba(167, 139, 250, 0.15);
  border-radius: 5px;
  padding: 0.08em 0.35em;
}

/* App hero (RouteTake-style pages) */
.app-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 2rem;
}

.app-hero .subtitle {
  max-width: 680px;
}

.app-logo {
  display: block;
  width: 68px;
  height: 68px;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 16px 38px rgba(242, 140, 84, 0.22);
  margin-bottom: 1.15rem;
}

/* RouteTake screenshots */
.screenshot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin: 2rem 0;
}

.screenshot-card {
  appearance: none;
  width: 100%;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(21, 31, 46, 0.92), rgba(14, 21, 32, 0.9));
  color: var(--text);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.16);
}

.screenshot-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.22);
}

.screenshot-card:focus-visible {
  outline-offset: 4px;
}

.screenshot-frame {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  background:
    linear-gradient(145deg, rgba(102, 212, 255, 0.045), rgba(167, 139, 250, 0.035)),
    rgba(14, 21, 32, 0.82);
}

.screenshot-preview {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: rgba(14, 21, 32, 0.82);
}

.screenshot-caption {
  display: block;
  padding: 0.95rem 1rem 1rem;
  font-size: 0.96rem;
  font-weight: 700;
}

.screenshot-caption-detail {
  display: block;
  margin-top: 0.12rem;
  color: var(--text-dim);
  font-size: 0.82rem;
  font-weight: 500;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  appearance: none;
  border: 0;
  background: rgba(6, 10, 16, 0.82);
  cursor: pointer;
}

.lightbox-content {
  position: relative;
  z-index: 1;
  margin: 0;
  max-width: min(1000px, calc(100vw - 3rem));
  max-height: calc(100vh - 3rem);
  display: grid;
  gap: 0.85rem;
}

.lightbox-content img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 8rem);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.38);
  background: rgba(14, 21, 32, 0.96);
}

.lightbox-content figcaption {
  color: var(--text-soft);
  text-align: center;
  font-size: 0.92rem;
}

body.lightbox-open {
  overflow: hidden;
}

.feature-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.78rem;
  text-align: left;
}

.feature-list li {
  padding-left: 1.55rem;
  position: relative;
}

.feature-list li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  top: 0.02rem;
  color: var(--accent);
  font-weight: 800;
}

footer {
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem;
  color: var(--text-dim);
  font-size: 0.83rem;
  border-top: 1px solid var(--border);
  text-align: center;
  box-sizing: border-box;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 640px) {
  nav {
    padding: 0.78rem 1rem;
  }

  .nav-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: calc(100% + 1px);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
    background: rgba(8, 12, 19, 0.98);
    border-bottom: 1px solid var(--border);
    padding: 0.8rem 1rem 1rem;
    box-shadow: 0 18px 35px rgba(0, 0, 0, 0.32);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links > li > a {
    width: 100%;
    justify-content: space-between;
    padding: 0.68rem 0.75rem;
  }

  main {
    padding: 2.7rem 1rem 4rem;
  }

  .center-page {
    min-height: auto;
    padding-top: 3.4rem;
    padding-bottom: 3.4rem;
  }

  .card {
    padding: 1.25rem;
  }

  .contact-list li {
    align-items: center;
    flex-direction: column;
    gap: 0.05rem;
  }

  .contact-list .label {
    min-width: 0;
    text-align: center;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
  }

  .donation-button {
    width: 100%;
    text-align: center;
  }

  .downloads-section-break {
    margin: 2.25rem 0;
  }

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