/* WP2 home shell */

.page-home.page-shell {
  padding-bottom: calc(var(--space-6) + env(safe-area-inset-bottom, 0px));
}

@media (max-width: 767px) {
  .page-home #cv {
    scroll-margin-bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
    padding-bottom: var(--space-4);
  }

  .page-home #cv-root {
    padding-bottom: var(--space-3);
  }
}

.page-home.page-shell .story-scroll {
  max-width: none;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  box-sizing: border-box;
}

.page-home .scene-hero {
  width: min(100%, 704px);
  margin-inline: auto;
}

.page-home #board,
.page-home #cv {
  width: 100%;
  max-width: none;
  padding-inline: var(--space-2);
  box-sizing: border-box;
}

.page-home #page {
  scroll-margin-top: var(--space-3);
}

.page-home [hidden] {
  display: none !important;
}

.page-home .scene {
  display: flex;
  flex-direction: column;
  padding: var(--space-1) var(--space-2) var(--space-2);
  box-sizing: border-box;
  min-height: 100svh;
  max-height: 100svh;
  overflow: hidden;
  justify-content: center;
}

.page-home #board,
.page-home #cv {
  max-height: none;
  min-height: auto;
  overflow: visible;
}

.page-home .scene-hero {
  max-height: none;
  min-height: auto;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-1);
  padding-top: var(--space-1);
}

.page-home .scene-live {
  padding-top: var(--space-2);
  padding-bottom: var(--space-2);
}

.page-home .scene h1.home-tape-title.scene-heading,
.page-home .scene h2.page-scene-title.scene-heading,
.page-home #board-title.scene-heading,
.page-home #cv-title.scene-heading {
  font-family: var(--font-pixel);
  font-size: 16px;
  line-height: 1.25;
  text-align: center;
  margin: 0;
  color: var(--phos);
  max-width: 100%;
  width: 100%;
  overflow-x: clip;
  overflow-wrap: anywhere;
}

@media (min-width: 768px) {
  .page-home .scene h1.home-tape-title.scene-heading,
  .page-home .scene h2.page-scene-title.scene-heading,
  .page-home #board-title.scene-heading,
  .page-home #cv-title.scene-heading {
    font-size: 24px;
  }
}

@media (min-width: 1440px) {
  .page-home .scene h1.home-tape-title.scene-heading,
  .page-home .scene h2.page-scene-title.scene-heading,
  .page-home #board-title.scene-heading,
  .page-home #cv-title.scene-heading {
    font-size: 32px;
  }
}

.hero-layout {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-2);
  width: min(100%, 704px);
  box-sizing: border-box;
}

.hero-layout #hero-face,
.hero-layout #page {
  width: 100%;
  min-width: 0;
}

.page-home .face-card-hero {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  grid-template-columns: 1fr;
  grid-template-areas:
    "portrait"
    "meta"
    "cta";
  padding: var(--space-2);
  gap: var(--space-2);
}

@media (min-width: 640px) {
  .page-home .face-card-hero {
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "portrait meta"
      "cta cta";
    align-items: start;
  }

  .page-home .face-card-hero .portrait-frame {
    justify-self: start;
  }
}

.page-home .face-card-hero .portrait-frame {
  grid-area: portrait;
  margin: 0 auto;
}

.page-home .face-card-hero .portrait-frame img {
  width: 112px;
  height: 112px;
  max-width: 112px;
}

@media (min-width: 361px) {
  .page-home .face-card-hero .portrait-frame img {
    width: 136px;
    height: 136px;
    max-width: 136px;
  }
}

@media (min-width: 768px) {
  .page-home .face-card-hero .portrait-frame img {
    width: 160px;
    height: 160px;
    max-width: 160px;
  }
}

@media (min-width: 1024px) {
  .page-home .face-card-hero .portrait-frame img {
    width: 200px;
    height: 200px;
    max-width: 200px;
  }
}

@media (max-width: 374px) {
  .page-home .scene h1.home-tape-title.scene-heading {
    font-size: 10px;
  }
}

.page-home .hero-title-tail {
  white-space: nowrap;
}

.page-home.page-shell .site-header::after {
  left: 0;
  right: 0;
  width: auto;
  height: 4px;
  bottom: 0;
  top: auto;
}

.page-home .face-card-hero .face-meta {
  grid-area: meta;
  width: 100%;
}

.page-home .face-tagline {
  margin: 0 0 var(--space-1);
  text-align: center;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 0.8125rem;
  line-height: 1.45;
}

.page-home .face-payments {
  margin: var(--space-1) 0 0;
  text-align: center;
  max-width: 36ch;
  margin-inline: auto;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 0.8125rem;
  line-height: 1.45;
}

.page-home .face-card-hero .face-stat-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-1);
  width: 100%;
  box-sizing: border-box;
}

.page-home .face-card-hero .cv-stat {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto auto;
  gap: var(--space-1);
  align-items: center;
  justify-items: center;
  min-width: 0;
  text-align: center;
}

.page-home .face-card-hero .cv-stat img {
  grid-row: 1;
  grid-column: 1;
  width: 28px;
  height: 28px;
}

@media (min-width: 375px) {
  .page-home .face-card-hero .cv-stat img {
    width: 32px;
    height: 32px;
  }
}

.page-home .face-card-hero .stat-value {
  grid-row: 2;
  grid-column: 1;
  font-family: var(--font-pixel);
  font-size: max(10px, 0.625rem);
  line-height: 1.3;
  white-space: nowrap;
  max-width: 100%;
}

@media (min-width: 640px) {
  .page-home .face-tagline,
  .page-home .face-payments {
    text-align: left;
  }

  .page-home .face-card-hero .face-stat-grid {
    row-gap: var(--space-2);
  }

  .page-home .face-card-hero .cv-stat img {
    width: 36px;
    height: 36px;
  }

  .page-home .face-card-hero .stat-value {
    white-space: normal;
    text-wrap: balance;
    overflow-wrap: normal;
    word-break: normal;
    width: 100%;
    box-sizing: border-box;
    font-size: max(11px, 0.6875rem);
  }
}

@media (min-width: 1024px) {
  .page-home .face-card-hero .stat-value {
    font-size: max(12px, 0.75rem);
  }
}

.page-home .face-card-hero .face-cta {
  grid-area: cta;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.hero-compose.page-compose-bezel {
  width: 100%;
  max-width: 100%;
  margin: 0;
  box-sizing: border-box;
}

.hero-compose-head {
  margin-bottom: var(--space-1);
}

.hero-compose .page-scene-title {
  margin: 0 0 var(--space-1);
}

.scene-live {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-2);
  width: 100%;
}

.board-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2);
  width: min(100%, 960px);
}

.board-stats {
  min-height: 2rem;
}

.board-detail {
  width: min(100%, 704px);
  min-height: 3rem;
  text-align: center;
}

.board-detail-default {
  margin: 0;
  color: var(--muted);
}

.live-verdict {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  margin: 0;
  font-family: var(--font-pixel);
  font-size: 24px;
  line-height: 1.1;
  color: var(--phos-up);
}

.live-verdict-text {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0.35em;
}

.live-verdict-phrase {
  white-space: nowrap;
}

@media (min-width: 768px) {
  .live-verdict {
    font-size: 32px;
  }
}

.live-verdict-shape {
  display: inline-flex;
  flex-shrink: 0;
}

.live-estate-mount {
  width: min(100%, 520px);
  max-height: min(36vh, 320px);
  margin: 0 auto;
}

.live-estate-mount .estate-viz {
  max-height: min(36vh, 320px);
}

@media (min-width: 768px) {
  .live-estate-mount {
    width: min(100%, 640px);
    max-height: min(42vh, 400px);
  }
}

.shelf-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: center;
  width: min(100%, 960px);
  margin-inline: auto;
}

.shelf-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  text-decoration: none;
  color: var(--text);
  padding: var(--space-1);
  border: 2px solid var(--bezel-hi);
  background: var(--bg);
  box-shadow: 4px 4px 0 var(--phos-dim);
}

.shelf-link img {
  width: 96px;
  height: 64px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.scene-cv .cv-body {
  min-height: 8rem;
  margin-top: var(--space-2);
}

.compose-tier-vis {
  text-align: center;
  margin: 0 0 var(--space-1);
  color: var(--zx-cyan-bright);
}

.compose-tier-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin: 0 0 var(--space-2);
}

.compose-tier-buttons .btn-phos {
  flex: 1 1 5rem;
  min-height: 44px;
  font-family: var(--font-pixel);
  font-size: max(10px, 0.55rem);
}

.compose-form.compose-zx textarea {
  min-height: 4.5rem;
  font-size: max(16px, 1rem);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.compose-need-label {
  display: block;
}

.compose-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: var(--space-2) 0 0;
  justify-content: flex-start;
}

.compose-contact-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: var(--space-1);
  border: 2px solid var(--zx-white);
  background: var(--bg);
  color: var(--phos);
  text-decoration: none;
  box-sizing: border-box;
}

.compose-contact-icon svg {
  width: 1.5rem;
  height: 1.5rem;
  display: block;
}

.compose-contact-icon:hover,
.compose-contact-icon:focus-visible {
  color: var(--zx-cyan-bright);
  border-color: var(--zx-cyan-bright);
}

.estate-viz {
  shape-rendering: crispEdges;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

@media not (prefers-reduced-motion: reduce) {
  .anim-packets .estate-packet {
    animation: estate-packet-drift 2.4s steps(8) infinite;
  }
}

@keyframes estate-packet-drift {
  to {
    transform: translate(calc(var(--packet-x, 0) * 1px), calc(var(--packet-y, 0) * 1px));
  }
}

.stat-glyph {
  font-family: var(--font-pixel);
  font-size: max(8px, 0.5rem);
  color: var(--phos);
}

.compose-form.compose-zx {
  border: 2px solid var(--phos-dim);
  padding: var(--space-2);
  background: color-mix(in srgb, var(--bg) 92%, var(--phos-dim));
}

.compose-form.compose-zx label {
  font-family: var(--font-pixel);
  font-size: max(8px, 0.5rem);
  color: var(--zx-yellow-bright);
  letter-spacing: 0.06em;
}

.compose-form.compose-zx textarea,
.compose-form.compose-zx input {
  font-family: var(--font-body);
  border: 2px solid var(--zx-white);
  border-radius: 0;
  background: var(--bg);
  color: var(--phos);
}

.toast.zx-toast {
  border: 2px solid var(--zx-white);
  background: var(--zx-green-bright);
  color: var(--bg);
}

.keys-help.zx-keys {
  border-color: var(--zx-magenta-bright);
}

.sec-check-toggle,
.sec-check-dismiss,
.sec-check-close,
.sec-check-toggle:hover,
.sec-check-dismiss:hover,
.sec-check-close:hover,
.sec-check-toggle:focus-visible,
.sec-check-dismiss:focus-visible,
.sec-check-close:focus-visible,
.sec-check-toggle:active,
.sec-check-dismiss:active,
.sec-check-close:active {
  box-shadow: none !important;
}

.sec-check {
  position: fixed;
  right: max(var(--space-2), env(safe-area-inset-right, 0px));
  bottom: max(var(--space-2), env(safe-area-inset-bottom, 0px));
  z-index: 55;
  max-width: min(calc(100vw - var(--space-4)), 22rem);
}

@media (max-width: 767px) {
  .page-home .sec-check {
    left: max(var(--space-2), env(safe-area-inset-left, 0px));
    right: auto;
    top: auto;
    bottom: max(var(--space-2), env(safe-area-inset-bottom, 0px));
    width: auto;
    max-width: none;
  }

  .page-home .sec-check-chrome {
    position: fixed;
    left: max(var(--space-2), env(safe-area-inset-left, 0px));
    right: auto;
    top: auto;
    bottom: max(var(--space-2), env(safe-area-inset-bottom, 0px));
    z-index: 59;
    align-items: center;
    gap: 0;
  }
}

@media (max-width: 430px) {
  /* Lift fixed pill so it clears PAGE PETE / compose icons while scrolling (320–430px). */
  .page-home .sec-check-chrome {
    transform: translate(-3px, -54px);
  }
}

@media (max-width: 480px) {
  .page-home .sec-check-toggle {
    position: relative;
    padding: var(--space-1);
    gap: 0;
    min-width: 44px;
    max-width: 44px;
    justify-content: center;
  }

  .page-home .sec-check-toggle::after {
    content: none;
  }

  .page-home .sec-check-badge {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  .page-home .sec-check-chrome .sec-check-dismiss {
    display: none;
  }

  .page-home .sec-check-close {
    display: none;
  }

  .page-home .sec-check:has(#sec-check-panel:not([hidden])) #sec-check-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-height: min(60svh, 28rem);
    margin: 0;
    z-index: 58;
    overflow-y: auto;
    box-sizing: border-box;
    border-radius: 0;
    border-bottom: none;
    padding-top: calc(var(--space-2) + 44px);
    padding-bottom: calc(var(--space-2) + env(safe-area-inset-bottom, 0px));
  }

  .page-home .sec-check:has(#sec-check-panel:not([hidden])) .sec-check-close {
    display: inline-flex;
    position: absolute;
    top: var(--space-1);
    right: var(--space-1);
    z-index: 2;
    min-height: 44px;
    min-width: 44px;
    padding: 0 var(--space-1);
    font-size: 1.25rem;
    line-height: 1;
  }
}

@media (min-width: 481px) {
  .sec-check-close {
    display: none !important;
  }
}

.sec-check-chrome {
  display: flex;
  align-items: stretch;
  gap: var(--space-1);
}

.sec-check-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: 44px;
  min-width: 44px;
  padding: var(--space-1) var(--space-2);
  border: 2px solid var(--zx-white);
  background: var(--bg);
  color: var(--phos);
  cursor: pointer;
  font-family: var(--font-pixel);
}

.sec-check-dismiss {
  min-height: 44px;
  min-width: 44px;
  padding: 0 var(--space-1);
  font-size: 1.25rem;
  line-height: 1;
}

.sec-check-panel {
  margin-top: var(--space-1);
  max-height: min(60svh, 28rem);
  overflow-y: auto;
  padding: var(--space-2);
}

.sec-check-title {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin: 0 0 var(--space-1);
}

.sec-check-lede {
  margin: 0 0 var(--space-2);
}

.sec-alerts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.sec-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-1);
  align-items: start;
  padding: var(--space-1);
  border: 1px solid var(--phos-dim);
}

.sec-row > :nth-child(n + 3) {
  grid-column: 2;
}

.sec-tip {
  margin: 0;
  overflow-wrap: anywhere;
}

.sec-row.sec-ok {
  color: var(--phos-up);
}

.sec-row.sec-warn {
  color: var(--phos-warn);
}

.sec-label {
  font-family: var(--font-pixel);
  font-size: max(16px, 0.85rem);
  line-height: 1.35;
}

.sec-foot {
  margin: var(--space-2) 0 0;
}

@media not (prefers-reduced-motion: reduce) {
  @keyframes sec-row-in {
    from {
      opacity: 0;
      transform: translateY(4px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .sec-row {
    animation: sec-row-in 0.35s steps(4, end) both;
  }
}

@media print {
  .sec-check {
    display: none !important;
  }
}

@media (forced-colors: active) {
  .sec-row {
    border: 2px solid CanvasText;
  }
}
