/* ============================================================================
 * home-v2.css — alternate home layout, served at /home-v2.
 *
 * Loaded only on the v2 route (via extraCss in BlogHomeV2Page.cs). Every rule
 * is prefixed with `.home-v2` so even if the file is ever included sitewide
 * by accident, V1 page (served at /) stays untouched.
 *
 * Adapted from the user's profile mock at C:/Users/Forbannet/Downloads/profile (1).html.
 * Differences from the mock:
 *   - Theme tokens (var(--io-accent), etc.) come from the chassis themes, not
 *     hardcoded :root in the mock. Removed the mock's :root block.
 *   - Font vars are the chassis ones (var(--io-font-mono), --io-font-pixel)
 *     instead of the mock's --mono / --pixel.
 *   - Shell stuff (body bg, scroll, etc.) lives in chassis CSS — we keep
 *     only the prof-* / kr-* / paper-mini-* / heatmap-* rules.
 *   - All rules scoped to `.home-v2` so V1 home rules don't fight V2 rules
 *     (and vice versa) when the user nav's between them.
 * ============================================================================ */

/* ─── rail heading ──────────────────────────────────────────────────────── */
.home-v2 .rail-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--io-font-pixel);
  font-size: 11px;
  font-weight: 400;
  color: var(--io-text-secondary);
  letter-spacing: 0.04em;
  text-transform: lowercase;
  margin-bottom: 14px;
}
.home-v2 .rail-heading i { color: var(--io-accent); font-size: 11px; }
.home-v2 .rail-heading .label { color: var(--io-text-secondary); }
.home-v2 .rail-heading .rule {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--io-border), transparent);
}

/* ─── identity row ─────────────────────────────────────────────────────── */
.home-v2 .prof-identity {
  display: grid;
  grid-template-columns: 200px 1fr 300px;
  gap: 36px;
  align-items: start;
  margin-bottom: 44px;
}

.home-v2 .prof-avatar-col { width: 200px; }

.home-v2 .prof-avatar {
  position: relative;
  width: 200px;
  height: 200px;
  background: var(--io-surface-raised);
  border: 1px solid var(--io-border);
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color .15s, transform .15s;
}
.home-v2 .prof-avatar:hover,
.home-v2 .prof-avatar:focus-visible {
  border-color: var(--io-accent-dim);
  outline: none;
}
.home-v2 .prof-avatar-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.home-v2 .prof-avatar-tag {
  position: absolute;
  top: 8px; left: 8px;
  font-family: var(--io-font-pixel);
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--io-text-secondary);
  background: rgba(10,10,10,0.78);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 4px 7px 3px;
  border-radius: 3px;
  border: 1px solid var(--io-border);
}
.home-v2 .prof-avatar-online {
  position: absolute;
  bottom: 8px; left: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--io-font-pixel);
  font-size: 9px;
  letter-spacing: 0.04em;
  color: var(--io-success);
  background: rgba(10,10,10,0.78);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 4px 8px 3px;
  border-radius: 3px;
  border: 1px solid var(--io-border);
}
.home-v2 .prof-avatar-online-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--io-success);
  box-shadow: 0 0 6px rgba(102,255,51,0.55);
  animation: home-v2-blip 1.4s ease-in-out infinite;
}
@keyframes home-v2-blip { 50% { opacity: .4 } }

.home-v2 .prof-avatar-actions { margin-top: 12px; }

/* ─── kr-btn (shared button atom for v2) ──────────────────────────────── */
.home-v2 .kr-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 4px;
  font-family: var(--io-font-mono);
  font-size: 13px;
  font-weight: 500;
  transition: all .15s ease;
  width: 100%;
  justify-content: center;
}
.home-v2 .kr-btn.primary {
  background: var(--io-accent);
  color: var(--io-on-accent);
  border: 1px solid var(--io-accent);
}
.home-v2 .kr-btn.primary:hover {
  background: var(--io-accent-bright);
  border-color: var(--io-accent-bright);
  transform: translateY(-1px);
}
.home-v2 .kr-btn.ghost {
  background: transparent;
  color: var(--io-text-secondary);
  border: 1px solid var(--io-border);
}
.home-v2 .kr-btn.ghost:hover {
  border-color: var(--io-accent-dim);
  color: var(--io-text-primary);
  background: var(--io-accent-subtle);
}
.home-v2 .kr-btn.ghost.sm {
  padding: 5px 10px;
  font-size: 11.5px;
  width: auto;
}

/* ─── copy column ─────────────────────────────────────────────────────── */
.home-v2 .prof-copy { min-width: 0; padding-top: 2px; }

.home-v2 .prof-kicker {
  font-family: var(--io-font-pixel);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--io-accent);
  margin-bottom: 10px;
}

.home-v2 .prof-name {
  font-family: var(--io-font-mono);
  font-weight: 700;
  font-size: clamp(2.6rem, 7vw, 5rem);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--io-text-primary);
  display: inline-flex;
  align-items: center;
  margin-bottom: 8px;
}
.home-v2 .kr-cursor {
  display: inline-block;
  width: 0.45em;
  height: 0.78em;
  background: var(--io-accent);
  box-shadow: 0 0 14px var(--io-accent-glow);
  animation: home-v2-cursor-blink 1.05s steps(1) infinite;
  margin-left: 0.1em;
  vertical-align: -0.04em;
}
@keyframes home-v2-cursor-blink { 50% { opacity: 0 } }

.home-v2 .prof-subtitle {
  font-family: var(--io-font-mono);
  font-size: 13px;
  color: var(--io-text-tertiary);
  margin-bottom: 18px;
}

.home-v2 .prof-bio {
  font-family: var(--io-font-mono);
  font-size: 14px;
  line-height: 1.6;
  color: var(--io-text-secondary);
  max-width: 62ch;
  margin-bottom: 18px;
}

.home-v2 .prof-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.home-v2 .kr-tag {
  font-family: var(--io-font-pixel);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--io-accent-bright);
  background: var(--io-accent-subtle);
  border: 1px solid color-mix(in srgb, var(--io-accent) 22%, transparent);
  padding: 5px 8px 4px;
  border-radius: 3px;
  transition: all .15s;
}
.home-v2 .kr-tag:hover {
  background: color-mix(in srgb, var(--io-accent) 14%, transparent);
  border-color: var(--io-accent-dim);
  color: var(--io-text-primary);
}

/* ─── connect column ──────────────────────────────────────────────────── */
.home-v2 .prof-links-col { min-width: 0; }
.home-v2 .prof-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.home-v2 .prof-link {
  display: grid;
  grid-template-columns: 22px 70px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 4px;
  font-size: 13px;
  transition: background .12s;
  border: 1px solid transparent;
  text-decoration: none;
}
.home-v2 .prof-link:hover {
  background: var(--io-surface-overlay);
  border-color: var(--io-border);
}
.home-v2 .prof-link-icon { font-size: 14px; }
.home-v2 .prof-link-k {
  font-family: var(--io-font-pixel);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--io-text-tertiary);
}
.home-v2 .prof-link-v {
  font-family: var(--io-font-mono);
  color: var(--io-text-primary);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.home-v2 .prof-link-out {
  color: var(--io-text-disabled);
  font-size: 10px;
}
.home-v2 .prof-link:hover .prof-link-out { color: var(--io-accent); }

/* ─── heatmap section (v2 — single boxed unit) ─────────────────────────
 * No more side-by-side row with a separate menu. Everything lives in one
 * .prof-heatmap-section box: inline tabs at the top, centered grid below.
 * The grid is capped at a sane "reads-good" max width and centered, so
 * ultrawide monitors don't get a sprawling rectangle. */

.home-v2 .hm-v2 {
  display: block;
  background: var(--io-surface-raised);
  border: 1px solid var(--io-border);
  border-radius: 4px;
  padding: 14px 18px 18px;
  min-width: 0;
  margin-bottom: 44px;
  /* Override V1's .prof-heatmap-section flex/grow rules — we're a block. */
  flex: initial;
}

/* ── inline tabs ─────────────────────────────────────────────────────
 * Subtle horizontal pill row. Wraps to multiple rows when the section
 * narrows. The first child (.prof-heatmap-menu-head from the shared
 * GetTabsHtml output) is hidden — it was the "// CONTRIBUTIONS" label
 * that the V1 sidebar menu needed; inline-on-top doesn't need it. */
.home-v2 .hm-v2 .hm-inline-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px dashed var(--io-border);
}
.home-v2 .hm-v2 .hm-inline-tabs .prof-heatmap-menu-head { display: none; }
.home-v2 .hm-v2 .hm-inline-tabs .prof-heatmap-menu-sub  {
  /* The "orgs" sub-divider becomes a thin vertical separator inline. */
  align-self: center;
  padding: 0 4px 0 8px;
  margin-left: 4px;
  border-left: 1px dashed var(--io-border);
  font-family: var(--io-font-pixel);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--io-text-tertiary);
  text-transform: uppercase;
}

/* ── tabs (override V1's full-width vertical button style) ──────────── */
.home-v2 .hm-v2 .prof-heatmap-tab {
  display: inline-flex;            /* override V1's flex (full-width row) */
  align-items: center;
  gap: 6px;
  padding: 5px 10px 4px;
  border-radius: 3px;
  font-family: var(--io-font-mono);
  font-size: 11.5px;
  color: var(--io-text-tertiary);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .12s;
  width: auto;                     /* override V1's stretch */
  justify-content: flex-start;
}
.home-v2 .hm-v2 .prof-heatmap-tab:hover {
  color: var(--io-text-primary);
  background: var(--io-surface-overlay);
}
.home-v2 .hm-v2 .prof-heatmap-tab.is-active {
  color: var(--io-accent-bright);
  background: var(--io-accent-subtle);
  border-color: color-mix(in srgb, var(--io-accent) 22%, transparent);
}
.home-v2 .hm-v2 .prof-heatmap-tab .k { font-family: inherit; }
.home-v2 .hm-v2 .prof-heatmap-tab .v {
  font-family: var(--io-font-pixel);
  font-size: 9px;
  color: var(--io-text-tertiary);
  letter-spacing: 0.04em;
}
.home-v2 .hm-v2 .prof-heatmap-tab.is-active .v { color: var(--io-accent); }

/* ── panes wrapper + centered grid ───────────────────────────────────
 * Hard-cap the grid width so the heatmap stops scaling past a comfortable
 * "reads-good" size regardless of viewport. 940px keeps cells in the
 * 13-17px range (good detail, no monster squares), centered within the
 * section box. Below the cap the grid fills available width fluidly. */
.home-v2 .hm-v2 .prof-heatmap-grids {
  width: 100%;
  min-width: 0;
}
.home-v2 .hm-v2 .heatmap-root {
  width: 100%;
  max-width: 940px;
  margin-inline: auto;
}

/* On very narrow viewports the 53-column grid hits its 10px-per-cell floor
 * and wants ~634px; let it scroll horizontally inside the section box
 * instead of breaking the outer layout. The boxed border becomes the
 * visual scroll affordance. */
@media (max-width: 760px) {
  .home-v2 .hm-v2 .prof-heatmap-grids {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* ─── overflow safety ─────────────────────────────────────────────────── *
 * Any flex / grid item that contains text needs min-width:0 or a long
 * unbroken string (URL, slug, hashed username) propagates the intrinsic
 * width up and breaks the parent column. These are all the V2 column
 * children that could plausibly host such content. */
.home-v2 .prof-copy,
.home-v2 .prof-links-col,
.home-v2 .prof-papers-col,
.home-v2 .prof-right-col,
.home-v2 .paper-mini-body,
.home-v2 .prof-now-meta { min-width: 0; }

.home-v2 .prof-link-v,
.home-v2 .paper-mini-t,
.home-v2 .paper-mini-venue,
.home-v2 .prof-now-track {
  overflow-wrap: anywhere;       /* break inside long URLs / slugs / hashes */
}

/* ─── bottom row ─────────────────────────────────────────────────────── */
.home-v2 .prof-bottom-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: start;
}

/* ── papers ── */
.home-v2 .paper-mini-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.home-v2 .paper-mini-empty {
  padding: 14px 16px;
  background: var(--io-surface-raised);
  border: 1px dashed var(--io-border);
  border-radius: 4px;
  font-family: var(--io-font-mono);
  font-size: 12px;
  color: var(--io-text-tertiary);
}
.home-v2 .paper-mini {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  background: var(--io-surface-raised);
  border: 1px solid var(--io-border);
  border-radius: 4px;
  cursor: pointer;
  transition: all .15s;
}
.home-v2 .paper-mini:hover {
  border-color: var(--io-accent-dim);
  background: var(--io-surface-overlay);
}
.home-v2 .paper-mini-y {
  font-family: var(--io-font-pixel);
  font-size: 13px;
  color: var(--io-accent);
  letter-spacing: 0.04em;
}
.home-v2 .paper-mini-body { min-width: 0; }
.home-v2 .paper-mini-t {
  font-family: var(--io-font-mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--io-text-primary);
  line-height: 1.35;
  margin-bottom: 4px;
}
.home-v2 .paper-mini-venue {
  font-family: var(--io-font-mono);
  font-size: 11.5px;
  color: var(--io-text-tertiary);
  letter-spacing: 0.02em;
}
.home-v2 .paper-mini-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* ── right column (now playing + recently) ── */
.home-v2 .prof-right-col {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.home-v2 .prof-now-card {
  background: var(--io-surface-raised);
  border: 1px solid var(--io-border);
  border-radius: 4px;
  padding: 14px;
}
.home-v2 .prof-now-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.home-v2 .prof-now-art {
  width: 48px;
  height: 48px;
  border-radius: 4px;
  background:
    radial-gradient(circle at 30% 30%, var(--io-accent-glow), transparent 60%),
    radial-gradient(circle at 70% 70%, rgba(102,194,255,0.3), transparent 60%),
    var(--io-surface-overlay);
  border: 1px solid var(--io-border);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  overflow: hidden;
}
.home-v2 .prof-now-art img { width: 100%; height: 100%; object-fit: cover; }
.home-v2 .prof-now-meta { min-width: 0; flex: 1; }
.home-v2 .prof-now-track {
  font-family: var(--io-font-mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--io-text-primary);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.home-v2 .prof-now-album {
  font-family: var(--io-font-mono);
  font-size: 12px;
  color: var(--io-text-tertiary);
  margin-top: 2px;
}
.home-v2 .prof-now-play {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--io-accent);
  font-size: 12px;
  flex-shrink: 0;
  cursor: pointer;
  transition: all .12s;
}
.home-v2 .prof-now-play:hover { color: var(--io-accent-bright); transform: scale(1.08); }

.home-v2 .prof-now-bar {
  height: 3px;
  background: var(--io-border);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 12px;
}
.home-v2 .prof-now-bar-fill {
  height: 100%;
  width: 44%;
  background: var(--io-accent);
  border-radius: 2px;
  box-shadow: 0 0 6px var(--io-accent-glow);
}
.home-v2 .prof-now-times {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-family: var(--io-font-pixel);
  font-size: 9px;
  color: var(--io-text-tertiary);
  letter-spacing: 0.06em;
}

/* ── recently terminal scroll ── */
.home-v2 .prof-recent { min-width: 0; }
.home-v2 .prof-recent-list {
  background: var(--io-surface-raised);
  border: 1px solid var(--io-border);
  border-radius: 4px;
  height: 260px;
  overflow: hidden;
  position: relative;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 12%, black 88%, transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0%, black 12%, black 88%, transparent 100%);
}
.home-v2 .prof-recent-track {
  font-family: var(--io-font-mono);
  font-size: 12.5px;
  padding: 12px 16px;
  animation: home-v2-recent-scroll 38s linear infinite;
}
.home-v2 .prof-recent-list:hover .prof-recent-track { animation-play-state: paused; }
@keyframes home-v2-recent-scroll {
  from { transform: translateY(0); }
  to   { transform: translateY(-50%); }
}
.home-v2 .prof-recent-line {
  padding: 3px 0;
  color: var(--io-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.home-v2 .prof-recent-sigil {
  color: var(--io-accent);
  margin-right: 8px;
  user-select: none;
}

@media (prefers-reduced-motion: reduce) {
  .home-v2 .prof-avatar-online-dot,
  .home-v2 .kr-cursor,
  .home-v2 .prof-recent-track { animation: none; }
}

/* ─── responsive ─────────────────────────────────────────────────────── */
@media (max-width: 1080px) {
  .home-v2 .prof-identity {
    grid-template-columns: 200px 1fr;
  }
  .home-v2 .prof-links-col {
    grid-column: 1 / -1;
    margin-top: 8px;
  }
  .home-v2 .prof-bottom-row {
    grid-template-columns: 1fr;
  }
  .home-v2 .prof-right-col {
    flex-direction: row;
    gap: 16px;
  }
  .home-v2 .prof-right-col > div:first-child { flex: 1; }
  .home-v2 .prof-right-col > .prof-recent { flex: 1.4; }
}

@media (max-width: 760px) {
  .home-v2 .prof-identity {
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .home-v2 .prof-avatar-col,
  .home-v2 .prof-avatar { width: 160px; }
  .home-v2 .prof-avatar { height: 160px; }
  .home-v2 .kr-btn { width: 160px; }
  .home-v2 .prof-right-col {
    flex-direction: column;
  }
  .home-v2 .paper-mini {
    grid-template-columns: 48px 1fr;
  }
  .home-v2 .paper-mini-actions {
    grid-column: 2;
    margin-top: 4px;
  }
}
