/* Shared first-screen layout for the public and private homepages. */
body.home {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}
.home #main {
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
}
.home #apps {
  flex: 1 0 auto;
}
.home::before {
  height: min(760px, 100svh);
}
.home .topbar {
  min-height: clamp(44px, 8.5svh, 64px);
}
.home .hero {
  min-height: clamp(144px, 28svh, 270px);
  padding: clamp(10px, 2.6svh, 26px) 0;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, .65fr);
  gap: 30px;
}
.home .hero h1 {
  font-size: clamp(35px, min(5.5vw, 6svh), 58px);
  line-height: 1.12;
  margin: 0;
}
.home .eyebrow {
  margin-bottom: 14px;
  font-size: 10px;
  line-height: 1.4;
}
.home .hero-art {
  height: clamp(112px, 24svh, 220px);
}
.home .crystal {
  width: min(100%, 230px);
  height: min(100%, 230px);
}
.home .apps {
  gap: 16px;
  margin-bottom: 0;
}
.home .app-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: clamp(12px, 2.6svh, 22px) 22px;
}
.home .card-top {
  align-items: center;
  justify-content: flex-start;
  gap: 15px;
  margin-bottom: clamp(8px, 1.8svh, 15px);
}
.home .card-heading {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.home .app-card .art-icon {
  width: 54px;
  height: 54px;
  border-radius: 15px;
  flex-shrink: 0;
}
.home .app-card .art-icon svg {
  width: 38px;
  height: 38px;
}
.home .app-card h3 {
  font-size: 23px;
  line-height: 1.2;
  margin: 0 0 6px;
}
.home .badge {
  display: inline-block;
  padding: 4px 9px;
  font-size: 10px;
}
.home .app-card p {
  min-block-size: 2lh;
  margin: 0 0 clamp(8px, 1.7svh, 14px);
  font-size: 14px;
  line-height: 1.6;
}
.home .card-bottom {
  margin-top: auto;
  padding-top: clamp(6px, 1.5svh, 12px);
  line-height: 21px;
}
.home .topnav .desktop-nav {
  min-inline-size: 4.25em;
  text-align: center;
}
.home .card-link {
  flex: 1;
  min-width: 0;
}
.home .card-bottom .arrow,
.home .support-strip .arrow {
  flex: 0 0 1.2em;
  inline-size: 1.2em;
  text-align: center;
}
.home .support-strip p {
  min-block-size: 2lh;
}
.home .support-strip .text-link {
  min-inline-size: 128px;
  flex-shrink: 0;
  justify-content: space-between;
}
.home .support-strip {
  margin-top: clamp(10px, 2svh, 24px);
  padding-block: clamp(9px, 2svh, 22px);
}
.home .footer {
  align-items: flex-end;
  justify-content: flex-end;
  padding-block: clamp(7px, 1.8svh, 20px);
}
.home .footer nav {
  justify-content: flex-end;
}

@media (max-width: 760px) {
  .home .topbar {
    min-height: clamp(48px, 8svh, 60px);
  }
  .home .hero {
    min-height: clamp(112px, 22svh, 188px);
    padding: clamp(12px, 2svh, 20px) 0;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  .home .eyebrow {
    margin-bottom: 10px;
    font-size: 9px;
    letter-spacing: .12em;
  }
  .home .hero h1 {
    font-size: clamp(25px, 7.5vw, 34px);
    line-height: 1.1;
  }
  .home .hero-art {
    top: 8px;
    right: -10px;
    width: 140px;
    height: 140px;
    opacity: .25;
  }
  .home .crystal {
    width: 130px;
    height: 130px;
  }
  .home .apps {
    gap: 10px;
  }
  .home .app-card {
    padding: clamp(12px, 2.2svh, 18px) 16px;
    border-radius: 12px;
  }
  .home .card-top {
    gap: 12px;
    margin-bottom: 10px;
  }
  .home .app-card .art-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }
  .home .app-card .art-icon svg {
    width: 31px;
    height: 31px;
  }
  .home .app-card h3 {
    font-size: 20px;
    line-height: 1.15;
    margin-bottom: 4px;
  }
  .home .badge {
    padding: 3px 8px;
    font-size: 9px;
    line-height: 1.2;
  }
  .home .app-card p {
    font-size: 13px;
    line-height: 1.45;
    margin-bottom: 8px;
  }
  .home .card-bottom {
    padding-top: 8px;
    font-size: 11px;
  }
  .home .support-strip {
    flex-direction: row;
    align-items: center;
    gap: 12px;
  }
  .home .support-strip .text-link {
    min-inline-size: 117px;
    gap: 10px;
  }
}

/* Short phone viewports keep full descriptions and links, with tighter spacing. */
@media (max-width: 760px) and (max-height: 820px) {
  .home .hero {
    min-height: 0;
    padding: 8px 0 10px;
  }
  .home .eyebrow {
    margin-bottom: 6px;
  }
  .home .hero h1 {
    font-size: clamp(25px, 7vw, 30px);
  }
  .home .apps {
    gap: 8px;
  }
  .home .app-card {
    padding-block: 8px;
  }
  .home .card-top {
    margin-bottom: 6px;
  }
  .home .app-card .art-icon {
    width: 36px;
    height: 36px;
  }
  .home .app-card h3 {
    font-size: 18px;
  }
  .home .app-card p {
    line-height: 1.35;
    margin-bottom: 6px;
  }
  .home .card-bottom {
    padding-top: 4px;
  }
  .home .support-strip {
    padding-block: 6px;
  }
  .home .support-strip h2 {
    font-size: 15px;
    margin-bottom: 4px;
  }
  .home .support-strip p {
    font-size: 12px;
    line-height: 1.45;
  }
  .home .support-strip .text-link {
    padding-block: 8px;
  }
  .home .footer {
    padding-block: 7px;
  }
}

@media (max-width: 350px) and (max-height: 650px) {
  .home .hero {
    padding-block: 6px 8px;
  }
  .home .hero h1 {
    font-size: 24px;
  }
  .home .app-card {
    padding-block: 7px;
  }
  .home .card-top {
    gap: 9px;
    margin-bottom: 4px;
  }
  .home .app-card h3 {
    font-size: 17px;
    margin-bottom: 2px;
  }
  .home .badge {
    padding-block: 2px;
  }
  .home .app-card p {
    font-size: 12px;
    margin-bottom: 5px;
  }
  .home .card-bottom {
    padding-top: 3px;
    line-height: 19px;
  }
  .home .card-bottom .arrow {
    font-size: 17px;
  }
  .home .support-strip {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 3px 8px;
  }
  .home .support-strip > div {
    display: contents;
  }
  .home .support-strip h2 {
    margin: 0;
    font-size: 14px;
  }
  .home .support-strip p {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .home .support-strip .text-link {
    grid-column: 2;
    grid-row: 1;
    min-height: 24px;
    min-inline-size: 94px;
    padding-block: 3px;
    gap: 6px;
    font-size: 11px;
  }
  .home .support-strip .text-link .arrow {
    font-size: 16px;
  }
  .home .footer {
    padding-block: 5px;
  }
}

/* Landscape phones use the same two-column cards as desktop. */
@media (min-width: 550px) and (max-height: 500px) {
  .home .topbar {
    min-height: 42px;
  }
  .home .hero {
    display: block;
    min-height: 0;
    padding: 7px 0 8px;
  }
  .home .hero-copy {
    display: grid;
    row-gap: 6px;
    align-items: center;
  }
  .home .eyebrow {
    grid-column: 1 / -1;
    margin: 0;
    font-size: 8px;
  }
  .home .hero h1 {
    margin: 0;
    font-size: clamp(22px, 3.9vw, 27px);
    line-height: 1.08;
  }
  .home .hero-art {
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    z-index: -1;
    opacity: .16;
  }
  .home .crystal {
    width: 96px;
    height: 96px;
  }
  .home .apps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .home .app-card {
    padding: 8px 14px;
  }
  .home .card-top {
    gap: 10px;
    margin-bottom: 6px;
  }
  .home .app-card .art-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }
  .home .app-card .art-icon svg {
    width: 27px;
    height: 27px;
  }
  .home .app-card h3 {
    font-size: 19px;
    margin-bottom: 3px;
  }
  .home .badge {
    font-size: 9px;
    padding: 3px 8px;
  }
  .home .app-card p {
    font-size: 12px;
    line-height: 1.4;
    margin-bottom: 6px;
  }
  .home .card-bottom {
    padding-top: 4px;
    font-size: 11px;
  }
  .home .support-strip {
    margin-top: 6px;
    padding-block: 4px;
  }
  .home .support-strip h2 {
    font-size: 15px;
    margin-bottom: 3px;
  }
  .home .support-strip p {
    font-size: 12px;
    line-height: 1.45;
  }
  .home .support-strip .text-link {
    padding-block: 6px;
  }
  .home .footer {
    padding-block: 4px;
  }
}

@media (min-width: 550px) and (max-height: 350px) {
  .home .topbar {
    min-height: 36px;
  }
  .home .topnav a {
    padding-block: 7px;
  }
  .home .hero {
    padding: 4px 0 5px;
  }
  .home .hero-copy {
    row-gap: 3px;
  }
  .home .app-card {
    padding: 6px 12px;
  }
  .home .card-top,
  .home .app-card p {
    margin-bottom: 4px;
  }
  .home .card-bottom {
    padding-top: 3px;
    line-height: 19px;
  }
  .home .card-bottom .arrow {
    font-size: 18px;
  }
  .home .support-strip {
    margin-top: 4px;
    padding-block: 3px;
  }
  .home .footer {
    padding-block: 3px;
  }
}

@media (351px <= width <= 430px) {
  .home .support-strip h2 {
    min-block-size: 2lh;
  }
}

/* The new title and smaller slogan share the original two-line heading space. */
.home .hero-heading {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: clamp(35px, min(5.5vw, 6svh), 58px);
  line-height: 1.12;
  block-size: 2lh;
}
.home .hero-heading h1 {
  font-size: inherit;
  line-height: inherit;
}
.home .hero-slogan {
  margin: 0;
  color: var(--muted);
  font-size: clamp(12px, .4em, 21px);
  line-height: 1.15;
  letter-spacing: -.025em;
}
.home .hero-slogan {
  font-family: inherit;
  font-style: normal;
  font-weight: 400;
  white-space: nowrap;
}
@media (max-width: 760px) {
  .home .hero-heading {
    font-size: clamp(25px, 7.5vw, 34px);
    line-height: 1.1;
  }
}
@media (max-width: 760px) and (max-height: 820px) {
  .home .hero-heading {
    font-size: clamp(25px, 7vw, 30px);
  }
}
@media (max-width: 350px) and (max-height: 650px) {
  .home .hero-heading {
    font-size: 24px;
  }
}
@media (min-width: 550px) and (max-height: 500px) {
  .home .hero-heading {
    font-size: clamp(22px, 3.9vw, 27px);
    line-height: 1.08;
  }
}

/* Support cards keep separate text controls; Practice cards open as one link. */
.app-title {
  display: inline;
  border: 0;
  padding: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-align: start;
  cursor: pointer;
}
.app-title:hover, .card-link:hover { color: #fff; }
.home .card-link { flex: 0 1 auto; width: fit-content; }
.home .app-launch-card p { margin-bottom: 0; }
.home .app-launch-card:hover,
.home .app-launch-card:focus-visible {
  border-color: #aaa9a7;
  background: linear-gradient(135deg, #272729 0%, #181819 75%);
  transform: translateY(-2px);
}
.home .app-launch-card:focus-visible { border-radius: 15px; }
.home .support-strip .text-link {
  border-bottom: 0;
  text-decoration: none;
  min-inline-size: 0;
  inline-size: fit-content;
  margin-inline-start: auto;
  justify-self: end;
  justify-content: flex-end;
  text-align: end;
}
.app-dialog {
  width: min(440px, calc(100% - 40px));
  border: 1px solid #ffffff30;
  border-radius: 16px;
  padding: 26px;
  background: #141415;
  color: var(--text);
  font-family: inherit;
  box-shadow: 0 18px 70px #0009;
}
.app-dialog::backdrop { background: #000a; }
.app-dialog h2 { margin: 0 0 14px; font-size: 23px; font-weight: 500; }
.app-dialog p { color: var(--muted); font-size: 14px; line-height: 1.8; }
.app-dialog form { display: flex; justify-content: flex-end; margin-top: 24px; }
