/* ---- SelfieDump interactive demo (/try) ----
   Dark, app-style surfaces modelled on the iOS app (black canvas, charcoal
   cards, tan "Cook" buttons). Everything is scoped under .try-page so the
   shared light site styles are untouched. */
.try-page {
    --sd-bg: #000;
    --sd-stage: #0B0B0C;
    --sd-surface: #141416;
    --sd-card: #1C1C1E;
    --sd-card-2: #2A2A2D;
    --sd-line: rgba(255, 255, 255, 0.09);
    --sd-text: #F5F3EF;
    --sd-dim: #8E8E93;
    --sd-tan: #B07A4F;
    --sd-tan-hover: #BD875B;
    --sd-tan-ink: #1A120C;
    --sd-tan-soft: #3A2A20;
    --sd-tan-text: #D8A67C;
    --sd-error: #FF8A73;
    --sd-ease: cubic-bezier(.2, .7, .3, 1);

    background: var(--sd-bg);
    color: var(--sd-text);
    padding: 136px 0 104px;
}

.try-page [hidden] {
    display: none !important;
}

.try-page :focus-visible {
    outline: 2px solid var(--sd-tan-text);
    outline-offset: 3px;
}

/* ---- intro ---- */
.try-head {
    max-width: 660px;
    margin-bottom: 40px;
}

.try-head .eyebrow {
    color: var(--sd-tan-text);
}

.try-head h1 {
    font-size: clamp(34px, 5vw, 54px);
    margin-bottom: 16px;
}

.try-head > p {
    color: var(--sd-dim);
    font-size: 17px;
    max-width: 560px;
}

.try-head .try-privacy {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-top: 22px;
    padding: 9px 16px;
    border-radius: 100px;
    background: var(--sd-card);
    border: 1px solid var(--sd-line);
    color: var(--sd-text);
    font-size: 13.5px;
    line-height: 1.35;
}

.try-privacy svg {
    flex-shrink: 0;
    color: var(--sd-tan-text);
}

.try-noscript {
    margin-bottom: 24px;
    color: var(--sd-dim);
}

.try-noscript a {
    color: var(--sd-tan-text);
    text-decoration: underline;
}

/* ---- tabs ---- */
.try-tabs {
    display: inline-flex;
    gap: 4px;
    padding: 5px;
    margin-bottom: 20px;
    max-width: 100%;
    border-radius: 100px;
    background: var(--sd-card);
    border: 1px solid var(--sd-line);
}

.try-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 22px;
    border: 0;
    border-radius: 100px;
    background: transparent;
    color: var(--sd-dim);
    font: 600 15px 'Inter', sans-serif;
    white-space: nowrap;
    cursor: pointer;
    transition: background .16s ease, color .16s ease;
}

.try-tab:hover {
    color: var(--sd-text);
}

.try-tab[aria-selected="true"] {
    background: var(--sd-card-2);
    color: var(--sd-text);
}

.try-tab[aria-selected="true"] svg {
    color: var(--sd-tan-text);
}

/* ---- panel: stage + controls ---- */
.try-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 372px;
    gap: 20px;
    align-items: stretch;
}

.try-stage {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 640px;
    padding: 48px 40px;
    border-radius: 28px;
    border: 1px solid var(--sd-line);
    background:
        radial-gradient(60% 50% at 20% 10%, rgba(176, 122, 79, 0.10), transparent 70%),
        radial-gradient(50% 45% at 85% 90%, rgba(176, 122, 79, 0.07), transparent 70%),
        var(--sd-stage);
    overflow: hidden;
    transition: border-color .16s ease, background-color .16s ease;
}

.try-stage.is-dragover {
    border-color: var(--sd-tan);
    border-style: dashed;
}

.try-controls {
    display: flex;
    flex-direction: column;
    gap: 26px;
    padding: 30px 28px;
    border-radius: 28px;
    border: 1px solid var(--sd-line);
    background: var(--sd-surface);
    min-width: 0;
}

.try-title {
    font-size: 30px;
}

.try-sub {
    margin-top: 8px;
    color: var(--sd-dim);
    font-size: 15px;
}

/* ---- empty states ---- */
.try-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 360px;
    text-align: center;
}

.try-empty-icon {
    color: #5C5C60;
    margin-bottom: 20px;
}

.try-empty h3 {
    font-size: 28px;
    margin-bottom: 8px;
}

.try-empty > p {
    color: var(--sd-dim);
    font-size: 15.5px;
}

.try-empty-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    margin-top: 28px;
}

.try-empty > .try-btn-quiet {
    margin-top: 12px;
}

.try-page .try-drop-hint {
    margin-top: 14px;
    font-size: 13px;
    color: #6E6E73;
}

@media (hover: none) {
    .try-page .try-drop-hint {
        display: none;
    }
}

/* ---- buttons ---- */
.try-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 54px;
    padding: 0 24px;
    border: 1px solid transparent;
    border-radius: 100px;
    font: 500 19px/1.1 'Fraunces', serif;
    text-align: center;
    cursor: pointer;
    transition: transform .16s ease, background .16s ease, opacity .16s ease;
}

.try-btn:active:not(:disabled) {
    transform: scale(0.97);
}

.try-btn:disabled {
    opacity: .38;
    cursor: not-allowed;
}

.try-btn svg {
    flex-shrink: 0;
}

.try-btn-primary {
    background: var(--sd-tan);
    color: var(--sd-tan-ink);
}

.try-btn-primary:hover:not(:disabled) {
    background: var(--sd-tan-hover);
}

.try-btn-secondary {
    background: var(--sd-tan-soft);
    color: var(--sd-tan-text);
}

.try-btn-secondary:hover:not(:disabled) {
    background: #45332A;
}

.try-btn-quiet {
    background: var(--sd-card-2);
    color: var(--sd-text);
    font: 600 14.5px/1.2 'Inter', sans-serif;
    min-height: 48px;
}

.try-btn-quiet:hover:not(:disabled) {
    background: #37373B;
}

.try-btn-sm {
    min-height: 44px;
    padding: 0 14px;
    gap: 6px;
    font-size: 14px;
}

.try-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--sd-text);
    cursor: pointer;
    transition: background .16s ease;
}

.try-icon-btn:hover:not(:disabled) {
    background: var(--sd-card-2);
}

.try-icon-btn:disabled {
    opacity: .35;
    cursor: not-allowed;
}

/* Floating pill in the stage corner, like the app's + / trash cluster. */
.try-toolbar {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 4px;
    border-radius: 100px;
    border: 1px solid var(--sd-line);
    background: rgba(28, 28, 30, 0.86);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.try-count {
    padding: 0 8px 0 12px;
    font-size: 13px;
    color: var(--sd-dim);
    font-variant-numeric: tabular-nums;
}

/* ---- form controls ---- */
.try-field {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.try-label {
    padding: 0;
    font-size: 14.5px;
    font-weight: 500;
    color: var(--sd-dim);
}

.try-label span {
    margin-left: 4px;
    font-size: 12.5px;
    color: #6E6E73;
}

/* <legend> ignores flex gap, so space it explicitly. */
legend.try-label {
    margin-bottom: 12px;
}

.try-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.try-label-row .try-count {
    padding: 0;
}

.try-input {
    width: 100%;
    min-height: 50px;
    padding: 0 16px;
    border: 1px solid var(--sd-line);
    border-radius: 14px;
    background: var(--sd-card);
    color: var(--sd-text);
    font: 16px 'Inter', sans-serif; /* 16px keeps iOS Safari from zooming on focus */
}

.try-input::placeholder {
    color: #6E6E73;
}

.try-input:focus {
    border-color: rgba(216, 166, 124, 0.5);
}

.try-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.try-chip {
    position: relative;
}

.try-chip input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
}

.try-chip span {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 18px;
    border: 2px solid transparent;
    border-radius: 100px;
    background: var(--sd-card-2);
    color: var(--sd-text);
    font-size: 15px;
    cursor: pointer;
    transition: background .16s ease, border-color .16s ease;
}

.try-chip span:hover {
    background: #37373B;
}

.try-chip input:checked + span {
    background: transparent;
    border-color: var(--sd-text);
}

.try-chip input:focus-visible + span {
    outline: 2px solid var(--sd-tan-text);
    outline-offset: 3px;
}

.try-footer {
    margin-top: auto;
}

.try-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.try-actions .try-btn {
    gap: 8px;
    padding: 0 12px;
    font-size: 17.5px;
    white-space: nowrap;
}

.try-actions-single {
    grid-template-columns: 1fr;
}

.try-page .try-hint {
    min-height: 1.5em;
    margin-top: 12px;
    font-size: 13.5px;
    color: var(--sd-dim);
}

.try-page .try-hint.is-error {
    color: var(--sd-error);
}

.try-page .try-help {
    font-size: 13px;
    color: #6E6E73;
}

/* Shared thumbnail media: a real photo, or a brand gradient "sample". */
.try-page .photo-card {
    border-radius: 0;
    box-shadow: none;
}

/* ---- AI Collage: board ---- */
.col-board {
    position: relative;
    width: min(100%, 470px);
    aspect-ratio: 4 / 5;
}

.col-tile {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: var(--w);
    height: var(--h);
    z-index: var(--z);
    transform: rotate(var(--r));
    transition: left .5s var(--sd-ease), top .5s var(--sd-ease), width .5s var(--sd-ease), height .5s var(--sd-ease), transform .5s var(--sd-ease);
    animation: colTileIn .35s var(--sd-ease) both;
}

@keyframes colTileIn {
    from {
        opacity: 0;
        scale: .9;
    }
}

.col-frame {
    width: 100%;
    height: 100%;
    padding: 5px;
    background: #fff;
    box-shadow: 0 18px 30px -14px rgba(0, 0, 0, 0.8);
    overflow: hidden;
}

.col-frame img,
.col-frame .photo-card {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    user-select: none;
    -webkit-user-drag: none;
}

.col-board[data-layout="grid"] .col-frame {
    padding: 0;
    border-radius: 10px;
}

.col-remove {
    position: absolute;
    top: -12px;
    right: -12px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 50%;
    background: #1C1C1E;
    color: #fff;
    cursor: pointer;
    opacity: 0;
    transition: opacity .15s ease, background .15s ease;
}

.col-remove:hover {
    background: #3A3A3E;
}

.col-tile:hover .col-remove,
.col-remove:focus-visible {
    opacity: 1;
}

@media (hover: none) {
    .col-remove {
        opacity: 1;
    }
}

.col-words {
    position: absolute;
    left: 50%;
    bottom: 3%;
    z-index: 50;
    max-width: 88%;
    padding: 4px 18px 7px;
    border-radius: 6px;
    background: var(--sunflower);
    color: #3A2A00;
    font: 700 clamp(20px, 4.4vw, 28px)/1.1 'Caveat', cursive;
    text-align: center;
    overflow-wrap: anywhere;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.45);
    transform: translateX(-50%) rotate(-3deg);
    pointer-events: none;
}

/* ---- Carousel: viewer ---- */
.car-viewer {
    width: min(100%, 420px);
}

.car-frame {
    position: relative;
}

.car-track {
    display: flex;
    aspect-ratio: 4 / 5;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    border-radius: 24px;
    background: var(--sd-card);
    scrollbar-width: none;
}

.car-track::-webkit-scrollbar {
    display: none;
}

.car-slide {
    flex: 0 0 100%;
    height: 100%;
    margin: 0;
    scroll-snap-align: center;
    scroll-snap-stop: always;
}

.car-slide img,
.car-slide .photo-card {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    user-select: none;
    -webkit-user-drag: none;
}

.car-pos {
    position: absolute;
    top: 14px;
    right: 14px;
    padding: 4px 11px;
    border-radius: 100px;
    background: rgba(0, 0, 0, 0.6);
    font-size: 12.5px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    pointer-events: none;
}

.car-nav {
    position: absolute;
    top: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    color: #fff;
    cursor: pointer;
    transform: translateY(-50%);
    transition: opacity .16s ease, background .16s ease;
}

.car-nav:hover {
    background: rgba(0, 0, 0, 0.75);
}

.car-nav:disabled {
    opacity: 0;
    pointer-events: none;
}

.car-prev {
    left: 12px;
}

.car-next {
    right: 12px;
}

.car-dots {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}

.car-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #48484A;
    transition: background .2s ease, transform .2s ease;
}

.car-dots span.is-active {
    background: #fff;
    transform: scale(1.15);
}

/* ---- Carousel: posting order ---- */
.car-order {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.car-thumb,
.car-add {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 4 / 5;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 10px;
    background: var(--sd-card-2);
    overflow: hidden;
    cursor: pointer;
}

.car-thumb img,
.car-thumb .photo-card {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.car-thumb.is-current {
    border-color: rgba(255, 255, 255, 0.35);
}

.car-thumb[aria-pressed="true"] {
    border-color: var(--sd-tan-text);
}

.car-thumb-num {
    position: absolute;
    top: 4px;
    left: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.car-add {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px dashed rgba(255, 255, 255, 0.28);
    background: transparent;
    color: var(--sd-text);
}

.car-add:hover {
    background: var(--sd-card);
}

.car-order-empty {
    padding: 18px;
    border: 1.5px dashed rgba(255, 255, 255, 0.16);
    border-radius: 14px;
    color: #6E6E73;
    font-size: 14px;
    text-align: center;
}

.car-tools {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
}

/* ---- Caption ---- */
.cap-add {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    width: min(100%, 320px);
    aspect-ratio: 4 / 5;
    margin-top: 28px;
    border: 1.5px dashed rgba(255, 255, 255, 0.3);
    border-radius: 24px;
    background: transparent;
    color: var(--sd-text);
    font: 500 17px 'Inter', sans-serif;
    cursor: pointer;
    transition: background .16s ease, border-color .16s ease;
}

.cap-add:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.5);
}

.cap-add-plus {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: var(--sd-card-2);
}

.cap-photo {
    position: relative;
    width: min(100%, 400px);
    margin: 0;
}

.cap-photo-media {
    aspect-ratio: 4 / 5;
    border: 1px solid var(--sd-line);
    border-radius: 24px;
    background: var(--sd-card);
    overflow: hidden;
}

.cap-photo-media img,
.cap-photo-media .photo-card {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cap-photo .try-toolbar {
    top: 12px;
    right: 12px;
}

/* ---- conversion dialog ---- */
.try-dialog {
    width: min(440px, calc(100% - 32px));
    max-width: none;
    max-height: calc(100% - 32px);
    margin: auto;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--sd-text);
    overflow: visible;
}

.try-dialog::backdrop {
    background: rgba(0, 0, 0, 0.72);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.try-dialog[open] .try-dialog-card {
    animation: tryDialogIn .28s var(--sd-ease) both;
}

@keyframes tryDialogIn {
    from {
        opacity: 0;
        transform: translateY(14px) scale(.98);
    }
}

.try-dialog-card {
    position: relative;
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    padding: 36px 28px 26px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 28px;
    background: var(--sd-surface);
    text-align: center;
    box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.9);
}

.try-dialog-x {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--sd-dim);
    cursor: pointer;
}

.try-dialog-x:hover {
    background: var(--sd-card-2);
    color: var(--sd-text);
}

.try-dialog-preview {
    display: flex;
    justify-content: center;
    height: 112px;
    margin-bottom: 22px;
}

.try-dialog-shot {
    width: 80px;
    height: 104px;
    padding: 4px;
    background: #fff;
    box-shadow: 0 12px 24px -10px rgba(0, 0, 0, 0.8);
}

.try-dialog-shot:nth-child(1) {
    transform: rotate(-8deg) translateX(14px);
}

.try-dialog-shot:nth-child(2) {
    z-index: 1;
    transform: translateY(-4px);
}

.try-dialog-shot:nth-child(3) {
    transform: rotate(8deg) translateX(-14px);
}

.try-dialog-shot:only-child {
    transform: rotate(-3deg);
}

.try-dialog-shot img,
.try-dialog-shot .photo-card {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.try-dialog-kicker {
    margin-bottom: 10px;
    color: var(--sd-tan-text);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.try-dialog h2 {
    margin-bottom: 12px;
    font-size: 27px;
}

.try-dialog-card > p:not(.try-dialog-kicker):not(.try-dialog-note) {
    margin-bottom: 26px;
    color: var(--sd-dim);
    font-size: 15px;
}

.try-dialog-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.try-dialog-note {
    margin-top: 16px;
    color: #6E6E73;
    font-size: 12.5px;
}

/* ---- responsive ---- */
@media (max-width: 980px) {
    .try-panel {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .try-stage {
        min-height: 520px;
        padding: 40px 28px;
    }
}

@media (max-width: 760px) {
    .try-page {
        padding: 100px 0 64px;
    }

    .try-page .wrap {
        padding-left: 16px;
        padding-right: 16px;
    }

    .try-head {
        margin-bottom: 28px;
    }

    .try-head > p {
        font-size: 16px;
    }

    .try-tabs {
        display: flex;
        width: 100%;
    }

    .try-tab {
        flex: 1 1 0;
        min-width: 0;
        gap: 6px;
        padding: 0 8px;
        font-size: 14px;
    }

    .try-stage {
        min-height: 440px;
        padding: 64px 14px 24px;
        border-radius: 24px;
    }

    .try-controls {
        gap: 22px;
        padding: 24px 18px;
        border-radius: 24px;
    }

    .try-title {
        font-size: 26px;
    }

    .try-empty h3 {
        font-size: 25px;
    }

    .col-remove {
        top: -9px;
        right: -9px;
        width: 30px;
        height: 30px;
    }

    .try-toolbar {
        top: 12px;
        right: 12px;
    }

    .cap-photo .try-toolbar {
        top: 10px;
        right: 10px;
    }
}

@media (max-width: 360px) {
    .try-tab svg {
        display: none;
    }

    .try-actions {
        grid-template-columns: 1fr;
    }

    .car-order {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .car-tools .try-btn-sm {
        padding: 0 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .col-tile,
    .try-dialog[open] .try-dialog-card {
        animation: none;
        transition: none;
    }

    .try-btn,
    .car-dots span {
        transition: none;
    }
}
