/* Thoughts — the index.
   A contents page rather than a feed: every title is set in its own essay's typeface,
   the masthead borrows whichever face you're pointing at, and each essay's header
   plays as a small live emblem beside the cursor (inline on touch screens). */

.home { --index-wide: 76rem; --wide: var(--index-wide); }

/* ---------------------------------------------------------------- masthead */

.mast {
  max-width: var(--index-wide); margin: clamp(1.5rem, 5vw, 4rem) auto 0; padding: 0 var(--gutter);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(16rem, 22rem); gap: 2rem 3rem; align-items: end;
}
@media (max-width: 56rem) { .mast { grid-template-columns: 1fr; } }

.mast-word {
  margin: 0; height: 1em; display: flex; align-items: baseline; white-space: nowrap;
  font: italic 380 clamp(5rem, 1.5rem + 15vw, 14.5rem)/0.9 var(--font-display);
  letter-spacing: -0.045em; margin-left: -0.05em;
}
.mast-word { transform-origin: 0 100%; transition: scale 0.3s ease; }
.mast-word span { display: inline-block; transition: color 0.35s ease; }

.mast-side { padding-bottom: 1.2rem; }
.mast-dek { margin: 0; font-size: 1.12em; line-height: 1.45; text-wrap: pretty; }
.mast-now {
  margin: 1.2rem 0 0; font: 500 0.78rem var(--font-ui); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
}
.mast-now b { font-weight: 650; color: var(--fg); transition: color 0.3s; }
.mast-meta { margin: 0.4rem 0 0; font: 500 0.78rem var(--font-ui); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.mast-meta a { color: inherit; }

/* ---------------------------------------------------------------- topics */

.topics {
  max-width: var(--index-wide); margin: clamp(2.5rem, 6vw, 4.5rem) auto 0; padding: 0 var(--gutter);
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.3rem 1.1rem;
  font: 500 0.9rem var(--font-ui);
}
.topics-label { color: var(--muted); font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; margin-right: 0.4rem; }
.topic {
  font: inherit; color: var(--muted); background: none; border: 0; padding: 0.2rem 0; cursor: pointer;
  text-decoration: underline transparent 1.5px; text-underline-offset: 0.3em; transition: color 0.2s, text-decoration-color 0.2s;
}
.topic sup { font-size: 0.62em; margin-left: 0.15em; font-variant-numeric: tabular-nums; }
.topic:hover { color: var(--fg); }
.topic.is-on { color: var(--fg); text-decoration-color: var(--fg); }

/* ---------------------------------------------------------------- contents */

.contents { max-width: var(--index-wide); margin: 1.6rem auto 0; padding: 0 var(--gutter); }
.contents-head, .entry-link { display: grid; grid-template-columns: 5rem minmax(0, 1fr) 9.5rem; gap: 2rem; }
.contents-head {
  margin: 0; padding: 0.7rem 0; border-bottom: 1px solid var(--fg);
  font: 600 0.72rem var(--font-mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted);
}
.contents-head span:last-child { text-align: right; }

.entries { list-style: none; margin: 0; padding: 0; }
.year span {
  display: block; padding: 2.4rem 0 0.2rem;
  font: 600 0.72rem var(--font-mono); letter-spacing: 0.04em; color: var(--muted);
}
.entry { transition: opacity 0.35s ease; }
.entry-link {
  align-items: baseline; padding: clamp(1.1rem, 2.2vw, 1.8rem) 0;
  border-bottom: 1px solid var(--rule); text-decoration: none; color: var(--card-fg, var(--fg));
}
.entry-link:hover { color: var(--card-fg, var(--fg)); }
.entry-link:focus-visible { outline-offset: 6px; }
.entry-no { font: 500 0.8rem var(--font-mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.entry-title {
  display: block;
  font-family: var(--card-font, var(--font-display));
  font-weight: var(--card-weight, 500);
  font-style: var(--card-style, normal);
  font-stretch: var(--card-stretch, 100%);
  text-transform: var(--card-case, none);
  letter-spacing: var(--card-tracking, -0.02em);
  font-size: calc(clamp(1.75rem, 0.9rem + 2.7vw, 3.5rem) * var(--card-scale, 1));
  line-height: 1.02; text-wrap: balance;
  transition: translate 0.35s cubic-bezier(.2,.7,.2,1);
}
.entry-sub {
  display: block; margin-top: 0.55em;
  font-size: 0.36em; line-height: 1.25; font-style: normal; letter-spacing: 0.01em;
  color: var(--muted);
}
.entry-meta {
  display: grid; justify-items: end; gap: 0.15rem;
  font: 500 0.78rem/1.3 var(--font-ui); color: var(--muted); text-align: right;
}
.entry-meta span { font-size: 0.72rem; }
.entry:is(:hover, :focus-within) .entry-no { color: var(--card-accent, var(--fg)); }
.entry:is(:hover, :focus-within) .entry-title { translate: 0.35rem 0; }
.entry[hidden], .year[hidden] { display: none; }

/* Pointing at one essay quiets the others */
@media (hover: hover) {
  .entries:has(.entry:is(:hover, :focus-within)) .entry:not(:is(:hover, :focus-within)) { opacity: 0.22; }
}

/* ---------------------------------------------------------------- the live preview */

.entry-dek { margin: 0; padding: 0.8rem 0.35rem 0.25rem; font: 0.84rem/1.45 var(--font-ui); color: var(--muted); text-wrap: pretty; }

.emb-box { container-type: inline-size; }
.emb {
  position: relative; aspect-ratio: 3 / 2; overflow: hidden; border-radius: 9px;
  container-type: inline-size; isolation: isolate;
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.06);
}
/* Emblems only animate while they're being looked at */
.entry:not(.is-live) .emb,
.entry:not(.is-live) .emb *,
.entry:not(.is-live) .emb *::before,
.entry:not(.is-live) .emb *::after { animation-play-state: paused !important; }

/* Desktop with a mouse (index.js adds .float-previews): one preview at a time, floating beside the cursor */
.float-previews {
  .entry-preview {
    position: fixed; left: 0; top: 0; z-index: 30; width: 21rem; padding: 0.5rem;
    background: var(--bg); border-radius: 14px;
    box-shadow: 0 0 0 1px rgb(0 0 0 / 0.06), 0 30px 60px -28px rgb(0 0 0 / 0.35);
    translate: var(--px, -100vw) var(--py, 0); scale: 0.94; opacity: 0;
    pointer-events: none; transition: opacity 0.2s ease, scale 0.3s cubic-bezier(.2,.8,.2,1);
  }
  .entry.is-live .entry-preview { opacity: 1; scale: 1; }
}

/* Everywhere else (touch, narrow, no script): every emblem sits inline and plays as it scrolls into view */
html:not(.float-previews) {
  .contents-head { display: none; }
  .entry { border-bottom: 1px solid var(--rule); padding-bottom: 1.6rem; }
  .entry-link { grid-template-columns: auto 1fr; gap: 0.6rem 1rem; border-bottom: 0; padding-bottom: 1rem; }
  .entry-no { grid-row: 1; }
  .entry-meta { grid-row: 1; grid-column: 2; display: flex; gap: 0.6rem; justify-content: flex-end; }
  .entry-title { grid-column: 1 / -1; }
  .entry-preview .emb { aspect-ratio: 16 / 9; }
  .entry-dek { padding: 0.8rem 0 0; }
}

/* ---------------------------------------------------------------- about */

.about {
  max-width: var(--index-wide); margin: 6rem auto 0; padding: 2.5rem var(--gutter) 0;
  display: grid; grid-template-columns: 5rem minmax(0, 1fr); gap: 2rem;
  border-top: 1px solid var(--fg);
}
.about h2 { margin: 0.35rem 0 0; font: 600 0.72rem var(--font-mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.about p { max-width: 40rem; margin: 0 0 1rem; font-size: 1.1em; }
@media (max-width: 40rem) { .about { grid-template-columns: 1fr; gap: 1rem; } }
.home .site-foot { max-width: var(--index-wide); }
.home .colophon + .colophon { margin-top: 0.5rem; }
