/* For You.
 *
 * Two completely different documents wearing the same tokens.
 *
 * The feed has to be boring in the right way: familiar card rhythm, handle,
 * timestamp, like count, nothing on screen that hints anything is being
 * counted. If it looks like an exhibit, the player performs and the
 * measurement is worthless.
 *
 * The reveal then breaks the format on purpose - the cards stop, the page
 * goes wide and quiet, and blocks of finding assemble in their place.
 */

/* ---------- shared shell ---------- */

.screen {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: 520px;
  margin: 0 auto;
  padding: max(64px, calc(env(safe-area-inset-top) + 56px)) 20px max(28px, env(safe-area-inset-bottom));
}

.screen[hidden] { display: none; }

/* The reveal takes focus so a screen reader hears the finding rather than
   silence. It is a region, not a control, so no gold ring. */
#reveal:focus,
#reveal:focus-visible { outline: none; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- intro ---------- */

#intro { justify-content: center; }

.kicker {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.24em;
  color: var(--dim);
}

.title {
  margin: 0;
  font-size: clamp(46px, 14vw, 78px);
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.045em;
}

.title .tl-2 { display: block; color: var(--volt); }

.pitch {
  margin: 26px 0 0;
  font-size: 17px;
  line-height: 1.5;
  color: var(--dim);
  max-width: 34ch;
}

.pitch.small { margin-top: 12px; font-size: 14px; }

.big-btn {
  margin-top: 32px;
  padding: 18px 26px;
  border-radius: 16px;
  background: var(--paper);
  color: var(--void);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
  transition: transform 0.14s var(--ease-snap);
}

.big-btn:active { transform: scale(0.97); }

.text-link {
  margin-top: 16px;
  text-align: center;
  font-size: 14px;
  color: var(--dim);
  text-decoration: none;
}

.text-link:hover { color: var(--paper); }

/* ---------- the feed ---------- */

.feed-wrap { position: relative; z-index: 1; }
.feed-wrap[hidden] { display: none; }

/* Sticky, not fixed: it sits above the cards and scrolls with the document
   the way a real app chrome does. The time bar is the only meter on screen,
   and it reads as "this session ends", not "you are being scored". */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: max(10px, env(safe-area-inset-top)) 16px 10px;
  /* leaves room for the fixed back-to-arcade pill on the left */
  padding-left: 132px;
  background: rgba(18, 9, 31, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--paper);
}

.timebar {
  flex: 1;
  height: 3px;
  border-radius: 99px;
  background: var(--panel-lift);
  overflow: hidden;
}

.timebar i {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: 99px;
  background: var(--dim);
  transform: scaleX(0);
  transform-origin: left;
}

.stop-btn {
  min-height: 44px;
  padding: 0 14px;
  margin: -8px -6px -8px 0;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--dim);
}

.stop-btn:hover { color: var(--paper); }

.feed {
  max-width: 520px;
  margin: 0 auto;
  padding: 14px 14px 0;
  display: grid;
  gap: 12px;
}

.feed:focus { outline: none; }

/* A card. Deliberately unremarkable. */
.card {
  padding: 14px 15px 8px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
}

/* A post coming round for the second time. Real feeds do this to you
   constantly once they think they have you, and it is the most recognisable
   symptom of a narrowed feed - so it is shown rather than hidden. */
.card.again .who::after {
  content: " \00b7 again";
  font-weight: 500;
  color: var(--dim);
}

.card-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px;
}

.pfp {
  width: 30px; height: 30px;
  flex: none;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--void);
  background: var(--dim);
}

.who {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--paper);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.when {
  margin-left: auto;
  flex: none;
  font-size: 12px;
  color: var(--dim);
}

.card-text {
  margin: 0;
  font-size: 16px;
  line-height: 1.48;
  color: var(--paper);
  letter-spacing: -0.005em;
}

.card-foot {
  margin-top: 4px;
  display: flex;
  align-items: center;
}

/* 44px tall, and the heart is a CSS shape rather than an emoji - the house
   rule bans emoji, and a glyph would render differently on every phone. */
.like {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px 0 4px;
  border-radius: 999px;
  color: var(--dim);
  font-size: 13px;
  font-weight: 600;
  transition: color 0.16s;
}

.heart {
  position: relative;
  width: 15px; height: 14px;
  flex: none;
  transition: transform 0.2s var(--ease-snap);
}

.heart::before,
.heart::after {
  content: "";
  position: absolute;
  top: 0;
  width: 8px; height: 12px;
  border-radius: 8px 8px 0 0;
  background: transparent;
  border: 1.6px solid var(--dim);
  transition: background 0.16s, border-color 0.16s;
}

.heart::before { left: 6.5px; transform: rotate(45deg); transform-origin: 0 100%; }
.heart::after  { left: 6.5px; transform: rotate(-45deg); transform-origin: 0 100%; }

.like:hover { color: var(--paper); }

.like.on { color: var(--hot); }
.like.on .heart::before,
.like.on .heart::after {
  background: var(--hot);
  border-color: var(--hot);
}

.like.on .heart { animation: heart-pop 0.34s var(--ease-snap); }

@keyframes heart-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.35); }
  100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .like.on .heart { animation: none; }
}

.feed-end {
  max-width: 520px;
  margin: 26px auto max(40px, env(safe-area-inset-bottom));
  padding: 0 20px;
  text-align: center;
  font-size: 13px;
  color: var(--dim);
}

.feed-end[hidden] { display: none; }

/* ---------- reveal ---------- */

#reveal { padding-top: max(84px, calc(env(safe-area-inset-top) + 72px)); }

.rv-title {
  margin: 0 0 10px;
  font-size: clamp(28px, 8vw, 42px);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.035em;
}

.rv-sub {
  margin: 0 0 28px;
  font-size: 15px;
  color: var(--dim);
  line-height: 1.45;
}

/* Blocks assemble one after another rather than all appearing at once. The
   feed was busy; this part should feel like something being laid out. */
.block {
  margin-bottom: 26px;
  animation: block-in 0.5s var(--ease-out) both;
}

.block:nth-of-type(1) { animation-delay: 0.05s; }
.block:nth-of-type(2) { animation-delay: 0.14s; }
.block:nth-of-type(3) { animation-delay: 0.23s; }
.block:nth-of-type(4) { animation-delay: 0.32s; }
.block:nth-of-type(5) { animation-delay: 0.41s; }

@keyframes block-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

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

.block[hidden] { display: none; }

.block-tag {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
}

.block-note {
  margin: 0 0 12px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--dim);
}

.block-none {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--dim);
}

.block-none[hidden] { display: none; }

/* the top three */

.top3 { display: grid; gap: 10px; }
.top3[hidden] { display: none; }

.t3 {
  padding: 13px 14px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.t3-head {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin-bottom: 8px;
}

.t3-rank {
  font-size: 12px;
  font-weight: 700;
  color: var(--void);
  background: var(--volt);
  border-radius: 999px;
  min-width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  align-self: center;
}

.t3-name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.t3-quote {
  margin: 0 0 7px;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--dim);
  border-left: 2px solid var(--line);
  padding-left: 10px;
}

.t3-ev {
  margin: 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--volt);
}

/* the tone */

.tone-name {
  margin: 0 0 6px;
  font-size: clamp(30px, 9vw, 44px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--hot);
}

.tone-line {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--dim);
}

/* the loudness chart. One shared 0-3 scale, no axis tricks. */

.loudchart {
  margin: 0 0 14px;
  padding: 16px 15px 12px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.lc-row {
  display: grid;
  grid-template-columns: 54px 1fr 34px;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.lc-label { font-size: 12px; color: var(--dim); letter-spacing: 0.04em; }

.lc-track {
  height: 16px;
  border-radius: 99px;
  background: var(--void);
  overflow: hidden;
}

.lc-bar {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: var(--dim);
}

.lc-bar.b2 { background: var(--volt); }
.lc-bar.b2.up { background: var(--hot); }

.lc-num { font-size: 14px; font-weight: 700; text-align: right; }

.lc-cap {
  margin: 4px 0 0;
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--dim);
}

.loud-line {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--paper);
}

/* what fell out */

.dropped { display: grid; gap: 8px; }

.drop {
  padding: 11px 13px;
  border-radius: 12px;
  background: var(--void);
  border: 1px solid var(--line);
  opacity: 0.72;
}

.drop-topic {
  display: block;
  margin-bottom: 5px;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
}

.drop-text {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--dim);
}

/* topic mix, start against end */

.mixchart {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 16px 15px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.mix-head {
  margin: 0 0 9px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
  text-align: center;
}

.mix-stack {
  height: 190px;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--void);
}

.mix-stack .seg {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2px;
  overflow: hidden;
}

.mix-stack .seg.empty { background: var(--panel-lift); }

.mix-stack .seg b {
  font-size: 10px;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  padding: 0 3px;
  color: var(--void);
  letter-spacing: -0.01em;
}

/* the one line */

.takeaway {
  padding: 18px 16px;
  border-radius: 16px;
  background: linear-gradient(165deg, var(--panel-lift), var(--panel));
  border: 1px solid var(--line);
  margin-bottom: 22px;
}

.ta-line {
  margin: 0 0 6px;
  font-size: 17px;
  line-height: 1.45;
  color: var(--paper);
}

.ta-why {
  margin: 2px 0 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--dim);
}

.rv-more summary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--dim);
  cursor: pointer;
  list-style: none;
}

.rv-more summary::-webkit-details-marker { display: none; }
.rv-more summary::after { content: " \25BE"; }
.rv-more[open] summary::after { content: " \25B4"; }
.rv-more summary:hover { color: var(--paper); }

/* the full log */

.log {
  margin-bottom: 26px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  overflow: hidden;
}

.log summary {
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--dim);
  cursor: pointer;
  list-style: none;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.log summary::-webkit-details-marker { display: none; }
.log summary::after { content: " \2193"; }
.log[open] summary::after { content: " \2191"; }
.log summary:hover { color: var(--paper); }

.log-list { padding: 0 12px 12px; display: grid; gap: 8px; }

.lrow {
  padding: 10px 12px;
  border-radius: 11px;
  background: var(--void);
  border: 1px solid var(--line);
}

.lrow-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.lnum { font-size: 11px; color: var(--dim); min-width: 16px; }

.ltopic {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--paper);
}

.ltone { font-size: 11px; color: var(--gold); }

.lloud { font-size: 8px; color: var(--hot); letter-spacing: 1px; }

.ldwell { margin-left: auto; font-size: 11px; color: var(--dim); }

.ltext {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--dim);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ltags { margin: 7px 0 0; display: flex; gap: 6px; flex-wrap: wrap; }

.lt {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 7px;
  border-radius: 999px;
}

.lt.like  { color: var(--void); background: var(--hot); }
.lt.back  { color: var(--void); background: var(--volt); }
.lt.flick { color: var(--dim); background: var(--panel-lift); }

/* ---------- short screens ---------- */

@media (max-height: 700px) {
  .screen { padding-top: max(52px, calc(env(safe-area-inset-top) + 44px)); }
  .card-text { font-size: 15px; }
  .mix-stack { height: 150px; }
}

/* ---------- narrow screens ----------
   Below about 360px the back pill and the topbar contents stop coexisting,
   so the brand drops and the bar keeps the clock and the stop button. */

@media (max-width: 360px) {
  .topbar { padding-left: 124px; gap: 9px; }
  .brand { display: none; }
}
