/* Homepage hero: the inventory. Everything is scoped under .ih. */
.ih { --mc: 137,180,250; --gut: 40px; --bright: #eef1fb; --idim: #7c80a0; --px: 'Press Start 2P', monospace; --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  position: relative; z-index: 1; overflow: hidden; padding-top: 64px; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; justify-content: center; font-family: var(--mono); font-size: 15px; line-height: 1.6; color: var(--text); }
.ih a { color: inherit; text-decoration: none; }
.ih img { display: block; }
.ih button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
.ih .pxl { image-rendering: pixelated; image-rendering: crisp-edges; }
.ih > canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.ih::before { content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(rgba(198,207,232,.06) 1px, transparent 1px) 0 0 / 100% 32px, linear-gradient(90deg, rgba(198,207,232,.06) 1px, transparent 1px) 0 0 / 32px 100%;
  -webkit-mask-image: radial-gradient(ellipse var(--mx, 62%) var(--my, 78%) at var(--mpx, 72%) var(--mpy, 50%), #000 10%, transparent 76%); mask-image: radial-gradient(ellipse var(--mx, 62%) var(--my, 78%) at var(--mpx, 72%) var(--mpy, 50%), #000 10%, transparent 76%); }
.ih-in { position: relative; z-index: 1; width: 100%; max-width: 1440px; margin: 0 auto; padding: 44px var(--gut) 64px; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 56px; align-items: center; }

.ih-title { font-family: var(--px); font-weight: 400; color: var(--bright); font-size: clamp(19px, 2.5vw, 35px); line-height: 1.55; letter-spacing: -0.5px; }
.ih-title .a { color: var(--pink); white-space: nowrap; }
.ih-title .b { color: rgb(var(--mc)); transition: color .25s; display: inline-block; min-height: 1.55em; }
.ih-sub { margin: 22px 0 30px; max-width: 44ch; color: #9aa0c0; font-size: clamp(14px, 1.15vw, 16.5px); line-height: 1.75; }
.ih-btns { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.ih-play { font-family: var(--px); font-size: 11px; letter-spacing: 1px; color: var(--void) !important; background: var(--pink); padding: 18px 26px; box-shadow: 4px 4px 0 #7d3b52; display: inline-flex; gap: 12px; align-items: center; transition: transform .08s, box-shadow .08s; }
.ih-play:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 #7d3b52; }
.ih-ghost { font-family: var(--px); font-size: 9px; letter-spacing: 1px; color: var(--text); padding: 17px 20px; border: 2px solid var(--border-lit); transition: border-color .12s, color .12s; }
.ih-ghost:hover { border-color: var(--blue); color: var(--bright) !important; }
.ih-note { margin-top: 20px; font-size: 12.5px; color: var(--idim); }
.ih-note b { color: var(--green); font-weight: 500; }

/* the window */
.ih-panel { position: relative; padding: 14px 16px 14px; background: #080912; border: 2px solid var(--border-lit); box-shadow: 8px 8px 0 rgba(0,0,0,.6); }
.ih-panel::before { content: ''; position: absolute; inset: -110px; z-index: -1; pointer-events: none; background: radial-gradient(closest-side, rgba(var(--mc), .28), transparent); }
.ih-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; height: 12px; margin-bottom: 14px; font: 8px/12px var(--px); letter-spacing: 1px; color: var(--idim); white-space: nowrap; }
.ih-head b { font-weight: 400; color: var(--bright); }
.ih-head i { display: inline-block; width: 8px; height: 8px; background: rgb(var(--mc)); margin-right: 10px; }
.ih-head button { font: 8px/12px var(--px); letter-spacing: 1px; color: var(--idim); } .ih-head button:hover { color: rgb(var(--mc)); }
.ih-cnt { color: rgb(var(--mc)); margin-right: 16px; }

/* the grid */
.ih-inv { position: relative; display: grid; grid-template-columns: repeat(var(--cols, 6), var(--u, 100px)); grid-auto-rows: var(--u, 100px); gap: var(--g, 6px); grid-auto-flow: dense; justify-content: space-between; }
/* Hold the grid's height before inventory.js fills it, so nothing under the hero jumps on a phone. Same sums as
   fit(): 6 columns and 4 rows, or 4 columns and 6 rows when the panel is under 520px. Slots are whole pixels,
   so the fraction left over goes between the rows, as it already does between the columns. */
.ih-fit { container-type: inline-size; }
.ih-inv { min-height: calc((100cqw - 30px) / 6 * 4 + 18px); align-content: space-between; }
@container (max-width: 519.98px) { .ih-inv { min-height: calc((100cqw - 18px) / 4 * 6 + 30px); } }
.ih .s { position: relative; display: grid; place-items: center; background: var(--panel); border: 2px solid var(--border); overflow: hidden; transition: border-color .12s, background .12s; }
.ih .s:hover { border-color: var(--border-lit); background: var(--card); }
.ih .s.on { border-color: rgba(var(--mc), .6); background: var(--card); }
.ih .s.w2 { grid-column: span 2; } .ih .s.w3 { grid-column: span 3; } .ih .s.h2 { grid-row: span 2; }
.ih .s img { max-width: none; }
.ih .s.fill img { width: 100%; height: 100%; object-fit: cover; }
.ih .grp { grid-auto-flow: column; grid-auto-columns: 1fr; place-items: stretch; overflow: visible; }
.ih .grp .cell { position: relative; display: flex; flex-direction: column; min-width: 0; }
.ih .grp .cell + .cell { border-left: 2px solid var(--border); }
.ih .grp .cell.in { background: #0a0b13; }
.ih .grp .cell.in + .cell { border-left: 2px dashed var(--border-lit); }
.ih .grp .art { flex: 1; min-height: 0; display: grid; place-items: center; }
.ih .grp em { flex: none; height: 18px; font: normal 10.5px/14px var(--mono); color: var(--idim); text-align: center; white-space: nowrap; }
.ih .grp .cell.in em { color: #9aa0c0; }
.ih .ph { object-fit: cover; image-rendering: auto; border: 2px solid var(--border-lit); }
.ih .grp .arr { position: absolute; top: calc(50% - 9px); width: 22px; height: 22px; margin: -11px 0 0 -11px; z-index: 2; background: rgb(var(--mc)); box-shadow: 0 0 0 4px var(--panel);
  clip-path: polygon(0 36%, 55% 36%, 55% 9%, 100% 50%, 55% 91%, 55% 64%, 0 64%); }
.ih .tag { position: absolute; left: 8px; top: -9px; z-index: 3; height: 16px; padding: 0 7px; font: 500 10.5px/16px var(--mono); white-space: nowrap; color: var(--bright); background: var(--border-lit); display: none; }
.ih .grp .tag { display: block; }
.ih .grp.on .tag, .ih .grp:hover .tag { color: var(--void); background: rgb(var(--mc)); }
.ih .sel { position: absolute; left: 0; top: 0; width: var(--u); height: var(--u); pointer-events: none; z-index: 4; margin: -5px; padding: 5px; box-sizing: content-box;
  transition: transform .16s steps(4), width .16s steps(4), height .16s steps(4); --c: rgb(var(--mc)); --l: 14px; --t: 3px;
  background:
    linear-gradient(var(--c), var(--c)) 0 0 / var(--l) var(--t), linear-gradient(var(--c), var(--c)) 0 0 / var(--t) var(--l),
    linear-gradient(var(--c), var(--c)) 100% 0 / var(--l) var(--t), linear-gradient(var(--c), var(--c)) 100% 0 / var(--t) var(--l),
    linear-gradient(var(--c), var(--c)) 0 100% / var(--l) var(--t), linear-gradient(var(--c), var(--c)) 0 100% / var(--t) var(--l),
    linear-gradient(var(--c), var(--c)) 100% 100% / var(--l) var(--t), linear-gradient(var(--c), var(--c)) 100% 100% / var(--t) var(--l);
  background-repeat: no-repeat; }
.ih-tip { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; min-height: 18px; margin-top: 14px; font-size: 13px; line-height: 18px; color: var(--bright); }
.ih-tip b { font-weight: 500; color: rgb(var(--mc)); margin-right: 10px; }
.ih-tip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ih-tip span:last-child { flex: none; color: rgb(var(--mc)); }

/* loot drop */
.ih .loot .s:not(.got) > * { visibility: hidden; }
.ih .loot .s.got > * { animation: ihDrop .3s steps(5) both; }
.ih .loot .s.got { animation: ihFlash .4s steps(3); }
@keyframes ihDrop { from { transform: translateY(-24px); opacity: 0; } 60% { transform: translateY(4px); opacity: 1; } to { transform: none; } }
@keyframes ihFlash { from { background: rgba(255,255,255,.3); border-color: #fff; } }
.ih .sp { position: absolute; width: 4px; height: 4px; margin: -2px; background: rgb(var(--mc)); z-index: 6; pointer-events: none; animation: ihFly .5s steps(6) forwards; }
@keyframes ihFly { to { transform: translate(var(--dx), var(--dy)); opacity: 0; } }

@media (max-width: 1000px) {
  .ih { --mpx: 50%; --mpy: 70%; --mx: 100%; --my: 60%; min-height: 0; display: block; }
  .ih-in { grid-template-columns: minmax(0, 1fr); gap: 30px; padding-top: 24px; padding-bottom: 40px; }
  .ih-sub { margin: 16px 0 22px; } .ih-note { margin-top: 14px; }
}
@media (max-width: 760px) {
  .ih { --gut: 16px; }
  .ih-title { font-size: 5.55vw; line-height: 1.6; }
  .ih-sub { font-size: 14px; line-height: 1.65; }
  .ih-btns { gap: 10px; flex-wrap: nowrap; } .ih-play { flex: 1; justify-content: center; padding: 17px 10px; font-size: 10px; } .ih-ghost { padding: 16px 12px; font-size: 8px; white-space: nowrap; }
  .ih-panel { padding: 12px 12px 12px; box-shadow: 5px 5px 0 rgba(0,0,0,.6); }
  .ih-panel::before { inset: -60px -16px; }
  .ih .grp em { font-size: 9.5px; }
  .ih-tip { flex-direction: column; gap: 2px; min-height: 38px; font-size: 12px; margin-top: 12px; } .ih-tip span { max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .ih .sel { transition: none; } .ih * { animation: none !important; } }
