:root {
  --bg: #f4f2ee;
  --surface: #ffffff;
  --surface-2: #ece9e2;
  --ink: #1c1b18;
  --ink-soft: #4a4740;
  --muted: #7a766c;
  --accent: #35597f;
  --accent-soft: #dde6ee;
  --line: #ddd8cd;
  --line-strong: #c7c1b3;
  --shadow: 0 1px 2px rgba(28, 27, 24, 0.04), 0 8px 20px -12px rgba(28, 27, 24, 0.18);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16181a;
    --surface: #1f2224;
    --surface-2: #262a2c;
    --ink: #eeece6;
    --ink-soft: #c7c4bb;
    --muted: #918d84;
    --accent: #85adda;
    --accent-soft: #26333f;
    --line: #34383a;
    --line-strong: #404547;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 24px -14px rgba(0, 0, 0, 0.6);
  }
}

:root[data-theme="dark"] {
  --bg: #16181a;
  --surface: #1f2224;
  --surface-2: #262a2c;
  --ink: #eeece6;
  --ink-soft: #c7c4bb;
  --muted: #918d84;
  --accent: #85adda;
  --accent-soft: #26333f;
  --line: #34383a;
  --line-strong: #404547;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 24px -14px rgba(0, 0, 0, 0.6);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Public Sans", -apple-system, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 4.5rem 2rem 5rem;
}

header.masthead {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
  padding-bottom: 2.25rem;
  margin-bottom: 2.75rem;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.6rem;
}

h1 {
  font-family: "Archivo", sans-serif;
  font-weight: 800;
  font-size: clamp(2.1rem, 4vw, 2.9rem);
  letter-spacing: -0.02em;
  line-height: 1.02;
  margin: 0;
  text-wrap: balance;
}

.tally {
  text-align: right;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
  padding-bottom: 0.35rem;
}

.tally strong {
  display: block;
  font-family: "Archivo", sans-serif;
  font-weight: 800;
  font-size: 2rem;
  color: var(--ink);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.page { container-type: inline-size; }

.featured { margin-bottom: 2.75rem; }

.featured-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.featured-title {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
}

.featured-note {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.feat {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.4rem;
  background: var(--accent-soft);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.feat-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; }

.feat-icon {
  width: 72px;
  height: 72px;
  border-radius: 17px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--surface-2);
  flex: none;
}

.badge {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--accent);
  color: var(--accent);
  white-space: nowrap;
}

.badge.new { background: var(--accent); color: var(--bg); }

.feat-name {
  font-family: "Archivo", sans-serif;
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0;
}

.feat-desc { margin: 0; color: var(--ink-soft); font-size: 0.9rem; line-height: 1.5; }

.feat-meta {
  margin: auto 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.64rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

@media (max-width: 760px) {
  .featured-grid { grid-template-columns: 1fr; }
  .featured-head { flex-direction: column; gap: 0.25rem; }
}


.list {
  --cols: 4;
  --gap: 14px;
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  grid-auto-rows: calc((100cqw - (var(--cols) - 1) * var(--gap)) / var(--cols));
  grid-auto-flow: dense;
  gap: var(--gap);
}

.row {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto 1fr auto auto;
  grid-template-areas: "icon kind" "gap gap" "name name" "desc desc";
  column-gap: 0.75rem;
  padding: 1.15rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  min-width: 0;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.row:hover { transform: translateY(-2px); }

.row.wide { grid-column: span 2; background: var(--surface-2); }
.row.big { grid-column: span 2; grid-row: span 2; background: var(--accent-soft); padding: 1.6rem; }

.icon, .icon-svg-wrap { grid-area: icon; }

.icon {
  width: 52px;
  height: 52px;
  border-radius: 13px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--surface-2);
}

.icon-svg-wrap {
  width: 52px;
  height: 52px;
  border-radius: 13px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  display: block;
  line-height: 0;
}

.icon-svg-wrap svg { display: block; width: 100%; height: 100%; }

.row.big .icon, .row.big .icon-svg-wrap { width: 96px; height: 96px; border-radius: 22px; }

.name-block { display: contents; }

.kind {
  grid-area: kind;
  align-self: start;
  justify-self: end;
  text-align: right;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
  padding-top: 0.2rem;
}

.app-name {
  grid-area: name;
  font-family: "Archivo", sans-serif;
  font-weight: 700;
  font-size: 1.12rem;
  letter-spacing: -0.015em;
  margin: 0 0 0.3rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row.big .app-name { font-size: 1.9rem; letter-spacing: -0.025em; margin-bottom: 0.5rem; }

.desc {
  grid-area: desc;
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.8rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  overflow: hidden;
}

.row.big .desc { font-size: 1rem; line-height: 1.5; -webkit-line-clamp: 6; }

@media (max-width: 900px) { .list { --cols: 3; } }
@media (max-width: 600px) {
  .list { --cols: 2; --gap: 10px; }
  .row { padding: 0.9rem; border-radius: 20px; }
  .icon, .icon-svg-wrap { width: 40px; height: 40px; border-radius: 10px; }
  .row.big .icon, .row.big .icon-svg-wrap { width: 64px; height: 64px; }
  .row.big { padding: 1.1rem; }
  .row.big .app-name { font-size: 1.4rem; }
  .row.big .desc { font-size: 0.85rem; }
  .app-name { font-size: 1rem; }
  .desc { font-size: 0.72rem; -webkit-line-clamp: 3; }
  .kind { font-size: 0.52rem; }
}

@media (prefers-reduced-motion: reduce) { .row { transition: none; } .row:hover { transform: none; } }

footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
}

@media (max-width: 560px) {
  .page { padding: 2.75rem 1.25rem 3.5rem; }
  header.masthead { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .tally { text-align: left; }
}

a.row { color: inherit; text-decoration: none; }
a.row:hover .app-name { color: var(--accent); }
a.row:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
div.row[data-page] { cursor: default; }
div.row[data-page]:hover { transform: none; }
.icon-svg { border-color: var(--line-strong); background: none; }

/* Faint code backdrop behind the whole page. */
body { position: relative; }
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: url("bg-code.jpg") center / cover no-repeat;
  opacity: 0.07;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) body::before { opacity: 0.16; } }
:root[data-theme="dark"] body::before { opacity: 0.16; }
.page { position: relative; }
