/* synomare index: field (illustration + cards) and recital over a WebGL2 red net.
   Typography (fonts, sizes, title treatment, letter reveal) follows the site's
   inline base styles; this file only adds layout and the net layers. */
main {
  position: relative;
  min-width: 0;
}

/* Continuous fixed WebGL2 shader layer behind cards/text, over paper */
.shader-backdrop {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  display: block;
}

/* Foreground Canvas2D entanglement layer weaving over hovered cards and enlarged glyphs */
.shader-fore {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 6;
  pointer-events: none;
  display: block;
}

/* Viewport 1: NO stacking context (no z-index) so .sheet multiply blends directly with #meshShaderCanvas */
.field {
  position: relative;
  min-height: 580px;
  height: calc(100svh - 4.4rem);
  box-sizing: border-box;
}

.field .sheet {
  position: absolute;
  inset: 0;
  z-index: 2;
  margin: 0;
  pointer-events: none;
  mix-blend-mode: multiply;
  /* Organic downward dissolve into paper + continuous shader mesh */
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 62%, rgba(0, 0, 0, 0.48) 84%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0%, #000 62%, rgba(0, 0, 0, 0.48) 84%, transparent 100%);
}

.field .sheet img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 23%;
  display: block;
  filter: contrast(1.05) saturate(0.90);
}

.field .sheet::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image: radial-gradient(circle, rgba(23, 20, 15, 0.45) 0 0.5px, transparent 0.6px);
  background-size: 3px 3px;
  mix-blend-mode: soft-light;
  opacity: 0.48;
}

.field .sheet::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, transparent 58%, rgba(255, 255, 255, 0.35) 82%, rgba(255, 255, 255, 0.96) 100%);
}

.field .ghost {
  position: absolute;
  left: 50%;
  bottom: 0.14em;
  transform: translateX(-50%);
  z-index: 4;
  margin: 0;
  /* face, size, spacing, hollow stroke and etched edge come from the site's .ghost */
  line-height: 1.15;
}

.thread-field {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  overflow: visible;
  pointer-events: none;
  color: var(--red);
}

.thread-field path {
  fill: none;
  stroke: currentColor;
  stroke-width: 0.72;
  opacity: 0.50;
  vector-effect: non-scaling-stroke;
  transition: opacity 200ms ease, stroke-width 200ms ease;
}

.thread-field path.thread-core {
  stroke-width: 1.2;
  opacity: 0.82;
}

.thread-field circle {
  fill: var(--red);
}

.thread-field g.is-active path {
  opacity: 1;
  stroke-width: 1.25;
}

.field .intro {
  position: absolute;
  top: 8%;
  left: 5%;
  z-index: 5;
  max-width: 20em;
  padding: 1.15rem 1.4rem;
  background: rgba(253, 253, 251, 0.95);
  border: 1px solid var(--ink);
  border-top: 2px solid var(--red);
  box-shadow: 5px 6px 0 rgba(23, 20, 15, 0.16);
  font-size: clamp(13px, 1.2vw, 15px);
  line-height: 2;
}

.field .intro .sec-head {
  margin-bottom: 0.8em;
}

.field .tag {
  position: absolute;
  z-index: 5;
  box-sizing: border-box;
  min-width: 178px;
  padding: 0.82rem 0.98rem 0.85rem;
  background: rgba(253, 253, 251, 0.95);
  box-shadow: 4px 5px 0 rgba(23, 20, 15, 0.18);
  transition: box-shadow 200ms ease, background-color 200ms ease, color 200ms ease;
}

.field .tag:hover,
.field .tag:focus-visible {
  background: var(--ink);
  color: var(--paper);
  box-shadow: 6px 9px 0 rgba(23, 20, 15, 0.20);
}

.field .tag:hover .jp,
.field .tag:focus-visible .jp {
  color: #d9d5c9;
}

.field .tag:hover .meta,
.field .tag:focus-visible .meta {
  color: #ff7a7a;
}

.field .tag:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 5px;
}

.field .thread-pin {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--red);
  left: 0;
  top: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 3px var(--paper);
  pointer-events: none;
}

.field .intro .thread-pin {
  left: 100%;
  top: 78%;
}

.field .tag-notes .thread-pin,
.field .tag-links .thread-pin {
  left: 100%;
}

.field .tag-works { top: 12%; right: 7%; }
.field .tag-gallery { top: 32%; right: 12%; }
.field .tag-notes { top: 44%; left: 12%; }
.field .tag-links { top: 61%; left: 5%; }
.field .tag-profile { top: 55%; right: 6%; }

/* Seamless Threshold Bridge (no heavy black cutoff) */
.threshold {
  position: relative;
  z-index: 3;
  max-width: 72rem;
  margin: 0 auto;
  padding: 0.75rem clamp(16px, 4vw, 48px) 0.45rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.5rem 1.4rem;
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  background: linear-gradient(180deg, rgba(244, 243, 239, 0.78) 0%, rgba(244, 243, 239, 0.92) 60%, rgba(244, 243, 239, 0) 100%);
}

.threshold::before {
  content: "";
  grid-column: 1 / -1;
  height: 1px;
  background: linear-gradient(90deg, var(--red) 0%, var(--ink) 28%, rgba(23, 20, 15, 0.18) 100%);
  margin-bottom: 0.45rem;
}

.threshold-counts {
  color: var(--red);
  white-space: nowrap;
}

.threshold-latest {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--jp);
  letter-spacing: 0.08em;
  text-transform: none;
  color: var(--ink);
}

.threshold-latest .d {
  font-family: var(--mono);
  color: var(--dim);
  margin-right: 0.55rem;
}

.threshold-cue {
  color: var(--dim);
  white-space: nowrap;
}

/* Recital seamlessly floating over the continuous WebGL2 red mesh */
.recital {
  position: relative;
  z-index: 3;
  padding: clamp(28px, 5vw, 68px) clamp(16px, 4vw, 48px) clamp(48px, 8vw, 96px);
}

.recital-frame {
  max-width: 72rem;
  margin: 0 auto;
  border-left: 1px solid rgba(196, 31, 31, 0.55);
  padding-left: clamp(1rem, 2.5vw, 2.2rem);
}

.recital .copy {
  margin: 0;
}

.stage-mark {
  display: block;
  font-family: var(--mono);
  font-size: 0.56rem;
  letter-spacing: 0.22em;
  color: var(--red);
  margin-bottom: 0.22rem;
  line-height: 1.4;
  user-select: none;
}

footer.caption {
  position: relative;
  z-index: 4;
}

@media (max-width: 900px) {
  .threshold {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.25rem;
  }
}

@media (max-width: 700px) {
  .field {
    min-height: 670px;
    height: auto;
    padding: 1.5rem 4.5vw 6.2rem;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
    align-items: start;
    gap: 0.95rem 0.65rem;
  }
  .field .sheet img {
    object-position: 55% 22%;
  }
  .field .intro {
    position: relative;
    grid-column: 1 / -1;
    top: auto;
    left: auto;
    max-width: none;
    width: 100%;
    box-sizing: border-box;
    margin: 0 0 0.25rem;
    padding: 0.95rem 1.05rem;
    font-size: 0.86rem;
  }
  .field .tag {
    position: relative;
    inset: auto !important;
    width: 100%;
    min-width: 0;
    padding: 0.78rem 0.68rem;
    font-size: 0.6rem;
  }
  .field .tag .jp {
    letter-spacing: 0.1em;
  }
  .field .tag-gallery { margin-top: 1.6rem; }
  .field .tag-profile { margin-top: 1.4rem; }
  .field .intro .thread-pin { left: 65%; top: 100%; }
  .field .ghost {
    bottom: 0.22em;
  }
  .recital-frame {
    padding-left: 0.85rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .field .tag,
  .thread-field path {
    transition: none;
  }
}

/* ---------- v6: recital glyph rendering ---------- */
/* The v5 glyphs kept `will-change: transform` on every span and the reveal animation
   kept `filter: blur(0)` filled forwards; both rasterise glyphs at 1x and then stretch
   the bitmap, which is why enlarged letters looked soft. v6 ends the reveal on `none`
   and lets the spring in recital-kinetic-v6.js drive the transform directly. */
@keyframes reveal-v6 {
  /* same motion as the site's reveal, but it ends on 'none' so glyphs stay crisp */
  0% { opacity: 0; translate: 0 15px; scale: 0.95; filter: blur(4px); }
  100% { opacity: 1; translate: none; scale: none; filter: none; }
}

.recital .copy .c {
  will-change: auto;
  transition: none;
  animation-name: reveal-v6;
  transform:
    translateX(calc(var(--tx, 0em) + var(--px, 0px)))
    translateY(var(--ty, 0))
    scale(var(--sx, 1), var(--sy, 1))
    scale(var(--ix, 1), var(--iy, 1));
  transform-origin: 50% 78%;
}

.recital .copy .c.is-live {
  position: relative;
  z-index: var(--iz, 1);
}

@media (prefers-reduced-motion: reduce) {
  .recital .copy .c { animation: none; }
}

/* kinsoku binding: a glyph and the punctuation after it never split across lines */
.recital .copy .kb {
  white-space: nowrap;
}
