* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  background: #000000 !important;
  -webkit-font-smoothing: antialiased;
}

body, #__next, #page_wrapper, #inner_wrapper {
  background: transparent !important;
  min-height: 100vh;
}

body {
  font-family: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  color: #ffffff;
  position: relative;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

/* Back link matching /projects/ and subpage headers */
.homelab-back {
  position: absolute;
  top: 16px;
  left: 24px;
  z-index: 20;
  font-family: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  font-weight: 400;
  font-size: clamp(1.0625rem, 0.96rem + 0.4vw, 1.3125rem);
  line-height: 1.4;
  color: #ffffff;
  text-decoration: none;
  white-space: nowrap;
}

.homelab-back:hover,
.homelab-back:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Understated greeting (centered white Welcome home. with muted prompt) */
#welcome-greeting {
  position: absolute;
  top: 16px;
  left: 0;
  right: 0;
  z-index: 5;
  pointer-events: none;
  user-select: none;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: baseline;
  column-gap: 14px;
}

.greeting-prompt,
.greeting-text {
  font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Consolas, monospace;
  white-space: nowrap;
  line-height: 1.2;
  color: #ffffff;
}

.greeting-prompt {
  grid-column: 1;
  justify-self: end;
  font-weight: 200;
  font-style: normal;
  font-size: 22px;
  letter-spacing: 3px;
  opacity: 0.5;
}

.greeting-center {
  grid-column: 2;
  justify-self: center;
  position: relative;
  display: inline-flex;
  align-items: baseline;
}

.greeting-text {
  font-weight: 200;
  font-style: normal;
  font-size: 22px;
  letter-spacing: 3px;
  opacity: 1;
}

.greeting-cursor {
  position: absolute;
  left: 100%;
  bottom: 2px;
  width: 10px;
  height: 22px;
  margin-left: 4px;
  border-radius: 1px;
  background: #ffffff;
  opacity: 0.5;
  animation: cursor-blink 2.5s steps(1, end) infinite;
}

@keyframes cursor-blink {
  0%, 40% { opacity: 0.5; }
  40.01%, 100% { opacity: 0; }
}

@media (max-width: 960px) {
  .homelab-back {
    top: 12px;
    left: 16px;
  }
}

@media (max-width: 1200px) {
  #welcome-greeting {
    top: 44px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: baseline;
    gap: 4px 10px;
    padding: 0 12px;
  }
  .greeting-prompt,
  .greeting-text {
    font-size: 18px;
    letter-spacing: 2px;
  }
  .greeting-cursor {
    width: 8px;
    height: 18px;
    bottom: 2px;
  }
}

/* Main Homepage container & stepped Tailwind breakpoints */
#inner_wrapper > .container {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: auto;
  padding-top: 58px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  z-index: 10;
}

@media (max-width: 1200px) {
  #inner_wrapper > .container {
    padding-top: 86px;
  }
}

@media (max-width: 639px) {
  #inner_wrapper > .container {
    padding-top: 112px;
  }
}

@media (min-width: 640px) {
  #inner_wrapper > .container { max-width: 640px; }
}
@media (min-width: 768px) {
  #inner_wrapper > .container { max-width: 768px; }
}
@media (min-width: 1024px) {
  #inner_wrapper > .container { max-width: 1024px; }
}
@media (min-width: 1280px) {
  #inner_wrapper > .container { max-width: 1280px; }
}
@media (min-width: 1536px) {
  #inner_wrapper > .container { max-width: 1536px; }
}

.service-link {
  display: block;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

#layout-groups {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
  margin: 16px 32px 32px;
}

.services-group {
  flex: 1 1 25%;
  min-width: 0;
  padding: 4px 4px 0;
}

.services-group.subgroup {
  flex: 1 1 100%;
  margin: 0;
  padding: 0;
}

/* Group headings (static lowercase white) */
h2.service-group-name {
  font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 20px;
  font-weight: 400;
  line-height: 28px;
  color: #ffffff;
  opacity: 1;
  text-transform: lowercase;
}

ul.services-list {
  display: flex;
  flex-direction: column;
  margin-top: 12px;
  list-style: none;
}

/* Service cards — exact Homepage styling + custom.css hover glow */
li.service {
  list-style: none;
}

li.service > div:first-child {
  position: relative;
  overflow: clip;
  font-weight: 400;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  padding: 4px;
  margin-bottom: 8px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow:
    0 4px 6px -1px rgba(15, 23, 42, 0.2),
    0 2px 4px -2px rgba(15, 23, 42, 0.2);
  color: #d4d4d4;
  transition: box-shadow 0.35s ease, transform 0.35s ease, border-color 0.35s ease, background-color 0.25s ease;
}

/* Only clickable cards (with a.service-link) get hover glow + pointer */
li.service > div:first-child:has(> a.service-link) {
  cursor: pointer;
}

li.service > div:first-child:hover {
  background-color: rgba(255, 255, 255, 0.10);
}

/* Subtle open-view icon on clickable cards (positioned in the title row, clear of top-right dot) */
.service-open-icon {
  position: absolute;
  right: 10px;
  bottom: 8px;
  width: 15px;
  height: 15px;
  color: rgba(255, 255, 255, 0.45);
  transition: color 0.2s ease, transform 0.2s ease;
}

li.service > div:first-child:has(> a.service-link):hover .service-open-icon {
  color: #ffffff;
  transform: translate(1.5px, -1.5px);
}

.service-title {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 0 32px 0 20%;
}

.service-icon {
  flex-shrink: 0;
  width: 40px;
  height: 52px;
  margin-right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.service-icon img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  display: block;
  filter: grayscale(1) brightness(1.1);
  transition: filter 0.25s ease;
}

li.service > div:first-child:hover .service-icon img {
  filter: none;
}

.service-name-wrap {
  padding: 8px 4px;
  min-width: 0;
  text-align: left;
}

.service-name {
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  color: #d4d4d4;
}

.service-description {
  font-size: 12px;
  font-weight: 300;
  line-height: 16px;
  color: #888888;
}

/* Top-right status dot */
.service-status-dot {
  position: absolute;
  top: 9px;
  right: 10px;
  width: 7px;
  height: 7px;
  border-radius: 9999px;
  background-color: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.45);
  z-index: 10;
}

/* Stat blocks */
.service-container {
  display: flex;
  flex-direction: row;
  width: 100%;
}

.service-block {
  flex: 1 1 0%;
  min-width: 0;
  background-color: rgba(15, 23, 42, 0.2);
  border-radius: 4px;
  margin: 4px;
  padding: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.service-block-value {
  font-size: 14px;
  font-weight: 200;
  line-height: 20px;
  letter-spacing: 0.1px;
  color: #d4d4d4;
  white-space: nowrap;
}

.service-block-label {
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  letter-spacing: 0.1px;
  text-transform: uppercase;
  color: #888888;
}

/* Footer controls */
#footer {
  margin-top: auto;
  padding: 32px;
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.telemetry-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #888888;
  opacity: 0.45;
}

.telemetry-dot {
  width: 7px;
  height: 7px;
  border-radius: 9999px;
  background-color: #64748b;
  flex-shrink: 0;
}

.telemetry-dot.is-live {
  background-color: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.45);
}

.telemetry-dot.is-static {
  background-color: #94a3b8;
}

/* Responsive column counts matching Homepage */
@media (max-width: 1279px) {
  .services-group:not(.subgroup) {
    flex: 1 1 33.333333%;
  }
}

@media (max-width: 1023px) {
  .services-group:not(.subgroup) {
    flex: 1 1 50%;
  }
}

@media (max-width: 767px) {
  .services-group:not(.subgroup) {
    flex: 1 1 100%;
  }
}

@media (max-width: 639px) {
  #layout-groups {
    margin: 16px;
  }
}
