/* Animated preview layer (not on the live site). Loaded after style.css. */

/* 1. the element cycle in the banner */
.strip { position: relative; overflow: hidden; }
.strip canvas.cycle { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.strip .cycle-hint { position: absolute; top: 8px; padding: 3px 9px; border-radius: 999px; background: rgba(0,16,36,0.6); color: #fff; font: 600 12px/1.4 var(--sans); opacity: 0; transform: translateY(-4px); transition: opacity 0.25s, transform 0.25s; pointer-events: none; }
.strip .cycle-hint.left { left: 12px; }
.strip .cycle-hint.right { right: 12px; }
.strip.hover-soil .cycle-hint.left, .strip.hover-sea .cycle-hint.right { opacity: 1; transform: none; }

/* themes on the home page light up when their end of the cycle is hovered */
.items .item { transition: background-color 0.3s, box-shadow 0.3s; border-radius: 8px; }
.items .item.lit { background: var(--accent-tint); box-shadow: inset 4px 0 0 var(--accent); }

/* 2. research page: the margins darken from sunlit to midnight as the page goes deeper */
/* same layout as every other page: the page column stays white and only the space outside it takes the depth colour */
body.depth { background: linear-gradient(90deg, var(--depth-bg, #fff) 0, var(--depth-bg, #fff) calc(50% - 560px), #fff calc(50% - 560px), #fff calc(50% + 560px), var(--depth-bg, #fff) calc(50% + 560px)); }
/* phones and tablets: a thin depth line at the left edge instead of the gauge */
.depth-line { position: fixed; left: 0; top: 0; bottom: 0; width: 5px; background: var(--depth-bg, #fff); z-index: 14; transition: background-color 1.2s ease-out; }
@media (min-width: 1180px) { .depth-line { display: none; } }

@media (prefers-reduced-motion: reduce) {
  body.depth, .depth-line, .items .item { transition: none; }
}

/* ---------- smooth page changes: the bar, banner and sidebar stay, the content fades ---------- */
@view-transition { navigation: auto; }
.topbar { view-transition-name: topbar; }
.strip { view-transition-name: strip; }
.side { view-transition-name: side; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 220ms; }

/* ---------- research figures ---------- */
.fig-anim { position: relative; }
.fig-anim > svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; border-radius: 10px; overflow: hidden; }

/* illustrations settle in the first time they are scrolled to */
figure.ill.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease-out, transform 0.7s ease-out; }
figure.ill.reveal.in { opacity: 1; transform: none; }

/* ---------- cards answer the pointer ---------- */
.item .thumb { transition: transform 0.25s ease-out, box-shadow 0.25s; }
.item:hover .thumb { transform: scale(1.04); box-shadow: 0 4px 14px rgba(0,0,0,0.16); }
.tool { transition: transform 0.2s ease-out, box-shadow 0.2s; }
.tool:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(0,0,0,0.10); }

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  .item .thumb, .tool,     }


/* animated theme thumbnails on the home page */
.thumb-anim { display: block; position: relative; width: 136px; height: 100px; border-radius: 6px; overflow: hidden; }
.thumb-anim > svg { position: absolute; inset: 1px; width: calc(100% - 2px); height: calc(100% - 2px); pointer-events: none; }
@media (max-width: 560px) { .thumb-anim { width: 100px; height: 74px; } }
@media (max-width: 480px) { .thumb-anim { width: 136px; height: 100px; } }
.item:hover .thumb-anim .thumb { transform: none; }
.item:hover .thumb-anim { transform: scale(1.04); box-shadow: 0 4px 14px rgba(0,0,0,0.16); }
.thumb-anim { transition: transform 0.25s ease-out, box-shadow 0.25s; }


/* ---------- networks: cards and the co-author globe ---------- */
.netcards { margin-top: 1.4rem; grid-auto-rows: 1fr; }
.netcards .tool h3 { font-size: 1.05rem; }
.globe-card { overflow: hidden; }
figure.netglobe { margin: auto 0 0; padding-top: 6px; }
figure.netglobe svg { display: block; width: 100%; height: auto; aspect-ratio: 1; touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none; }
figure.netglobe svg:active { cursor: grabbing; }
figure.netglobe .sea { fill: #e3eef1; }
figure.netglobe .rim { fill: url(#shade); stroke: #bcd1d7; stroke-width: 1; pointer-events: none; }
figure.netglobe .grat { fill: none; stroke: #c3d6db; stroke-width: 0.6; }
figure.netglobe .land { fill: #dde7e3; stroke: #b9cbc8; stroke-width: 0.6; }
figure.netglobe .route { fill: none; stroke: var(--accent); stroke-opacity: 0.65; stroke-width: 2; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
figure.netglobe.in .route { transition: stroke-dashoffset 1.3s ease-in-out var(--d); stroke-dashoffset: 0; }
figure.netglobe .dot { fill: var(--accent); stroke: #fff; stroke-width: 2; }
figure.netglobe .home .dot { fill: #1f4e5f; }
figure.netglobe .ring { fill: none; stroke: var(--accent); stroke-width: 2; opacity: 0; transform-box: fill-box; transform-origin: center; }
figure.netglobe.in .ring { animation: netping 2.2s ease-out calc(var(--d) + 900ms) 2; }
@keyframes netping { from { transform: scale(1); opacity: 0.8; } to { transform: scale(3); opacity: 0; } }
figure.netglobe .pin { opacity: 0; transition: opacity 0.5s calc(var(--d) + 700ms); }
figure.netglobe.in .pin { opacity: 1; }
figure.netglobe .pin-label { font: 600 17px var(--sans); fill: var(--ink-2); paint-order: stroke; stroke: rgba(244,249,250,0.95); stroke-width: 4px; }
@media (prefers-reduced-motion: reduce) { figure.netglobe .route { stroke-dashoffset: 0; } figure.netglobe.in .ring { animation: none; } figure.netglobe .pin { transition: none; } }
figure.netglobe .pin-label .cc { font-weight: 500; fill: var(--muted); }
figure.netflat .pin-label.minor { opacity: 0; transition: opacity 0.4s; }
figure.netflat.zoomed .pin-label.minor { opacity: 1; }
figure.netflat.wide { margin: 0.6rem 0 0; }
figure.netflat.wide svg { aspect-ratio: auto; }
.emo { margin-right: 0.5em; }
.netcards { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
figure.netflat svg { cursor: grab; touch-action: pan-y; }
figure.netflat svg:active { cursor: grabbing; }
/* Networks: the map section sits close under the bold opening line */
#coauthors { margin-top: 0.8rem; }
#coauthors h2 { margin-top: 0; margin-bottom: 0.5rem; }
