:root {
  --fondo: #ffffff;
  --inchiostro: #111113;
  --grigio: #6f6f77;
  --grigio-chiaro: #a1a1aa;
  --bordo: rgba(17, 17, 19, 0.08);
  --accento: #5b5bd6;
  --link: rgba(91, 91, 214, 0.09);
  --link-su: rgba(91, 91, 214, 0.17);
  --card: #ffffff;
}

* { box-sizing: border-box; margin: 0; }

html, body { height: 100%; }

body {
  background: var(--fondo);
  color: var(--inchiostro);
  font-family: "Mona Sans Variable", "Mona Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.stage {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
}

/* the article keeps room under the text, so the open card always stays inside it */
.article {
  position: relative;
  width: min(540px, 100%);
  padding: 8px 4px min(196px, 30vh);
}

.article__kicker {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--inchiostro);
}
.article__kicker span { color: var(--grigio-chiaro); font-weight: 500; }

.article__title {
  margin-top: 8px;
  font-size: clamp(21px, 4.2vmin, 28px);
  line-height: 1.12;
  font-weight: 640;
  font-stretch: 96%;
  letter-spacing: -0.015em;
}

.article__text {
  margin-top: 12px;
  font-size: clamp(14px, 2.6vmin, 16.5px);
  line-height: 1.62;
  color: #3a3a40;
}

.article__meta {
  margin-top: 14px;
  font-size: 12px;
  color: var(--grigio-chiaro);
  font-variant-numeric: tabular-nums;
}

/* the links: bold with a soft tint, never an animated underline */
.ref {
  color: var(--inchiostro);
  font-weight: 620;
  text-decoration: none;
  background: var(--link);
  border-radius: 5px;
  padding: 1px 4px;
  margin: 0 -1px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  transition: background-color 0.25s ease, color 0.25s ease;
  cursor: pointer;
}
.ref.is-on { background: var(--link-su); color: var(--accento); }
@media (hover: hover) { .ref:hover { background: var(--link-su); } }
.ref:focus-visible { outline: 2px solid var(--accento); outline-offset: 2px; }

/* the peek: one box that is first a pill and then the card; GSAP drives its size and place */
.peek {
  position: absolute;
  left: 0;
  top: 0;
  width: 150px;
  height: 30px;
  border-radius: 15px;
  background: var(--card);
  border: 1px solid var(--bordo);
  box-shadow: 0 1px 2px rgba(17, 17, 19, 0.05), 0 8px 22px -10px rgba(17, 17, 19, 0.22);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 3;
  will-change: transform, width, height;
}

.peek__arrow {
  position: absolute;
  top: -5px;
  left: 20px;
  width: 10px;
  height: 10px;
  background: var(--card);
  border-left: 1px solid var(--bordo);
  border-top: 1px solid var(--bordo);
  transform: translateX(-50%) rotate(45deg);
  border-radius: 2px 0 0 0;
}
.peek.is-above .peek__arrow { top: auto; bottom: -5px; border-left: 0; border-top: 0; border-right: 1px solid var(--bordo); border-bottom: 1px solid var(--bordo); border-radius: 0 0 2px 0; }

.peek__pill {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  font-size: 12.5px;
  font-weight: 560;
  color: #3a3a40;
  white-space: nowrap;
}

.peek__card {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  opacity: 0;
}

.peek__img {
  position: relative;
  display: block;
  width: 100%;
  height: 46%;
  overflow: hidden;
  background: #f1f1f3;
  border-bottom: 1px solid var(--bordo);
}
.peek__img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform-origin: 50% 60%;
}
.peek__img img[data-photo="0"] { object-position: 50% 74%; }
.peek__img img[data-photo="1"] { object-position: 50% 58%; }
/* a hairline of light on the top edge of the photo, like glass over a print */
.peek__img::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), inset 0 -18px 24px -22px rgba(17, 17, 19, 0.35);
}

.peek__body { padding: 11px 14px 0; }

.peek__title {
  font-size: 14px;
  font-weight: 640;
  line-height: 1.25;
  letter-spacing: -0.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.peek__line {
  margin-top: 4px;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--grigio);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.peek__src {
  margin-top: 9px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 560;
  color: var(--grigio-chiaro);
}

.fav { width: 14px; height: 14px; flex: none; }
.peek__out { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; margin-left: auto; }

.ghost {
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  fill: #111113;
  stroke: #ffffff;
  stroke-width: 1.4;
  stroke-linejoin: round;
  opacity: 0;
  pointer-events: none;
  z-index: 5;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.18));
}

@media (max-width: 420px) {
  .article { padding-bottom: min(190px, 34vh); }
  .peek__line { -webkit-line-clamp: 1; }
}
