:root {
  color-scheme: dark;
  --bg: #111214;
  --panel: #191a1e;
  --panel-hover: #202126;
  --line: #2a2b31;
  --muted: #8d9099;
  --text: #f1f1f2;
  --accent: #b8dc60;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { min-height: 100%; background: var(--bg); }

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
}

.site-header,
main,
footer {
  width: min(1240px, calc(100% - 64px));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 84px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid #3b432a;
  border-radius: 10px;
  background: #1b2117;
  color: var(--accent);
  font-family: Georgia, serif;
  font-size: 20px;
  font-style: italic;
}

.brand strong { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }

.identity {
  display: flex;
  gap: 9px;
  align-items: center;
  min-height: 38px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
}

.identity-dot { width: 7px; height: 7px; border-radius: 50%; background: #5e6572; }
.identity.authenticated { color: var(--text); border-color: #46512d; }
.identity.authenticated .identity-dot { background: var(--accent); }

main { min-height: calc(100vh - 153px); padding: 56px 0 96px; }

.page-heading {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 46px;
}

h1 { margin: 0; font-size: 36px; font-weight: 650; letter-spacing: -0.04em; }
#app-total {
  color: var(--muted);
  font-size: 13px;
}

.loading { display: flex; gap: 7px; align-items: center; color: var(--muted); }
.loading span { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); animation: pulse 1.2s infinite ease-in-out; }
.loading span:nth-child(2) { animation-delay: 0.15s; }
.loading span:nth-child(3) { animation-delay: 0.3s; }
.loading b { margin-left: 8px; font-size: 12px; font-weight: 500; }

@keyframes pulse { 0%, 80%, 100% { opacity: 0.2; transform: scale(0.8); } 40% { opacity: 1; transform: scale(1); } }

.sections { display: grid; gap: 52px; }
.section-heading { display: flex; align-items: baseline; gap: 9px; margin-bottom: 16px; }
.section-heading h2 { margin: 0; font-size: 14px; font-weight: 600; }
.section-heading span { color: var(--muted); font-size: 11px; }

.app-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }

.app-card {
  position: relative;
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 15px;
  align-items: center;
  min-height: 118px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  color: inherit;
  text-decoration: none;
  transition: border-color 140ms ease, background 140ms ease;
}

.app-card:hover,
.app-card:focus-visible { border-color: #4b4d56; background: var(--panel-hover); outline: none; }

.app-icon {
  z-index: 1;
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border: 1px solid #303138;
  border-radius: 13px;
  background: #222329;
}

.app-icon img { width: 48px; height: 48px; object-fit: contain; image-rendering: auto; }
.app-copy { z-index: 1; min-width: 0; }
.app-copy strong,
.app-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-copy strong { font-size: 14px; font-weight: 600; }
.app-description {
  display: -webkit-box;
  margin-top: 5px;
  overflow: hidden;
  color: #b8bac1;
  font-size: 12px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.app-copy small { margin-top: 6px; color: var(--muted); font-size: 10px; }
.app-arrow { z-index: 1; align-self: start; color: #60626a; font-size: 13px; transition: color 140ms ease; }
.app-card:hover .app-arrow { color: var(--text); }

footer {
  display: flex;
  justify-content: space-between;
  padding: 24px 0 32px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

@media (max-width: 1050px) {
  .app-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 780px) {
  .site-header, main, footer { width: min(100% - 40px, 1240px); }
  .app-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .site-header, main, footer { width: min(100% - 28px, 1240px); }
  .site-header { height: 70px; }
  .identity { max-width: 48%; overflow: hidden; white-space: nowrap; }
  main { min-height: calc(100vh - 139px); padding-top: 38px; padding-bottom: 64px; }
  .page-heading { margin-bottom: 32px; }
  h1 { font-size: 30px; }
  .sections { gap: 42px; }
  .app-grid { grid-template-columns: 1fr; }
  .app-card { min-height: 108px; grid-template-columns: 56px 1fr auto; }
  .app-icon { width: 56px; height: 56px; border-radius: 12px; }
  .app-icon img { width: 42px; height: 42px; }
}

@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; }
}
