/* Flag emoji for Windows, which has no flag glyphs (shows "PL" letters instead).
   Twemoji Country Flags, CC-BY 4.0 (c) Twitter, via country-flag-emoji-polyfill.
   unicode-range keeps it limited to flags; Apple devices use Apple Color Emoji first. */
@font-face {
  font-family: "Twemoji Country Flags";
  src: url("../../../assets/fonts/TwemojiCountryFlags.woff2") format("woff2");
  unicode-range: U+1F1E6-1F1FF, U+1F3F4, U+E0062-E0063, U+E0065, U+E0067, U+E006C, U+E006E, U+E0073-E0074, U+E0077, U+E007F;
  font-display: swap;
}

:root {
  --navy: #163947;
  --navy-dark: #0c242e;
  --gold-start: #ffd25a;
  --gold-end: #f6b93b;
  --text-light: #f2fafd;
  --text-muted: #a9c7d1;
  --card-bg: #17414f;
  --page-bg: var(--navy-dark);
  --header-border: rgba(255,255,255,0.08);
  --overlay-bg: rgba(6, 16, 20, 0.85);
}

html[data-theme="light"] {
  --text-light: #10333f;
  --text-muted: #4c6e78;
  --card-bg: #ffffff;
  --page-bg: #eaf6fa;
  --header-border: rgba(16, 51, 63, 0.08);
  --overlay-bg: rgba(10, 30, 37, 0.85);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--page-bg);
  color: var(--text-light);
  font-family: -apple-system, "Helvetica Neue", "Apple Color Emoji", "Twemoji Country Flags", Arial, sans-serif;
  scroll-behavior: smooth;
  transition: background 0.2s ease, color 0.2s ease;
}

a { color: inherit; }

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px;
}

header.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  max-width: 720px;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
  min-width: 0;
  flex-shrink: 1;
}

.brand img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.brand img.avatar {
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.brand-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

@media (max-width: 480px) {
  .brand-text {
    display: none;
  }
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--card-bg);
  border: none;
  color: var(--text-light);
  font-size: 1rem;
  cursor: pointer;
  line-height: 1;
}

.lang-switch {
  display: flex;
}

/* Language picker: a native <select> (a row of flag links overflowed a phone header). */
.lang-switch select {
  -webkit-appearance: none;
  appearance: none;
  font: inherit;
  font-size: 0.85rem;
  color: var(--text-light);
  background: var(--card-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23888' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 10px center;
  border: none;
  border-radius: 999px;
  padding: 5px 28px 5px 12px;
  cursor: pointer;
}

/* iOS Safari zooms into any form control under 16px when it gets focus. */
@media (max-width: 480px) {
  .lang-switch select { font-size: 16px; }
}

.hero {
  text-align: center;
  padding: 40px 20px 20px;
}

.hero img.app-icon {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

.hero h1 {
  font-size: 2.2rem;
  margin: 20px 0 8px;
}

.hero p.tagline {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 480px;
  margin: 0 auto 24px;
}

.hero p.platforms {
  color: #8a8a8a;
  font-size: 0.75rem;
  max-width: 480px;
  margin: 16px auto 0;
}

.app-store-badge {
  display: inline-block;
  transition: transform 0.15s ease;
}

.app-store-badge:hover {
  transform: translateY(-2px);
}

.app-store-badge img {
  width: 200px;
  height: auto;
  display: block;
}

.download-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.qr-code {
  width: 72px;
  height: 72px;
  border-radius: 10px;
}

html[data-theme="light"] .dark-only { display: none; }
html:not([data-theme="light"]) .light-only { display: none; }

.whats-new {
  text-align: center;
  padding: 8px 20px 0;
}

.whats-new-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold-start), var(--gold-end));
  color: #2b2200;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(0,0,0,0.25);
  transition: transform 0.15s ease;
}

.whats-new-link:hover {
  transform: translateY(-2px);
}

.screenshots {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  overflow-x: auto;
  padding: 24px 20px 8px;
  scroll-snap-type: x mandatory;
}

.screenshots img {
  scroll-snap-align: center;
  border-radius: 20px;
  height: 380px;
  flex: 0 0 auto;
  box-shadow: 0 12px 30px rgba(0,0,0,0.4);
  cursor: zoom-in;
  transition: transform 0.15s ease;
}

.screenshots img:hover {
  transform: translateY(-4px);
}

/* Carousel enhancement - applied by site.js; a .screenshots element
   without this class keeps the plain scrollable listing above as a
   no-JS fallback. */
.screenshots.is-carousel {
  display: block;
  overflow: visible;
  padding: 24px 0 8px;
  scroll-snap-type: none;
}

.carousel {
  position: relative;
  margin: 0 auto;
  padding: 0 48px;
}

.carousel-viewport {
  position: relative;
  overflow: hidden;
}

.carousel-track {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: transform 0.35s cubic-bezier(.4,0,.2,1);
}

@media (prefers-reduced-motion: reduce) {
  .carousel-track {
    transition: none;
  }
}

.carousel-track img {
  scroll-snap-align: unset;
  flex: 0 0 auto;
  width: 220px;
  height: 477px;
  object-fit: cover;
  border-radius: 20px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.4);
  cursor: zoom-in;
}

.carousel-track img:hover {
  transform: none;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--card-bg);
  color: var(--text-light);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
}

.carousel-btn:hover {
  transform: translateY(-50%) scale(1.08);
}

.carousel-btn:focus-visible {
  outline: 2px solid var(--gold-end);
  outline-offset: 2px;
}

.carousel-btn.prev { left: 0; }
.carousel-btn.next { right: 0; }

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}

.carousel-dots button {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: var(--text-muted);
  opacity: 0.4;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.carousel-dots button:focus-visible {
  outline: 2px solid var(--gold-end);
  outline-offset: 2px;
}

.carousel-dots button.active {
  opacity: 1;
  background: var(--gold-end);
  transform: scale(1.2);
}

.carousel-caption {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 10px;
  min-height: 1.4em;
  padding: 0 20px;
}

.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1000;
  cursor: zoom-out;
}

.lightbox-overlay img {
  width: 92vw;
  height: 88vh;
  object-fit: contain;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
}

section.features {
  padding: 40px 20px;
}

section.features h2 {
  text-align: center;
  margin-bottom: 24px;
}

.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 560px) {
  .feature-grid { grid-template-columns: 1fr 1fr; }
}

.feature-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 16px 18px;
}

.feature-card h3 {
  margin: 0 0 6px;
  font-size: 1rem;
  color: var(--gold-start);
}

.feature-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.4;
}

footer.site-footer {
  border-top: 1px solid var(--header-border);
  margin-top: 40px;
  padding: 24px 20px 40px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

footer.site-footer a {
  color: var(--text-light);
  text-decoration: underline;
}

footer.site-footer .lang-switch {
  justify-content: center;
  margin: 12px 0;
}

.legal {
  padding: 40px 20px 60px;
  line-height: 1.6;
}

.legal h1 {
  font-size: 1.6rem;
}

.legal h2 {
  font-size: 1.15rem;
  color: var(--gold-start);
  margin-top: 28px;
}

.legal p, .legal li {
  color: var(--text-muted);
}

.legal .updated {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 24px;
}

.back-link {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
}
