/* Recipe capture demos: web ports of the fitzap nutrition onboarding
   animations (FoodApp src/components/onboarding/recipeDemo). Each phone
   lays its scene out on the app's fixed 216 x 456 design canvas, and
   recipe-demos.js scales that canvas to the rendered phone. */

.recipe-capture {
    padding: clamp(70px, 9vw, 120px) clamp(4px, 3vw, 30px) clamp(40px, 6vw, 80px);
}

.recipe-capture__heading {
    max-width: 760px;
    margin: 0 auto;
    text-align: center;
}

.recipe-capture__heading h2 {
    margin: 0;
    font-size: clamp(2.5rem, 5vw, 4.6rem);
    line-height: .98;
    letter-spacing: -.058em;
}

.recipe-capture__heading h2 span { color: var(--brand); }

.recipe-capture__heading > p:last-child {
    max-width: 600px;
    margin: 20px auto 0;
    color: var(--ink-soft);
    font-size: 1.07rem;
    line-height: 1.7;
}

.recipe-capture__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    margin-top: clamp(40px, 6vw, 64px);
}

.capture-card {
    display: grid;
    justify-items: center;
    gap: 28px;
    margin: 0;
    padding: clamp(32px, 4vw, 48px) clamp(20px, 3vw, 40px) clamp(28px, 3vw, 40px);
    border: 1px solid var(--line);
    border-radius: 28px;
    background:
        radial-gradient(circle at 50% 30%, rgba(98, 234, 209, .12), transparent 60%),
        linear-gradient(135deg, var(--panel), var(--panel-strong));
}

.capture-card figcaption {
    max-width: 380px;
    text-align: center;
}

.capture-card__step {
    display: block;
    color: var(--brand);
    font-size: .7rem;
    font-weight: 850;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.capture-card h3 {
    margin: 8px 0 0;
    font-size: clamp(1.4rem, 2.4vw, 1.8rem);
    letter-spacing: -.035em;
}

.capture-card p {
    margin: 10px 0 0;
    color: var(--ink-soft);
    line-height: 1.6;
}

/* Phone */
.demo-phone {
    --bezel: 9px;
    position: relative;
    width: min(250px, 66vw);
    aspect-ratio: 216 / 456;
    padding: var(--bezel);
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 40px;
    background: #0c0d10;
    box-shadow: 0 26px 60px rgba(0, 0, 0, .45);
}

html[data-theme="light"] .demo-phone {
    border-color: rgba(0, 0, 0, .2);
    background: #1c1f24;
    box-shadow: 0 22px 50px rgba(4, 40, 34, .22);
}

.demo-phone::after {
    content: "";
    position: absolute;
    top: calc(var(--bezel) + 7px);
    left: 35%;
    width: 30%;
    height: 21px;
    border-radius: 12px;
    background: #000;
}

.demo-screen {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 31px;
    background: #0a1715;
}

.demo-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 216px;
    height: 456px;
    overflow: hidden;
    transform-origin: 0 0;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #f2f7f5;
    line-height: 1.25;
}

.demo-canvas * { box-sizing: border-box; }

.d-abs { position: absolute; }
.d-fill { position: absolute; top: 0; left: 0; width: 216px; height: 456px; }
.d-app { background: #0a1715; }

/* Share demo: feed */
.d-video-bg { background: linear-gradient(160deg, #f7b866, #e0703f 55%, #6e2a1c); }

.d-plate-wrap {
    top: 120px;
    left: 32px;
    width: 132px;
    height: 132px;
    will-change: transform;
}

.d-plate {
    position: relative;
    width: 132px;
    height: 132px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #fff4e6;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
}

.d-pasta {
    width: 98px;
    height: 98px;
    border-radius: 50%;
    background: #f2c66e;
}

.d-topping { position: absolute; border-radius: 5px; }

.d-tiktok {
    position: relative;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: .5px solid rgba(255, 255, 255, .28);
    background: #000;
}

.d-tiktok svg { position: absolute; }

.d-rail {
    top: 212px;
    right: 8px;
    width: 40px;
    display: grid;
    justify-items: center;
    gap: 12px;
}

.d-rail-item {
    display: grid;
    justify-items: center;
    gap: 2px;
    color: #fff;
    font-size: 8px;
    font-weight: 700;
}

.d-rail-item svg { width: 22px; height: 22px; fill: #fff; }

.d-caption {
    left: 12px;
    right: 56px;
    bottom: 26px;
    display: grid;
    gap: 3px;
    color: #fff;
}

.d-caption strong { font-size: 10.5px; font-weight: 800; }
.d-caption span { font-size: 9px; font-weight: 500; }

.d-track {
    left: 0;
    right: 0;
    bottom: 10px;
    height: 2.5px;
    background: rgba(255, 255, 255, .3);
}

.d-track i { display: block; height: 100%; background: #fff; }

/* Share demo: share sheet */
.d-backdrop { background: #000; opacity: 0; }

.d-sheet {
    top: 284px;
    left: 0;
    width: 216px;
    height: 172px;
    border-radius: 18px 18px 0 0;
    background: #13221f;
    will-change: transform;
}

.d-grabber {
    width: 30px;
    height: 4px;
    margin: 6px auto 0;
    border-radius: 2px;
    background: rgba(189, 207, 202, .4);
}

.d-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 12px 0;
}

.d-preview-thumb {
    width: 30px;
    height: 30px;
    flex: none;
    border-radius: 7px;
    background: linear-gradient(135deg, #f7b866, #e0703f);
}

.d-lines { flex: 1; display: grid; gap: 5px; }
.d-bar { height: 6px; border-radius: 3px; background: rgba(189, 207, 202, .2); }

.d-tiles {
    top: 64px;
    left: 10px;
    display: flex;
    gap: 9px;
}

.d-tile-col { width: 32px; display: grid; justify-items: center; gap: 4px; }
.d-tile { width: 32px; height: 32px; border-radius: 8px; background: rgba(189, 207, 202, .2); }
.d-tile-label { width: 26px; height: 4px; border-radius: 2px; background: rgba(189, 207, 202, .2); }
.d-tile-col b { color: #f2f7f5; font-size: 7.5px; font-weight: 600; }
.d-fitzap { position: relative; will-change: transform; }
.d-fitzap img { display: block; width: 32px; height: 32px; border-radius: 8px; }

.d-ring {
    position: absolute;
    inset: -3px;
    border: 2px solid #62ead1;
    border-radius: 11px;
    opacity: 0;
}

.d-actions {
    top: 120px;
    left: 10px;
    right: 10px;
    height: 40px;
    display: grid;
    align-content: center;
    gap: 7px;
    padding: 0 10px;
    border-radius: 10px;
    background: rgba(189, 207, 202, .1);
}

/* Fitzap screen */
.d-app-inner {
    padding: 40px 12px 0;
    display: grid;
    gap: 10px;
    align-content: start;
}

.d-chip {
    justify-self: start;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px 3px 3px;
    border: 1px solid rgba(225, 255, 247, .12);
    border-radius: 12px;
    background: #13221f;
    font-size: 8.5px;
    font-weight: 700;
}

.d-mini-video {
    height: 74px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(135deg, #f7b866, #e0703f 55%, #6e2a1c);
}

.d-mini-video svg { width: 26px; height: 26px; fill: #fff; }

.d-stage { top: 174px; left: 12px; right: 12px; }
.d-overlay { position: absolute; top: 0; left: 0; right: 0; opacity: 0; }

.d-importing {
    display: grid;
    justify-items: center;
    gap: 8px;
    padding-top: 18px;
    color: #bdcfca;
    font-size: 10px;
    font-weight: 600;
}

.d-dots { display: flex; gap: 5px; }
.d-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(98, 234, 209, .9); }

/* AI building */
.d-building { display: grid; justify-items: center; gap: 10px; }

.d-spark {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(98, 234, 209, .35);
    border-radius: 50%;
    background: rgba(98, 234, 209, .16);
}

.d-spark svg { width: 20px; height: 20px; fill: #62ead1; }
.d-building b { font-size: 10.5px; font-weight: 700; text-align: center; }
.d-shimmer { justify-self: stretch; display: grid; gap: 7px; margin-top: 4px; }
.d-shimmer i { display: block; height: 8px; border-radius: 4px; background: rgba(189, 207, 202, .3); }

/* Result card */
.d-card {
    display: grid;
    gap: 8px;
    padding: 10px;
    border: 1px solid rgba(225, 255, 247, .12);
    border-radius: 14px;
    background: #13221f;
    opacity: 0;
    will-change: transform, opacity;
}

.d-card-head { display: flex; align-items: center; gap: 6px; }

.d-card-icon {
    width: 26px;
    height: 26px;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: rgba(98, 234, 209, .14);
}

.d-card-icon svg { width: 15px; height: 15px; fill: none; stroke: #62ead1; stroke-width: 1.8; stroke-linecap: round; }
.d-card-text { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px; }
.d-card-text b { font-size: 10.5px; letter-spacing: -.01em; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-card-text span { color: #bdcfca; font-size: 8px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-kcal { display: grid; justify-items: end; }
.d-kcal b { color: #fb7185; font-size: 14px; font-weight: 800; }
.d-kcal span { color: #bdcfca; font-size: 8px; font-weight: 600; }
.d-macros { display: flex; gap: 4px; }

.d-macro {
    padding: 2px 5px;
    border: 1px solid;
    border-radius: 7px;
    font-size: 8px;
    font-weight: 700;
}

.d-macro--p { color: #6ee7b7; background: rgba(110, 231, 183, .1); border-color: rgba(110, 231, 183, .22); }
.d-macro--c { color: #60a5fa; background: rgba(96, 165, 250, .1); border-color: rgba(96, 165, 250, .22); }
.d-macro--f { color: #f59e0b; background: rgba(245, 158, 11, .1); border-color: rgba(245, 158, 11, .22); }

.d-ingredients { display: grid; gap: 6px; margin-top: 10px; }
.d-ingredient { display: flex; align-items: center; gap: 6px; opacity: 0; }
.d-ingredient i { width: 12px; height: 12px; flex: none; border-radius: 4px; background: rgba(98, 234, 209, .22); }
.d-ingredient s { height: 7px; border-radius: 3.5px; background: rgba(189, 207, 202, .22); }

/* Screenshot demo */
.d-topbar {
    top: 36px;
    left: 12px;
    right: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.d-topbar i { height: 7px; border-radius: 3.5px; background: rgba(189, 207, 202, .3); }

.d-shot {
    width: 66px;
    height: 99px;
    will-change: transform;
}

.d-art {
    width: 100%;
    height: 100%;
    overflow: hidden;
    border: 1px solid rgba(225, 255, 247, .12);
    border-radius: 6px;
    background: #13221f;
}

.d-art-photo { height: 52%; }
.d-art-lines { display: grid; gap: 4px; padding: 8%; }
.d-art-lines i { height: 4px; border-radius: 2px; background: rgba(189, 207, 202, .3); }

.d-pick {
    position: absolute;
    inset: 0;
    border: 2px solid #62ead1;
    border-radius: 6px;
    background: rgba(98, 234, 209, .12);
    opacity: 0;
}

.d-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    border: 1.5px solid #fff;
    border-radius: 50%;
    background: #62ead1;
    color: #042720;
    font-size: 10px;
    font-weight: 800;
}

.d-note {
    top: 138px;
    left: 12px;
    right: 12px;
    height: 74px;
    padding: 8px;
    border: 1px solid rgba(225, 255, 247, .14);
    border-radius: 10px;
    background: #0f1f1c;
    font-size: 10px;
    line-height: 14px;
}

.d-note .d-placeholder { color: #6f8a83; }
.d-caret { color: #62ead1; font-weight: 700; }

.d-build-btn {
    top: 224px;
    left: 12px;
    right: 12px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: #62ead1;
    color: #042720;
    font-size: 10.5px;
    font-weight: 700;
}

/* Finger */
.d-finger, .d-ripple {
    top: 0;
    left: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
    will-change: transform, opacity;
}

.d-finger { background: rgba(255, 255, 255, .55); border: 1.5px solid rgba(0, 0, 0, .22); }
.d-ripple { border: 2px solid rgba(255, 255, 255, .9); }

@media (max-width: 860px) {
    .recipe-capture__grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .recipe-capture { padding: 56px 0 24px; }
    .recipe-capture__heading { padding-inline: 4px; }
    .capture-card { padding: 30px 16px 26px; border-radius: 22px; }
}
