:root {
    --home-ink: #222322;
    --home-muted: #686b6b;
    --home-blue: #5a80e9;
    --home-paper: #f8f8f6;
    --home-line: #e1e2df;
}

body.home-page {
    height: auto;
    min-height: 100dvh;
    margin: 0;
    padding: 18px;
    overflow-x: hidden;
    background: #242424;
    color: var(--home-ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

.site-frame {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: calc(100dvh - 36px);
    overflow: hidden;
    border: 1px solid #dededb;
    border-radius: 28px;
    background: var(--home-paper);
}

.home-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: min(1350px, 100%);
    height: 86px;
    margin: 0 auto;
    padding: 0 42px;
    border-bottom: 1px solid var(--home-line);
}

.home-brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: #222322;
    font-size: 23px;
    font-weight: 760;
    letter-spacing: -.055em;
}

.brand-icon {
    display: grid;
    place-items: center;
    width: 35px;
    height: 35px;
    border: 1.5px solid #262626;
    border-radius: 11px;
    background: #f8f8f6;
}

.brand-icon svg {
    width: 22px;
    height: 22px;
    fill: var(--home-blue);
}

.home-header-note {
    color: #666a6b;
    font-size: 12px;
    font-weight: 550;
}

.home-header-note span {
    margin-left: 8px;
    color: var(--home-blue);
    font-size: 18px;
}

.home-shell {
    display: grid;
    flex: 1 0 auto;
    grid-template-columns: minmax(0, .96fr) minmax(0, 1.04fr);
    align-items: center;
    gap: clamp(24px, 4vw, 70px);
    width: min(1350px, 100%);
    min-height: min(720px, calc(100dvh - 160px));
    margin: 0 auto;
    padding: 45px 42px 34px;
}

.home-copy {
    position: relative;
    z-index: 1;
    max-width: 590px;
}

.home-kicker {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #566dba;
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .14em;
}

.kicker-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #5a80e9;
}

#title {
    margin: 31px 0 21px;
    color: var(--home-ink);
    font-size: clamp(56px, 5.7vw, 82px);
    font-weight: 720;
    letter-spacing: -.052em;
    line-height: 1.07;
    text-align: left;
}

#title em {
    color: var(--home-blue);
    font-style: normal;
}

.home-lead {
    max-width: 480px;
    margin: 0 0 37px;
    color: var(--home-muted);
    font-size: 17px;
    line-height: 1.58;
}

.join-card {
    width: min(495px, 100%);
    padding: 23px;
    border: 1px solid #dcddda;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(34, 35, 34, .045);
}

.join-card-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.join-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid #cbd6f3;
    border-radius: 10px;
    background: #eef2fd;
    color: #526fd0;
    font-size: 24px;
}

.join-card-heading strong,
.join-card-heading small {
    display: block;
}

.join-card-heading strong {
    color: #242424;
    font-size: 16px;
    font-weight: 680;
}

.join-card-heading small {
    margin-top: 3px;
    color: #858987;
    font-size: 12px;
}

#groupform label {
    display: block;
    margin: 0 0 8px;
    color: #444746;
    font-size: 12px;
    font-weight: 650;
}

.join-form-row {
    display: flex;
    gap: 8px;
}

#group {
    flex: 1;
    min-width: 0;
    height: 47px;
    border: 1px solid #d6d9d8;
    border-radius: 9px;
    background: #fff;
    color: #252626;
    font-size: 14px;
}

#group:focus {
    outline: 2px solid #8aa7f2;
    outline-offset: 1px;
}

#submitbutton {
    width: 108px;
    border: 1px solid #272829;
    border-radius: 9px;
    background: #282a2c;
    color: #fff;
    font-size: 14px;
    font-weight: 650;
    cursor: pointer;
}

#submitbutton:hover {
    background: #414345;
}

#errormessage {
    min-height: 0;
    height: auto;
    margin: 8px 0 0;
    color: #b43d51;
    font-size: 12px;
}

#errormessage:empty {
    display: none;
}

#public-groups {
    width: min(495px, 100%);
    margin-top: 15px;
    padding: 14px 18px;
    border: 1px solid var(--home-line);
    border-radius: 12px;
    background: #fff;
}

#public-groups.nogroups {
    display: none;
}

#public-groups h2 {
    margin: 0 0 12px;
    font-size: 14px;
}

#public-groups-table {
    width: 100%;
    color: #626666;
    font-size: 12px;
}

#public-groups-table td {
    padding: 7px 4px;
}

.home-points {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin-top: 23px;
    color: #797d7b;
    font-size: 12px;
}

.home-points span::before {
    content: '✳';
    margin-right: 7px;
    color: var(--home-blue);
}

.home-preview {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
    height: 610px;
}

.preview-art {
    position: absolute;
    inset: -85px -72px -90px -70px;
    width: calc(100% + 142px);
    height: calc(100% + 175px);
    object-fit: contain;
    pointer-events: none;
}

.preview-window {
    position: relative;
    z-index: 1;
    width: min(545px, 94%);
    padding: 15px;
    border: 1px solid #27292c;
    border-radius: 18px;
    background: #282a2d;
    box-shadow: 15px 18px 0 rgba(90, 128, 233, .13);
    transform: rotate(-2deg);
}

.preview-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 34px;
    padding: 0 5px 10px;
    color: #f8f8f6;
}

.preview-brand {
    font-size: 13px;
    font-weight: 720;
    letter-spacing: -.04em;
}

.preview-brand-dot {
    margin-left: 4px;
    color: #8eabfa;
    font-size: 12px;
}

.preview-live {
    color: #c7c9cc;
    font-size: 10px;
}

.preview-live i {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: 5px;
    border-radius: 50%;
    background: #8aceaa;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.preview-person {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 145px;
    overflow: hidden;
    border: 1px solid #54585c;
    border-radius: 10px;
}

.preview-person-one { background: #3a434c; }
.preview-person-two { background: #494451; }
.preview-person-three { background: #3c4b49; }
.preview-person-four { background: #4b4243; }

.preview-avatar {
    display: grid;
    place-items: center;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: #6f86b9;
    color: #fff;
    font-size: 27px;
    font-weight: 620;
}

.preview-person-two .preview-avatar { background: #8d79a5; }
.preview-person-three .preview-avatar { background: #729892; }
.preview-person-four .preview-avatar { background: #ad827e; }

.preview-name {
    position: absolute;
    left: 10px;
    bottom: 9px;
    padding: 4px 7px;
    border-radius: 6px;
    background: #26282b;
    color: #fff;
    font-size: 10px;
}

.preview-controls {
    display: flex;
    justify-content: center;
    gap: 7px;
    padding: 13px 0 1px;
}

.preview-controls span {
    display: grid;
    place-items: center;
    width: 31px;
    height: 31px;
    border: 1px solid #62666c;
    border-radius: 8px;
    background: #3c3f44;
    color: #f4f4f4;
    font-size: 13px;
}

.preview-controls .preview-hangup {
    width: 42px;
    border-color: #b84555;
    background: #b84555;
}

.preview-caption {
    position: relative;
    z-index: 1;
    margin-top: 26px;
    color: #606463;
    font-size: 13px;
}

.preview-caption span {
    color: var(--home-blue);
}

.signature {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: min(1350px, 100%);
    min-height: 64px;
    margin: auto auto 0;
    padding: 15px 42px;
    border-top: 1px solid var(--home-line);
    color: #919593;
    font-size: 11px;
}

@media (max-width: 950px) {
    .home-shell {
        grid-template-columns: 1fr;
        gap: 0;
        padding-top: 50px;
    }

    .home-copy {
        max-width: 650px;
    }

    .home-preview {
        width: min(650px, 100%);
        height: 500px;
        margin: 0 auto;
    }
}

@media (max-width: 600px) {
    body.home-page { padding: 7px; }
    .site-frame { min-height: calc(100dvh - 14px); border-radius: 18px; }
    .home-header { height: 66px; padding: 0 20px; }
    .home-brand { font-size: 20px; }
    .brand-icon { width: 32px; height: 32px; }
    .home-header-note { display: none; }
    .home-shell { padding: 38px 20px 24px; }
    #title { margin: 24px 0 17px; font-size: clamp(43px, 11.6vw, 62px); }
    .home-lead { margin-bottom: 27px; font-size: 15px; }
    .join-card { padding: 18px; }
    .preview-grid { gap: 5px; }
    .preview-person { min-height: 95px; }
    .preview-avatar { width: 45px; height: 45px; font-size: 20px; }
    .home-preview { height: 370px; }
    .preview-art { inset: -35px -30px; width: calc(100% + 60px); height: calc(100% + 70px); }
    .preview-window { width: 93%; padding: 10px; }
    .preview-caption { margin-top: 20px; font-size: 12px; }
    .signature { min-height: 55px; padding: 13px 20px; }
    .signature span:last-child { display: none; }
}

@media (max-width: 360px) {
    .home-shell { padding-left: 16px; padding-right: 16px; }
    .join-card { padding: 15px; }
    #submitbutton { width: 92px; }
}
