/* =========================================================
   03 · Humanity — #pulse (owned by Agent C)
   ========================================================= */
#pulse {
  --accent: var(--magenta);
  --pulse-glow: rgba(255, 79, 216, 0.35);
  overflow: hidden;
  background:
    radial-gradient(60% 40% at 50% 34%, rgba(255, 79, 216, 0.07), transparent 70%),
    radial-gradient(40% 30% at 85% 80%, rgba(155, 123, 255, 0.06), transparent 70%);
}
#pulse a { color: var(--ink); text-decoration-color: rgba(255, 79, 216, 0.6); }
#pulse a:hover { color: var(--magenta); }
#pulse a:focus-visible, #pulse button:focus-visible { outline: 2px solid var(--magenta); outline-offset: 3px; border-radius: 6px; }

/* ---------- status bar ---------- */
#pulse .pulse-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: -12px 0 8px; }
#pulse .pulse-replay {
  font-family: var(--f-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  padding: 5px 10px; border-radius: 999px; color: #1a0716; background: var(--amber); font-weight: 600;
}
#pulse .pulse-replay[hidden] { display: none; }
#pulse .pulse-src { font-size: 11px; color: var(--ink-3); overflow-wrap: anywhere; }

/* ---------- living field ---------- */
#pulse .pulse-field {
  position: relative; width: 100%; height: clamp(260px, 42vw, 640px);
  margin: 12px 0 34px;
}
#pulse .pulse-field::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(var(--bg), transparent 9%, transparent 91%, var(--bg));
  opacity: .8;
}
#pulse .pulse-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#pulse .pulse-rate {
  position: absolute; z-index: 1; left: max(var(--gutter), calc((100% - var(--maxw)) / 2 + var(--gutter))); top: 14%;
  display: flex; flex-direction: column; pointer-events: none;
  text-shadow: 0 0 24px rgba(4, 5, 10, .9), 0 0 4px rgba(4, 5, 10, .9);
}
#pulse .pulse-rate__n {
  font-size: var(--step-3); font-weight: 600; line-height: 1; color: var(--ink);
  text-shadow: 0 0 28px var(--pulse-glow), 0 0 4px rgba(4, 5, 10, .9);
}
#pulse .pulse-rate__u { font-family: var(--f-mono); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--magenta); margin-top: 6px; }
#pulse .pulse-legend {
  position: absolute; z-index: 1; right: max(var(--gutter), calc((100% - var(--maxw)) / 2 + var(--gutter))); bottom: 6%;
  display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px 14px; margin: 0; padding: 7px 12px; list-style: none;
  font-size: 10.5px; color: var(--ink-2); background: rgba(4, 5, 10, .62); border: 1px solid var(--line); border-radius: 999px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); max-width: calc(100% - 2 * var(--gutter));
}
#pulse .pulse-legend li { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
#pulse .pulse-legend__size { color: var(--ink-3); }
#pulse .pulse-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
#pulse .pulse-dot--human { background: var(--magenta); box-shadow: 0 0 8px var(--magenta), inset 0 0 0 2px rgba(255,255,255,.6); }
#pulse .pulse-dot--bot { background: var(--violet); opacity: .7; }
#pulse .pulse-dot--new { background: #fff; box-shadow: 0 0 10px #fff, 0 0 16px var(--amber); }

/* ---------- stats ---------- */
#pulse .pulse-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 14px; }
#pulse .pulse-stats .card { padding: 18px 20px; }
#pulse .pulse-stats .stat__value small { color: var(--magenta); }
#pulse .pulse-bytes .stat__value { font-size: var(--step-1); display: flex; flex-wrap: wrap; gap: 0 12px; padding-top: .25em; }
#pulse .pulse-plus { color: var(--lime); }
#pulse .pulse-minus { color: var(--red); }
#pulse [data-k="perday"] { color: var(--ink); }

#pulse .pulse-feature { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
#pulse .pulse-feature .card { min-width: 0; }
#pulse .pulse-feature h3 { font-family: var(--f-mono); font-size: 11px; font-weight: 400; letter-spacing: .18em; text-transform: uppercase; color: var(--magenta); }
#pulse .pulse-feature p { margin: 0 0 8px; }
#pulse .pulse-big__size { font-size: var(--step-1); color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
#pulse .pulse-big__title, #pulse .pulse-newest__title { font-family: var(--f-display); font-weight: 500; font-size: var(--step-0); line-height: 1.3; overflow-wrap: anywhere; color: var(--ink); }
#pulse .pulse-newest__meta { font-size: 12px; color: var(--ink-3); }
#pulse .pulse-langs__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; font-size: var(--step--1); }
#pulse .pulse-langs__list li { display: grid; grid-template-columns: minmax(0, 8.5em) 1fr 2.6em; align-items: center; gap: 10px; }
#pulse .pulse-langs__name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
#pulse .pulse-langs__bar { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .05); overflow: hidden; }
#pulse .pulse-langs__bar i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, rgba(255,79,216,.35), var(--magenta)); transition: width .5s var(--ease-out); }
#pulse .pulse-langs__list .mono { text-align: right; color: var(--ink); font-size: 12px; }
#pulse .pulse-langs__empty { color: var(--ink-3); display: block !important; }

/* ---------- parts 2 + 3 ---------- */
#pulse .pulse-part { margin-top: clamp(72px, 10vh, 120px); }
#pulse .pulse-part__head { margin-bottom: 22px; }
#pulse .pulse-h { font-family: var(--f-display); font-weight: 700; font-size: var(--step-2); line-height: 1.1; letter-spacing: -0.01em; margin: 0 0 10px; }
#pulse .pulse-h em { font-style: normal; color: var(--magenta); }
#pulse .pulse-sub { color: var(--ink-2); margin: 0 0 14px; max-width: 62ch; }
#pulse .pulse-note { font-size: 11px; color: var(--ink-3); margin: 12px 0 0; overflow-wrap: anywhere; }

/* most read */
#pulse .pulse-top { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
#pulse .pulse-top__sk { height: 76px; }
#pulse .pulse-top__item {
  position: relative; display: grid; grid-template-columns: 2.2em 64px minmax(0, 1fr) auto; align-items: center; gap: 16px;
  padding: 10px 16px 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel);
  transition: border-color .3s, background .3s;
}
#pulse .pulse-top__item:hover { border-color: rgba(255, 79, 216, .45); background: rgba(40, 14, 40, .45); }
#pulse .pulse-top__rank { font-size: var(--step-1); color: var(--ink-3); text-align: right; }
#pulse .pulse-top__item:first-child .pulse-top__rank { color: var(--magenta); }
#pulse .pulse-top__thumb { width: 64px; height: 64px; border-radius: 10px; overflow: hidden; background: rgba(255,255,255,.04); }
#pulse .pulse-top__thumb img { width: 100%; height: 100%; object-fit: cover; }
#pulse .pulse-top__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
#pulse .pulse-top__title { font-weight: 600; font-size: var(--step-0); line-height: 1.25; overflow-wrap: anywhere; }
#pulse .pulse-top__desc { font-size: var(--step--1); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#pulse .pulse-top__bar { height: 4px; margin-top: 6px; border-radius: 2px; background: rgba(255,255,255,.05); overflow: hidden; }
#pulse .pulse-top__bar i {
  display: block; height: 100%; width: var(--w); border-radius: 2px;
  background: linear-gradient(90deg, rgba(155,123,255,.7), var(--magenta)); box-shadow: 0 0 10px var(--pulse-glow);
  transform-origin: left; transform: scaleX(0); transition: transform 1.4s var(--ease-out) .2s;
}
#pulse .pulse-top.is-in .pulse-top__bar i { transform: none; }
#pulse .pulse-top__nums { display: grid; justify-items: end; gap: 2px; }
#pulse .pulse-top__views { font-size: var(--step-0); font-weight: 600; white-space: nowrap; }
#pulse .pulse-top__views small { font-size: .7em; color: var(--ink-3); font-weight: 400; }
#pulse .pulse-top__spike { font-size: 10.5px; color: var(--amber); white-space: nowrap; }
#pulse .pulse-spark { overflow: visible; }
#pulse .pulse-spark__line { fill: none; stroke: var(--magenta); stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: round; }
#pulse .pulse-spark__area { fill: rgba(255, 79, 216, .12); }
#pulse .pulse-spark__dot { fill: #fff; }

/* on this day: ruler */
#pulse .pulse-otd { padding: 0; overflow: hidden; }
#pulse .pulse-ruler { overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: rgba(255,79,216,.4) transparent; }
#pulse .pulse-ruler__sk { height: 220px; margin: 20px; }
#pulse .pulse-ruler__track { position: relative; min-width: 760px; height: 230px; margin: 0 24px; }
#pulse .pulse-ruler__axis {
  position: absolute; left: 0; right: 0; bottom: 56px; height: 2px;
  background: linear-gradient(90deg, rgba(155,123,255,.25), var(--magenta)); box-shadow: 0 0 14px var(--pulse-glow);
}
#pulse .pulse-ruler__grid { position: absolute; bottom: 8px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; font-size: 10px; line-height: 1.3; color: var(--ink-3); white-space: nowrap; }
#pulse .pulse-ruler__grid::before { content: ""; position: absolute; bottom: 46px; left: 50%; width: 1px; height: 8px; background: var(--ink-3); }
#pulse .pulse-ruler__grid b { font-weight: 400; color: var(--ink-2); }
#pulse .pulse-ruler__grid em { font-style: normal; }
#pulse .pulse-ruler__now { position: absolute; right: -8px; bottom: 62px; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--magenta); }

#pulse .pulse-tick {
  --stem: calc(30px + var(--lane) * 30px);
  position: absolute; bottom: 57px; width: 26px; height: calc(var(--stem) + 14px); margin-left: -13px;
  padding: 0; border: 0; background: none; cursor: pointer; touch-action: manipulation;
}
#pulse .pulse-tick::before {   /* stem */
  content: ""; position: absolute; left: 50%; bottom: 0; width: 1px; height: var(--stem);
  background: linear-gradient(to top, var(--magenta), rgba(255,79,216,.15)); transition: width .2s;
}
#pulse .pulse-tick::after {    /* head */
  content: ""; position: absolute; left: 50%; bottom: var(--stem); width: 9px; height: 9px; margin: 0 0 -4px -4.5px; border-radius: 50%;
  background: var(--magenta); box-shadow: 0 0 10px var(--magenta), 0 0 22px var(--pulse-glow);
  transition: transform .25s var(--ease-out), background .25s;
}
#pulse .pulse-tick__yr { position: absolute; left: 50%; bottom: calc(var(--stem) + 10px); transform: translateX(-50%); font-size: 10.5px; color: var(--ink-2); white-space: nowrap; transition: color .2s; }
#pulse .pulse-tick:hover::after, #pulse .pulse-tick:focus-visible::after { transform: scale(1.5); }
#pulse .pulse-tick[aria-pressed="true"]::after { background: #fff; transform: scale(1.7); box-shadow: 0 0 12px #fff, 0 0 26px var(--magenta); }
#pulse .pulse-tick[aria-pressed="true"]::before { width: 2px; }
#pulse .pulse-tick[aria-pressed="true"] .pulse-tick__yr { color: #fff; font-weight: 600; }
#pulse .pulse-tick:focus-visible { outline-offset: 0; }

#pulse .pulse-otd__detail {
  display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 22px; align-items: start;
  padding: 22px clamp(18px, 2.4vw, 28px) 26px; border-top: 1px solid var(--line); min-height: 170px;
}
#pulse .pulse-otd__detail:not(:has(img)) { grid-template-columns: minmax(0, 1fr); }
#pulse .pulse-otd__img { width: 120px; height: 120px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }
#pulse .pulse-otd__year { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; margin: 0 0 8px; }
#pulse .pulse-otd__year > .mono:first-child { font-size: var(--step-2); font-weight: 600; color: var(--ink); line-height: 1; }
#pulse .pulse-otd__ago { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--magenta); }
#pulse .pulse-otd__body { margin: 0 0 12px; color: var(--ink); font-size: var(--step-0); line-height: 1.5; max-width: 70ch; }
#pulse .pulse-otd__link { font-size: var(--step--1); }

/* ---------- small screens ---------- */
@media (max-width: 760px) {
  #pulse .pulse-field { height: clamp(250px, 70vw, 360px); }
  #pulse .pulse-rate { top: 6%; }
  #pulse .pulse-rate__n { font-size: var(--step-2); }
  #pulse .pulse-legend { bottom: 3%; font-size: 9.5px; gap: 4px 10px; padding: 5px 10px; border-radius: 12px; }
  #pulse .pulse-legend__size { display: none !important; }
  #pulse .pulse-stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  #pulse .pulse-stats .card { padding: 14px; }
  #pulse .pulse-bytes { grid-column: 1 / -1; }
  #pulse .pulse-top__item { grid-template-columns: 1.6em 48px minmax(0, 1fr); gap: 10px 12px; padding: 10px 12px 10px 8px; }
  #pulse .pulse-top__rank { font-size: var(--step-0); }
  #pulse .pulse-top__thumb { width: 48px; height: 48px; }
  #pulse .pulse-top__nums { grid-column: 3; justify-items: start; grid-auto-flow: column; align-items: center; gap: 10px; }
  #pulse .pulse-otd__detail { grid-template-columns: 72px minmax(0, 1fr); gap: 14px; }
  #pulse .pulse-otd__img { width: 72px; height: 72px; }
}
@media (max-width: 420px) {
  #pulse .pulse-stats .stat__value { font-size: var(--step-1); }
}

@media (prefers-reduced-motion: reduce) {
  #pulse .pulse-top__bar i { transform: none; transition: none; }
}
