/* ==========================================================================
   Edna case study: the app chapter. A sticky phone whose screen follows the
   story, with the chat, look, wardrobe and profile screens rebuilt from the
   designs at 360 x 760 and scaled to fit.
   App colours: ink #1B2B32, green #027a5c, send #D49059, bubble #F2F7FB.
   ========================================================================== */

.story { display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); gap: clamp(24px, 5vw, 80px); }
.story-stage { grid-column: 2; grid-row: 1; position: sticky; top: calc(var(--bar) + 24px); align-self: start; height: calc(100vh - var(--bar) - 48px); display: grid; place-items: center; }
.story-steps { grid-column: 1; grid-row: 1; padding: 4vh 0 22vh; }
.step { min-height: 78vh; display: flex; flex-direction: column; justify-content: center; }
/* Steps further away are greyed rather than faded, so the text keeps enough contrast */
.step h3, .step p { color: #5d6b72; transition: color 0.6s var(--ease); }
.step.is-on h3 { color: var(--ink); }
.step.is-on p { color: var(--ink-2); }
.step-n { align-self: flex-start; font: 500 12px/1 var(--mono); padding: 6px 9px; border-radius: 999px; background: var(--line-2); margin-bottom: 14px; transition: background 0.4s, color 0.4s; }
.step.is-on .step-n { background: var(--green); color: #fff; }
.step h3 { font: 400 clamp(32px, 3.2vw, 46px)/1.05 var(--serif); letter-spacing: -0.015em; margin-bottom: 14px; }
.step p { font-size: 17px; max-width: 46ch; }

.story-stage::before { content: ""; position: absolute; inset: 6% 4%; border-radius: 40px; background: var(--cream); z-index: -1; }

.phone { position: relative; width: min(330px, calc((100vh - var(--bar) - 80px) * 0.465)); padding: 10px; border-radius: 52px; background: #15171a; box-shadow: inset 0 0 0 1.5px #3b3f45, inset 0 0 0 4px #15171a, 0 40px 80px rgba(27, 43, 50, 0.28); }
.phone::before, .phone::after { content: ""; position: absolute; left: -3px; width: 3px; border-radius: 2px 0 0 2px; background: #2a2d32; }
.phone::before { top: 22%; height: 9%; }
.phone::after { top: 34%; height: 9%; }
.phone-screen { position: relative; aspect-ratio: 360 / 760; border-radius: 42px; overflow: hidden; background: #fff; isolation: isolate; }
.screens { position: absolute; left: 0; top: 0; width: 360px; height: 760px; transform: scale(var(--s, 1)); transform-origin: 0 0; color: #0a111e; font-family: var(--sans); }

.scr { position: absolute; inset: 0; display: flex; flex-direction: column; background: #fff; opacity: 0; visibility: hidden; transform: translateY(14px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease), visibility 0.6s; }
.scr.is-on { opacity: 1; visibility: visible; transform: none; }

/* Status bar and top bar */
.sb { position: relative; flex: none; height: 46px; display: flex; align-items: center; justify-content: space-between; padding: 6px 30px 0 34px; font-size: 14.5px; }
.sb::after { content: ""; position: absolute; left: 50%; top: 11px; width: 98px; height: 28px; margin-left: -49px; border-radius: 20px; background: #000; }
.sb b { font-weight: 600; }
.sb-i { display: flex; align-items: center; gap: 5px; }
.sig, .wifi { display: block; height: 11px; background: #000; -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }
.sig { width: 17px; --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 17 11'%3E%3Crect x='0' y='7' width='3' height='4' rx='.8'/%3E%3Crect x='4.6' y='5' width='3' height='6' rx='.8'/%3E%3Crect x='9.2' y='2.6' width='3' height='8.4' rx='.8'/%3E%3Crect x='13.8' y='0' width='3' height='11' rx='.8'/%3E%3C/svg%3E"); }
.wifi { width: 15px; --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 15 11'%3E%3Cpath d='M7.5 11 5.3 8.6a3.2 3.2 0 0 1 4.4 0z'/%3E%3Cpath d='M3.6 6.8a5.6 5.6 0 0 1 7.8 0l-1.1 1.2a4 4 0 0 0-5.6 0z'/%3E%3Cpath d='M1.8 4.9a8.2 8.2 0 0 1 11.4 0l1.1-1.2a9.8 9.8 0 0 0-13.6 0z'/%3E%3C/svg%3E"); }
.bat { position: relative; width: 24px; height: 11.5px; border-radius: 3.5px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.4); }
.bat::before { content: ""; position: absolute; inset: 2px 4px 2px 2px; border-radius: 1.5px; background: #000; }
.bat::after { content: ""; position: absolute; right: -3px; top: 3.5px; width: 1.6px; height: 4.5px; border-radius: 0 1px 1px 0; background: rgba(0, 0, 0, 0.45); }

.topbar { flex: none; height: 58px; display: flex; align-items: center; gap: 12px; padding: 0 18px; }
.topbar h4 { flex: 1; min-width: 0; font: 400 26px/1 var(--serif); letter-spacing: -0.01em; color: #1b2b32; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-look h4, .topbar-you h4 { text-align: left; }
.ava { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(140deg, #f3a788, #c75a6a); color: #fff; font: 600 14px var(--sans); box-shadow: 0 0 0 2px #fff, 0 0 0 3px #eadfe0; }

/* Icons drawn as masks so they take the text colour */
.ic { display: inline-block; flex: none; width: 22px; height: 22px; background: currentColor; -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }
.ic-menu { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 7h16M4 12h16M4 17h16'/%3E%3C/svg%3E"); }
.ic-clip { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M15.5 7.5v9a3.5 3.5 0 0 1-7 0V6a2.5 2.5 0 0 1 5 0v10a1.2 1.2 0 0 1-2.4 0V8'/%3E%3C/svg%3E"); }
.ic-send { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 20.5 21.5 12 3 3.5l.02 6.6L15 12 3.02 13.9z'/%3E%3C/svg%3E"); }
.ic-back { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 12H5m6-6-6 6 6 6'/%3E%3C/svg%3E"); }
.ic-bookmark { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linejoin='round'%3E%3Cpath d='M6 3.5h12v17l-6-4-6 4z'/%3E%3C/svg%3E"); }
.ic-close { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6 6 18'/%3E%3C/svg%3E"); }
.ic-chev { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 5 7 7-7 7'/%3E%3C/svg%3E"); }
.ic-up { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linejoin='round'%3E%3Cpath d='M7 11v9H4v-9zm0 9h9.5a2 2 0 0 0 2-1.6l1.3-6A2 2 0 0 0 17.8 10H14V6a2 2 0 0 0-2-2l-5 7'/%3E%3C/svg%3E"); }
.ic-down { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linejoin='round'%3E%3Cpath d='M17 13V4h3v9zm0-9H7.5a2 2 0 0 0-2 1.6l-1.3 6A2 2 0 0 0 6.2 14H10v4a2 2 0 0 0 2 2l5-7'/%3E%3C/svg%3E"); }
.ic-cart { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 4h2.5l2.2 11h10.6l2-8H7m3 13.5h.01M17 19.5h.01M12 8.5v4m-2-2h4'/%3E%3C/svg%3E"); }
.star { display: inline-block; width: 11px; height: 11px; vertical-align: -1px; background: #f4b400; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m12 2.5 2.9 6.1 6.6.8-4.9 4.6 1.3 6.6L12 17.3l-5.9 3.3 1.3-6.6-4.9-4.6 6.6-.8z'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m12 2.5 2.9 6.1 6.6.8-4.9 4.6 1.3 6.6L12 17.3l-5.9 3.3 1.3-6.6-4.9-4.6 6.6-.8z'/%3E%3C/svg%3E") center / contain no-repeat; }

/* ---------- Chat ---------- */
.chat-view, .look-view, .ward-view, .you-view { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.chat-list, .look-list, .ward-list, .you-list { will-change: transform; }
.chat-list { padding: 6px 16px 24px; }
.who { margin: 14px 0 6px; font-size: 13px; font-weight: 500; color: #0a111e; }
.who-you { text-align: right; }
.msg { position: relative; max-width: 84%; padding: 12px 14px 13px; border-radius: 8px; font-size: 14.5px; line-height: 1.5; font-weight: 500; letter-spacing: 0.01em; }
.msg + .msg { margin-top: 8px; }
.msg-you { margin-left: auto; width: fit-content; background: #027a5c; color: #fff; border-radius: 8px 8px 0 8px; }
.msg-you::after { content: ""; position: absolute; right: 0; bottom: -10px; border-left: 12px solid transparent; border-top: 10px solid #027b4f; }
.msg-edna { background: #f2f7fb; color: #000; border-radius: 0 8px 8px 8px; box-shadow: 0 1px 2px rgba(10, 17, 30, 0.08); }
.msg-wide { max-width: none; }
.msg-look { max-width: 92%; padding: 14px; background: #f2f7fb; border-radius: 8px; box-shadow: 0 1px 2px rgba(10, 17, 30, 0.08); }
.ml-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.ml-grid span { aspect-ratio: 1; display: grid; place-items: center; padding: 15%; background: var(--bg); }
.ml-expand { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 9px 20px; border-radius: 999px; background: rgba(168, 146, 152, 0.62); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); font-size: 15px; font-weight: 500; color: #241a1f; white-space: nowrap; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4); }
.chat-list .msg, .chat-list .who, .chat-list .typing { transition: opacity 0.5s var(--ease), transform 0.5s var(--ease); }
.chat-list .is-wait { opacity: 0; transform: translateY(10px); }
.typing.is-wait { display: none; }
.typing { display: flex; gap: 5px; width: fit-content; margin-top: 10px; padding: 13px 15px; border-radius: 0 8px 8px 8px; background: #f2f7fb; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: #9aa6b2; animation: typing 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing { 0%, 60%, 100% { transform: none; opacity: 0.5; } 30% { transform: translateY(-4px); opacity: 1; } }

.composer { flex: none; display: flex; align-items: center; gap: 10px; padding: 10px 14px 24px; background: #fff; }
.cp-field { flex: 1; display: flex; align-items: center; gap: 12px; height: 50px; padding: 0 16px; border-radius: 999px; background: #f4f6f8; box-shadow: 0 2px 8px rgba(10, 17, 30, 0.08); font-size: 15px; color: #8e98a2; }
.cp-field .ic { width: 20px; height: 20px; color: #5f6b76; }
.cp-send { flex: none; display: grid; place-items: center; width: 50px; height: 50px; border-radius: 50%; background: #d49059; color: #fff; box-shadow: 0 6px 14px rgba(212, 144, 89, 0.35); }
.cp-send .ic { width: 21px; height: 21px; }
.cp-send-plain { background: none; box-shadow: none; color: #1b2b32; width: 40px; }

/* ---------- Look ---------- */
.topbar-look .ic, .topbar-you .ic { width: 22px; height: 22px; color: #1b2b32; }
.look-list { padding-bottom: 150px; }
.look-why { margin: 2px 16px 6px; padding: 10px 13px; border-radius: 0 8px 8px 8px; background: #f2f7fb; font-size: 13.5px; line-height: 1.45; font-weight: 500; }
.look-why small { display: block; font-size: 11.5px; color: #66737a; margin-bottom: 2px; }
.art h5 { margin: 16px 16px 10px; font: 400 20px/1.2 var(--serif); color: #1b2b32; }
.art-row { display: flex; gap: 12px; padding: 0 16px; width: max-content; }
.pc { flex: none; width: 196px; border-radius: 12px; overflow: hidden; background: #f2f7fb; box-shadow: 0 0 0 1px #e1e8ef; }
.art-row .pc:first-child { box-shadow: 0 0 0 1.5px #74c9da; }
.pc-img { position: relative; height: 172px; display: grid; place-items: center; padding: 12% 16%; background: var(--bg); }
.pc-go { position: absolute; right: 10px; bottom: 10px; padding: 5px 11px; border-radius: 999px; background: rgba(27, 43, 50, 0.32); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); color: #fff; font-size: 12px; font-weight: 500; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45); }
.pc-top { display: flex; align-items: baseline; justify-content: space-between; padding: 10px 12px 2px; }
.pc-top b { font-size: 16px; font-weight: 600; }
.pc-top span { font-size: 12px; color: #66737a; }
.pc-name { padding: 0 12px 12px; font-size: 14px; line-height: 1.4; font-weight: 500; color: #1b2b32; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 51px; }
.fb { padding: 28px 16px 0; }
.fb-q { display: flex; align-items: center; gap: 8px; font: 400 20px/1.2 var(--serif); color: #212121; }
.fb-btns { display: flex; gap: 8px; margin-top: 12px; }
.fb-btns span { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; background: #c3d4e1; font-size: 15px; font-weight: 500; transition: background 0.3s, color 0.3s; }
.fb-btns span.is-press { background: #027a5c; color: #fff; }
.fb-btns .ic { width: 20px; height: 20px; }
.fab-cart { position: absolute; right: 16px; bottom: 96px; display: inline-flex; align-items: center; gap: 10px; padding: 15px 22px; border-radius: 999px; background: #027a5c; color: #fff; font-size: 16px; font-weight: 500; box-shadow: 0 10px 22px rgba(3, 137, 105, 0.32); }
.fab-cart .ic { width: 22px; height: 22px; }
.composer-look { position: absolute; left: 0; right: 0; bottom: 0; }

/* ---------- Wardrobe ---------- */
.ward-list { padding: 0 16px 90px; background: #fafbf9; min-height: 100%; }
.scr-ward { background: #fafbf9; }
.serif { font: 400 21px/1.2 var(--serif); color: #1b2b32; margin: 14px 0 10px; }
.ootd { display: flex; gap: 8px; width: max-content; }
.ootd span { flex: none; width: 94px; font-size: 11.5px; line-height: 1.35; font-weight: 500; color: #818792; }
.ootd b { display: grid; place-items: center; height: 120px; margin-bottom: 6px; padding: 16% 12%; background: var(--bg); }
.scr-ward .who { margin-top: 16px; }
.gap-h { display: flex; align-items: center; justify-content: space-between; margin-top: 26px; }
.gap-h .serif { margin: 0; }
.gap-h .ic { width: 20px; height: 20px; color: #5f6b76; }
.gap-card { margin-top: 10px; padding: 14px 16px; border-radius: 8px; box-shadow: inset 0 0 0 1.5px #cedef6; background: #fff; font: 400 18px/1.4 var(--serif); color: #1b2b32; transition: box-shadow 0.4s, background 0.4s; }
.gap-card.is-glow { box-shadow: inset 0 0 0 1.5px #387edc, 0 0 0 4px rgba(56, 126, 220, 0.14); }
.scr-ward .gap-h + .gap-card + .serif { margin-top: 30px; }
.cat > p { margin: 14px 0 8px; font-size: 13.5px; font-weight: 500; color: #1b2b32; }
.cat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.cat-row span { display: flex; flex-direction: column; font-size: 11.5px; font-weight: 600; color: #1b2b32; line-height: 1.3; }
.cat-row b { display: grid; place-items: center; aspect-ratio: 1 / 1.05; margin-bottom: 6px; padding: 14%; background: var(--bg); }
.cat-row em { display: flex; align-items: center; margin-top: 2px; font-style: normal; font-size: 11px; font-weight: 500; color: #1b2b32; }
.cat-row em i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55); margin-left: -2px; }
.cat-row em i:first-child { margin-left: 4px; }
.fab-add { position: absolute; right: 16px; bottom: 22px; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: #20a090; color: #fff; font: 300 32px/1 var(--sans); box-shadow: 0 10px 22px rgba(32, 160, 144, 0.34); }

/* ---------- About you ---------- */
.topbar-you { flex-direction: row; }
.you-list { padding: 0 18px 30px; }
.you-head { display: flex; align-items: center; gap: 14px; margin: 4px 0 6px; }
.ava-lg { width: 56px; height: 56px; font-size: 22px; }
.you-head b { display: block; font-size: 17px; font-weight: 600; }
.you-head small { display: block; font-size: 12.5px; color: #66737a; }
.you-k { margin: 20px 0 10px; font-size: 14px; font-weight: 600; letter-spacing: 0.015em; color: #616161; }
.you-info { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.you-info div { padding: 10px 12px; border-radius: 10px; background: #f4f2f7; }
.you-info dt { font-size: 12.5px; font-weight: 500; color: #9e9e9e; }
.you-info dd { font-size: 17px; font-weight: 500; color: #212121; }
.pref li { display: grid; grid-template-columns: 52px 1fr; align-items: center; gap: 14px; padding: 8px 0; border-bottom: 1px solid #eef0f2; }
.pref small { display: block; font-size: 13px; font-weight: 500; color: #9e9e9e; }
.pref b { display: block; font-size: 17px; font-weight: 500; color: #212121; }
.pf-sw { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 10px; background: var(--c, #f1f3f5); }
.pf-check { background: repeating-conic-gradient(#1b2b32 0 25%, #f4f4f4 0 50%) 0 0 / 16px 16px; }
.pf-khadi { background: repeating-linear-gradient(0deg, rgba(120, 96, 60, 0.18) 0 1px, transparent 1px 3px), repeating-linear-gradient(90deg, rgba(120, 96, 60, 0.2) 0 1px, transparent 1px 3px), #e9dcc0; }
.pf-g { padding: 7px; background: #f1f3f5; }
.pf-rupee { background: #e3f3ed; color: #027a5c; font: 500 24px/1 var(--serif); }

/* ==========================================================================
   Narrow screens: the phone stays pinned under the bar, the steps scroll
   ========================================================================== */
@media (max-width: 900px) {
    .story { display: block; }
    .story-stage { top: var(--bar); z-index: 5; height: auto; padding: 12px 0 16px; margin: 0 calc(var(--gut) * -1); background: linear-gradient(#fff 82%, rgba(255, 255, 255, 0)); }
    .story-stage::before { inset: 10px var(--gut) 18px; border-radius: 24px; }
    .phone { width: min(186px, 48vw); padding: 6px; border-radius: 30px; }
    .phone-screen { border-radius: 25px; }
    .phone::before, .phone::after { display: none; }
    .story-steps { padding: 4vh 0 10vh; }
    .step { min-height: 64vh; justify-content: flex-start; padding-top: 4vh; }
    .step h3 { font-size: 30px; margin-bottom: 10px; }
    .step p { font-size: 16px; }
}
