/*
 * /articles/
 *
 * 1. The base rules are a complete static page (no JS, or reduced motion):
 *    a short intro, then each category with a plain grid of articles.
 * 2. Rules under `.sn-js` apply only when the head script decided motion is
 *    welcome. They lift every article onto a single S-shaped track that
 *    scrolls like a snake. If the script never reports in, `.sn-js` is removed
 *    and the static layout returns.
 *
 * Only transform and opacity are animated.
 */

:root {
  --sn-ink: #171018;
  --sn-soft: #4b4351;
  --sn-muted: #74697c;
  --sn-line: rgba(23, 16, 24, 0.1);
  --sn-accent: #e94f8d;
  --sn-ease: cubic-bezier(0.22, 0.8, 0.24, 1);
}

html.lenis,
html.lenis body {
  height: auto;
}
.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}
.lenis.lenis-stopped {
  overflow: hidden;
}

.articles-page {
  background: #fff;
}

/* about.css sets overflow:hidden on the shell, which would break sticky.
   `clip` still stops horizontal bleed without creating a scroll container. */
.articles-shell {
  overflow: visible;
  overflow: clip;
  background: #fff;
}

.articles-page a:focus-visible {
  outline: 2px solid var(--sn-accent);
  outline-offset: 4px;
  border-radius: 6px;
}

.sn-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ------------------------------------------------- static layout (default) */

.sn-group {
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(28px, 4vw, 52px) clamp(20px, 5vw, 70px);
  border-top: 1px solid var(--sn-line);
}

.sn-head h2 {
  margin: 0;
  color: var(--sn-ink);
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.sn-head p {
  max-width: 48ch;
  margin: 8px 0 0;
  color: var(--sn-muted);
  font-size: 1rem;
}

.sn-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: 30px 24px;
  margin: 30px 0 0;
  padding: 0;
  list-style: none;
}

.sn-tile-link {
  display: block;
  color: var(--sn-ink);
}

.sn-tile-media {
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 22px;
  background: #fff0f6;
}

.sn-tile-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--sn-ease);
}

.sn-tile-title {
  margin: 12px 2px 0;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.005em;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.sn-tile-link:hover .sn-tile-media img,
.sn-tile-link:focus-visible .sn-tile-media img {
  transform: scale(1.04);
}

.sn-tile-link:hover .sn-tile-title {
  color: var(--sn-accent);
}

/* ------------------------------------------------------- fly-through layout */

.sn-caption {
  display: none;
}

.sn-js .sn {
  position: relative; /* height is set by the script: the length of the shot */
}

.sn-js .sn-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background: #fff;
}

.sn-js .sn-chain,
.sn-js .sn-group,
.sn-js .sn-tiles {
  display: contents;
}

/* Headings and titles stay in the document for search engines and screen
   readers; on screen the caption carries them. */
.sn-js .sn-head,
.sn-js .sn-tile-title {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.sn-js .sn-tile {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--ts, 320px);
  height: var(--ts, 320px);
  margin: calc(var(--ts, 320px) / -2) 0 0 calc(var(--ts, 320px) / -2);
  will-change: transform, opacity;
  backface-visibility: hidden;
  transform-origin: 50% 50%;
  visibility: hidden;
}

.sn-js .sn-tile-link {
  display: block;
  width: 100%;
  height: 100%;
  -webkit-tap-highlight-color: transparent;
}

.sn-js .sn-tile-media {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  border-radius: clamp(14px, 1.6vw, 22px);
  background: transparent;
}

.sn-js .sn-tile-media img,
.sn-js .sn-tile-link:hover .sn-tile-media img {
  transform: none;
  transition: none;
}

.sn-js .sn-tile-link:focus-visible {
  outline-offset: 6px;
}

.sn-js .sn-caption {
  display: block;
  position: absolute;
  z-index: 10000000; /* above every thumbnail, however close */
  left: 50%;
  bottom: max(28px, 5vh);
  width: min(560px, calc(100% - 40px));
  text-align: center;
  transform: translateX(-50%);
}

.sn-caption-cat {
  margin: 0;
  color: var(--sn-muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.sn-caption-title {
  display: inline-block;
  margin-top: 6px;
  color: var(--sn-ink);
  font-size: clamp(1.05rem, 1.8vw, 1.4rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.015em;
  transition: color 0.25s ease;
}

.sn-caption-title:hover {
  color: var(--sn-accent);
}

.sn-caption.is-swapping > * {
  animation: sn-swap 0.35s var(--sn-ease) both;
}

.sn-caption.is-swapping .sn-caption-title {
  animation-delay: 0.05s;
}

@keyframes sn-swap {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* --------------------------------------------------------------- directory */

.sn-directory {
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(56px, 8vw, 100px) clamp(20px, 5vw, 70px) 0;
}

.sn-directory h2 {
  margin: 0 0 clamp(24px, 3vw, 40px);
  color: var(--sn-ink);
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.025em;
}

.sn-dir-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 32px 28px;
}

.sn-dir-group h3 {
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--sn-line);
  color: var(--sn-ink);
  font-size: 0.98rem;
  font-weight: 700;
}

.sn-dir-group ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.sn-dir-group a {
  display: block;
  padding: 6px 0;
  color: var(--sn-soft);
  font-size: 0.92rem;
  line-height: 1.4;
  transition: color 0.2s ease;
}

.sn-dir-group a:hover,
.sn-dir-group a:focus-visible {
  color: var(--sn-accent);
}

/* ------------------------------------------------------------------- outro */

.sn-outro {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(64px, 9vw, 120px) clamp(20px, 5vw, 70px);
  text-align: center;
}

.sn-outro h2 {
  margin: 0;
  color: var(--sn-ink);
  font-size: clamp(1.9rem, 4vw, 3.1rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.sn-outro p {
  max-width: 52ch;
  margin: 16px auto 0;
  color: var(--sn-soft);
  font-size: 1.04rem;
}

.sn-button {
  display: inline-flex;
  margin-top: 28px;
  padding: 13px 28px;
  border-radius: 999px;
  background: #ff94bb; /* the header's pink */
  color: #fff;
  font-size: 0.92rem;
  font-weight: 700;
  transition: background 0.3s ease, transform 0.3s var(--sn-ease);
}

.sn-button:hover,
.sn-button:focus-visible {
  background: #ff6fa5;
  transform: translateY(-2px);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
