/*
 * Warm orange glow dividers between dark and light sections, used on case.html,
 * article.html and (in the "Glow" transition mode) index.html. Animated by
 * js/custom/glow.js.
 */
/* Only the ellipse HEIGHT is animated (--glow from js/custom/glow.js), so the colours
   along the edge touching the white section never change: no seam while it moves. */
.case-glow { --glow: 1; height: 22rem; background: #080808; }
.case-glow--to-light {
  background:
    radial-gradient(ellipse 85% calc(var(--glow) * 100%) at 50% 100%,
      #fff 0%, #fff 34%, #fff3cf 42%, #ffc04a 50%, #ff7a1a 57%, #d8300f 64%, #6b0d07 72%, #1c0403 80%, #080808 88%) #080808;
}
.case-glow--to-dark {
  background:
    radial-gradient(ellipse 85% calc(var(--glow) * 100%) at 50% 0%,
      #fff 0%, #fff 34%, #fff3cf 42%, #ffc04a 50%, #ff7a1a 57%, #d8300f 64%, #6b0d07 72%, #1c0403 80%, #080808 88%) #080808;
}

@media (max-width: 767px) { .case-glow { height: 14rem; } }

/* Homepage: the dividers only show in the "Glow" transition mode (js/custom/transitions.js). */
.tr-glow { display: none; position: relative; z-index: 2; }
html[data-transitions="glow"] .tr-glow { display: block; }

/* ---------- Homepage (Glow mode): "pulled" light ----------
   Drawn on a canvas by js/custom/pull-glow.js: the light is grabbed in the middle
   and pulled (bell-shaped, not an oval), then snaps to white / dark.
   .hero-glow sits inside the hero between the canvas and the text; its bottom edge
   is always white and meets the white services section directly. */
.hero-glow { display: none; }
html[data-transitions="glow"] .hero-glow {
  display: block;
  position: absolute;
  left: 0;
  right: 0;
  top: 15%;
  bottom: calc(-1 * var(--hero-glow-gap, 18vh) - 6px); /* tucks the edge under the white section */
  z-index: 1;
  pointer-events: none;
}
/* The canvas overhangs by 48px (BLEED in pull-glow.js) and is blurred; the overhang
   keeps the blur from softening the visible edges. Sideways overhang is clipped. */
[data-pull] { overflow-x: clip; }
[data-pull] > canvas { position: absolute; left: -48px; top: -48px; width: calc(100% + 96px); height: calc(100% + 96px); display: block; } /* blurred in pull-glow.js (CSS blur left light strips at the screen edges in Safari) */
html[data-transitions="glow"] .hero-section > .hero-overlay { position: relative; z-index: 2; background-image: none !important; }
/* A short see-through gap below the hero: the light reaches into it and turns solid
   white there, so the join with the white section never shows a line. */
html[data-transitions="glow"] .tr-glow.case-glow--to-light {
  height: var(--hero-glow-gap, 18vh);
  background: none;
  z-index: 0;
}
/* Services start right after the light snaps to white (less empty white space). */
html[data-transitions="glow"] .section-services { padding-top: 1.5rem !important; }
/* Services → portfolio: the white is pulled down in the middle, then snaps to dark. */
/* Slides up over the (empty) end of the white services section, so it starts right
   after the last card; its white parts are see-through. Tall, so the tongue can stretch. */
html[data-transitions="glow"] .tr-glow--pull {
  position: relative; z-index: 3; height: 58vh; margin-top: -48vh; pointer-events: none;
  /* White behind the part below the services section (the page behind it is dark). */
  background: linear-gradient(to bottom, transparent calc(48vh - 8px), #fff calc(48vh - 8px)); /* white from just above where the services section ends: no gap line */
}
@media (max-width: 767px) {
  :root { --hero-glow-gap: 12vh; }
  html[data-transitions="glow"] .tr-glow--pull { height: 40vh; margin-top: -32vh; background: linear-gradient(to bottom, transparent calc(32vh - 8px), #fff calc(32vh - 8px)); }
}

/* ---------- Inner pages (article.html, case.html): same as the homepage ----------
   up:   slides up over the empty dark bottom of the section before it (like the light
         inside the hero), turns solid white in its bottom 18vh, then the white section.
   down: slides up over the empty white bottom of the section before it (like the
         portfolio divider); its white parts are see-through. */
.pull-divider { position: relative; pointer-events: none; }
.pull-divider--up { height: 46vh; margin-top: -22vh; z-index: 1; }
.pull-divider--down { height: 58vh; margin-top: -45vh; z-index: 3; background: linear-gradient(to bottom, transparent calc(45vh - 8px), #fff calc(45vh - 8px)); }
:root { --pull-room-dark: 22vh; --pull-room-light: 45vh; }
@media (max-width: 767px) {
  .pull-divider--up { height: 34vh; margin-top: -16vh; }
  .pull-divider--down { height: 40vh; margin-top: -32vh; background: linear-gradient(to bottom, transparent calc(32vh - 8px), #fff calc(32vh - 8px)); }
  :root { --pull-room-dark: 16vh; --pull-room-light: 32vh; }
}

/* The section after a down divider sits above it (like #works on the homepage), so the
   divider's blurred overhang never greys out its heading. */
.post-more, .case-more { position: relative; z-index: 4; }

/* Card grids outside .blog/.post need the grid gap too (cards were touching). */
.post-more, .case-more { --page-gap: var(--grid-gap, 1.5rem); }
