/* House of Clicks — startpagina.
   Stijl "Studio": haarlijnen in plaats van schaduwen, veel wit, groen alleen
   waar het iets betekent (het mark en de focusstaat). De app-logo's leveren
   straks de kleur; de pagina blijft een rustige ondergrond.

   Kleuren komen van houseofclicks.nl: aqua-500 #33CE68, aqua-950 #004238. */

@font-face {
  font-family: 'Outfit';
  src: url('../fonts/outfit-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Outfit';
  src: url('../fonts/outfit-latin-ext.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --accent: #33ce68;
  --accent-deep: #004238;

  --bg: #fbfbf9;
  --surface: #ffffff;
  --surface-2: #f1f3ef;
  --text: #141714;
  --muted: #6b736c;
  --line: #e4e5e1;
  --ring: rgba(51, 206, 104, 0.22);
  --overlay: 0 10px 34px rgba(20, 30, 22, 0.1);

  --radius: 10px;
  --radius-lg: 12px;
  --max: 940px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: #3ddc74;
    --bg: #0c0e0c;
    --surface: #141714;
    --surface-2: #1b1f1b;
    --text: #e9eee9;
    --muted: #8a938b;
    --line: #242822;
    --ring: rgba(61, 220, 116, 0.25);
    --overlay: 0 10px 34px rgba(0, 0, 0, 0.6);
  }
}

/* Handmatige keuze wint altijd van de systeemvoorkeur. */
:root[data-theme='light'] {
  --accent: #33ce68;
  --bg: #fbfbf9;
  --surface: #ffffff;
  --surface-2: #f1f3ef;
  --text: #141714;
  --muted: #6b736c;
  --line: #e4e5e1;
  --ring: rgba(51, 206, 104, 0.22);
  --overlay: 0 10px 34px rgba(20, 30, 22, 0.1);
  color-scheme: light;
}

:root[data-theme='dark'] {
  --accent: #3ddc74;
  --bg: #0c0e0c;
  --surface: #141714;
  --surface-2: #1b1f1b;
  --text: #e9eee9;
  --muted: #8a938b;
  --line: #242822;
  --ring: rgba(61, 220, 116, 0.25);
  --overlay: 0 10px 34px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

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

html, body { height: 100%; }

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 'Outfit', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

svg { fill: currentColor; }

/* ---------- topbar ---------- */

.topbar {
  display: flex;
  justify-content: flex-end;
  padding: 16px 20px 0;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 11px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
}

.icon-button:hover { color: var(--text); border-color: var(--line); }
.icon-button__icon { font-size: 14px; line-height: 1; }

/* ---------- layout ---------- */

.page {
  flex: 1;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 3vh 20px 56px;
}

@media (min-width: 700px) {
  .page { padding-top: 8vh; }
}

/* ---------- logo ---------- */

.hero { margin-bottom: 46px; }

.logo {
  display: flex;
  justify-content: center;
  margin: 0 0 30px;
  font-size: 0;
}

/* Het officiële lockup. De hoogte stuurt de breedte; de verhouding zit in de
   viewBox (731 × 111), dus 26px hoog is ~172px breed. */
.logo__lockup {
  height: 26px;
  width: auto;
  fill: currentColor;
}

@media (max-width: 599px) {
  .logo__lockup { height: 22px; }
}

/* ---------- zoekveld ---------- */

.search {
  position: relative;
  max-width: 580px;
  margin: 0 auto;
}

.search__box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 0 15px;
  height: 50px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.12s, box-shadow 0.12s;
}

.search__box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring);
}

.search__icon {
  flex: none;
  width: 19px;
  height: 19px;
  color: var(--muted);
}

.search__input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 16px;
  outline: none;
}

.search__input::placeholder { color: var(--muted); }
.search__input::-webkit-search-cancel-button { display: none; }

.search__clear {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--muted);
  cursor: pointer;
}

.search__clear svg { width: 17px; height: 17px; }
.search__clear:hover { background: var(--surface-2); color: var(--text); }
.search__clear[hidden] { display: none; }

/* ---------- suggesties ---------- */

.suggestions {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 5px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--overlay);
  max-height: min(58vh, 440px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.suggestion {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 11px;
  border-radius: 7px;
  cursor: pointer;
}

.suggestion[aria-selected='true'] { background: var(--surface-2); }

.suggestion__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: var(--muted);
}

.suggestion__icon svg { width: 16px; height: 16px; }
.suggestion__icon img { width: 20px; height: 20px; object-fit: contain; border-radius: 4px; }

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

.suggestion__text b { font-weight: 600; }

.suggestion__meta {
  flex: none;
  color: var(--muted);
  font-size: 12px;
}

.suggestion__remove {
  flex: none;
  padding: 2px 6px;
  border: 0;
  border-radius: 5px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
  visibility: hidden;
}

.suggestion:hover .suggestion__remove,
.suggestion[aria-selected='true'] .suggestion__remove { visibility: visible; }
.suggestion__remove:hover { color: var(--text); background: var(--line); }

/* ---------- hint ---------- */

.hint {
  margin: 15px auto 0;
  max-width: 580px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

kbd {
  display: inline-block;
  min-width: 17px;
  padding: 1px 4px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font: inherit;
  font-size: 10.5px;
  text-align: center;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  color: var(--text);
  white-space: nowrap;
}

/* ---------- groepen ---------- */

.group + .group { margin-top: 36px; }
.group[hidden] { display: none; }

.group__title {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.group__title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* Eén aaneengesloten raster met haarlijnen ertussen. De randen van de laatste
   kolom en rij vallen buiten de container en worden weggeknipt. */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.app {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 -1px -1px 0;
  padding: 14px 14px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
  transition: background-color 0.12s;
}

.app:hover { background: var(--surface); }

.app:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  background: var(--surface);
}

.app[hidden] { display: none; }

.app__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  overflow: hidden;
}

.app__icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.app__icon--fallback {
  background: var(--surface-2);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.app__body {
  display: block;
  min-width: 0;
}

.app__name {
  display: block;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.3;
}

.app__desc {
  display: block;
  margin-top: 1px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Mobiel: één kolom, en de sneltoetsen zeggen daar toch niets. */
@media (max-width: 599px) {
  .hero { margin-bottom: 32px; }
  .hint { display: none; }
  .grid { grid-template-columns: 1fr; }
}

/* ---------- states & footer ---------- */

.state {
  padding: 30px 0;
  color: var(--muted);
  font-size: 13.5px;
  text-align: center;
}

.state--error { color: #d1453b; }

.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 22px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 20px 20px 32px;
  color: var(--muted);
  font-size: 12px;
}

.footer__details summary { cursor: pointer; }
.footer__body { max-width: 580px; margin-top: 10px; text-align: left; }
.footer__body p { margin: 0 0 8px; }
.footer__note { opacity: 0.8; }

.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.link-button:hover { color: var(--text); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
