/* =========================================================================
   work-rail.css — the Work index (grid of project journeys).
   Styles the existing views/work.php markup. Tone covers are a restrained
   dark palette; one accent (--blue) appears only on hover. Dark-mode aware.
   ========================================================================= */

.work-index {
  max-width: var(--container);
  margin: 0 auto;
  padding: calc(var(--nav-h, 88px) + clamp(44px, 9vh, 96px))
           var(--gutter)
           clamp(80px, 12vh, 140px);
}

/* ---- header ---- */
.work-index__head { max-width: 760px; margin-bottom: clamp(44px, 7vh, 80px); }
.work-index__head h1 {
  font-family: var(--font-display);
  font-size: clamp(3rem, 7vw, 6rem);
  line-height: .92;
  letter-spacing: -0.05em;
  margin: 0 0 18px;
}
.work-index__head p {
  font-size: clamp(1.05rem, 1.6vw, 1.375rem);
  line-height: 1.55;
  opacity: .62;
  max-width: 620px;
  margin: 0;
}

/* ---- grid ---- */
.work-index__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr));
  gap: clamp(28px, 3vw, 44px) clamp(24px, 2.5vw, 32px);
}

/* ---- tile ---- */
.work-tile {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

.work-tile__thumb {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: clamp(240px, 30vw, 320px);
  padding: clamp(22px, 2.4vw, 30px);
  border-radius: var(--radius-md, 14px);
  border: 1px solid rgba(0, 0, 0, .10);
  overflow: hidden;
  color: #f5f5f3;
  background: var(--tone, #16171c);
  transition: transform .35s var(--ease-out, cubic-bezier(.23,1,.32,1)),
              box-shadow .35s var(--ease-out, cubic-bezier(.23,1,.32,1));
}

/* restrained, sophisticated tone covers */
.tone-0 { --tone: #14161d; }   /* ink          */
.tone-1 { --tone: #1c1a16; }   /* warm charcoal */
.tone-2 { --tone: #0f1a20; }   /* teal-ink     */
.tone-3 { --tone: #1a141c; }   /* plum-ink     */
.tone-4 { --tone: #15181b; }   /* graphite     */

/* optional cover image: fills the thumb, tone colour is the fallback */
.work-tile__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  transition: transform .5s var(--ease-out, ease);
}
.work-tile:hover .work-tile__img { transform: scale(1.04); }

/* scrim only when an image is present, so the tag + metric stay legible */
.work-tile__thumb.has-img::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg,
              rgba(8,8,10,.55) 0%,
              rgba(8,8,10,.10) 30%,
              rgba(8,8,10,.18) 58%,
              rgba(8,8,10,.80) 100%);
}

/* keep the overlaid text above image + scrim */
.work-tile__thumb .tag,
.work-tile__thumb .metric { position: relative; z-index: 2; }

.work-tile__thumb .tag {
  font-family: var(--font-mono, "Space Mono", ui-monospace, monospace);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(245, 245, 243, .7);
}

.work-tile__thumb .metric {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 4.2vw, 3.6rem);
  line-height: .95;
  letter-spacing: -0.04em;
}
.work-tile__thumb .metric small {
  display: block;
  margin-top: 8px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .01em;
  color: rgba(245, 245, 243, .6);
}

/* teardown covers carry no metric — let the tag breathe */
.work-tile__thumb:not(:has(.metric)) { justify-content: flex-start; }
.work-tile__thumb:not(:has(.metric)) .tag { font-size: 13px; }

/* hover: lift the cover, accent the title (the one place blue appears) */
.work-tile:hover .work-tile__thumb {
  transform: translateY(-6px);
  box-shadow: 0 22px 50px rgba(0, 0, 0, .18);
}

/* ---- meta ---- */
.work-tile__meta { padding: 22px 4px 0; }
.work-tile__meta .title {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 1.8vw, 1.6rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  transition: color .25s var(--ease-out, ease);
}
.work-tile:hover .work-tile__meta .title { color: var(--blue, #1a46c9); }
.work-tile__meta .org {
  margin-top: 8px;
  font-size: clamp(.95rem, 1.2vw, 1.05rem);
  line-height: 1.5;
  opacity: .6;
}

/* ---- dark mode: covers stay dark, just firm up their edge ---- */
[data-theme="dark"] .work-tile__thumb { border-color: rgba(255, 255, 255, .10); }

/* ---- responsive ---- */
@media (max-width: 720px) {
  .work-index { padding-top: calc(var(--nav-h, 88px) + 28px); }
  .work-index__grid { grid-template-columns: 1fr; }
}

/* ---- reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  .work-tile__thumb { transition: none; }
  .work-tile:hover .work-tile__thumb { transform: none; }
  .work-tile__img { transition: none; }
  .work-tile:hover .work-tile__img { transform: none; }
}

/* =========================================================================
   work-tiles.js FX — dot burst, "Click" cursor, warp veil.
   No new tokens: vivid dots match the hero; cursor uses the single accent.
   ========================================================================= */
.tile-fx {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
}



.tile-warp {
  position: fixed;
  inset: 0;
  z-index: 55;
  pointer-events: none;
  background: var(--bg, #f5f5f3);
  opacity: 0;
  transition: opacity .5s var(--ease-out, ease);
}
.tile-warp.is-on { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .tile-fx, .tile-warp { display: none !important; }
}
