/* === HOME PAGE === */

.demo-template-card {
    overflow: visible;
    width: 250px;
    max-width: 250px;
    flex-shrink: 0;
    padding: 0 0 0.9rem;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-lg);
    background: var(--app-surface);
    box-shadow: var(--app-shadow-md);
    cursor: pointer;
    scroll-snap-align: start;
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.demo-template-card:hover,
.demo-template-card:focus-within {
    transform: translateY(-3px);
    border-color: var(--app-border-strong);
    box-shadow: 0 22px 52px rgba(16, 24, 40, 0.14);
}

.demo-template-card:focus-within {
    box-shadow: var(--app-shadow-focus), 0 22px 52px rgba(16, 24, 40, 0.14);
}

.demo-template-card.is-active {
    border-color: rgba(0, 98, 255, 0.48);
    box-shadow: var(--app-shadow-focus), var(--app-shadow-md);
}

.demo-template-card img {
    display: block;
    width: 100%;
    height: 430px;
    object-fit: cover;
    border-radius: calc(var(--app-radius-lg) - 1px) calc(var(--app-radius-lg) - 1px) var(--app-radius-sm) var(--app-radius-sm);
}

.home-after-generator:not(:has(#guest-account-cta:not(.hidden))) {
    display: none;
}

.home-after-generator .guest-account-cta {
    margin-top: 0;
}

.demo-templates__header {
    max-width: 760px;
    margin-bottom: 1.25rem;
}

.demo-templates__header h2 {
    margin: 0;
    color: var(--app-text);
    font-size: clamp(1.65rem, 3vw, 2.45rem);
    line-height: 1.05;
    letter-spacing: -0.045em;
}

.demo-templates__header p:not(.eyebrow) {
    margin: 0.65rem 0 0;
    color: var(--app-text-soft);
    font-size: 0.98rem;
    line-height: 1.55;
}

.demo-templates__carousel {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
}

.demo-templates__carousel.is-fitted {
    grid-template-columns: minmax(0, 1fr);
}

.demo-templates__carousel.is-fitted .demo-templates__nav {
    display: none;
}

.demo-templates__nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--app-border);
    border-radius: 999px;
    background: linear-gradient(135deg, var(--app-primary), var(--app-brand));
    color: #fff;
    cursor: pointer;
    box-shadow: var(--app-shadow-sm);
    transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease, opacity 160ms ease;
}

.demo-templates__nav:hover,
.demo-templates__nav:focus-visible {
    transform: translateY(-1px);
    box-shadow: var(--app-shadow-sm);
}

.demo-templates__nav:focus-visible {
    outline: none;
    box-shadow: var(--app-shadow-focus), var(--app-shadow-sm);
}

.demo-templates__nav:disabled {
    opacity: 0.4;
    cursor: default;
    transform: none;
    box-shadow: none;
}

.demo-templates__viewport {
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-block: 0.55rem 0.9rem;
}

.demo-templates__viewport::-webkit-scrollbar {
    display: none;
}

.demo-templates__carousel.is-fitted .demo-templates__viewport {
    display: flex;
    justify-content: center;
}

.demo-templates__grid {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 250px;
    gap: clamp(1.25rem, 3vw, 2rem);
    width: max-content;
}

.demo-template-card__actions {
    display: flex;
    gap: 0.5rem;
    padding: 0.65rem 0.75rem 0;
}

.demo-template-card__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    flex: 1 1 0;
    min-height: 34px;
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--app-border);
    border-radius: 999px;
    background: linear-gradient(135deg, var(--app-primary), var(--app-brand));
    color: #fff;
    cursor: pointer;
    font-size: 0.76rem;
    font-weight: 800;
    transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.demo-template-card__action:hover,
.demo-template-card__action:focus-visible {
    transform: translateY(-1px);
    box-shadow: var(--app-shadow-sm);
}

.demo-template-card__action:focus-visible {
    outline: none;
    box-shadow: var(--app-shadow-focus), var(--app-shadow-sm);
}

.demo-template-card__action--stop {
    flex: 0 0 auto;
    min-width: 68px;
    color: var(--app-text);
    background: rgba(255, 255, 255, 0.9);
    border-color: var(--app-border);
}

