/* ErdOS home */
.home main > section { margin-bottom: 0; padding-block: 40px; border-bottom: 1px solid var(--line); }

.home .hero-band {
  padding-block: clamp(56px, 8vw, 120px) clamp(36px, 5vw, 72px);
  background-color: var(--band);
  background-image: radial-gradient(ellipse 72% 48% at 74% 48%, #283747, transparent);
}
.home .hero-band .shell { width: min(100% - clamp(36px, 6vw, 80px), 1440px); }
.hero-stage {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3.5fr);
  align-items: center;
  gap: clamp(28px, 5vw, 72px);
}
.home .hero-intro h1 { max-width: 16ch; text-wrap: wrap; }
.hero-description { max-width: 44ch; margin: 18px 0 26px; color: #ccd3de; font-size: 1.125rem; }
.release-links { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 22px; }
.primary-link { display: inline-block; background: #c4def6; color: #0c1b2b; padding: 10px 18px; border-radius: 5px; text-decoration: none; font-weight: 650; }
.primary-link:hover { background: #eaf5ff; }

.screenshot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(8px, 1.4vw, 18px);
  scroll-margin-top: 24px;
}
.screenshot-grid a { display: block; border: 1px solid #455361; border-radius: 8px; overflow: hidden; }
.screenshot-grid a:hover { border-color: var(--link); }
.screenshot-grid a:focus-visible { outline-offset: 2px; }
.screenshot-grid img { display: block; width: 100%; height: auto; }

html:has(.screenshot-dialog) { scrollbar-gutter: stable; }
html:has(.screenshot-dialog[open]) { overflow: hidden; }
.screenshot-dialog {
  max-width: min(1280px, calc(100% - 24px), calc((100dvh - 24px) * 1.6));
  max-height: calc(100% - 24px);
  padding: 0;
  border: 0;
  background: transparent;
}
.screenshot-dialog::backdrop { background: rgb(7 11 17 / 84%); }
.screenshot-dialog-close { position: absolute; inset: 8px 8px auto auto; }
.screenshot-dialog-close button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgb(7 11 17 / 80%);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}
.screenshot-dialog-close button:hover { background: #070b11; }
.screenshot-dialog img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
}

.hero-features {
  margin-top: clamp(36px, 6vw, 76px);
  padding-top: clamp(22px, 3vw, 34px);
  border-top: 1px solid var(--line);
  scroll-margin-top: 24px;
}
.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px clamp(20px, 3vw, 40px);
  margin: 0;
}
.feature-grid dt { color: #c4def6; font-weight: 650; }
.feature-grid dd { margin: 5px 0 0; color: var(--muted); font-size: .9375rem; line-height: 1.5; }

.home .apps-section {
  padding-block: clamp(56px, 8vw, 108px);
  background: #1b232d;
  text-align: center;
}
.home .apps-section h2 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 4.5vw, 3.75rem);
  text-wrap: balance;
}
.apps-description { margin: 0 0 clamp(32px, 5vw, 60px); color: var(--muted); font-size: 1.125rem; }
.app-list {
  --app-columns: 5;
  --app-gap: clamp(12px, 2vw, 24px);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 32px var(--app-gap);
  margin: 0;
  padding: 0;
  list-style: none;
}
.app {
  --app-icon-size: clamp(56px, 7vw, 76px);
  flex: 0 0 calc((100% + var(--app-gap)) / var(--app-columns) - var(--app-gap));
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
}
.app-icon { display: block; width: var(--app-icon-size); height: var(--app-icon-size); object-fit: contain; }
.file-icon {
  display: grid;
  place-items: center;
  width: var(--app-icon-size);
  height: var(--app-icon-size);
  border-radius: 14px;
  background: #e6e9eb;
}
.file-icon .app-icon { width: 68%; height: 68%; }
.home .app h3 { margin: 14px 0 4px; font-size: clamp(1.125rem, 2vw, 1.375rem); }
.app h3 a { color: inherit; text-decoration: none; }
.app h3 a:hover { color: #c4def6; text-decoration: underline; }
.app p { margin: 0; color: var(--muted); font-size: .9375rem; line-height: 1.4; }
.app-shortcut { margin-top: auto; padding-top: 10px; color: var(--muted); font-size: .8125rem; white-space: nowrap; }
.app-labwc {
  --app-icon-size: clamp(48px, 5vw, 64px);
  display: grid;
  flex-basis: 100%;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.8fr) auto;
  gap: clamp(16px, 3vw, 40px);
  margin-top: clamp(4px, 1.5vw, 20px);
  padding-top: clamp(20px, 3vw, 32px);
  border-top: 1px solid var(--line);
  text-align: start;
}
.labwc-identity { display: flex; align-items: center; gap: 12px; }
.labwc-identity .app-icon { flex: none; }
.home .labwc-identity h3 { margin: 0 0 4px; }
.app-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px clamp(12px, 2vw, 28px);
  margin: 0;
  font-size: .875rem;
  line-height: 1.4;
}
.app-controls dt { margin-bottom: 3px; font-weight: 600; }
.app-controls dd { margin: 0; color: var(--muted); }
.app-controls dd + dd { margin-top: 4px; }
.app kbd {
  display: inline-block;
  padding: 2px 6px;
  border: 1px solid #4a5969;
  border-radius: 5px;
  background: #18212b;
  color: #eef2f5;
  font: inherit;
  font-size: .8125rem;
}
.app-controls-reference { font-size: .8125rem; }
.home .site-footer { border-top: 0; }

@media (max-width: 960px) {
  .app-list { --app-columns: 3; }
}
@media (max-width: 820px) {
  .hero-stage { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .home main > section { padding-block: 32px; }
  .release-links { font-size: .875rem; gap: 12px 16px; }
  .app-list { --app-columns: 2; }
  .app-labwc { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .labwc-identity { flex-direction: column; }
  .app-controls { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .feature-grid { grid-template-columns: 1fr; }
}
