:root {
  --font-sans: "Cantarell", ui-sans-serif, system-ui, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", monospace;

  --bg:           #f6f5f4;
  --bg-card:      #ffffff;
  --bg-sidebar:   #ffffff;
  --surface:      #ebebeb;
  --border:       rgba(0,0,0,.10);
  --border-strong: rgba(0,0,0,.18);

  --text:         #1e1e1e;
  --text-muted:   #5e5c64;
  --text-hint:    #9a9996;

  --accent:       #1c71d8;
  --accent-hover: #1b66c9;
  --accent-text:  #ffffff;

  --gnome-circle: #3d3b8e;

  --radius-sm:    6px;
  --radius-md:    12px;
  --radius-lg:    16px;
  --radius-xl:    20px;

  --shadow-card:  0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
  --shadow-img:   0 2px 8px rgba(0,0,0,.15), 0 8px 32px rgba(0,0,0,.12);

  --nav-height:   56px;
  --transition:   160ms cubic-bezier(.4,0,.2,1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:           #1e1e1e;
    --bg-card:      #2e2e2e;
    --bg-sidebar:   #2e2e2e;
    --surface:      #393939;
    --border:       rgba(255,255,255,.10);
    --border-strong: rgba(255,255,255,.18);

    --text:         #ffffff;
    --text-muted:   #c0bfbc;
    --text-hint:    #77767b;

    --accent:       #3584e4;
    --accent-hover: #4a91e8;

    --gnome-circle: #7b78e9;

    --shadow-card:  0 1px 3px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
    --shadow-img:   0 2px 8px rgba(0,0,0,.4), 0 8px 32px rgba(0,0,0,.3);
  }
}

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

html {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
h1, h2, h3 { font-weight: 700; line-height: 1.2; }
ul { list-style: none; }

.container {
  width: 100%;
  max-width: 960px;
  margin-inline: auto;
  padding-inline: 24px;
}

main { flex: 1; padding-bottom: 64px; }

.top-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.top-bar-inner {
  max-width: 960px;
  margin-inline: auto;
  padding-inline: 24px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  color: var(--text);
}
.nav-logo-icon { width: 28px; height: 28px; color: var(--accent); }
.nav-logo-text { font-size: 15px; font-weight: 400; letter-spacing: -.01em; }
.nav-logo-text strong { font-weight: 700; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}
.nav-links a {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
}
.nav-links a:hover {
  background: var(--surface);
  color: var(--text);
}

.nav-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9999px;
  padding: 6px 14px;
  transition: border-color var(--transition);
}
.nav-search:focus-within { border-color: var(--accent); }
.nav-search svg { width: 14px; height: 14px; flex-shrink: 0; color: var(--text-muted); }
.nav-search input {
  border: none;
  background: transparent;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  outline: none;
  width: 160px;
}
.nav-search input::placeholder { color: var(--text-hint); }

.breadcrumb-bar {
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}
.breadcrumb-bar .container {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  font-size: 13px;
  color: var(--text-muted);
}
.breadcrumb-bar a {
  color: var(--accent);
  transition: opacity var(--transition);
}
.breadcrumb-bar a:hover { opacity: .8; }
.breadcrumb-bar svg { width: 12px; height: 12px; opacity: .5; }
.breadcrumb-bar span { color: var(--text); }

.app-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  align-items: start;
  padding-top: 40px;
  padding-bottom: 40px;
}

.app-header-icon-wrap {
  padding-top: 4px;
}

.app-icon {
  width: 96px;
  height: 96px;
  border-radius: var(--radius-xl);
  flex-shrink: 0;
}

.app-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.1;
  margin-bottom: 2px;
}

.app-developer {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.app-developer a { color: var(--accent); }
.app-developer a:hover { text-decoration: underline; }

.app-summary {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 14px;
  max-width: 480px;
}

.app-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .01em;
  border: 1px solid transparent;
}
.badge-free {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 25%, transparent);
}
.badge-oss {
  background: color-mix(in srgb, #2ec27e 10%, transparent);
  color: #2ec27e;
  border-color: color-mix(in srgb, #2ec27e 25%, transparent);
}
.badge-gnome {
  background: color-mix(in srgb, var(--gnome-circle) 10%, transparent);
  color: var(--gnome-circle);
  border-color: color-mix(in srgb, var(--gnome-circle) 25%, transparent);
}

.app-header-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  padding-top: 4px;
  flex-shrink: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font: 600 14px / 1 var(--font-sans);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.btn:active { transform: scale(.98); }

.btn-install {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
  box-shadow: 0 1px 4px color-mix(in srgb, var(--accent) 40%, transparent);
  padding: 12px 22px;
  font-size: 14px;
}
.btn-install:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 45%, transparent);
}
.btn-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.btn-alt {
  background: var(--bg-card);
  color: var(--text);
  border-color: var(--border-strong);
  font-size: 13px;
  padding: 9px 18px;
}
.btn-alt:hover {
  background: var(--surface);
}

.install-hint {
  font-size: 12px;
  color: var(--text-hint);
  text-align: right;
}

.screenshots-section {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 32px 0 24px;
  overflow: hidden;
}

.screenshots-carousel {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 960px;
  margin-inline: auto;
}

.carousel-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), opacity var(--transition), box-shadow var(--transition);
  box-shadow: 0 1px 4px rgba(0,0,0,.10);
  margin: 0 8px;
}
.carousel-btn svg { width: 16px; height: 16px; }
.carousel-btn:hover { background: var(--surface); box-shadow: 0 2px 8px rgba(0,0,0,.14); }
.carousel-btn:active { transform: scale(.95); }
.carousel-btn:disabled { opacity: .3; cursor: default; pointer-events: none; }

.screenshots-track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 4px 4px 12px;
  flex: 1;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.screenshots-track::-webkit-scrollbar { display: none; }

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 14px;
}
.carousel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: none;
  background: var(--border-strong);
  cursor: pointer;
  padding: 0;
  transition: background var(--transition), width var(--transition);
}
.carousel-dot.active {
  background: var(--accent);
  width: 20px;
  border-radius: 3px;
}

.screenshot-figure {
  flex-shrink: 0;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.screenshot-figure img {
  width: auto;
  max-height: 380px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-img);
  object-fit: cover;
}

.screenshot-figure figcaption {
  font-size: 12px;
  color: var(--text-hint);
  text-align: center;
  font-weight: 500;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.app-body {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 40px;
  padding-top: 40px;
  align-items: start;
}

.app-description h2 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--text-hint);
  margin-bottom: 14px;
  margin-top: 32px;
}
.app-description h2:first-child { margin-top: 0; }

.app-description p {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.75;
  max-width: 60ch;
  margin-bottom: 14px;
}
.app-description p:last-child { margin-bottom: 0; }

.changelog-entry {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
}
.changelog-version {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  letter-spacing: .02em;
}
.changelog-entry ul {
  padding-left: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.changelog-entry li {
  font-size: 14px;
  color: var(--text-muted);
  display: flex;
  gap: 10px;
}
.changelog-entry li::before {
  content: "·";
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
}

.app-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: calc(var(--nav-height) + 40px + 1px);
}

.sidebar-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-card);
}

.sidebar-card h2 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-hint);
  margin-bottom: 14px;
}

.info-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.info-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.info-row:last-child { border-bottom: none; padding-bottom: 0; }
.info-row:first-child { padding-top: 0; }
.info-row dt {
  font-size: 13px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.info-row dd {
  font-size: 13px;
  font-weight: 500;
  text-align: right;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 160px;
}
.info-row dd a {
  color: var(--accent);
}
.info-row dd a:hover { text-decoration: underline; }
.app-id-text {
  font-family: var(--font-mono);
  font-size: 11px !important;
  color: var(--text-hint) !important;
  font-weight: 400 !important;
}

.sidebar-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  transition: background var(--transition), color var(--transition);
}
.sidebar-link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--text-muted);
}
.sidebar-link:hover {
  background: var(--surface);
  color: var(--accent);
}
.sidebar-link:hover svg { color: var(--accent); }

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-card);
  padding: 20px 0;
  margin-top: auto;
}
.site-footer .container {
  display: flex;
  align-items: center;
}
.site-footer p {
  font-size: 13px;
  color: var(--text-hint);
  line-height: 1.5;
}
.site-footer a {
  color: var(--text-muted);
}
.site-footer a:hover {
  color: var(--accent);
  text-decoration: underline;
}

@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav-search input { width: 100px; }

  .app-header {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
  }
  .app-header-actions {
    grid-column: 1 / -1;
    align-items: flex-start;
  }

  .app-body {
    grid-template-columns: 1fr;
  }
  .app-sidebar { position: static; }

  .app-title { font-size: 1.6rem; }
  .app-icon { width: 72px; height: 72px; }
}
