/* =========================================================
   Monocled Moose Studios — site styles
   Edit colors, spacing, typography below. Per-project accent
   colors live at the bottom (search for "Per-project accents").
   ========================================================= */

@font-face {
  font-family: "Kenney Future Narrow";
  src: url("../fonts/KenneyFutureNarrow.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: #0a0a0a;
  color: #f2f2f2;
  line-height: 1.6;
  font-size: 16px;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* ---------- Typography ---------- */
.display,
h1, h2, h3, .nav__brand, .nav__link, .btn {
  font-family: "Kenney Future Narrow", "Inter", sans-serif;
  letter-spacing: 0.04em;
}

h1 { font-size: clamp(2.5rem, 6vw, 5rem); line-height: 1; }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.8rem); line-height: 1.1; }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); }

p { max-width: 68ch; }

.tagline {
  font-family: "Kenney Future Narrow", sans-serif;
  font-size: clamp(0.9rem, 1.2vw, 1.05rem);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #c4c4c4;
}

.eyebrow {
  font-family: "Kenney Future Narrow", sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #888;
  margin-bottom: 0.5rem;
}

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
}

.container--narrow { max-width: 860px; }

section { padding: clamp(4rem, 10vw, 8rem) 0; }

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem clamp(1.25rem, 4vw, 3rem);
  background: transparent;
  transition: background-color 0.35s ease, color 0.35s ease;
  color: #f2f2f2;
}

.nav--scrolled {
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav--light { color: #0a0a0a; }
.nav--light.nav--scrolled { background: rgba(255, 255, 255, 0.92); }

.nav__brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.1rem;
  line-height: 1.05;
  position: relative;
}

/* Logo swap: white-text version is the default (for dark backgrounds).
   When the nav is in light mode (over a light hero), show the dark-text
   version instead. The scroll logic in main.js toggles .nav--light. */
.nav__logo {
  height: 48px;
  width: auto;
  display: block;
  transition: opacity 0.25s ease;
}

.nav__logo--dark { display: none; }

.nav--light .nav__logo--light { display: none; }
.nav--light .nav__logo--dark  { display: block; }

@media (max-width: 720px) {
  .nav__logo { height: 40px; }
}

.nav__links {
  display: flex;
  gap: clamp(1.5rem, 4vw, 3rem);
  list-style: none;
}

.nav__link {
  font-size: 0.95rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  position: relative;
  padding-bottom: 4px;
  transition: opacity 0.2s ease;
}

.nav__link::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.nav__link:hover::after,
.nav__link[aria-current="page"]::after {
  transform: scaleX(1);
}

.nav__toggle {
  display: none;
  font-size: 1.5rem;
  letter-spacing: 0.1em;
}

@media (max-width: 720px) {
  .nav__links {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 10, 0.97);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    font-size: 1.5rem;
    transform: translateX(100%);
    transition: transform 0.35s ease;
  }
  .nav__links.is-open { transform: translateX(0); }
  .nav__toggle { display: block; z-index: 101; }
}

/* ---------- Hero (home) ---------- */
.home-hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding-top: 120px;
  padding-bottom: 60px;
}

.home-hero__bg {
  position: absolute;
  inset: 0;
  background: url("../images/home-hero.png") center/cover no-repeat;
  filter: saturate(1.1);
  z-index: 0;
}

.home-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10,10,10,0.15) 0%, rgba(10,10,10,0.55) 70%, #0a0a0a 100%);
  z-index: 1;
}

.home-hero__content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 900px;
  padding: 0 1.5rem;
}

.home-hero__title {
  font-size: clamp(3rem, 8vw, 7rem);
  text-transform: uppercase;
  line-height: 0.95;
  margin-bottom: 1.5rem;
  text-shadow: 0 4px 30px rgba(0,0,0,0.6);
}

.home-hero__tagline {
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #e5e5e5;
}

/* Small section hero (projects page, about page) */
.page-hero {
  padding-top: calc(120px + 3rem);
  padding-bottom: 3rem;
  text-align: left;
}

.page-hero h1 {
  font-size: clamp(2.5rem, 7vw, 6rem);
  text-transform: uppercase;
  line-height: 0.95;
}

/* ---------- Project grid ----------
   Edge-to-edge, 3 columns on desktop, no gap.
   At rest: pure image. On hover: image dims + title/status fade in.
*/
.grid-section {
  padding-left: 0;
  padding-right: 0;
  padding-top: clamp(4rem, 10vw, 7rem);
  padding-bottom: clamp(4rem, 10vw, 7rem);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  width: 100%;
}

@media (max-width: 900px) {
  .project-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 520px) {
  .project-grid { grid-template-columns: 1fr; }
}

.project-card {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  display: block;
  isolation: isolate;
  transform: translateZ(0);
}

.project-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1),
              filter 0.4s ease;
}

/* Scrim = dimming layer that appears on hover */
.project-card__scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  opacity: 0;
  transition: opacity 0.35s ease;
  z-index: 1;
}

/* Meta = title + status text, centered, hidden at rest */
.project-card__meta {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem;
  color: #fff;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.35s ease, transform 0.35s ease;
  pointer-events: none;
}

.project-card__title {
  font-family: "Kenney Future Narrow", sans-serif;
  font-size: clamp(1.1rem, 1.6vw, 1.6rem);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  line-height: 1.1;
  max-width: 20ch;
}

.project-card__status {
  font-family: "Kenney Future Narrow", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 0.75rem;
}

/* Hover state */
.project-card:hover img,
.project-card:focus-visible img {
  transform: scale(1.03);
  filter: saturate(1.1);
}

.project-card:hover .project-card__scrim,
.project-card:focus-visible .project-card__scrim {
  opacity: 1;
}

.project-card:hover .project-card__meta,
.project-card:focus-visible .project-card__meta {
  opacity: 1;
  transform: translateY(0);
}

/* Touch devices: show a subtle label at the bottom instead of hover, so the
   experience isn't broken on phones/tablets where there's no hover. */
@media (hover: none) {
  .project-card__scrim {
    opacity: 1;
    background: linear-gradient(180deg, rgba(0,0,0,0) 55%, rgba(0,0,0,0.75) 100%);
  }
  .project-card__meta {
    opacity: 1;
    transform: none;
    justify-content: flex-end;
    text-align: left;
    align-items: flex-start;
    padding: 1.25rem;
  }
  .project-card__title { font-size: 1rem; }
  .project-card__status { font-size: 0.7rem; margin-top: 0.35rem; }
}

/* ---------- Project detail pages ---------- */
.project-hero {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 600px;
  overflow: hidden;
}

.project-hero__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.1) 60%, #0a0a0a 100%);
}

.project-hero__scroll-cue {
  position: absolute;
  left: 50%; bottom: 2rem;
  transform: translateX(-50%);
  font-family: "Kenney Future Narrow", sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.8);
  z-index: 2;
  animation: bob 2.5s ease-in-out infinite;
}

@keyframes bob {
  0%,100% { transform: translate(-50%, 0); }
  50%     { transform: translate(-50%, 6px); }
}

.project-intro {
  padding: clamp(3rem, 8vw, 6rem) 0 clamp(2rem, 5vw, 4rem);
}

.project-intro__layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 860px) {
  .project-intro__layout {
    grid-template-columns: 1.2fr 1fr;
    gap: 4rem;
    align-items: start;
  }
}

.project-title {
  font-size: clamp(2.5rem, 6vw, 5rem);
  line-height: 0.95;
  text-transform: uppercase;
  color: var(--accent, #f2f2f2);
  margin-bottom: 1rem;
}

.project-tagline {
  font-family: "Kenney Future Narrow", sans-serif;
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #d6d6d6;
  margin-bottom: 2rem;
  max-width: 40ch;
}

.project-body p + p { margin-top: 1em; }
.project-body { color: #d6d6d6; }
.project-body strong { color: #fff; }

/* Metadata block (right column) */
.project-meta {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 1.5rem;
}

.project-meta__row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-size: 0.9rem;
}

.project-meta__label {
  font-family: "Kenney Future Narrow", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #888;
  font-size: 0.8rem;
}

.project-meta__value { color: #f2f2f2; text-align: right; }

.project-meta__value--status {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border: 1px solid var(--accent, #f2f2f2);
  color: var(--accent, #f2f2f2);
  font-family: "Kenney Future Narrow", sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  border-radius: 2px;
}

/* CTA buttons */
.cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  border: 1px solid currentColor;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.85rem;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.btn:hover { transform: translateY(-2px); }

.btn--primary {
  background: var(--accent, #f2f2f2);
  color: #0a0a0a;
  border-color: var(--accent, #f2f2f2);
}

.btn--primary:hover {
  background: transparent;
  color: var(--accent, #f2f2f2);
}

.btn--ghost:hover {
  background: #f2f2f2;
  color: #0a0a0a;
}

/* Gallery */
.project-gallery {
  padding-bottom: clamp(4rem, 10vw, 8rem);
}

.project-gallery__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 700px) {
  .project-gallery__grid { grid-template-columns: 1fr 1fr; }
  .project-gallery__grid .wide { grid-column: 1 / -1; }
}

.project-gallery__item {
  background: #1a1a1a;
  border: 1px dashed rgba(255,255,255,0.15);
  border-radius: 4px;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #555;
  font-family: "Kenney Future Narrow", sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
}

.project-gallery__item img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 3px;
}

/* Next project link */
.next-project {
  padding: clamp(4rem, 10vw, 8rem) 0;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
}

.next-project__label {
  font-family: "Kenney Future Narrow", sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #888;
  margin-bottom: 0.5rem;
}

.next-project__title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1;
  text-transform: uppercase;
  transition: color 0.3s ease;
}

.next-project a:hover .next-project__title { color: var(--accent, #fff); }

/* ---------- About page ---------- */
.about-copy {
  max-width: 720px;
  margin: 0 auto;
  font-size: clamp(1.05rem, 1.3vw, 1.2rem);
  line-height: 1.75;
  color: #dcdcdc;
}

.about-copy p + p { margin-top: 1.35em; }

/* ---------- Featured on home ---------- */
.home-featured {
  padding: clamp(4rem, 10vw, 7rem) 0;
  background: #0a0a0a;
}

.home-featured__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.home-featured__header h2 { text-transform: uppercase; }

.view-all-link {
  font-family: "Kenney Future Narrow", sans-serif;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.85rem;
  padding-bottom: 3px;
  border-bottom: 1px solid currentColor;
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 3rem 0 2rem;
  color: #888;
  font-size: 0.9rem;
}

.footer__grid {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: center;
}

.footer__brand {
  display: flex; align-items: center; gap: 0.75rem;
  color: #ccc;
}

.footer__brand img { height: 46px; width: auto; }

.footer__links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  font-family: "Kenney Future Narrow", sans-serif;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.8rem;
}

.footer__copy { font-size: 0.8rem; letter-spacing: 0.08em; }

/* ---------- Reveal-on-scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* =========================================================
   Per-project accents
   Each project page sets a body class, e.g. <body class="proj-odins-ttrpg">
   These variables drive the accent color and tonal background tint.
   ========================================================= */

.proj-odins-ttrpg      { --accent: #d92d26; }   /* Viking blood red */
.proj-odins-game       { --accent: #7fb4d4; }   /* Icy mist blue */
.proj-mr-wonderful     { --accent: #f6c844; }   /* Circus yellow */
.proj-kingdoms-tribus  { --accent: #d6d6d6; }   /* Dragon-scale silver */
.proj-vibrato-obscura  { --accent: #b983ff; }   /* Wizard violet */
.proj-d20-chess        { --accent: #f1d53b; }   /* d20 gold */

/* Tonal page tint behind the content — very subtle */
.proj-odins-ttrpg      .project-intro { background: linear-gradient(180deg, rgba(217,45,38,0.06), transparent 80%); }
.proj-odins-game       .project-intro { background: linear-gradient(180deg, rgba(127,180,212,0.06), transparent 80%); }
.proj-mr-wonderful     .project-intro { background: linear-gradient(180deg, rgba(246,200,68,0.05), transparent 80%); }
.proj-kingdoms-tribus  .project-intro { background: linear-gradient(180deg, rgba(214,214,214,0.03), transparent 80%); }
.proj-vibrato-obscura  .project-intro { background: linear-gradient(180deg, rgba(185,131,255,0.06), transparent 80%); }
.proj-d20-chess        .project-intro { background: linear-gradient(180deg, rgba(241,213,59,0.05), transparent 80%); }
