/* Shared layout for hand-built 3030 department pages (games / music / art). */
:root {
  --bg: #0e1826;
  --panel: #182535;
  --ink: #f4f1ea;
  --dim: #8fa3bb;
  --pink: #fa5c79;
  --teal: #37d3de;
  --led: #7dffa0;
  --mono: 'Space Mono', ui-monospace, Menlo, monospace;
  --sans: 'Poppins', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  background-image: radial-gradient(rgba(55,211,222,.05) 1px, transparent 1.5px);
  background-size: 26px 26px;
  color: var(--ink);
  font-family: var(--sans);
  overflow-x: hidden;
}
::selection { background: var(--pink); color: #fff; }

.dept-hero { max-width: 1180px; margin: 0 auto; padding: 3.2rem 1.2rem 1.4rem; }
.dept-hero .sys { font-family: var(--mono); font-size: .72rem; color: var(--teal); letter-spacing: .12em; text-transform: uppercase; }
.dept-hero h1 {
  margin: .35rem 0 .5rem;
  font-size: clamp(2rem, 5.4vw, 3.6rem);
  font-weight: 800; line-height: 1.02; letter-spacing: -.01em; text-transform: uppercase;
  text-shadow: 1.5px 0 rgba(255,43,74,.55), -1.5px 0 rgba(55,211,222,.55);
}
.dept-hero .tag { margin: 0; color: var(--dim); font-size: 1rem; max-width: 52em; line-height: 1.6; }
.dept-hero .tag b { color: var(--ink); font-weight: 600; }
.dept-hero .tag a { color: var(--pink); }

#deptMain { max-width: 1180px; margin: 1.4rem auto 0; padding: 0 1.2rem 3rem; }

/* ---- card grid (games, music) ---- */
.dept-cards { display: grid; gap: 1.1rem; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 980px) { .dept-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .dept-cards { grid-template-columns: 1fr; } }
.dcard {
  background: var(--panel);
  border: 1px solid rgba(55,211,222,.45);
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(10,17,28,.9), inset 0 0 24px rgba(0,0,0,.55);
  overflow: hidden; position: relative;
  display: flex; flex-direction: column;
  color: var(--ink); text-decoration: none;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.dcard::before, .dcard::after {
  content: ''; position: absolute; width: 9px; height: 9px; z-index: 3;
  border-color: var(--teal); border-style: solid; pointer-events: none;
}
.dcard::before { top: -1px; left: -1px; border-width: 2px 0 0 2px; }
.dcard::after { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }
a.dcard:hover {
  transform: translateY(-3px);
  border-color: var(--pink);
  box-shadow: 0 0 0 1px rgba(10,17,28,.9), inset 0 0 24px rgba(0,0,0,.55), 0 0 26px rgba(250,92,121,.28);
}
a.dcard:hover::before, a.dcard:hover::after { border-color: var(--pink); }
.dc-head {
  display: flex; align-items: center; gap: .55rem;
  padding: .45rem .8rem .4rem;
  font-family: var(--mono); font-size: .64rem; color: var(--dim);
  background: rgba(10,17,28,.75);
  border-bottom: 1px solid rgba(55,211,222,.25);
}
.dc-head .led { width: .5em; height: .5em; border-radius: 50%; background: var(--led); box-shadow: 0 0 6px var(--led); }
.dc-head .num { color: var(--teal); }
.dc-view { position: relative; aspect-ratio: 16 / 9; background: #0a121e; overflow: hidden; margin: .7rem .8rem 0; border: 1px solid rgba(55,211,222,.25); border-radius: 2px; }
.dc-view img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dc-scan {
  position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.26) 0 1px, transparent 1px 3px);
}
.dc-noimg { display: flex; align-items: center; justify-content: center; }
.dc-noimg span {
  font-family: var(--mono); color: var(--teal); font-size: 1rem; text-align: center; padding: 0 1rem;
  text-shadow: 1px 0 rgba(255,43,74,.5), -1px 0 rgba(55,211,222,.5);
}
.dc-name { padding: .6rem .8rem .1rem; font-weight: 800; font-size: 1.05rem; line-height: 1.15; text-transform: uppercase; }
.dc-blurb { margin: .35rem 0 0; padding: 0 .8rem; color: var(--dim); font-family: var(--mono); font-size: .74rem; line-height: 1.6; flex: 1 1 auto; }
.dc-role { margin: .6rem 0 0; padding: 0 .8rem .8rem; font-family: var(--mono); font-size: .62rem; color: var(--teal); letter-spacing: .04em; }
.dcard > p:last-child { padding-bottom: .85rem; }

/* ---- art gallery (masonry via columns) ---- */
.dept-gallery { columns: 3 300px; column-gap: 1rem; }
.dept-gallery a {
  display: block; margin: 0 0 1rem; break-inside: avoid;
  border: 1px solid rgba(55,211,222,.35); border-radius: 3px;
  overflow: hidden; position: relative;
  background: var(--panel);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.dept-gallery a:hover { border-color: var(--pink); box-shadow: 0 0 22px rgba(250,92,121,.25); }
.dept-gallery img { width: 100%; height: auto; display: block; }

.dept-lightbox {
  position: fixed; inset: 0; z-index: 10100;
  background: rgba(3,7,14,.94);
  display: flex; align-items: center; justify-content: center;
}
.dept-lightbox img { max-width: 92vw; max-height: 92vh; object-fit: contain; box-shadow: 0 8px 40px rgba(0,0,0,.6); }
.dept-lightbox button {
  position: absolute; background: none; border: none; color: #fff;
  font-size: 44px; line-height: 1; cursor: pointer; padding: 12px 18px; opacity: .75; z-index: 2;
}
.dept-lightbox button:hover { opacity: 1; }
.dept-lightbox .lb-x { top: 10px; right: 14px; }
.dept-lightbox .lb-p { left: 6px; top: 50%; transform: translateY(-50%); font-size: 60px; }
.dept-lightbox .lb-n { right: 6px; top: 50%; transform: translateY(-50%); font-size: 60px; }

footer.dept-footer {
  text-align: center; padding: 1.4rem 1rem 2.2rem;
  font-family: var(--mono); font-size: .64rem; color: var(--dim);
}
footer.dept-footer a { color: var(--dim); }

/* ---- logo + heading row / hero terminal (shared with homepage) ---- */
.hero-row { display: flex; align-items: center; gap: clamp(.8rem, 2vw, 1.4rem); margin: .5rem 0 .45rem; }
.hero-logo {
  width: clamp(66px, 8vw, 110px); height: auto; flex: 0 0 auto;
  filter: drop-shadow(0 0 16px rgba(55,211,222,.35));
}
.hero-row h1 { margin: 0; }
.term {
  font-family: var(--mono);
  font-size: clamp(.8rem, 1.4vw, .95rem);
  line-height: 1.65;
  color: var(--ink);
  max-width: 56em;
  height: 9.5em;
  overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 2.4em);
  mask-image: linear-gradient(180deg, transparent 0, #000 2.4em);
  cursor: text;
}
.term-lines { white-space: pre-wrap; word-break: break-word; }
.term-lines .t-dim { color: var(--dim); }
.term-lines .t-pink { color: var(--pink); }
.term-lines .t-teal { color: var(--teal); }
.term-lines a { color: var(--pink); }
.term-row { display: flex; align-items: baseline; }
.term-prompt { color: var(--pink); margin-right: .55em; }
.term-row input {
  background: none; border: 0; outline: 0; padding: 0;
  color: var(--ink); font: inherit;
  caret-color: transparent;
  flex: 0 1 auto; min-width: 1px;
}
.term-cursor { color: var(--pink); animation: t-blink 1.1s steps(1) infinite; margin-left: -2px; }
@keyframes t-blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

/* ---- label releases grid (music page) ---- */
.dept-sect { margin-top: 2.4rem; }
.dept-sect-title {
  font-family: var(--mono); font-size: .78rem; color: var(--teal);
  letter-spacing: .12em; text-transform: uppercase;
  border-bottom: 1px solid rgba(55,211,222,.3);
  padding-bottom: .45rem; margin-bottom: .6rem;
}
.dept-sect-blurb { margin: 0 0 1rem; font-family: var(--mono); font-size: .74rem; color: var(--dim); }
.dept-releases { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.dept-releases a {
  display: block; aspect-ratio: 1 / 1; overflow: hidden;
  border: 1px solid rgba(55,211,222,.35); border-radius: 3px;
  background: var(--panel);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.dept-releases a:hover { border-color: var(--pink); box-shadow: 0 0 20px rgba(250,92,121,.3); transform: translateY(-2px); }
.dept-releases img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---- hero: terminal left, player right ---- */
.dh-flex { display: flex; gap: 2rem; align-items: flex-end; }
.dh-left { flex: 1 1 auto; min-width: 0; }
.dh-left .term { max-width: none; }
.dh-side { flex: 0 0 380px; }
.dh-side iframe { width: 380px; height: 152px; border: 0; border-radius: 12px; display: block; }
@media (max-width: 900px) {
  .dh-flex { flex-direction: column; align-items: stretch; }
  .dh-side { flex: 1 1 auto; }
  .dh-side iframe { width: 100%; }
}
/* ---- compact project links row ---- */
.dept-links { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; margin-top: .9rem; font-family: var(--mono); font-size: .74rem; }
.dept-links-label { color: var(--teal); }
.dept-links a { color: var(--dim); text-decoration: none; }
.dept-links a::before { content: '▸ '; color: var(--pink); }
.dept-links a:hover { color: var(--pink); }

/* ---- grid tile power-on ---- */
.dept-releases .tile-boot { opacity: 0; }
.dept-releases.grid-on .tile-boot { animation: tile-on .55s cubic-bezier(.2,.7,.3,1) forwards; }
@keyframes tile-on {
  0%   { opacity: 0; transform: scale(.92); filter: brightness(0) saturate(0); }
  35%  { opacity: 1; transform: scale(1.015); filter: brightness(2.4) saturate(.1) contrast(1.4); }
  48%  { filter: brightness(.6) saturate(.4); }
  62%  { filter: brightness(1.7) saturate(.7); }
  100% { opacity: 1; transform: scale(1); filter: brightness(1) saturate(1); }
}
@media (prefers-reduced-motion: reduce) {
  .dept-releases .tile-boot { opacity: 1; animation: none !important; }
}
