/* stephenlemieux.com — site-wide behaviour styles.
   Layout and typography live inline in the design files (design/*.dc.html);
   this sheet adds what the static site needs on top: texture, motion, phone layout, viewer. */

/* ---------- Carbon-fibre weave behind everything (never over photos) ---------- */
html, body { background: #0A0A0B url(carbon.png) repeat; background-size: 32px 32px; }
.site { background: transparent !important; }

/* ---------- Dip-to-black between pages (Chrome, Edge, Safari; others load normally) ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .26s ease-in both; }
::view-transition-new(root) { animation: vt-in .34s ease-out .2s both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; } }

/* ---------- Letterbox reveal: frames open from a thin strip as they scroll in ---------- */
html.reveal-on :is(.gallery-frame, .tile-media, .reel-frame) {
  clip-path: inset(40% 0 40% 0);
  transition: clip-path 1.1s cubic-bezier(.2, .7, .2, 1);
}
html.reveal-on :is(.gallery-frame, .tile-media, .reel-frame).revealed { clip-path: inset(0); }
html.reveal-on :is(.gallery-frame, .tile-media, .reel-frame).settled { clip-path: none; transition: none; }

/* ---------- Galleries: crossfade, ambient glow, open full screen ---------- */
.gallery-frame { position: relative; cursor: zoom-in; transition: box-shadow 1.2s ease; }
.gallery-frame .xfade { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity .45s ease; pointer-events: none; }
.gallery-frame .xfade.on { opacity: 1; }

/* ---------- Full-screen viewer ---------- */
.viewer { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; background: rgba(5, 5, 6, .96); opacity: 0; transition: opacity .3s ease; }
.viewer.open { opacity: 1; }
.viewer img { display: block; max-width: calc(100vw - 200px); max-height: calc(100vh - 150px); object-fit: contain; }
.viewer button { appearance: none; background: none; border: 0; color: #ECE8E1; cursor: pointer; font: 500 11px/1 'JetBrains Mono', monospace; letter-spacing: .16em; text-transform: uppercase; }
.viewer button:hover { color: #E9A04B; border-color: #E9A04B; }
.viewer .v-close { position: absolute; top: 18px; right: clamp(16px, 4vw, 48px); padding: 12px 0; }
.viewer .v-prev, .viewer .v-next { position: absolute; top: 50%; transform: translateY(-50%); width: 56px; height: 56px; border: 1px solid rgba(236, 232, 225, .3); border-radius: 999px; font-size: 18px; letter-spacing: 0; }
.viewer .v-prev { left: clamp(10px, 2vw, 32px); }
.viewer .v-next { right: clamp(10px, 2vw, 32px); }
.viewer .v-bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; padding: 20px clamp(16px, 4vw, 48px); font: 500 11px/1.4 'JetBrains Mono', monospace; letter-spacing: .16em; text-transform: uppercase; color: #A9A398; }
body.locked { overflow: hidden; }

/* ---------- Phones ---------- */
@media (max-width: 760px) {
  .site-header { flex-wrap: nowrap !important; padding: 18px 20px !important; }
  .menu-btn { display: block; position: relative; z-index: 31; appearance: none; background: none; border: 1px solid rgba(236, 232, 225, .35); border-radius: 999px; color: #ECE8E1; font: 500 11px/1 'JetBrains Mono', monospace; letter-spacing: .16em; text-transform: uppercase; padding: 11px 16px; cursor: pointer; }
  .site-nav { display: none !important; }
  .site-header.open .site-logo { position: relative; z-index: 31; }
  .site-header.open .site-nav { display: flex !important; position: fixed; inset: 0; z-index: 30; flex-direction: column !important; flex-wrap: nowrap !important; justify-content: center !important; align-items: flex-start !important; gap: 4px !important; padding: 90px 28px 40px; background: #0A0A0B; font-size: 17px !important; }
  .site-header.open .site-nav a { padding: 12px 0 !important; }

  .page-title { font-size: clamp(44px, 15vw, 200px) !important; }

  .gallery-thumbs { display: flex !important; gap: 8px !important; margin-top: 8px !important; padding: 4px 2px 8px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; }
  .gallery-thumbs::-webkit-scrollbar { display: none; }
  .gallery-thumbs .thumb { flex: 0 0 27%; scroll-snap-align: start; outline-offset: -2px !important; }

  .reel-frame { aspect-ratio: 16 / 9 !important; }
  .reel-caption { display: none; }

  .viewer img { max-width: 100vw; max-height: calc(100vh - 120px); }
  .viewer .v-prev, .viewer .v-next { display: none; }
}

/* ---------- Respect "reduce motion" ---------- */
@media (prefers-reduced-motion: reduce) {
  html.reveal-on :is(.gallery-frame, .tile-media, .reel-frame) { clip-path: none !important; transition: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
  .gallery-frame .xfade, .viewer { transition: none; }
}

/* ---------- Recognition + contact ----------
   The page itself places contact in the left column under the heading, with the awards list
   spanning the right column. Document order is heading → awards → contact, so once the
   columns no longer fit, everything simply stacks in that order. */
@media (max-width: 900px) {
  .recognition { grid-template-columns: 1fr !important; grid-template-rows: none !important; row-gap: 40px !important; }
  .recognition-intro, .recognition-list, .recognition #contact { grid-column: auto !important; grid-row: auto !important; }
  .recognition #contact { margin-top: 0 !important; }
}
