/* ══════════════════════════════════════════════════════════
   Lilac Zine — quest (project) pages
   "Magazine B" look from the design exploration, applied to
   the EXISTING project-page markup. No HTML or copy changes:
   these rules target the original class names, so every page
   keeps its full text.

   Used by project-*.html and contact.html.
   Pairs with quest.js (reveals + gallery lightbox).
   ══════════════════════════════════════════════════════════ */

:root {
  --bg:      #f4f1fa;
  --paper:   #fdfbff;
  --ink:     #2f2545;
  --violet:  #7b5ec7;
  --lilac:   #a48ae0;
  --deep:    #5b3fa8;
  --pale:    #d9c9f5;
  --muted:   #7a7096;
  --body:    #5c5178;
  --chip-a:  #eae2fa;
  --chip-b:  #e6dcf7;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Nunito', sans-serif;
  font-size: 16px;
  line-height: 1.75;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--violet); }
img { max-width: 100%; display: block; }

/* paper grain, without needing an extra element */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 50; pointer-events: none; opacity: 0.45;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="160" height="160"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency="0.8" numOctaves="2"/><feColorMatrix values="0 0 0 0 0.18 0 0 0 0 0.14 0 0 0 0 0.27 0 0 0 0.05 0"/></filter><rect width="160" height="160" filter="url(%23n)"/></svg>');
}

@keyframes stamp-in {
  0%   { transform: scale(1.6) rotate(var(--lr, 0deg)); opacity: 0; }
  60%  { transform: scale(0.92) rotate(var(--lr, 0deg)); opacity: 1; }
  100% { transform: scale(1) rotate(var(--lr, 0deg)); opacity: 1; }
}

/* ── back link, floated as the nav pill ── */
.proj-back {
  position: fixed; top: 1rem; left: 1.6rem; z-index: 999;
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-size: 0.62rem; font-weight: 800; letter-spacing: 1px; text-transform: uppercase;
  background: var(--paper); color: var(--ink);
  border: 2px solid var(--ink); border-radius: 30px;
  padding: 0.4rem 1rem 0.4rem 0.8rem; box-shadow: 2px 2px 0 var(--ink);
  transition: transform 0.15s, box-shadow 0.15s;
}
.proj-back::before { content: '⚅'; font-size: 1.05rem; color: var(--violet); }
.proj-back:hover {
  color: var(--violet); transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink);
}

/* ── hero ── */
.proj-detail { position: relative; }

.proj-hero {
  position: relative; height: 66vh; min-height: 420px;
  margin-top: 4.6rem; overflow: hidden;
  border-top: 2.5px solid var(--ink); border-bottom: 2.5px solid var(--ink);
}
.proj-hero > img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center top;
}
.proj-hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(47,37,69,0.82), rgba(47,37,69,0.15) 55%, transparent);
}
.proj-hero-text {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 2.5rem 3rem; display: flex; flex-direction: column; gap: 0.5rem;
}
.proj-genre {
  align-self: flex-start; margin: 0;
  background: var(--bg); color: var(--ink);
  font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800;
  font-size: 0.62rem; letter-spacing: 1px; text-transform: uppercase;
  padding: 0.25rem 0.8rem; border-radius: 20px; border: 2px solid var(--ink);
  --lr: -2deg; transform: rotate(-2deg);
  animation: stamp-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
}
.proj-hero-text h1 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: clamp(2.6rem, 8vw, 6.5rem); font-weight: 800;
  line-height: 0.95; margin: 0; letter-spacing: -0.02em; color: var(--paper);
}

/* ── content: meta becomes a strip, body goes full width ── */
.proj-content { display: block; }

/* full-bleed bar, inner content still aligned to the 1150px column */
.proj-meta {
  background: var(--paper); border-bottom: 2.5px solid var(--ink);
  margin: 0 0 3.2rem;
  padding: 1.1rem max(2rem, calc((100% - 1150px) / 2));
  display: flex; gap: 2.5rem; flex-wrap: wrap; align-items: baseline;
}
.proj-meta-group { display: flex; flex-direction: column; gap: 0.05rem; max-width: 320px; }
.proj-meta-label {
  font-weight: 800; letter-spacing: 1px; font-size: 0.58rem;
  text-transform: uppercase; color: var(--muted);
}
.proj-meta-value { font-size: 0.82rem; font-weight: 700; line-height: 1.5; }

.proj-meta-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; align-self: center; }
.tag {
  font-size: 0.62rem; font-weight: 800; padding: 0.2rem 0.7rem;
  border: 2px solid var(--ink); border-radius: 20px; background: var(--chip-a);
}
.tag:nth-child(even) { background: var(--chip-b); }

/* ── body ── */
.proj-body {
  max-width: 1150px; margin: 0 auto; padding: 0 2rem;
  display: flex; flex-direction: column; gap: 3rem;
}
.proj-body > div { display: flex; flex-direction: column; gap: 0.8rem; }

.proj-body h2 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 2rem; font-weight: 800; margin: 0;
}
.proj-body h2::after { content: '.'; color: var(--violet); }
.proj-body h3 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1.2rem; font-weight: 800; margin: 0.4rem 0 0;
}
.proj-body p {
  font-size: 0.95rem; color: var(--body); line-height: 1.85; margin: 0;
  max-width: 76ch;
}
.proj-body strong { color: var(--ink); }
.proj-body em { color: var(--violet); font-style: italic; }
.proj-body ul, .proj-body ol {
  margin: 0; padding-left: 1.2rem;
  display: flex; flex-direction: column; gap: 0.35rem;
}
.proj-body li { font-size: 0.92rem; color: var(--body); line-height: 1.7; max-width: 74ch; }
.proj-body li::marker { color: var(--violet); }
.proj-body a { color: var(--violet); font-weight: 700; text-decoration: underline; }

/* callout → pull-quote card */
.proj-callout {
  background: var(--paper); border: 2.5px solid var(--ink); border-radius: 18px;
  padding: 1.5rem 1.7rem; box-shadow: 5px 5px 0 var(--lilac); transform: rotate(0.6deg);
}
.proj-callout p { font-family: 'Patrick Hand', cursive; font-size: 1.3rem; color: var(--violet); }

/* ── magazine spreads: text one side, rotated image card the other ──
   scoped to `.proj-body >` so these beat the generic
   `.proj-body > div { display:flex }` rule above (0-1-1 specificity). */
.proj-body > .spread {
  display: grid; grid-template-columns: var(--cols, 1.1fr 1fr);
  gap: 3rem; align-items: start;
}
.spread-text {
  order: var(--txt-order, 0); min-width: 0;
  display: flex; flex-direction: column; gap: 0.8rem;
}
.spread-figure {
  order: var(--img-order, 1); margin: 0;
  display: flex; flex-direction: column; gap: 0.45rem;
  position: sticky; top: 90px;
}
.spread-figure .frame {
  border: 2.5px solid var(--ink); border-radius: 14px; overflow: hidden;
  background: var(--paper); box-shadow: 5px 5px 0 var(--shadow, var(--lilac));
  transform: rotate(var(--rot, 0deg));
}
.spread-figure img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.spread-figure figcaption {
  font-family: 'Patrick Hand', cursive; font-size: 0.9rem;
  color: var(--muted); text-align: center;
}
/* a section with no image left to pair with */
.proj-body > .spread-solo { grid-template-columns: 1fr; }
.spread-solo .spread-text { max-width: 76ch; }

/* ── gallery + lightbox ── */
.proj-body > .quest-gallery { display: flex; flex-direction: column; gap: 1.1rem; }
.gallery-head { display: flex; align-items: baseline; gap: 0.9rem; flex-wrap: wrap; }
.gallery-hint { font-family: 'Patrick Hand', cursive; font-size: 1rem; color: var(--violet); }

.gallery-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem;
}
.shot {
  all: unset; cursor: zoom-in; display: block;
  border: 2.5px solid var(--ink); border-radius: 12px; overflow: hidden;
  box-shadow: 3px 3px 0 var(--lilac); aspect-ratio: 1; background: #ece5f8;
  transition: transform 0.2s, box-shadow 0.2s;
}
.shot:hover { transform: translateY(-3px); box-shadow: 5px 6px 0 var(--violet); }
.shot:focus-visible { outline: 3px solid var(--violet); outline-offset: 3px; }
.shot img { width: 100%; height: 100%; object-fit: cover; }

.lightbox {
  position: fixed; inset: 0; z-index: 2000; display: none;
  align-items: center; justify-content: center;
  background: rgba(47, 37, 69, 0.9); backdrop-filter: blur(4px);
  padding: 3rem; cursor: zoom-out;
}
.lightbox.is-open { display: flex; }
.lightbox img {
  max-width: 90%; max-height: 90%;
  border: 3px solid var(--paper); border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.lightbox button {
  position: absolute; top: 1.5rem; right: 1.8rem;
  all: unset; cursor: pointer;
  font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800; font-size: 1.6rem;
  color: var(--paper); background: rgba(123, 94, 199, 0.6); border-radius: 50%;
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
}
.lightbox button:focus-visible { outline: 3px solid var(--paper); }

/* ── carousel, restyled (JS contract untouched) ── */
.proj-carousel {
  position: relative; width: 100%;
  border: 2.5px solid var(--ink); border-radius: 18px; overflow: hidden;
  background: #ece5f8; box-shadow: 6px 6px 0 var(--lilac);
}
.proj-carousel:focus-visible { outline: 3px solid var(--violet); outline-offset: 4px; }

.carousel-track {
  display: flex;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}
.carousel-track img {
  min-width: 100%; width: 100%; height: 460px;
  object-fit: cover; object-position: center;
}

.carousel-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 42px; height: 42px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; font-weight: 800; color: var(--ink);
  background: var(--paper); border: 2.5px solid var(--ink); border-radius: 50%;
  box-shadow: 2px 2px 0 var(--ink);
  transition: transform 0.15s, box-shadow 0.15s;
}
.carousel-btn:hover { background: var(--chip-a); }
.carousel-btn:active { transform: translateY(-50%) translate(2px, 2px); box-shadow: 0 0 0 var(--ink); }
.carousel-prev { left: 1rem; }
.carousel-next { right: 1rem; }

.carousel-footer {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.7rem 1.1rem;
  background: linear-gradient(to top, rgba(47,37,69,0.75), transparent);
}
.carousel-dots { display: flex; gap: 0.4rem; align-items: center; }
.carousel-dot {
  width: 9px; height: 9px; padding: 0; cursor: pointer;
  border-radius: 50%; border: 2px solid var(--paper); background: transparent;
  transition: background 0.2s, transform 0.2s;
}
.carousel-dot.active { background: var(--paper); transform: scale(1.25); }
.carousel-counter {
  font-family: 'Patrick Hand', cursive; font-size: 0.95rem; color: var(--paper);
}

/* ── next quest ── */
.proj-next { max-width: 1150px; margin: 3.5rem auto 0; padding: 0 2rem; }
.proj-next-link {
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  background: var(--paper); border: 2.5px solid var(--ink); border-radius: 18px;
  padding: 1.4rem 1.8rem; box-shadow: 5px 5px 0 var(--lilac);
  transition: transform 0.2s, box-shadow 0.2s;
}
.proj-next-link:hover {
  color: inherit; transform: translate(2px, 2px); box-shadow: 3px 3px 0 var(--lilac);
}
.proj-next-label { font-family: 'Patrick Hand', cursive; font-size: 0.95rem; color: var(--violet); }
.proj-next-title { font-family: 'Bricolage Grotesque', sans-serif; font-size: 1.5rem; font-weight: 800; }
.proj-next-arrow { font-size: 1.8rem; color: var(--violet); }

/* ── footer ── */
.site-footer {
  margin-top: 4rem; padding: 2.4rem 2rem;
  border-top: 2.5px solid var(--ink); background: var(--paper);
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.2rem; flex-wrap: wrap;
}
.footer-text { font-size: 0.72rem; letter-spacing: 1.5px; color: var(--muted); margin: 0; }
.footer-links { display: flex; gap: 1.5rem; }
.footer-link {
  font-size: 0.72rem; font-weight: 800; letter-spacing: 1px;
  text-transform: uppercase; color: var(--muted);
}
.footer-link:hover { color: var(--violet); }

/* ── responsive ── */
@media (max-width: 900px) {
  /* spreads stack, image always under its text, nothing sticky */
  .proj-body > .spread { grid-template-columns: 1fr !important; gap: 1.5rem; }
  .spread-text, .spread-figure { order: 0 !important; }
  .spread-figure { position: static; }
  .spread-figure .frame { transform: rotate(0deg); }
}

@media (max-width: 760px) {
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(115px, 1fr)); gap: 0.7rem; }
  .lightbox { padding: 1.2rem; }
  .lightbox button { top: 0.6rem; right: 0.8rem; }
  .proj-back { top: 0.7rem; left: 0.8rem; padding: 0.35rem 0.8rem 0.35rem 0.6rem; font-size: 0.58rem; }
  .proj-hero { height: 52vh; min-height: 300px; margin-top: 3.6rem; }
  .proj-hero-text { padding: 1.4rem 1.2rem; }
  .proj-meta { gap: 1.1rem; margin-bottom: 2.2rem; }
  .proj-meta-group { max-width: none; }
  .proj-body { gap: 2.2rem; }
  .proj-body h2 { font-size: 1.55rem; }
  .carousel-track img { height: 260px; }
  .carousel-btn { width: 34px; height: 34px; font-size: 0.9rem; }
  .carousel-prev { left: 0.5rem; }
  .carousel-next { right: 0.5rem; }
  .proj-next { padding: 0 1.2rem; }
  .proj-next-link { padding: 1.1rem 1.2rem; }
  .proj-next-title { font-size: 1.2rem; }
  .site-footer { justify-content: center; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
