/* ---------- Grid homepage + project detail pages ----------
   Body text stays plain Archivo throughout; the Recursive scramble effect
   (js/scramble.js, .scramble-char in style.css) is reserved for the
   interactive navigation elements — banner, nav links, tile labels. */

:root { --sidebar-w: 180px; }

.wrap-wide { max-width: 1100px; }

/* ---------- Banner: "Jim Hoult" / home link ----------
   A separate, always-rendered fixed element — deliberately NOT inside
   #sidebar, so it stays visible on mobile even while the nav list below
   is collapsed/translateX'd off-screen. The underline is drawn with
   box-shadow (not text-decoration) so it can be faded independently: shown
   instantly on click, then fading out over the scramble's duration — the
   "takes a moment before moving on" beat, like bk.studio's logo. */
.site-banner {
  position: fixed; top: 1.6rem; left: 1.25rem; z-index: 150;
  font-size: 1.05rem; font-weight: 700; color: var(--ink); text-decoration: none;
  box-shadow: 0 1px 0 0 rgba(0,0,0,0); transition: box-shadow 0.5s ease-out;
  padding-bottom: 2px;
}
.site-banner.clicked { box-shadow: 0 1px 0 0 var(--ink); transition: none; }

/* ---------- Sidebar: nav list ----------
   Desktop: fixed left column, content offset by --sidebar-w (see body.has-sidebar).
   Mobile: collapses behind a hamburger; #sidebar becomes a slide-out drawer. */
#sidebar {
  position: fixed; top: 4.5rem; left: 0; bottom: 0; width: var(--sidebar-w);
  padding: 0 1.25rem 2rem; overflow-y: auto; z-index: 100;
}
.sidebar-nav { display: flex; flex-direction: column; }
.nav-heading {
  color: var(--lightgrey); font-size: 0.78rem; letter-spacing: 0.04em;
  margin: 0 0 0.5rem;
}
.nav-group { display: flex; flex-direction: column; gap: 0.5rem; margin-left: 0.9rem; }
.nav-spacer { height: 1.4rem; }
.sidebar-nav a {
  color: var(--grey); font-size: 0.88rem; text-decoration: none; line-height: 1.35;
  /* Locked to one line: while scrambling, random substitute characters are
     wider/narrower than the real ones, so the wrap point shifts frame to
     frame — left unconstrained, that makes items flip between one and two
     lines and the whole list below jumps. Clipping to a single line with
     an ellipsis keeps every item's height constant throughout the effect. */
  display: block; width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-group a { font-size: 0.82rem; }
.sidebar-nav a:hover { color: var(--ink); }
.sidebar-nav a.current { color: var(--ink); font-weight: 700; }

.nav-toggle {
  display: none; position: fixed; top: 1.4rem; right: 1.25rem; z-index: 200;
  width: 30px; height: 30px; border: none; background: transparent;
  flex-direction: column; align-items: center; justify-content: center;
  gap: 5px; cursor: pointer;
}
.nav-toggle span { width: 18px; height: 2px; background: var(--ink); display: block; }

body.has-sidebar .wrap { margin-left: var(--sidebar-w); }

@media (max-width: 760px) {
  body.has-sidebar .wrap { margin-left: 0; padding-top: 4.5rem; }
  .nav-toggle { display: flex; }
  #sidebar {
    top: 0; padding-top: 4.5rem; width: 220px;
    transform: translateX(-100%); transition: transform 0.2s ease-out;
    background: var(--bg);
  }
  #sidebar.open { transform: translateX(0); }
}

/* ---------- Grid ---------- */
.project-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.6rem; margin-top: 1rem;
}
.tile {
  position: relative; display: block; aspect-ratio: 4/3; overflow: hidden;
  border-radius: 2px; background: #111;
}
.tile img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 0.4s ease;
}
.tile:hover img { transform: scale(1.04); }
/* Flashed over the image on click, before navigating. White + difference
   = every channel inverts fully (255 − photo), a true photographic
   negative for a moment — see the mix-blend-mode discussion in
   conversation for why white is what makes `difference` read as a full
   invert rather than a partial, muddy one. */
.tile-flash {
  position: absolute; inset: 0; background: #ffffff;
  mix-blend-mode: difference; opacity: 0; transition: opacity 0.2s ease-out;
  pointer-events: none;
}
.tile.clicked .tile-flash { opacity: 1; transition: opacity 0.08s ease-in; }
.tile-label {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 0.7em 0.8em;
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
  color: #fff; font-size: 0.92rem; line-height: 1.3;
}
.tile-label .scramble-char { color: #fff; }

/* ---------- About page ---------- */
.about-layout { display: grid; grid-template-columns: 240px 1fr; gap: 2rem; align-items: start; margin: 0 0 2rem; }
.about-photo { width: 100%; display: block; border-radius: 2px; }
/* No section headings on this page (see conversation — they read as
   redundant labels on content that's already self-evident), so each
   block below the photo+bio gets its own top margin to stay visually
   separated instead. */
.about-block { margin-top: 1.5rem; }
@media (max-width: 560px) { .about-layout { grid-template-columns: 1fr; } .about-photo { max-width: 240px; } }

/* ---------- Project detail ---------- */
.project-detail {
  display: grid;
  grid-template-columns: clamp(200px, 30%, 320px) 1fr;   /* was 320px 1fr */
  gap: clamp(1.5rem, 3vw, 2.5rem);                        /* was 2.5rem */
  padding: 2rem 0 4rem; align-items: start;
}

.project-text { position: sticky; top: 2rem; }

/* Stack text above the gallery earlier (was 760px) */
@media (max-width: 860px) {
  .project-detail { grid-template-columns: 1fr; }
  .project-text { position: static; }
}

/* Landscape phones: sticky text taller than the screen gets cut off */
@media (orientation: landscape) and (max-height: 500px) {
  .project-text { position: static; }
}

.project-title {
  font-size: 1.6rem; margin: 0.1em 0 0.3em; line-height: 1.2;
  /* Matches .scramble-char's resting values exactly (style.css) — the
     tile's title scrambles in on hover/click and settles here, so the
     static title reads as the same typographic voice, "landed". */
  font-family: "Recursive", "Archivo", sans-serif;
  font-variation-settings: "CASL" 0.3, "wght" 650, "slnt" 0, "CRSV" 0.4;
}
.project-desc { font-size: 0.96rem; line-height: 1.6; margin: 1em 0; }
.project-credits { font-size: 0.88rem; color: var(--charcoal); line-height: 1.7; margin: 1em 0; }

/* .project-gallery {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem;
}
.project-gallery img { width: 100%; display: block; border-radius: 2px; }
@media (max-width: 480px) {
  .project-gallery { grid-template-columns: 1fr; }
  .project-gallery img.wide { grid-column: auto; }
}
.project-gallery { grid-auto-flow: dense; }
.project-gallery img.wide { grid-column: span 2; } */

.project-gallery {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem;
}
.project-gallery img { width: 100%; display: block; border-radius: 2px; }
.project-gallery img.wide { grid-column: 1 / -1; }

/* About page: bio is body text (Archivo, smaller than default, readable) */
.about-text .hint {
  color: var(--charcoal);
  font-size: 0.92rem;
  line-height: 1.6;
  margin: 0 0 1em;
}

/* Links + email: Recursive, same voice as the titles on Dates / project pages */
.about-page .entry-links a,
.about-page .about-block a {
  font-family: "Recursive", "Archivo", sans-serif;
  font-variation-settings: "CASL" 0.3, "wght" 620, "slnt" 0, "CRSV" 0.35;
  text-underline-offset: 3px;
}

/* Contact line: match the size and colour of the Instagram / Bandcamp links */
.about-page p.about-block {
  font-size: 0.86rem;
  color: var(--ink);
}

#email {
  font-family: "Recursive", "Archivo", sans-serif;
  font-variation-settings: "CASL" 0.3, "wght" 620, "slnt" 0, "CRSV" 0.35;
  font-size: 0.86rem; line-height: 1.6; margin: 1em 0;
  text-underline-offset: 3px;
} 

