/* ~/lab index: the banner, the rain, the project cards and the shell. Shared styles live in base.css. */
#rain { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; opacity: 0.6; }
.defs { position: absolute; }

/* ---------- intro: ASCII banner over a rippling puddle ---------- */
.intro {
  display: grid; grid-template-columns: auto 1fr; gap: clamp(24px, 5vw, 64px); align-items: center;
  padding: clamp(24px, 4vw, 44px) clamp(18px, 4vw, 40px) 8px;
}
.banner-wrap { font-size: clamp(12px, 1.7vw, 18px); height: 9.6em; overflow: hidden; }
.banner {
  margin: 0; font-family: var(--mono); font-size: 1em; line-height: 1; white-space: pre; font-weight: 400;
  background: linear-gradient(90deg, var(--accent), var(--blue) 60%, var(--white));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.banner.reflect {
  margin-top: 0.25em; transform: scaleY(-1); opacity: 0.32; filter: url(#ripple);
  -webkit-mask-image: linear-gradient(to top, #000 0%, transparent 62%);
  mask-image: linear-gradient(to top, #000 0%, transparent 62%);
}
.counts { margin: 0; color: var(--dim); font-size: 13px; }
.counts b { color: var(--white); font-weight: 500; }

/* ---------- project cards ---------- */
.projects { padding: 22px clamp(18px, 4vw, 40px) 8px; }
.ls-head { margin: 0 0 14px; font-size: 14px; font-weight: 400; color: var(--text); }
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.cards > li { display: flex; min-width: 0; }
.cards > li[hidden] { display: none; }
.card {
  flex: 1; display: flex; flex-direction: column; overflow: hidden;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text);
  transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
}
a.card:hover, a.card:focus-visible { color: var(--text); border-color: rgba(52, 224, 234, 0.45); transform: translateY(-4px); box-shadow: 0 20px 60px rgba(8, 145, 178, 0.15); }
a.card:focus-visible { outline-offset: 4px; border-radius: var(--radius); }
.card-bar span:first-of-type { margin-left: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-bar .st { margin-left: auto; padding-left: 10px; }
.shot { position: relative; margin: 0; aspect-ratio: 16 / 9; overflow: hidden; background: #07111a; border-bottom: 1px solid var(--line); }
.shot img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
a.card:hover .shot img { transform: scale(1.04); }
/* faint scanlines, as if the terminal is rendering the image */
.shot::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(5, 11, 18, 0.28) 0 1px, transparent 1px 3px);
}
/* no screenshot yet: the project's name stands in, framed like a placeholder */
.shot.noimg {
  display: grid; place-items: center; padding: 20px; text-align: center; overflow-wrap: anywhere;
  font-size: 17px; font-weight: 700; color: var(--accent);
  background: radial-gradient(circle at 50% 40%, rgba(8, 145, 178, 0.16), transparent 70%), #07111a;
}

.card-body { flex: 1; display: flex; flex-direction: column; padding: 16px 18px 18px; }
.card h3 { margin: 0 0 8px; font-size: 19px; line-height: 1.3; color: var(--white); }
.card p { margin: 0 0 14px; color: var(--mist); font-size: 13.5px; }
.card-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--dim); }
.go { color: var(--accent); font-size: 14px; font-weight: 700; white-space: nowrap; transition: color 0.2s; }
.go span { display: inline-block; transition: transform 0.2s; }
a.card:hover .go { color: var(--white); }
a.card:hover .go span { transform: translateX(4px); }

/* an empty slot, so a short index still looks deliberate */
.card.empty { background: transparent; border-style: dashed; border-color: rgba(52, 224, 234, 0.14); color: var(--dim); }
.card.empty .card-bar { background: none; border-bottom-style: dashed; border-color: rgba(52, 224, 234, 0.1); }
.empty-body {
  flex: 1; min-height: 220px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 20px; text-align: center; font-size: 13px; color: rgba(127, 154, 166, 0.6);
}
.awaiting { color: var(--dim); font-size: 14px; }
.awaiting .caret { color: var(--accent); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.noscript { color: var(--mist); }

/* cards deal in one after another on load */
.js .cards > li { animation: deal 0.45s ease-out backwards; animation-delay: calc(var(--n, 0) * 90ms + 100ms); }
@keyframes deal { from { opacity: 0; transform: translateY(10px); } }

/* ---------- shell (optional) ---------- */
.shell { padding: 18px clamp(18px, 4vw, 40px) 22px; }
.out { max-height: 280px; overflow-y: auto; font-size: 14px; }
.out .ln { white-space: pre-wrap; overflow-wrap: anywhere; }
.out .ok { color: var(--mint); }
.out .err { color: var(--mist); }
.out .art { color: var(--text); line-height: 1.25; }
.out .cmd-name { color: var(--white); display: inline-block; min-width: 15ch; }
.prompt { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.prompt label { white-space: nowrap; color: var(--text); }
.prompt input {
  flex: 1; min-width: 0; font: inherit; color: var(--white); caret-color: var(--accent);
  background: transparent; border: 0; padding: 4px 0; border-bottom: 1px dashed transparent;
}
.prompt input::placeholder { color: var(--dim); }
.prompt input:focus { outline: none; border-bottom-color: var(--line); }

/* ---------- goose, waddling along the top of the window ---------- */
.goose {
  position: absolute; top: -31px; left: 80%; width: 32px; height: 32px; z-index: 2;
  padding: 0; border: 0; background: none; cursor: pointer; animation: waddle 23s ease-in-out -6s infinite;
}
.goose svg { width: 100%; height: 100%; animation: bob 0.45s ease-in-out infinite alternate; overflow: visible; }
.g-body { fill: #e2eef3; }
.g-beak { fill: #fb923c; }
.g-eye { fill: #050b12; }
.g-leg { stroke: #fb923c; stroke-width: 2.5; stroke-linecap: round; fill: none; }
.goose.hop svg { animation: hop 0.45s ease-out; }
@keyframes bob { from { transform: rotate(-4deg); } to { transform: rotate(4deg) translateY(-1px); } }
@keyframes hop { 40% { transform: translateY(-14px) rotate(-8deg); } }
@keyframes waddle {
  0% { left: 80%; transform: scaleX(-1); }
  44% { left: 18%; transform: scaleX(-1); }
  50% { left: 18%; transform: scaleX(1); }
  94% { left: 80%; transform: scaleX(1); }
  100% { left: 80%; transform: scaleX(-1); }
}

/* ---------- responsive ---------- */
@media (max-width: 1060px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .intro { grid-template-columns: 1fr; gap: 10px; }
  .banner-wrap { font-size: 11px; height: 8.4em; }
  .cards { grid-template-columns: 1fr; }
}
