/* ---------- Contact: Messages on the outer screen of a folded iPhone Duo ----------
   Built from the iPhone Duo · iOS 27 UI Kit: the Star White bezel is the kit's own
   artwork (assets/duo-bezel.webp, camera included). Every size below is in kit
   points: 1u = one point of the 524 × 730 bezel, so the whole phone scales as one. */
@media(min-width:901px){
  .brief-phone{width:min(100%,calc((100svh - 190px) * 524 / 730),420px);aspect-ratio:524/730;flex:none;justify-self:end;align-self:start;
    position:sticky;top:96px;container-type:inline-size;--u:calc(100cqw / 524)}
  /* soft shadow that follows the bezel's own silhouette (drawn once, under the screen) */
  .brief-phone::before{content:"";position:absolute;inset:0;z-index:0;pointer-events:none;
    background:url(assets/duo-bezel.webp) 0 0/100% 100% no-repeat;
    filter:drop-shadow(0 calc(10 * var(--u)) calc(14 * var(--u)) rgba(28,25,40,.16)) drop-shadow(0 calc(34 * var(--u)) calc(40 * var(--u)) rgba(28,25,40,.2))}
  /* the kit's bezel sits on top of the screen (it also draws the camera) */
  .brief-phone::after{content:"";position:absolute;inset:0;z-index:7;pointer-events:none;
    background:url(assets/duo-bezel.webp) 0 0/100% 100% no-repeat}

  /* the outer display: 466 × 678 pt, square-ish corners on the hinge side */
  .brief-phone>.brief-preview{position:absolute!important;z-index:1;top:calc(26 * var(--u));left:calc(29 * var(--u));
    width:calc(467 * var(--u));height:calc(679 * var(--u));display:block;
    border-radius:calc(8 * var(--u)) calc(66 * var(--u)) calc(66 * var(--u)) calc(8 * var(--u))!important;
    background:#fff!important;box-shadow:none!important;-webkit-backdrop-filter:none!important;backdrop-filter:none!important;
    font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","SF Pro","Segoe UI",sans-serif}
  .brief-phone>.brief-preview::after,.brief-phone>.brief-preview::before{display:none}

  /* ---- side strip: status, then the bar buttons ---- */
  .duo-strip{position:absolute;top:0;right:0;width:calc(96 * var(--u));height:100%;z-index:5;pointer-events:none}
  .duo-time{position:absolute;top:calc(84 * var(--u));left:0;right:0;margin-right:calc(-1.4 * var(--u));text-align:center;
    font-size:calc(17 * var(--u));line-height:1;font-weight:600;letter-spacing:calc(-.2 * var(--u));color:#000;font-variant-numeric:tabular-nums}
  .duo-ring{position:absolute;top:calc(113 * var(--u));left:50%;width:calc(40 * var(--u));height:calc(40 * var(--u));margin-left:calc(-18.6 * var(--u))}
  .duo-ring .arc,.duo-ring .wifi{fill:none;stroke:#000;stroke-linecap:round}
  .duo-ring .arc{stroke-width:3}
  .duo-ring .wifi{stroke-width:2.7}
  .duo-ring .dot,.duo-ring .wedge{fill:#000}
  .duo-ring .wedge{stroke:#000;stroke-width:1.4;stroke-linejoin:round}

  /* Liquid Glass bar buttons, 48 pt, centred on the strip */
  .brief-phone .brief-preview .im-back,.brief-phone .brief-preview .im-video{position:absolute;z-index:6;left:auto!important;
    right:calc(-51.7 * var(--u))!important;width:calc(48 * var(--u))!important;height:calc(48 * var(--u))!important;padding:0;border:0;border-radius:50%;
    display:grid;place-items:center;color:#000;
    background:linear-gradient(180deg,#fff 0%,#fbfbfb 55%,#f1f1f2 100%);
    box-shadow:inset 0 0 0 calc(.6 * var(--u)) rgba(0,0,0,.075),inset 0 calc(1 * var(--u)) 0 #fff,0 calc(3 * var(--u)) calc(10 * var(--u)) calc(-2 * var(--u)) rgba(0,0,0,.09),0 calc(1 * var(--u)) calc(2 * var(--u)) rgba(0,0,0,.04)}
  .brief-phone .brief-preview .im-back{top:calc(180 * var(--u))!important}
  .brief-phone .brief-preview .im-video{top:calc(238 * var(--u))!important}
  .brief-phone .brief-preview .im-back svg{width:calc(11 * var(--u));height:calc(19 * var(--u));stroke-width:2.6}
  .brief-phone .brief-preview .im-video svg{width:calc(25 * var(--u));height:calc(17 * var(--u));stroke-width:1.9}
  .brief-phone .brief-preview .im-video::after{inset:calc(-3 * var(--u))}
  /* hover: the glass turns prominent iOS blue, the glyph white */
  .brief-phone .brief-preview :is(.im-back,.im-video,.im-plus){cursor:pointer;
    transition:background .25s ease,color .25s ease,box-shadow .25s ease,transform .3s cubic-bezier(.34,1.5,.5,1)}
  .brief-phone .brief-preview :is(.im-back,.im-video,.im-plus) svg{transition:none}
  @media(hover:hover){
    .brief-phone .brief-preview :is(.im-back,.im-video,.im-plus:not(.is-locked)):hover,
    .pointer-enabled .brief-phone .brief-preview :is(.im-back,.im-video,.im-plus:not(.is-locked)):hover{
      background:#0088ff!important;color:#fff;
      box-shadow:inset 0 calc(1 * var(--u)) 0 rgba(255,255,255,.35),0 calc(4 * var(--u)) calc(12 * var(--u)) calc(-3 * var(--u)) rgba(0,136,255,.55)}
    .brief-phone .brief-preview .im-video:hover svg :is(rect,path){fill:transparent}
  }
  .brief-phone .brief-preview :is(.im-back,.im-video,.im-plus):active{transform:scale(.92)}
  .brief-phone .brief-preview .im-back.is-nudge{animation:duo-nudge .4s cubic-bezier(.34,1.5,.5,1)}
  @keyframes duo-nudge{40%{transform:translateX(calc(-4 * var(--u)))}}
  .brief-phone .brief-preview.is-call-open .im-video{opacity:1;pointer-events:auto}

  /* ---- content area: everything left of the strip ---- */
  .brief-phone .brief-chat-head{position:absolute!important;top:0;left:0;right:calc(76 * var(--u));z-index:4;display:flex;flex-direction:column;align-items:center;
    gap:calc(6 * var(--u));padding:calc(22 * var(--u)) 0 calc(18 * var(--u))!important;border:0!important;
    background:linear-gradient(#fff 70%,rgba(255,255,255,0))!important}
  .brief-phone .brief-chat-avatar{width:calc(58 * var(--u));height:calc(58 * var(--u))}
  .brief-phone .brief-chat-who strong{gap:calc(3 * var(--u));padding:calc(5 * var(--u)) calc(11 * var(--u));border-radius:999px;
    font-size:calc(13 * var(--u));font-weight:600;letter-spacing:0;color:#000;
    background:linear-gradient(180deg,#fff,#f6f6f7);box-shadow:inset 0 0 0 calc(.6 * var(--u)) rgba(0,0,0,.07),0 calc(2 * var(--u)) calc(8 * var(--u)) calc(-2 * var(--u)) rgba(0,0,0,.1)}
  .brief-phone .brief-chat-who strong svg{width:calc(6 * var(--u));height:calc(10 * var(--u))}
  .brief-phone .im-progress{bottom:auto;top:0}

  .brief-phone .brief-chat{position:absolute!important;left:0;right:calc(76 * var(--u));top:calc(120 * var(--u));bottom:calc(66 * var(--u));
    min-height:0!important;overflow:hidden;padding:0 calc(14 * var(--u)) calc(4 * var(--u)) calc(16 * var(--u))!important;display:flex;flex-direction:column;justify-content:flex-end}
  .brief-phone .im-time{margin:0 0 calc(10 * var(--u));font-size:calc(12 * var(--u));line-height:1.3;color:#8a8a8e}
  .brief-phone .brief-bubble{max-width:92%;margin-right:calc(4 * var(--u));padding:calc(7 * var(--u)) calc(13 * var(--u)) calc(8 * var(--u));
    border-radius:calc(19 * var(--u));background:#0088ff;font-size:calc(16 * var(--u));line-height:1.3;letter-spacing:calc(-.2 * var(--u))}
  .brief-phone .brief-bubble::before{background:#0088ff}
  .brief-phone .brief-bubble p:first-child{margin-bottom:calc(6 * var(--u))}
  .brief-phone .brief-bubble p{margin-bottom:calc(2 * var(--u))}
  .brief-phone .brief-bubble [data-part="project"]{margin:calc(6 * var(--u)) 0}
  .brief-phone .im-status{margin:calc(4 * var(--u)) calc(6 * var(--u)) 0 0;font-size:calc(11.5 * var(--u))}

  /* compose: glass "+" and a glass field, bottom of the content area */
  .brief-phone .im-bar{position:absolute!important;left:calc(14 * var(--u));right:calc(84 * var(--u));bottom:calc(16 * var(--u));z-index:4;
    display:flex;align-items:center;gap:calc(8 * var(--u));padding:0!important;background:none!important}
  .brief-phone .im-plus{width:calc(42 * var(--u));height:calc(42 * var(--u));color:#000;
    background:linear-gradient(180deg,#fff 0%,#fbfbfb 55%,#f1f1f2 100%)!important;
    box-shadow:inset 0 0 0 calc(.6 * var(--u)) rgba(0,0,0,.075),0 calc(3 * var(--u)) calc(10 * var(--u)) calc(-2 * var(--u)) rgba(0,0,0,.09)}
  .brief-phone .im-plus svg{width:calc(19 * var(--u));height:calc(19 * var(--u))}
  .brief-phone .im-field{height:calc(42 * var(--u));padding:0 calc(4 * var(--u)) 0 calc(15 * var(--u));font-size:calc(17 * var(--u));color:#a6a6ab;
    background:linear-gradient(180deg,#fff,#fafafa);box-shadow:inset 0 0 0 calc(.6 * var(--u)) rgba(0,0,0,.09),0 calc(3 * var(--u)) calc(10 * var(--u)) calc(-2 * var(--u)) rgba(0,0,0,.08)}
  .brief-phone .im-send{width:calc(34 * var(--u));height:calc(34 * var(--u));margin-left:calc(-42 * var(--u))}
  .brief-phone .im-arrow{width:calc(27 * var(--u));height:calc(27 * var(--u))}

  /* sheets open inside the content area */
  .brief-phone .brief-preview .call-sheet,.brief-phone .brief-preview .refs-sheet{left:calc(10 * var(--u));right:calc(86 * var(--u));bottom:calc(68 * var(--u))}
  .brief-phone .brief-preview .call-sheet{max-height:calc(100% - 84 * var(--u))}
  .brief-phone .brief-preview .refs-sheet{max-height:calc(100% - 150 * var(--u))}
  /* time chips: four fit across and the next one peeks in, so the row reads as swipeable */
  .brief-phone .call-times{margin:8px 0 0;padding:2px 0 4px;min-height:32px;scroll-padding:0;scroll-snap-type:x mandatory}
  .brief-phone .call-times>*+*{margin-left:5px}
  .call-time.is-peek{opacity:.55;transition:opacity .2s ease}
  .call-time.is-peek[aria-selected="true"]{opacity:.55}
  .call-time.is-peek,.call-time.is-peek:hover{background:rgba(118,118,128,.1)!important;cursor:e-resize}
  .brief-phone .call-time{flex:0 0 calc((100% - 20px) / 4.3);height:28px;padding:0 2px;font-size:11px;letter-spacing:-.02em;white-space:nowrap;scroll-snap-align:start}
  /* red dots instead of the handwritten hints: until the button is tried */
  .brief-phone .brief-preview :is(.im-video,.im-plus)::after{content:"";position:absolute;inset:auto;top:calc(1 * var(--u));right:calc(1 * var(--u));
    width:calc(11 * var(--u));height:calc(11 * var(--u));border-radius:50%;background:#ff3b30;box-shadow:0 0 0 calc(2 * var(--u)) #fff;
    opacity:1;animation:none;transform:scale(1);transition:transform .35s cubic-bezier(.34,1.5,.5,1),opacity .25s ease}
  .brief-phone .brief-preview .im-plus::after{top:0;right:0}
  .brief-phone .brief-preview.is-explored :is(.im-video,.im-plus)::after,
  .brief-phone .brief-preview :is(.im-video.is-booked,.im-video.is-locked,.im-plus.is-locked)::after{opacity:0;transform:scale(.3)}

  /* a sheet is up: the rest of the phone sinks into an iOS-style blur */
  .brief-phone .brief-preview :is(.brief-chat-avatar,.brief-chat-who,.brief-chat,.im-bar,.duo-strip){
    transition:filter .45s cubic-bezier(.22,1,.36,1),opacity .45s ease,transform .45s cubic-bezier(.22,1,.36,1)}
  .brief-phone .brief-preview:is(.is-call-open,.is-refs-open,.is-alert-open) :is(.brief-chat-avatar,.brief-chat-who,.brief-chat,.im-bar,.duo-strip){
    filter:blur(calc(7 * var(--u))) saturate(1.15);opacity:.75!important;transform:none!important}
  .brief-phone .brief-preview:is(.is-call-open,.is-refs-open,.is-alert-open) .im-bar{pointer-events:none}
  .brief-phone .brief-preview:is(.is-call-open,.is-refs-open,.is-alert-open) .brief-chat-head{z-index:6;background:none!important}
  .brief-phone .brief-preview:is(.is-call-open,.is-refs-open,.is-alert-open)::before{display:block;content:"";position:absolute;inset:0;z-index:5;
    background:rgba(255,255,255,.18);pointer-events:none}
  @media(prefers-reduced-motion:reduce){.brief-phone .brief-preview :is(.brief-chat-avatar,.brief-chat-who,.brief-chat,.im-bar,.duo-strip){transition:none}}
}
@media(max-width:900px){.duo-strip{display:none}}

/* ---------- the "extras" nudge: an incoming iMessage + an iOS alert ---------- */
.im-in{position:relative;align-self:flex-start;max-width:86%;margin:10px 0 2px 4px;padding:8px 13px 9px;border-radius:19px;background:#e9e9eb;color:#000;
  font-size:15px;line-height:1.32;letter-spacing:-.01em;transform-origin:0 100%}
.im-in::before,.im-in::after{content:"";position:absolute;bottom:0;height:20px}
.im-in::before{left:-7px;width:20px;background:#e9e9eb;border-bottom-right-radius:16px 14px}
.im-in::after{left:-26px;width:26px;background:#fff;border-bottom-right-radius:10px}
.im-in p{margin:0}
.im-in .im-in-sub{margin-top:4px;color:#3c3c43}
.im-in-ico{display:inline-grid;place-items:center;width:1.45em;height:1.45em;margin:-.2em .1em;vertical-align:middle;position:relative;top:-.06em;border-radius:50%;background:#fff;
  box-shadow:inset 0 0 0 .5px rgba(0,0,0,.08),0 1px 3px rgba(0,0,0,.1);font-style:normal}
.im-in-ico svg{width:.85em;height:.85em;fill:none;stroke:#000;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
@media(min-width:901px){
  .brief-phone .im-in{margin:calc(10 * var(--u)) 0 calc(2 * var(--u)) calc(4 * var(--u));padding:calc(7 * var(--u)) calc(13 * var(--u)) calc(8 * var(--u));
    border-radius:calc(19 * var(--u));font-size:calc(16 * var(--u))}
}

/* iOS 26 alert: frosted card, bold title, two capsule buttons */
.duo-alert{position:absolute;inset:0;z-index:9;display:grid;place-items:center;padding:0 20px;background:rgba(0,0,0,0);transition:background-color .25s ease}
.duo-alert.is-open{background:rgba(0,0,0,.12)}
.duo-alert-card{width:min(100%,270px);padding:20px 16px 14px;border-radius:30px;text-align:center;
  background:rgba(255,255,255,.86);-webkit-backdrop-filter:blur(30px) saturate(1.8);backdrop-filter:blur(30px) saturate(1.8);
  box-shadow:inset 0 0 0 .5px rgba(255,255,255,.9),0 0 0 .5px rgba(0,0,0,.06),0 20px 50px -12px rgba(0,0,0,.35);
  opacity:0;transform:scale(1.12);transition:opacity .22s ease,transform .38s cubic-bezier(.32,1.25,.5,1)}
.duo-alert.is-open .duo-alert-card{opacity:1;transform:none}
.duo-alert-card h4{margin:0 0 6px;font-size:17px;line-height:1.25;font-weight:600;letter-spacing:-.02em;color:#000}
.duo-alert-card p{margin:0 0 16px;font-size:13.5px;line-height:1.35;color:#3c3c43}
.duo-alert-btns{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.duo-alert-btns button{height:44px;border:0;border-radius:999px;font:inherit;font-size:16px;font-weight:600;cursor:pointer;
  background:rgba(118,118,128,.14);color:#000;transition:transform .15s cubic-bezier(.22,1,.36,1),background-color .2s ease}
.duo-alert-btns button.is-primary{background:#0088ff;color:#fff}
@media(hover:hover){.duo-alert-btns button:hover{background:rgba(118,118,128,.22)}.duo-alert-btns button.is-primary:hover{background:#0a7ae6}}
.duo-alert-btns button:active{transform:scale(.95)}
.duo-alert-btns button:focus-visible{outline:3px solid #91baff;outline-offset:2px}
/* inside the phone: sized in kit points */
@media(min-width:901px){
  .brief-phone .duo-alert{padding:0 calc(30 * var(--u))}
  .brief-phone .duo-alert-card{width:calc(300 * var(--u));padding:calc(22 * var(--u)) calc(18 * var(--u)) calc(16 * var(--u));border-radius:calc(34 * var(--u))}
  .brief-phone .duo-alert-card h4{font-size:calc(17 * var(--u));margin-bottom:calc(6 * var(--u))}
  .brief-phone .duo-alert-card p{font-size:calc(14 * var(--u));margin-bottom:calc(18 * var(--u))}
  .brief-phone .duo-alert-btns{gap:calc(8 * var(--u))}
  .brief-phone .duo-alert-btns button{height:calc(46 * var(--u));font-size:calc(17 * var(--u))}
}
/* on phones (no mockup) the alert floats over the page */
.duo-alert.is-page{position:fixed;z-index:120;-webkit-backdrop-filter:blur(0);backdrop-filter:blur(0);transition:background-color .25s ease,backdrop-filter .3s ease}
.duo-alert.is-page.is-open{background:rgba(20,18,28,.22);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}
html.duo-alert-lock{overflow:hidden}
/* "No": the two tool buttons give a little wave */
.brief-tools.is-nudge .brief-tool{animation:duo-wave .6s cubic-bezier(.34,1.5,.5,1) both}
.brief-tools.is-nudge .brief-tool+.brief-tool{animation-delay:.08s}
@keyframes duo-wave{30%{transform:translateY(-4px) scale(1.04)}60%{transform:translateY(1px)}}
@media(prefers-reduced-motion:reduce){.duo-alert-card,.duo-alert{transition:none}.brief-tools.is-nudge .brief-tool{animation:none}}

/* Chat items never squash: when the thread is taller than the screen it scrolls
   off the top (like Messages) instead of piling the photos onto the call card. */
@media(min-width:901px){
  .brief-phone .brief-chat>*{flex-shrink:0}
  .brief-phone .im-event{margin:0 calc(4 * var(--u)) calc(10 * var(--u)) 0;padding:calc(9 * var(--u)) calc(14 * var(--u)) calc(9 * var(--u)) calc(9 * var(--u));border-radius:calc(20 * var(--u));max-width:88%}
  .brief-phone .im-event-cal{width:calc(44 * var(--u));height:calc(44 * var(--u));margin-right:calc(10 * var(--u));border-radius:calc(11 * var(--u))}
  .brief-phone .im-event-cal b{font-size:calc(9.5 * var(--u))}
  .brief-phone .im-event-cal i{font-size:calc(21 * var(--u))}
  .brief-phone .im-event-text b{font-size:calc(15 * var(--u))}
  .brief-phone .im-event-text span{font-size:calc(13 * var(--u))}
  /* pinned references: a fanned photo stack, its own message with clear air around it */
  .brief-phone .im-attach{width:calc(150 * var(--u));height:calc(112 * var(--u));margin:0 calc(6 * var(--u)) calc(10 * var(--u)) 0}
  .brief-phone .im-attach-card{right:calc(var(--i) * 16 * var(--u));width:calc(80 * var(--u));height:calc(104 * var(--u));border-radius:calc(16 * var(--u))}
}

/* the booked call can be taken back out of the brief */
.im-event-wrap{position:relative;align-self:flex-end;max-width:88%;flex-shrink:0;transition:opacity .25s ease,transform .3s cubic-bezier(.22,1,.36,1)}
.im-event-wrap:has(.im-event[hidden]){display:none}
.im-event-wrap .im-event{max-width:100%;margin-right:0}
.im-event-wrap.is-out{opacity:0;transform:scale(.9)}
.im-event-x{position:absolute;top:-7px;left:-7px;z-index:2;display:grid;place-items:center;width:22px;height:22px;padding:0;border:0;border-radius:50%;cursor:pointer;
  background:#fff;color:#56565b;box-shadow:0 0 0 .5px rgba(0,0,0,.1),0 2px 6px -1px rgba(0,0,0,.18);
  transition:background-color .2s ease,color .2s ease,transform .25s cubic-bezier(.34,1.5,.5,1)}
.im-event-x svg{width:10px;height:10px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round}
@media(hover:hover){.im-event-x:hover{background:#ff3b30;color:#fff;transform:scale(1.08)}}
.im-event-x:active{transform:scale(.9)}
.im-event-x:focus-visible{outline:2px solid #91baff;outline-offset:2px}
.im-event:disabled~.im-event-x{display:none}
.call-remove{height:34px;padding:0 10px;border:0;border-radius:999px;background:none;color:#ff3b30;font:inherit;font-size:14px;cursor:pointer;margin-right:auto}
.call-remove[hidden]{display:none}
@media(hover:hover){.call-remove:hover{background:rgba(255,59,48,.08)}}
@media(min-width:901px){
  .brief-phone .im-event-wrap{margin:0 calc(4 * var(--u)) calc(10 * var(--u)) 0}
  .brief-phone .im-event-wrap .im-event{margin:0}
  .brief-phone .im-event-x{top:calc(-8 * var(--u));left:calc(-8 * var(--u));width:calc(24 * var(--u));height:calc(24 * var(--u))}
  .brief-phone .im-event-x svg{width:calc(10 * var(--u));height:calc(10 * var(--u))}
}
@media(prefers-reduced-motion:reduce){.im-event-wrap{transition:none}}
