/* ==========================================================================
   Stela Entertainment — site.css
   Single consolidated stylesheet. Plain CSS, no build step.
   Sections: 1) Tokens  2) Reset/base  3) Layout  4) Nav  5) Components
             6) Sections/pages  7) Game embed  8) Jam template  9) Media queries
   ========================================================================== */

/* ============================ 1. Design tokens ============================ */
:root {
  --bg:            #0c0a06;
  --bg-raised:     #14110b;
  --bg-card:       #17130c;
  --bg-dark:       #080604;
  --border:       #2a2013;
  --border-strong:#3a2d18;

  --text:          #ece0cc;   /* warm off-white — main body copy            */
  --text-dim:      #a4855e;   /* muted captions, meta                       */
  --text-faint:    #6f5d43;

  --brand:         #f7941d;   /* Stela orange                              */
  --brand-hi:      #ffb04d;
  --accent:        #00d4ff;   /* cyan — links / interactive                */
  --accent-hi:     #5fe6ff;
  --danger:        #f75555;

  --maxw:          1180px;
  --radius:        12px;
  --radius-sm:     8px;
  --shadow:        0 16px 40px rgba(0, 0, 0, 0.45);
  --shadow-brand:  0 16px 36px rgba(247, 148, 29, 0.14);

  --font-display: 'Kelly Slab', Georgia, 'Times New Roman', serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  --header-h: 68px;
}

/* ============================ 2. Reset & base ============================ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 1.0625rem;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.12; color: var(--text); font-weight: 400; }
h1 { font-size: clamp(2.6rem, 7vw, 4.6rem); }
h2 { font-size: clamp(2rem, 4.5vw, 3rem); }
h3 { font-size: 1.4rem; }

p { max-width: 68ch; }

a { color: var(--accent); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--accent-hi); }
a:focus-visible,
button:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

ul { list-style-position: inside; }

.section-title {
  text-align: center;
  margin-bottom: 2.75rem;
  background: linear-gradient(90deg, var(--brand), var(--danger));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.eyebrow {
  font-family: var(--font-body);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--brand);
  display: block;
  margin-bottom: .9rem;
}

.lead { font-size: 1.2rem; color: var(--text-dim); }

.muted { color: var(--text-dim); }

/* ============================ 3. Layout ============================ */
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 1.4rem; }

.section { padding: 5rem 0; }
.section--tight { padding: 3.5rem 0; }
.section--dark { background: var(--bg-dark); }
.section--raised { background: var(--bg-raised); }

.stack > * + * { margin-top: 1rem; }

.skip-link {
  position: absolute; left: 8px; top: 8px;
  background: var(--brand); color: #000; padding: .6rem 1rem;
  border-radius: 6px; font-weight: 600; transform: translateY(-150%);
  transition: transform .2s ease; z-index: 200;
}
.skip-link:focus { transform: translateY(0); color: #000; }

/* ============================ 4. Header / Nav ============================ */
.site-header {
  position: fixed; inset: 0 0 auto 0;
  height: var(--header-h);
  display: flex; align-items: center;
  background: rgba(12, 10, 6, .82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
}

.brand {
  display: flex; align-items: center; gap: .6rem;
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--brand);
  white-space: nowrap;
}
.brand:hover { color: var(--brand-hi); }
.brand img { width: 30px; height: 30px; }

.nav { display: flex; align-items: center; gap: .35rem; }
.nav a {
  color: var(--text-dim);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: .98rem;
  padding: .55rem .8rem;
  border-radius: 6px;
}
.nav a:hover { color: var(--text); background: rgba(255,255,255,.04); }
.nav a[aria-current="page"] { color: var(--brand); }

.nav-toggle { display: none; }
.hamburger {
  display: none;
  flex-direction: column; justify-content: space-between;
  width: 28px; height: 19px; cursor: pointer; background: none; border: 0;
}
.hamburger span { display: block; height: 3px; width: 100%; background: var(--brand); border-radius: 2px; transition: transform .3s ease, opacity .3s ease; }

body { padding-top: var(--header-h); }

/* ============================ 5. Components ============================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .85rem 1.6rem;
  min-height: 48px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: .98rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--brand); color: #140c02; }
.btn--primary:hover { background: var(--brand-hi); color: #140c02; }
.btn--outline { border-color: var(--brand); color: var(--brand); }
.btn--outline:hover { background: var(--brand); color: #140c02; }
.btn--ghost { border-color: var(--border-strong); color: var(--text); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn--sm { min-height: 40px; padding: .55rem 1.1rem; font-size: .9rem; }

.btn-row { display: flex; flex-wrap: wrap; gap: 1rem; }

.tag-list { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; }
.tag {
  font-family: var(--font-body);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .03em;
  padding: .3rem .7rem;
  border-radius: 999px;
  background: rgba(247, 148, 29, .1);
  border: 1px solid var(--border-strong);
  color: var(--text-dim);
}
.tag--accent { background: rgba(0, 212, 255, .1); color: var(--accent); border-color: rgba(0,212,255,.25); }

.pill {
  display: inline-block;
  font-family: var(--font-body);
  font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: .25rem .6rem; border-radius: 6px;
}
.pill--live { background: rgba(0, 212, 255, .14); color: var(--accent); }
.pill--wip  { background: rgba(247, 148, 29, .14); color: var(--brand); }
.pill--done { background: rgba(120, 200, 120, .14); color: #7fce7f; }

/* Card grid */
.card-grid {
  display: grid;
  gap: 1.75rem;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
/* Keeps cards a readable size (and centered) when there are only one or two. */
.card-grid--cap {
  grid-template-columns: repeat(auto-fit, minmax(300px, 380px));
  justify-content: center;
}

.card {
  display: flex; flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.card:hover, .card:focus-within {
  transform: translateY(-6px);
  box-shadow: var(--shadow-brand);
  border-color: var(--border-strong);
}
.card__media {
  aspect-ratio: 16 / 10;
  object-fit: cover;
  width: 100%;
  background: linear-gradient(135deg, #1c1710, #0d0a06);
  border-bottom: 1px solid var(--border);
}
.card__media--contain { object-fit: contain; padding: 1.5rem; background: #0d0a06; }
.card__body { padding: 1.4rem 1.5rem 1.6rem; display: flex; flex-direction: column; gap: .7rem; flex: 1; }
.card__body h3 { color: var(--text); }
.card__meta { font-size: .9rem; color: var(--text-dim); }
.card__body p { color: var(--text); font-size: .98rem; }
.card__foot { margin-top: auto; padding-top: .4rem; display: flex; flex-wrap: wrap; gap: .6rem; }

/* Placeholder used when an image asset is not supplied yet */
.img-slot {
  display: flex; align-items: center; justify-content: center;
  gap: .3ch;
  text-align: center;
  background:
    repeating-linear-gradient(45deg, #16110a 0 12px, #100c07 12px 24px);
  color: var(--text-faint);
  font-family: var(--font-body);
  font-size: .82rem;
  border: 1px dashed var(--border-strong);
  min-height: 200px;
  padding: 1rem;
}
.img-slot.card__media { min-height: 210px; }
img.img-error { /* set by site.js when an <img> fails to load */
  min-height: 180px;
}

/* ============================ 6. Hero + page sections ============================ */
.hero {
  position: relative;
  padding: 4.5rem 0 4rem;
  overflow: hidden;
}
.hero__inner { position: relative; z-index: 2; max-width: 760px; }
.hero__bg {
  position: absolute; inset: 0; z-index: 0;
  background-size: cover; background-position: center;
  opacity: .2;
  -webkit-mask-image: linear-gradient(to bottom, #000 40%, transparent);
  mask-image: linear-gradient(to bottom, #000 40%, transparent);
}
.hero h1 { margin-bottom: 1.1rem; }
.hero h1 .accent { color: var(--brand); }
.hero .lead { margin-bottom: 2rem; max-width: 60ch; }

.home-hero { text-align: center; }
.home-hero .hero__inner { margin: 0 auto; }
.home-hero .btn-row { justify-content: center; }

.avatar {
  width: 120px; height: 120px; border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border-strong);
  margin: 0 auto 1.6rem;
}

/* Skills */
.skills-grid {
  display: grid; gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.skill {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.skill h3 { font-size: 1.2rem; color: var(--brand); margin-bottom: .6rem; }
.skill ul { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; }
.skill li {
  font-size: .82rem; color: var(--text-dim);
  border: 1px solid var(--border-strong); border-radius: 999px; padding: .25rem .65rem;
}

/* Stats */
.stat-row { display: flex; flex-wrap: wrap; gap: 2.5rem; justify-content: center; }
.stat { text-align: center; }
.stat .num {
  display: block; font-family: var(--font-display);
  font-size: 2.6rem; color: var(--brand); line-height: 1;
}
.stat .label { font-size: .85rem; color: var(--text-dim); letter-spacing: .05em; text-transform: uppercase; }

/* Split layout (text + image) */
.split {
  display: grid; gap: 2.5rem; align-items: center;
  grid-template-columns: 1fr;
}
.split img, .split .img-slot { border-radius: var(--radius); box-shadow: var(--shadow); }

/* Gallery */
.gallery {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.gallery img { border-radius: var(--radius-sm); border: 1px solid var(--border); width: 100%; }

/* Masonry gallery for mixed-aspect artwork (no cropping) */
.gallery--masonry { column-count: 3; column-gap: 1rem; }
.gallery--masonry img {
  width: 100%;
  margin: 0 0 1rem;
  display: block;
  break-inside: avoid;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #000;
}
@media (max-width: 900px) { .gallery--masonry { column-count: 2; } }
@media (max-width: 560px) { .gallery--masonry { column-count: 1; } }

/* Portrait / phone screenshots: a centered row capped by height, not width */
.gallery--portrait { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; }
.gallery--portrait img {
  width: auto;
  height: 460px;
  max-width: 100%;
  background: #000;
}
@media (max-width: 720px) {
  .gallery--portrait img { height: auto; width: calc(50% - .5rem); }
}

/* Feature list */
.feature-grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.feature { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }
.feature h3 { font-size: 1.15rem; color: var(--brand); margin-bottom: .5rem; }
.feature p { font-size: .95rem; }

/* Contact */
.contact-card {
  text-align: center;
  max-width: 640px; margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
}
.contact-links { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; margin-top: 1.5rem; }

/* Footer */
.site-footer {
  background: var(--bg-dark);
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
  text-align: center;
  color: var(--text-faint);
  font-size: .9rem;
}
.site-footer a { color: var(--text-dim); }
.site-footer a:hover { color: var(--brand); }
.site-footer nav { display: flex; gap: 1.2rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1rem; }

/* Breadcrumb */
.breadcrumb { font-size: .88rem; color: var(--text-faint); margin-bottom: 1.5rem; }
.breadcrumb a { color: var(--text-dim); }

/* ============================ 7. Game embed ============================ */
.game-embed {
  max-width: 960px;
  margin: 0 auto;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
}
.game-embed__frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
}
.game-embed__frame iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0;
}
.game-embed__overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1rem; text-align: center; padding: 2rem;
  background: radial-gradient(circle at center, #1a140c, #000);
}
.game-embed__overlay p { color: var(--text-dim); font-size: .9rem; max-width: 40ch; }
.game-embed__bar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .7rem 1rem;
  background: var(--bg-raised);
  border-top: 1px solid var(--border);
  font-size: .85rem; color: var(--text-dim);
}
.game-embed__bar button {
  background: none; border: 1px solid var(--border-strong); color: var(--text-dim);
  border-radius: 6px; padding: .4rem .8rem; cursor: pointer; font-family: var(--font-body);
}
.game-embed__bar button:hover { color: var(--accent); border-color: var(--accent); }

/* ============================ 8. Jam template ============================ */
.jam-header { border-bottom: 1px solid var(--border); padding-bottom: 2rem; margin-bottom: 2.5rem; }
.jam-facts {
  display: grid; gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin-top: 1.5rem;
}
.jam-fact .k { display: block; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-faint); }
.jam-fact .v { font-family: var(--font-display); font-size: 1.2rem; color: var(--text); }

.team-grid {
  display: grid; gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.team-member {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.3rem; text-align: center;
}
.team-member img, .team-member .img-slot {
  width: 84px; height: 84px; min-height: 0; border-radius: 50%; object-fit: cover;
  margin: 0 auto .8rem; border: 2px solid var(--border-strong);
  aspect-ratio: 1; font-size: .7rem;
}
.team-member .name { font-family: var(--font-display); font-size: 1.1rem; color: var(--text); }
.team-member .role { font-size: .85rem; color: var(--brand); margin: .2rem 0 .5rem; }
.team-member .links { display: flex; gap: .6rem; justify-content: center; font-size: .82rem; }

.retro { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.retro > div { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem; }
.retro h3 { font-size: 1.05rem; margin-bottom: .6rem; }
.retro--good h3 { color: #7fce7f; }
.retro--bad h3 { color: var(--danger); }

.sample-banner {
  background: rgba(0, 212, 255, .1);
  border: 1px solid rgba(0, 212, 255, .3);
  color: var(--accent);
  border-radius: var(--radius-sm);
  padding: .8rem 1rem;
  font-size: .9rem;
  margin-bottom: 2rem;
}

/* ============================ 9. Media queries ============================ */
@media (min-width: 720px) {
  .split { grid-template-columns: 1fr 1fr; }
  .split--reverse > :first-child { order: 2; }
}

@media (min-width: 900px) {
  .section { padding: 6.5rem 0; }
  .hero { padding: 6rem 0 5rem; }
}

@media (max-width: 860px) {
  .hamburger { display: flex; }
  .nav {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: rgba(10, 8, 4, .98);
    border-bottom: 1px solid var(--border);
    padding: .5rem 0;
    display: none;
  }
  .nav a { padding: .95rem 1.4rem; border-radius: 0; font-size: 1.05rem; }
  .nav-toggle:checked ~ .nav { display: flex; }
  .nav-toggle:checked ~ .hamburger span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .nav-toggle:checked ~ .hamburger span:nth-child(2) { opacity: 0; }
  .nav-toggle:checked ~ .hamburger span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
}

@media (max-width: 480px) {
  .btn { width: 100%; }
  .btn-row { flex-direction: column; }
  .home-hero .btn-row { flex-direction: column; }
  .stat-row { gap: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
