/* ==========================================================================
   Nebula Games (studio hub) - site skin
   Keeps the studio defaults from tokens.css and adds the hub hero and the
   game title cards.
   ========================================================================== */

.hub-hero {
  padding-bottom: clamp(3rem, 7vw, 5rem);
  text-align: center;
}

/* The key art already carries the full logo lockup, so it gets its own band
   rather than sitting behind the headline - overlapping the two made both
   unreadable. The bottom fade hands off to the page ground. */
.hub-hero__art {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  max-height: 60svh;
  /* root-absolute so it resolves both locally and at the domain root */
  background: url("/shared/img/nebula-games-background.jpg") center / cover no-repeat;
}
.hub-hero__art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(10,14,28,.55) 0%,
    rgba(10,14,28,0) 18%,
    rgba(10,14,28,0) 74%,
    rgba(10,14,28,.8) 92%,
    var(--ink) 100%);
}

.hub-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.2rem, 6vw, 4.2rem);
  line-height: 1.06;
  letter-spacing: -.02em;
  margin: 0 0 1.4rem;
  text-wrap: balance;
}

.hub-hero .lede { margin: 0 auto 2.2rem; }
.hub-hero .cta-row { justify-content: center; }

/* --- game title cards ----------------------------------------------------- */

.titles {
  margin-top: 3rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.4rem;
}

.title-card {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  color: inherit;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.title-card:hover {
  text-decoration: none;
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: 0 28px 60px -30px color-mix(in srgb, var(--accent) 60%, transparent);
}

.title-card img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  transition: transform .5s cubic-bezier(.2,.8,.3,1);
}
.title-card:hover img { transform: scale(1.04); }

.title-card__body { padding: 1.5rem 1.4rem 1.7rem; }

.title-card__status {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent-2);
  display: block;
  margin-bottom: .7rem;
}

.title-card h3 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.2rem;
  margin: 0 0 .55rem;
  line-height: 1.2;
}
.title-card p { margin: 0; color: var(--text-dim); font-size: .93rem; }

@media (prefers-reduced-motion: reduce) {
  .title-card, .title-card img { transition: none; }
}

/* --- tag chips on a title card -------------------------------------------- */

.title-card .tags {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: 1rem;
}
.title-card .chip { font-size: .66rem; padding: .3rem .65rem; letter-spacing: .12em; }

/* --- about + connect ------------------------------------------------------ */

.about {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: clamp(2rem, 5vw, 3.2rem);
  align-items: start;
  text-align: left;
}
@media (max-width: 820px) { .about { grid-template-columns: 1fr; } }

.about .card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.8rem 1.6rem;
}
.about .card h3 {
  font-family: var(--mono);
  font-size: .76rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--accent-deep);
  margin: 0 0 1.2rem;
}
.about .card .cta-row { gap: .6rem; }
.about .card .btn { padding: .6rem 1rem; font-size: .85rem; }

/* the studio line under the hero reads as a label, not an alert */
.badge--quiet {
  color: var(--text-dim);
  border-color: var(--line);
  background: color-mix(in srgb, var(--panel) 70%, transparent);
  text-transform: none;
  letter-spacing: .08em;
}
.badge--quiet::before { background: var(--accent-2); box-shadow: 0 0 8px var(--accent-2); }

/* --- nebula bloom ---------------------------------------------------------
   The page ground now matches the key art's darkest corner, so the rest of
   the page can carry the art's composition too: cool blue through the middle,
   the warmer cloud colour bleeding in from both flanks. Sampled from
   shared/img/nebula-games-background.jpg. Kept very low alpha - it should
   register as depth, not as a gradient anyone notices. */

body {
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-image:
    radial-gradient(70svh 55svh at 50% 0%,
      color-mix(in srgb, var(--nebula-cyan) 7%, transparent), transparent 70%),
    radial-gradient(60svh 70svh at 2% 38%,
      color-mix(in srgb, var(--nebula-magenta) 9%, transparent), transparent 68%),
    radial-gradient(60svh 70svh at 98% 62%,
      color-mix(in srgb, var(--nebula-magenta) 8%, transparent), transparent 68%);
}

/* --- the nebula toy -------------------------------------------------------
   Enhancement only. The canvas and its controls are hidden by default and are
   revealed by the `js` class the inline script in <head> sets, so with
   js/nebula.js missing or blocked the section degrades to its heading and
   paragraph rather than a blank grey box. This is the inverse of the .reveal
   rule and deliberately so: a canvas with no script is not content. */

.nebula { margin-top: 2rem; }

.nebula__canvas,
.nebula__bar { display: none; }

.js .nebula__canvas {
  display: block;
  width: 100%;
  height: clamp(260px, 42vw, 460px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--nebula-void);
  cursor: crosshair;
  touch-action: manipulation;
}
.js .nebula__canvas:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.js .nebula__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6rem;
  margin-top: .9rem;
}
.nebula__bar .btn { padding: .55rem 1rem; font-size: .85rem; }

.nebula__count {
  font-family: var(--mono);
  font-size: .78rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-left: auto;
}

/* The toy IS this section's content, so with no JS the whole section goes
   rather than leaving "Make a nebula" as a heading over nothing. The page then
   reads games -> about, which is how it read before this existed. The `js`
   class comes from the inline script in <head>, so it is set before first
   paint - the same mechanism .reveal uses, not the deferred site.js. */
#play { display: none; }
.js #play { display: block; }

@media (max-width: 560px) {
  .nebula__count { margin-left: 0; width: 100%; }
}

/* --- star-type picker ----------------------------------------------------
   These are chips rather than buttons so five of them can sit in a row
   without shouting. aria-pressed carries the selection for assistive tech;
   the ring carries it visually. */

.chip--star,
.chip--reset {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 80%, transparent);
  color: var(--text-dim);
  transition: border-color .2s ease, color .2s ease, background .2s ease;
}
.chip--star:hover,
.chip--reset:hover { color: var(--text); border-color: var(--accent-deep); }

.chip--star[aria-pressed="true"] {
  color: var(--text);
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 18%, transparent);
}
.chip--star:focus-visible,
.chip--reset:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* a dot in each chip's own colour, so the names are not the only cue */
.chip--star::before {
  content: "";
  display: inline-block;
  width: .5rem; height: .5rem;
  border-radius: 50%;
  margin-right: .45rem;
  vertical-align: baseline;
  background: currentColor;
}
.chip--star[data-star="random"]::before  { background: hsl(280, 90%, 72%); }
.chip--star[data-star="red"]::before     { background: hsl(14, 85%, 58%); }
.chip--star[data-star="blue"]::before    { background: hsl(211, 95%, 74%); }
.chip--star[data-star="neutron"]::before { background: hsl(193, 35%, 96%); }
.chip--star[data-star="hole"]::before    { background: #05070f; box-shadow: 0 0 0 1px rgba(255,190,120,.8); }

/* Chips inherit a compact size from base.css, which is fine for the static
   tag chips on a title card but too small as a tap target - these are real
   controls. 44px is the usual floor for a finger. */
@media (pointer: coarse), (max-width: 700px) {
  .chip--star,
  .chip--reset {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding-inline: .85rem;
  }
}
