:root {
  --fondo: #f4f1ec;
  --carta: #fffdf9;
  --inchiostro: #1d1a17;
  --tenue: #8b8279;
  --linea: #e6e0d7;
  --accento: #b4532a;
  --evidenza: #f6dccb;
  --pannello: #ffffff;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
html { font-size: clamp(12px, min(1.6vw, 2.5vh), 18px); }
body {
  background: var(--fondo);
  color: var(--inchiostro);
  font-family: 'Mona Sans Variable', 'Mona Sans', system-ui, sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }

.stage {
  position: relative;
  height: 100vh;
  display: grid;
  place-items: center;
  padding: min(4vh, 28px) min(4vw, 28px);
}

/* ---- the post ---- */
.post {
  position: relative;
  width: min(54rem, 100%);
  max-height: 100%;
  overflow: hidden;
  background: var(--carta);
  border: 1px solid var(--linea);
  border-radius: 18px;
  padding: 1.7rem 4.4rem 1.8rem 2rem;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 24px 48px -28px rgba(60, 40, 20, 0.28), 0 2px 6px -2px rgba(60, 40, 20, 0.08);
}
.post__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--tenue);
  margin-bottom: 1rem;
}
.brand { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--inchiostro); font-weight: 600; font-stretch: 112%; letter-spacing: -0.01em; }
.brand svg { width: 1rem; height: 1rem; fill: none; stroke: var(--accento); stroke-width: 1.8; stroke-linecap: round; }
.post__title {
  font-family: 'Newsreader Variable', 'Newsreader', Georgia, serif;
  font-weight: 500;
  font-size: clamp(20px, min(4vw, 6.4vh), 52px);
  line-height: 1.04;
  letter-spacing: -0.02em;
  font-variation-settings: 'opsz' 72;
  max-width: 17ch;
}
.post__title em { font-style: italic; color: var(--accento); }
.post__by {
  display: flex; align-items: center; gap: 0.45rem;
  margin: 0.8rem 0 1.15rem;
  font-size: 0.72rem; color: var(--tenue);
}

.av {
  --c: #e6dfd6;
  display: inline-grid; place-items: center;
  width: 1.9rem; height: 1.9rem; border-radius: 50%;
  background: var(--c);
  font-size: 0.6rem; font-weight: 650; letter-spacing: 0.02em; color: rgba(29, 26, 23, 0.78);
  flex: none;
}
.av--small { width: 1.45rem; height: 1.45rem; font-size: 0.5rem; }

/* ---- the paragraphs with their bubble in the margin ---- */
.post__body { display: grid; gap: 0.9rem; }
.par { position: relative; }
.par p {
  font-family: 'Newsreader Variable', 'Newsreader', Georgia, serif;
  font-size: clamp(12px, min(2vw, 3.1vh), 21px);
  line-height: 1.5;
  font-variation-settings: 'opsz' 14;
  color: var(--inchiostro);
}
.hl {
  background-image: linear-gradient(var(--evidenza), var(--evidenza));
  background-repeat: no-repeat;
  background-position: 0 88%;
  background-size: 0% 46%;
  border-radius: 2px;
}
.bub {
  position: absolute;
  top: 0.15rem;
  right: -3.75rem;
  display: inline-flex; align-items: center; gap: 0.2rem;
  height: 1.95rem;
  padding: 0 0.55rem 0 0.42rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--tenue);
  font-size: 0.78rem; font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.bub svg { width: 1.2rem; height: 1.2rem; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }
.bub__n { display: inline-block; min-width: 0.6em; }
.bub:focus-visible { outline: 2px solid var(--accento); outline-offset: 2px; }
.bub.is-open { color: var(--accento); border-color: rgba(180, 83, 42, 0.28); background: #fbefe7; }
@media (hover: hover) {
  .bub:hover { color: var(--inchiostro); border-color: var(--linea); background: #fff; }
  .bub.is-open:hover { color: var(--accento); }
}

/* ---- the responses panel ---- */
.panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(24rem, 86%);
  display: flex; flex-direction: column;
  background: var(--pannello);
  border-left: 1px solid var(--linea);
  box-shadow: -24px 0 48px -30px rgba(60, 40, 20, 0.35);
  padding: 1.05rem 1rem 0.9rem;
  visibility: hidden;
}
.panel__head { display: flex; align-items: center; justify-content: space-between; }
.panel__title { font-size: 0.8rem; font-weight: 650; font-stretch: 108%; }
.close {
  display: grid; place-items: center;
  width: 1.8rem; height: 1.8rem; border-radius: 50%;
  border: 0; background: #f3efe9; cursor: pointer;
}
.close svg { width: 0.85rem; height: 0.85rem; fill: none; stroke: var(--inchiostro); stroke-width: 1.8; stroke-linecap: round; }
.close:focus-visible { outline: 2px solid var(--accento); outline-offset: 2px; }
.quote {
  margin: 0.75rem 0 0.6rem;
  padding: 0.15rem 0 0.15rem 0.65rem;
  border-left: 2px solid var(--accento);
  font-family: 'Newsreader Variable', 'Newsreader', Georgia, serif;
  font-style: italic;
  font-size: 0.8rem;
  line-height: 1.4;
  color: #5d554d;
}
.list { list-style: none; flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: none; overscroll-behavior: contain; display: grid; align-content: start; gap: 0.15rem; }
.list { -webkit-mask-image: linear-gradient(transparent, #000 8px, #000 calc(100% - 14px), transparent); mask-image: linear-gradient(transparent, #000 8px, #000 calc(100% - 14px), transparent); }
.list::-webkit-scrollbar { display: none; }
.com { display: grid; grid-template-columns: auto 1fr; gap: 0.55rem; padding: 0.5rem 0; border-top: 1px solid #f1ece5; }
.com:first-child { border-top: 0; }
.com__who { font-size: 0.68rem; font-weight: 650; }
.com__who span { color: var(--tenue); font-weight: 450; margin-left: 0.3rem; }
.com__txt { font-size: 0.72rem; line-height: 1.4; color: #3b3530; margin-top: 0.1rem; }
.like {
  display: inline-flex; align-items: center; gap: 0.25rem;
  margin-top: 0.3rem;
  border: 0; background: none; cursor: pointer;
  font-size: 0.64rem; color: var(--tenue);
  -webkit-tap-highlight-color: transparent;
}
.like svg { width: 0.85rem; height: 0.85rem; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.like.is-on { color: var(--accento); }
.like.is-on svg { fill: var(--accento); }
.like:focus-visible { outline: 2px solid var(--accento); outline-offset: 2px; border-radius: 6px; }

.reply {
  display: flex; align-items: center; gap: 0.45rem;
  margin-top: 0.55rem;
  padding: 0.35rem 0.35rem 0.35rem 0.4rem;
  border: 1px solid var(--linea); border-radius: 999px;
  background: #fbf9f6;
}
.reply:focus-within { border-color: rgba(180, 83, 42, 0.45); box-shadow: 0 0 0 3px rgba(180, 83, 42, 0.12); }
.reply__in { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 0.72rem; }
.reply__go {
  border: 0; border-radius: 999px;
  padding: 0.38rem 0.75rem;
  background: var(--inchiostro); color: #fff;
  font-size: 0.66rem; font-weight: 650;
  cursor: pointer;
  transition: opacity 0.2s;
}
.reply__go:disabled { opacity: 0.3; cursor: default; }
.reply__go:focus-visible { outline: 2px solid var(--accento); outline-offset: 2px; }

/* the drawn pointer of the autopilot */
.ghost {
  position: fixed; left: 0; top: 0;
  width: 22px; height: 22px;
  fill: #1d1a17; stroke: #fff; stroke-width: 1.4; stroke-linejoin: round;
  pointer-events: none; z-index: 20;
  visibility: hidden;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.2));
}

/* on a narrow screen the comments rise from the bottom as a sheet */
@media (max-width: 560px) {
  .post { padding: 1.1rem 2.9rem 1.2rem 1.1rem; border-radius: 14px; }
  .bub { right: -2.55rem; padding: 0 0.3rem; }
  .panel {
    top: auto; left: 0; width: 100%; height: 78%;
    border-left: 0; border-top: 1px solid var(--linea);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -20px 40px -26px rgba(60, 40, 20, 0.35);
  }
}
