/* Flit homepage
   Colors come from the app icon. Dark mode follows the visitor's system setting. */

:root {
  color-scheme: light dark;

  --bg: #F4F1E7;
  --text: #1F2A19;
  --muted: #566049;
  --card: #FBF9F2;
  --border: #DCD7C6;
  --btn-bg: #55683F;
  --btn-text: #F4F1E7;
  --outline: #55683F;
  --link: #3F5030;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1A2115;
    --text: #F4F1E7;
    --muted: #B5BCA8;
    --card: #232C1D;
    --border: #36422D;
    --btn-bg: #8CA374;
    --btn-text: #172011;
    --outline: #8CA374;
    --link: #C9D6B8;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

/* Layout */

.page {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 32px 24px 24px;
}

/* Hero */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 640px;
  text-align: center;
}

.hero-icon {
  display: block;
  width: 88px;
  height: 88px;
}

h1 {
  margin: 0;
  font-size: 56px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
}

.tagline {
  margin: 0;
  font-size: 20px;
  line-height: 1.45;
  color: var(--muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
}

.btn-primary {
  background: var(--btn-bg);
  color: var(--btn-text);
}

.btn-primary:hover {
  filter: brightness(1.1);
}

.btn-outline {
  border: 1.5px solid var(--outline);
  color: var(--link);
}

.btn-outline:hover {
  background: var(--card);
}

.version {
  padding-left: 10px;
  border-left: 1px solid currentColor;
  font-size: 14px;
  font-weight: 500;
}

.version[hidden] {
  display: none;
}

.platforms {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0 8px;
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.platform-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 6px;
  color: var(--link);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.platform-link[hidden] {
  display: none;
}

/* Screenshots */

.shots {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 720px;
}

.shot {
  min-width: 0;
  margin: 0;
}

.shot > img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  box-shadow: 0 10px 32px rgb(31 42 25 / 10%);
}

.shot figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.shot-thumbnails {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 5px 5px 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--muted) transparent;
  overscroll-behavior: contain;
}

.shot-thumb {
  flex: 0 0 144px;
  min-width: 0;
  scroll-margin: 5px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.shot-thumb:hover {
  border-color: var(--outline);
}

.shot-thumb[aria-pressed="true"] {
  border-color: var(--outline);
  box-shadow: 0 0 0 1px var(--outline);
}

.shot-thumb:focus-visible {
  outline: 3px solid var(--outline);
  outline-offset: 4px;
}

.shot-thumb img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  border-radius: 4px;
}

.shot-thumb-title {
  display: block;
  margin-top: 6px;
  padding: 0 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 700;
}

/* The selected caption names the theme without repeating it on every thumbnail. */
.shot-thumb-theme {
  display: none;
}

@media (min-width: 768px) and (max-height: 800px) {
  .shots {
    max-width: 560px;
  }
}

/* Features */

.features {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  width: 100%;
  max-width: 1000px;
}

.feature {
  display: flex;
  flex: 1 1 240px;
  flex-direction: column;
  gap: 8px;
}

.feature h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.feature p {
  margin: 0;
  font-size: 16px;
  color: var(--muted);
}

/* Footer */

.footer {
  display: flex;
  flex-wrap: wrap;
  margin-top: auto; /* pins the footer to the bottom when the page is short */
  justify-content: center;
  gap: 8px 24px;
  font-size: 14px;
  color: var(--muted);
  text-align: center;
}

.footer a {
  color: var(--link);
}

@media (max-width: 480px) {
  .page {
    padding-top: 40px;
  }

  h1 {
    font-size: 44px;
  }
}
