/* Clean glass showcase: every project gets its own large frosted panel lit by its
   language color. Hovering one project quietly pushes the others back. */

:root {
  --base: #0f0a1c;
  --text: #f4f2f8;
  --soft: #a8a2b8;
  --panel: rgba(255, 255, 255, 0.055);
  --panel-hover: rgba(255, 255, 255, 0.085);
  --edge: rgba(255, 255, 255, 0.11);
  --focus: #7aa2ff;

  --font: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

body {
  min-height: 100vh;
  background: var(--base);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  font-variation-settings: "opsz" 16;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
::selection { background: var(--focus); color: #0b0716; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }

/* ---------- Blurred moving background ---------- */
.backdrop {
  position: fixed; inset: -15%; z-index: -1; pointer-events: none;
  filter: blur(110px) saturate(140%);
}
.backdrop::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 30%, transparent 0%, rgba(15, 10, 28, 0.55) 80%);
}
.backdrop span { position: absolute; border-radius: 50%; mix-blend-mode: screen; will-change: transform; }
.backdrop .b1 { width: 50vmax; height: 50vmax; left: -5%; top: -10%; background: #5a6cff; opacity: 0.5; animation: d1 38s ease-in-out infinite alternate; }
.backdrop .b2 { width: 46vmax; height: 46vmax; right: -10%; top: 5%; background: #b04dff; opacity: 0.45; animation: d2 44s ease-in-out infinite alternate; }
.backdrop .b3 { width: 42vmax; height: 42vmax; left: 25%; bottom: -25%; background: #ff5a8a; opacity: 0.35; animation: d3 41s ease-in-out infinite alternate; }
.backdrop .b4 { width: 34vmax; height: 34vmax; right: 10%; bottom: -10%; background: #24c4b0; opacity: 0.3; animation: d4 48s ease-in-out infinite alternate; }
@keyframes d1 { to { transform: translate(30vw, 25vh) scale(1.15); } }
@keyframes d2 { to { transform: translate(-35vw, 30vh) scale(0.85); } }
@keyframes d3 { to { transform: translate(20vw, -40vh) scale(1.2); } }
@keyframes d4 { to { transform: translate(-40vw, -20vh) scale(1.25); } }

/* ---------- Layout ---------- */
.page { width: min(1120px, 100% - 48px); margin: 0 auto; padding: 96px 0 48px; }

/* ---------- Header ---------- */
.head { margin-bottom: 40px; }
.name {
  font-size: clamp(56px, 9vw, 112px);
  font-weight: 750;
  font-variation-settings: "opsz" 96, "wdth" 85;
  line-height: 0.95;
  letter-spacing: -0.035em;
}
.lede {
  margin-top: 16px; max-width: 40ch;
  font-size: 21px; line-height: 1.4; color: var(--soft);
  font-variation-settings: "opsz" 24;
}
.head-row { display: flex; align-items: center; gap: 24px; margin-top: 40px; flex-wrap: wrap; }

.search {
  position: relative; flex: 0 1 420px;
  display: flex; align-items: center;
  height: 50px; border-radius: 16px;
  background: var(--panel);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  border: 1px solid var(--edge);
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease), box-shadow 0.4s var(--ease);
}
.search:focus-within { border-color: rgba(122, 162, 255, 0.6); background: var(--panel-hover); box-shadow: 0 0 0 4px rgba(122, 162, 255, 0.15); }
.search svg { position: absolute; left: 16px; width: 18px; height: 18px; fill: var(--soft); pointer-events: none; }
.search input {
  width: 100%; height: 100%; padding: 0 48px 0 46px;
  background: none; border: 0; outline: 0;
  color: var(--text); font: inherit; font-size: 16px;
}
.search input::placeholder { color: var(--soft); }
.search input::-webkit-search-cancel-button { filter: invert(1) opacity(0.6); cursor: pointer; }
.search kbd {
  position: absolute; right: 14px;
  min-width: 24px; height: 24px; padding: 0 6px; border-radius: 7px;
  display: grid; place-items: center;
  border: 1px solid var(--edge); color: var(--soft);
  font: 500 13px var(--font);
  transition: opacity 0.2s;
}
.search:focus-within kbd { opacity: 0; }

.profile { color: var(--soft); font-size: 15px; transition: color 0.2s; }
.profile:hover { color: var(--text); }
.count { margin-top: 14px; font-size: 14px; color: var(--soft); min-height: 21px; }

/* ---------- Project panels ---------- */
.repos {
  list-style: none;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px;
}
.repo {
  --c: #8a84a0;
  position: relative;
  transition: opacity 0.45s var(--ease), filter 0.45s var(--ease), transform 0.5s var(--ease);
}
.repo a {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column;
  min-height: 300px; height: 100%;
  padding: 32px 34px 28px;
  border-radius: 28px;
  background: var(--panel);
  backdrop-filter: blur(30px) saturate(160%);
  -webkit-backdrop-filter: blur(30px) saturate(160%);
  border: 1px solid var(--edge);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 24px 60px -30px rgba(4, 2, 10, 0.8);
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.5s var(--ease), transform 0.5s var(--ease);
}
/* Each panel's own light, in its language color */
.repo a::before {
  content: ""; position: absolute; z-index: -1;
  width: 70%; aspect-ratio: 1; right: -20%; top: -35%;
  border-radius: 50%;
  background: var(--c);
  filter: blur(70px);
  opacity: 0.32;
  transition: opacity 0.5s var(--ease), transform 0.7s var(--ease);
}

.repo-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 14px; color: var(--soft); }
.lang { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-weight: 500; }
.lang i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); }
.lang.none { color: var(--soft); font-weight: 400; }

.repo h2 {
  margin-top: auto; padding-top: 40px;
  font-size: clamp(32px, 3.6vw, 44px);
  font-weight: 700;
  font-variation-settings: "opsz" 64, "wdth" 88;
  line-height: 1.02;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
}
.repo p { margin-top: 10px; max-width: 38ch; color: var(--soft); font-size: 17px; line-height: 1.45; }
.repo p.none { opacity: 0.7; }

.repo-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 26px; padding-top: 18px;
  border-top: 1px solid var(--edge);
  font-size: 14px; color: var(--soft);
}
.stats { display: flex; gap: 16px; }
.stats span { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.stats svg { width: 14px; height: 14px; fill: currentColor; }
.open { color: var(--text); font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.open svg { width: 14px; height: 14px; fill: currentColor; transition: transform 0.4s var(--ease); }

/* ---------- Hover focus: the chosen project comes forward, the rest step back ---------- */
@media (hover: hover) {
  .repo:hover a, .repo:focus-within a {
    background: var(--panel-hover);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 40px 90px -30px rgba(4, 2, 10, 0.9);
    transform: translateY(-4px);
  }
  .repo:hover a::before, .repo:focus-within a::before { opacity: 0.6; transform: scale(1.2); }
  .repo:hover .open svg, .repo:focus-within .open svg { transform: translate(2px, -2px); }

  .repos:has(.repo:hover, .repo:focus-within) .repo:not(:hover, :focus-within) {
    opacity: 0.35;
    filter: blur(2px) saturate(0.5);
    transform: scale(0.98);
  }
}

/* ---------- Empty search ---------- */
.empty { padding: 60px 0; color: var(--soft); font-size: 19px; }
.empty b { color: var(--text); font-weight: 600; }

/* ---------- Footer ---------- */
.foot {
  margin-top: 96px; padding-top: 24px;
  border-top: 1px solid var(--edge);
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap;
  color: var(--soft);
}
.foot p:first-child { font-size: 17px; color: var(--text); font-weight: 300; }
.foot-small { font-size: 13px; }

/* ---------- One page-load moment: panels settle in once ---------- */
.head { animation: rise 0.9s var(--ease) both; }
.repos.intro .repo { animation: rise 0.8s var(--ease) both; animation-delay: calc(0.15s + var(--i) * 0.07s); }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }

/* ---------- Small screens ---------- */
@media (max-width: 760px) {
  .page { width: min(100% - 32px, 1120px); padding-top: 64px; }
  .repos { grid-template-columns: 1fr; gap: 14px; }
  .repo a { min-height: 0; padding: 26px 24px 22px; border-radius: 22px; }
  .repo h2 { padding-top: 28px; }
  .search { flex-basis: 100%; }
  .search kbd { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
}
