.page-home {
  --home-line: rgba(160, 176, 192, .14);
  --home-glow-green: 0 0 22px rgba(57, 255, 20, .28);
  --home-glow-orange: 0 0 22px rgba(255, 106, 0, .25);
  background: var(--color-bg);
  overflow-x: hidden;
}

.page-home img {
  max-width: 100%;
  height: auto;
  display: block;
}

.page-home section[id] {
  scroll-margin-top: 96px;
}

.page-home a:focus-visible,
.page-home button:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.page-home .home-hero {
  position: relative;
  padding: clamp(2.5rem, 7vw, 5.5rem) 0;
}

.page-home .home-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(160, 176, 192, .08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(160, 176, 192, .08) 1px, transparent 1px);
  background-size: 36px 36px;
  -webkit-mask-image: linear-gradient(to bottom, black, transparent 85%);
  mask-image: linear-gradient(to bottom, black, transparent 85%);
  pointer-events: none;
}

.page-home .home-hero__grid {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 2.25rem;
  align-items: center;
}

.page-home .home-hero h1 {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  line-height: 1.12;
  letter-spacing: .02em;
  text-shadow: 0 0 28px rgba(42, 92, 170, .75);
  margin: 0 0 1.2rem;
  color: var(--color-white);
}

.page-home .home-hero__emph {
  display: block;
  color: var(--color-accent);
  text-shadow: var(--home-glow-green);
  animation: home-glow 4s ease-in-out infinite alternate;
}

@keyframes home-glow {
  from {
    opacity: .82;
  }
  to {
    opacity: 1;
  }
}

.page-home .home-hero__lead {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--color-muted);
  max-width: 34em;
  margin: 0 0 1.25rem;
}

.page-home .home-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-bottom: 1.6rem;
}

.page-home .home-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .8rem;
}

.page-home .home-hero__visual {
  position: relative;
  padding: .4rem;
}

.page-home .home-hero__panel {
  position: relative;
  border: 1px solid var(--home-line);
  background:
    linear-gradient(135deg, rgba(42, 92, 170, .24), rgba(11, 29, 58, .7)),
    var(--gradient-haihe);
  padding: .8rem;
  transform: rotate(1.1deg);
  box-shadow: 0 18px 48px rgba(0, 0, 0, .25);
}

.page-home .home-hero__figure {
  margin: 0;
  border: 0;
}

.page-home .home-hero__figure img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.page-home .home-statusbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .08em;
  color: var(--color-muted);
  padding: .25rem .25rem .5rem;
  border-bottom: 1px solid var(--home-line);
  margin-bottom: .5rem;
}

.page-home .home-statusbar__led {
  width: .55rem;
  height: .55rem;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 12px var(--color-accent);
  animation: home-led 2s ease-in-out infinite alternate;
}

@keyframes home-led {
  from {
    opacity: .45;
  }
  to {
    opacity: 1;
  }
}

.page-home .home-hero__coords {
  position: absolute;
  right: .6rem;
  bottom: .6rem;
  font-family: var(--font-mono);
  font-size: .7rem;
  color: rgba(160, 176, 192, .72);
  background: rgba(11, 29, 58, .72);
  padding: .2rem .45rem;
  border: 1px solid var(--home-line);
}

.page-home .home-live,
.page-home .home-trends,
.page-home .home-offline,
.page-home .home-devices {
  padding: clamp(3rem, 6vw, 5.5rem) 0;
}

.page-home .home-live {
  background: linear-gradient(180deg, transparent, rgba(30, 42, 58, .32), transparent);
}

.page-home .home-live__grid,
.page-home .home-trend-tabs,
.page-home .home-devices__grid {
  margin-top: 2rem;
}

.page-home .home-live__grid {
  display: grid;
  gap: 1.25rem;
}

.page-home .home-panelcard {
  position: relative;
  border: 1px solid var(--home-line);
  background: linear-gradient(145deg, rgba(30, 42, 58, .88), rgba(22, 35, 55, .92));
  padding: 1.2rem;
  border-radius: .4rem;
  transition: border-color .25s ease, box-shadow .25s ease;
}

.page-home .home-panelcard:hover {
  border-color: rgba(57, 255, 20, .45);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .16), var(--home-glow-green);
}

.page-home .home-panelcard__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  margin-bottom: 1rem;
}

.page-home .home-score {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: .5rem;
  align-items: center;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--color-muted);
}

.page-home .home-score strong {
  font-size: 2.4rem;
  color: var(--color-white);
  text-shadow: var(--home-glow-green);
  background: rgba(57, 255, 20, .06);
  padding: .3rem .6rem;
  border: 1px solid rgba(57, 255, 20, .2);
  font-weight: 900;
}

.page-home .home-score__meta {
  margin: .8rem 0 0;
  text-align: center;
  color: var(--color-muted);
  font-family: var(--font-mono);
  font-size: .8rem;
}

.page-home .home-keyevents {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
}

.page-home .home-keyevents li {
  font-family: var(--font-mono);
  font-size: .75rem;
  padding: .3rem .55rem;
  border: 1px solid var(--home-line);
  color: var(--color-muted);
}

.page-home .home-statlist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .5rem;
}

.page-home .home-statlist li {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px dashed var(--home-line);
  padding: .45rem 0;
  font-family: var(--font-mono);
  color: var(--color-muted);
}

.page-home .home-statlist strong {
  color: var(--color-warning);
  font-size: 1.3rem;
}

.page-home .home-refresh {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: var(--color-accent);
  font-family: var(--font-mono);
  font-size: .85rem;
}

.page-home .home-refresh__dot {
  width: .5rem;
  height: .5rem;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 10px var(--color-accent);
}

.page-home .home-refresh__track {
  position: relative;
  height: 3px;
  background: rgba(160, 176, 192, .14);
  overflow: hidden;
  margin: .75rem 0;
}

.page-home .home-refresh__bar {
  display: block;
  width: 55%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--color-accent), var(--color-warning));
  animation: home-refresh-cycle 60s linear infinite;
}

@keyframes home-refresh-cycle {
  from {
    transform: translateX(-30%);
  }
  to {
    transform: translateX(130%);
  }
}

.page-home .home-panelcard--refresh p {
  color: var(--color-muted);
  line-height: 1.65;
  margin: 0;
  font-size: .92rem;
}

.page-home .home-trends {
  background: radial-gradient(circle at 82% 12%, rgba(42, 92, 170, .16), transparent 48%);
}

.page-home .tabs__nav {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  border-bottom: 1px solid var(--home-line);
  padding-bottom: .5rem;
  margin-bottom: 1.5rem;
}

.page-home .tabs__btn {
  background: transparent;
  border: 1px solid var(--home-line);
  color: var(--color-muted);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: .9rem;
  padding: .5rem .9rem;
  cursor: pointer;
  border-radius: .15rem;
  transition: border-color .2s, color .2s, box-shadow .2s;
}

.page-home .tabs__btn.is-active {
  border-color: var(--color-accent);
  color: var(--color-accent);
  box-shadow: var(--home-glow-green);
}

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

.page-home .home-trend-panel {
  display: grid;
  gap: 1.5rem;
}

.page-home .home-trend-figure {
  margin: 0;
  border: 1px solid var(--home-line);
  background: var(--color-panel-2);
}

.page-home .home-trend-figure img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.page-home .home-trend-readout h3 {
  font-size: 1.3rem;
  color: var(--color-white);
  margin: 0 0 .75rem;
  font-family: var(--font-head);
}

.page-home .home-trend-readout p {
  color: var(--color-muted);
  line-height: 1.7;
  margin: 0 0 1rem;
}

.page-home .home-trend-readout ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.page-home .home-trend-readout li {
  position: relative;
  padding: .25rem 0 .25rem 1.1rem;
  color: var(--color-muted);
}

.page-home .home-trend-readout li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .7rem;
  width: .5rem;
  height: .5rem;
  background: var(--color-accent);
  opacity: .8;
}

.page-home .home-trend-stats {
  display: grid;
  gap: .75rem;
}

.page-home .home-metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(30, 42, 58, .6);
  border: 1px solid var(--home-line);
  padding: 1.4rem 1rem;
  color: var(--color-muted);
}

.page-home .home-metric__label {
  font-size: .8rem;
  letter-spacing: .1em;
}

.page-home .home-metric strong {
  font-family: var(--font-mono);
  font-size: 2rem;
  color: var(--color-white);
  text-shadow: var(--home-glow-green);
}

.page-home .home-formlist {
  list-style: none;
  display: flex;
  gap: .5rem;
  margin: 0;
  padding: 0;
  align-self: start;
}

.page-home .home-formlist li {
  flex: 1;
  text-align: center;
  padding: .7rem;
  border: 1px solid var(--home-line);
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--color-muted);
}

.page-home .home-formlist__win {
  color: var(--color-accent);
  border-color: rgba(57, 255, 20, .4);
}

.page-home .home-formlist__draw {
  color: var(--color-muted);
}

.page-home .home-formlist__loss {
  color: var(--color-warning);
  border-color: rgba(255, 106, 0, .5);
}

.page-home .home-offline {
  background:
    radial-gradient(circle at 90% 20%, rgba(42, 92, 170, .18), transparent 55%),
    linear-gradient(135deg, rgba(11, 29, 58, .95), rgba(27, 42, 58, .7)),
    var(--color-bg);
}

.page-home .home-offline__grid {
  display: grid;
  gap: 2rem;
}

.page-home .home-offline__media {
  margin: 0;
  border: 1px solid var(--home-line);
  background: var(--color-panel-2);
}

.page-home .home-offline__media img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.page-home .home-offline__content .sectionhead {
  margin-bottom: 1rem;
}

.page-home .home-offline__lead {
  color: var(--color-muted);
  line-height: 1.75;
  margin: 0 0 1rem;
}

.page-home .home-offline__list {
  list-style: none;
  padding: 0;
  margin: 1.2rem 0 0;
}

.page-home .home-offline__list li {
  position: relative;
  padding: .55rem 0 .55rem 1.4rem;
  border-bottom: 1px dashed var(--home-line);
  color: var(--color-muted);
}

.page-home .home-offline__list li::before {
  content: "↘";
  position: absolute;
  left: 0;
  color: var(--color-accent);
  font-family: var(--font-mono);
}

.page-home .home-offline__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .8rem;
  margin-top: 1.5rem;
}

.page-home .home-devices {
  background:
    linear-gradient(rgba(160, 176, 192, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(160, 176, 192, .05) 1px, transparent 1px),
    linear-gradient(180deg, rgba(11, 29, 58, .2), rgba(27, 42, 58, .4), rgba(11, 29, 58, .2));
  background-size: 34px 34px, 34px 34px, auto;
}

.page-home .home-devices__grid {
  display: grid;
  gap: 1.25rem;
}

.page-home .home-device {
  border: 1px solid var(--home-line);
  background: rgba(30, 42, 58, .72);
  padding: 1.25rem;
  transition: border-color .25s ease, transform .25s ease;
}

.page-home .home-device:hover {
  border-color: rgba(57, 255, 20, .45);
  transform: translateY(-3px);
}

.page-home .home-device h3 {
  margin: .9rem 0 .4rem;
  color: var(--color-white);
  font-family: var(--font-head);
}

.page-home .home-device p {
  color: var(--color-muted);
  line-height: 1.6;
  margin: 0;
}

.page-home .device-chip {
  position: relative;
  width: 100%;
  height: 120px;
  border: 1px solid var(--home-line);
  background: rgba(11, 29, 58, .6);
  overflow: hidden;
}

.page-home .device-chip--desktop::before {
  content: "";
  display: block;
  height: 22px;
  background: rgba(160, 176, 192, .14);
  border-bottom: 1px solid var(--home-line);
}

.page-home .device-chip--desktop::after {
  content: "";
  display: block;
  margin: .6rem;
  height: 76px;
  border: 1px solid rgba(57, 255, 20, .25);
  background: linear-gradient(135deg, rgba(42, 92, 170, .2), rgba(57, 255, 20, .05));
}

.page-home .device-chip--mobile {
  width: 72px;
  height: 120px;
  margin: 0 auto;
  border-radius: .4rem;
  border-color: rgba(160, 176, 192, .3);
}

.page-home .device-chip--mobile::before {
  content: "";
  display: block;
  width: 26%;
  height: 5px;
  background: rgba(160, 176, 192, .28);
  border-radius: 0 0 .4rem .4rem;
  margin: 0 auto;
}

.page-home .device-chip--mobile::after {
  content: "";
  display: block;
  width: 80%;
  height: 76px;
  margin: 14% auto;
  border: 1px solid rgba(42, 92, 170, .5);
  background: rgba(57, 255, 20, .06);
}

.page-home .device-chip--offline::before,
.page-home .device-chip--offline::after {
  content: "";
  position: absolute;
  left: 20%;
  right: 20%;
  border: 1px solid var(--home-line);
  background: rgba(22, 35, 55, .8);
}

.page-home .device-chip--offline::before {
  top: 18%;
  height: 58%;
  transform: rotate(2deg);
  border-color: rgba(255, 106, 0, .25);
}

.page-home .device-chip--offline::after {
  top: 28%;
  height: 52%;
  transform: rotate(-2deg);
  border-color: rgba(57, 255, 20, .25);
}

.page-home .home-cityband {
  border-top: 1px solid var(--home-line);
  background: var(--color-bg);
}

.page-home .home-cityband img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  object-position: center 35%;
}

.page-home .home-cityband__bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  max-width: var(--container);
  margin: 0 auto;
  color: var(--color-muted);
  font-family: var(--font-mono);
  font-size: .8rem;
}

.page-home .home-cityband__bar a {
  color: var(--color-accent);
  text-decoration: none;
}

.page-home .home-cityband__bar a:hover {
  text-decoration: underline;
}

@media (min-width: 760px) {
  .page-home .home-devices__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 860px) {
  .page-home .home-trend-panel {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
    align-items: center;
  }

  .page-home .home-offline__grid {
    grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
    align-items: center;
  }
}

@media (min-width: 880px) {
  .page-home .home-live__grid {
    grid-template-columns: 1.15fr .9fr .95fr;
    align-items: start;
  }

  .page-home .home-panelcard--score {
    transform: rotate(-.6deg) translateY(-.35rem);
  }

  .page-home .home-panelcard--refresh {
    transform: rotate(.8deg) translateY(.6rem);
  }

  .page-home .home-panelcard--score:hover,
  .page-home .home-panelcard--refresh:hover {
    transform: translateY(-3px);
  }
}

@media (min-width: 960px) {
  .page-home .home-hero__grid {
    grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .page-home *,
  .page-home *::before,
  .page-home *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
